opencode-swarm 7.162.0 → 7.162.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/background/pr-review-contract.d.ts +1 -24
- package/dist/cli/authorization-vstrh7ra.js +23 -0
- package/dist/cli/{coder-settlement-s8cskxk7.js → coder-settlement-zrda71k0.js} +9 -9
- package/dist/cli/{config-doctor-636h188h.js → config-doctor-gjw4hdvt.js} +2 -2
- package/dist/cli/{core-h3hsczyq.js → core-q5j5a7fh.js} +1 -1
- package/dist/cli/{curation-policy-ayq5kmnf.js → curation-policy-nv31cr6t.js} +5 -5
- package/dist/cli/{curator-llm-factory-g65xmh8f.js → curator-llm-factory-8d6kqsj1.js} +32 -30
- package/dist/cli/{curator-p0dwpn2x.js → curator-njskp28b.js} +32 -30
- package/dist/cli/{evidence-summary-service-hvbqyb4g.js → evidence-summary-service-5rry81jm.js} +12 -12
- package/dist/cli/{gate-evidence-dhgmnsh0.js → gate-evidence-b6k9wng8.js} +5 -5
- package/dist/cli/{guardrail-explain-s0dzn8c6.js → guardrail-explain-5yw549sm.js} +33 -31
- package/dist/cli/{guardrail-log-qc7rfhv2.js → guardrail-log-nrnx87ac.js} +7 -7
- package/dist/cli/{guardrail-reset-cxkf5h0x.js → guardrail-reset-zm5an5bw.js} +32 -30
- package/dist/cli/{hive-promoter-ppbrv8m1.js → hive-promoter-zzgnfhxr.js} +32 -30
- package/dist/cli/{index-vcv9m2q5.js → index-0myjf1y2.js} +2 -2
- package/dist/cli/{index-jw7z3gem.js → index-1eqbnwm6.js} +1 -1
- package/dist/cli/{index-q87ht62k.js → index-3b762978.js} +5 -2
- package/dist/cli/{index-r7rn6e5f.js → index-3fs3p6ck.js} +5 -5
- package/dist/cli/{index-4wmpv2kn.js → index-3gym3fjj.js} +6 -6
- package/dist/cli/{index-7z9gyts0.js → index-3nsewz46.js} +1 -1
- package/dist/cli/{index-77syzssw.js → index-5a8nk165.js} +4 -4
- package/dist/cli/{index-db520vnn.js → index-63s6t3z4.js} +1 -1
- package/dist/cli/{index-8vwe2qjh.js → index-7322jr05.js} +8 -8
- package/dist/cli/{index-z4n60b0a.js → index-9cvfa8p8.js} +1 -1
- package/dist/cli/{index-80pmq6q2.js → index-9m1ze4z4.js} +1 -1
- package/dist/cli/{index-qw893zqp.js → index-a1bh2e4f.js} +6 -6
- package/dist/cli/{index-6w468bjy.js → index-bgzdwkpe.js} +1 -1
- package/dist/cli/{index-tnj464kq.js → index-cjjcey0h.js} +1 -1
- package/dist/cli/{index-tjaawnws.js → index-f18bqg18.js} +5 -3
- package/dist/cli/{index-9wrmzsnk.js → index-fckfgptr.js} +1 -1
- package/dist/cli/{index-3gwkmq53.js → index-gss86tj3.js} +2 -2
- package/dist/cli/{index-vkaqrrsc.js → index-gwbxeh8j.js} +14 -643
- package/dist/cli/{index-1mbwgw4p.js → index-hq1gdz0g.js} +2 -2
- package/dist/cli/{index-0h63swrc.js → index-j1gq4qm8.js} +5 -5
- package/dist/cli/{index-mfewnd7j.js → index-m24pv3f4.js} +4 -4
- package/dist/cli/{index-5wq0dd30.js → index-m516tpxe.js} +2 -2
- package/dist/cli/index-mmngnxev.js +883 -0
- package/dist/cli/{index-acnwj4pc.js → index-nbfpnb0w.js} +1 -1
- package/dist/cli/{index-kk9yk7an.js → index-rkr19fdv.js} +1 -1
- package/dist/cli/{index-1wapt173.js → index-ttdjphep.js} +3 -3
- package/dist/cli/{index-ydbd41sv.js → index-v0t8z5ab.js} +1 -1
- package/dist/cli/{index-2ze7yqm8.js → index-vcen0ne4.js} +1 -1
- package/dist/cli/{index-bdmg6yvj.js → index-w1sfjffe.js} +2 -2
- package/dist/cli/index-w7ekntej.js +643 -0
- package/dist/cli/{index-pde4zn7j.js → index-wvfgkms6.js} +1 -1
- package/dist/cli/{index-25xvw7hq.js → index-xsv6zv7n.js} +34 -32
- package/dist/cli/{index-2rhs7j4r.js → index-xtjvg1wx.js} +2149 -2619
- package/dist/cli/{index-qn4w0gar.js → index-y3fgbx8g.js} +1 -1
- package/dist/cli/{index-sjkxrf06.js → index-z74stz9p.js} +4 -4
- package/dist/cli/index.js +32 -30
- package/dist/cli/{knowledge-escalator-nyeg4ndw.js → knowledge-escalator-8y3adkn0.js} +11 -11
- package/dist/cli/{knowledge-events-z7smbnff.js → knowledge-events-mnexhwe2.js} +9 -9
- package/dist/cli/{knowledge-link-0byjmj0w.js → knowledge-link-jr8rqr39.js} +4 -4
- package/dist/cli/{knowledge-store-p14t72y5.js → knowledge-store-cp42ccd1.js} +5 -5
- package/dist/cli/{knowledge-validator-jg6zhx9s.js → knowledge-validator-hwp1t6x3.js} +7 -7
- package/dist/cli/{pending-delegations-0111ywd2.js → pending-delegations-jj5vaq9q.js} +5 -4
- package/dist/cli/{pr-subscriptions-4e64sbwg.js → pr-subscriptions-mm6kyyv0.js} +4 -4
- package/dist/cli/{runner-rddddxmq.js → runner-d402vnq3.js} +5 -5
- package/dist/cli/{scan-cursor-wjad4yd7.js → scan-cursor-d75dh3hv.js} +6 -6
- package/dist/cli/{schema-9ebqj7mv.js → schema-djm1bhb8.js} +1 -1
- package/dist/cli/{scope-persistence-j5hz4mnd.js → scope-persistence-g0yc6dfa.js} +8 -8
- package/dist/cli/{skill-generator-x6b05jz6.js → skill-generator-9ppgxz4j.js} +13 -13
- package/dist/cli/{worktree-collision-ownership-g5n5xbqy.js → worktree-collision-ownership-061zmyyp.js} +6 -5
- package/dist/cli/{worktree-isolation-ha70bwes.js → worktree-isolation-vk82698z.js} +32 -30
- package/dist/hooks/pr-workflow-gate.d.ts +20 -245
- package/dist/index.js +374 -374
- package/dist/{hooks/pr-review-reentry-authorization.d.ts → pr-review/authorization.d.ts} +32 -10
- package/dist/{hooks/pr-review-resilience-circuit.d.ts → pr-review/circuit.d.ts} +60 -3
- package/dist/pr-review/completion.d.ts +373 -0
- package/dist/pr-review/critic-routing.d.ts +37 -0
- package/dist/pr-review/guardrails.d.ts +67 -0
- package/dist/pr-review/legacy-transcript-adapter.d.ts +276 -0
- package/dist/pr-review/persistence.d.ts +107 -0
- package/dist/pr-review/reducer.d.ts +54 -0
- package/dist/pr-review/types.d.ts +225 -0
- package/package.json +1 -1
- package/dist/cli/pr-review-reentry-authorization-b7ceja9y.js +0 -301
|
@@ -2,13 +2,19 @@ import * as fsp from 'node:fs/promises';
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { type CandidateSeverity, type FindingsSeverity, type RowFormatFamily } from '../background/candidate-contract.js';
|
|
4
4
|
import { type LaneOutputArtifact } from '../background/lane-output-store.js';
|
|
5
|
-
import { type BackgroundDelegationRecord, type BackgroundDelegationResult, type
|
|
5
|
+
import { type BackgroundDelegationRecord, type BackgroundDelegationResult, type BackgroundDelegationWorkflowLaneRecovery, findByBatchId, sweepStaleDelegations } from '../background/pending-delegations.js';
|
|
6
6
|
import { PR_REVIEW_BASE_DIMENSION_IDS, type PrReviewLaneResultEnvelope, type PrReviewRiskImpact, type PrReviewRiskTag } from '../background/pr-review-contract.js';
|
|
7
7
|
import { type PrReviewInlineTriggerRow } from '../background/pr-review-trigger-contract.js';
|
|
8
8
|
import { type RevisionDigestResult, resolveCommitCountSince, resolveCommitCountSinceAsync, resolveCurrentGitHead, resolveCurrentGitHeadAsync, resolveCurrentLocalHeadRefAsync, resolveCurrentUpstreamPushTarget, resolveCurrentUpstreamPushTargetAsync, resolveCurrentUpstreamRemoteRef, resolveExactRemoteBranchHead, resolveExactRemoteBranchHeadAsync, resolveIsExactSingleChildCommit, resolveIsExactSingleChildCommitAsync, resolveIsWorkingTreeClean, resolveIsWorkingTreeCleanAsync, resolvePrReviewDiffStats, resolvePrReviewDiffStatsAsync, resolvePrWorkflowRevisionDigest, resolvePrWorkflowRevisionDigestDetailed, resolveRemoteRefsContainingHead, resolveRemoteRefsContainingHeadAsync, resolveRemoteUrlIdentity, resolveRemoteUrlIdentityAsync } from '../background/workspace-snapshot.js';
|
|
9
9
|
import { type PrReviewResilienceConfig } from '../config/schema.js';
|
|
10
10
|
import { classifyPrWorkflowGitState, type PrWorkflowGitState } from '../git/pr-workflow-state.js';
|
|
11
|
-
import { classifyPrReviewCircuitSignal, type PrReviewCircuitLegacyRecord, type PrReviewCircuitRecordV2 } from '
|
|
11
|
+
import { classifyPrReviewCircuitSignal, type PrReviewCircuitLegacyRecord, type PrReviewCircuitRecordV2, type PrReviewResiliencePolicyRecord, resolvePrReviewResiliencePolicy } from '../pr-review/circuit.js';
|
|
12
|
+
import { type PrReviewDimensionCancellationRecord, type PrReviewPartialBaseCoverageRecord, type PrReviewReportVerdict, type PrReviewTerminalCoverageSettlement } from '../pr-review/completion.js';
|
|
13
|
+
import { type PrReviewComposablePhase, type PrReviewPhaseComposition, parseCriticVerdict } from '../pr-review/legacy-transcript-adapter.js';
|
|
14
|
+
import { withPrWorkflowCheckoutMutationLock, workflowCheckoutMutationLockRelativePath, workflowGateStateLockRelativePath, workflowGateStateRelativePath } from '../pr-review/persistence.js';
|
|
15
|
+
export type { PrReviewDimensionCancellationRecord, PrReviewDimensionTerminalState, PrReviewPartialBaseCoverageRecord, PrReviewPartialBaseCoverageRecordV1, PrReviewPartialBaseCoverageRecordV2, PrReviewReportVerdict, PrReviewTerminalCoverageKind, PrReviewTerminalCoverageSettlement, PrReviewUnresolvedDimensionRecord, } from '../pr-review/completion.js';
|
|
16
|
+
export { allowedPrReviewReportVerdicts, normalizePrReviewPartialBaseCoverageRecord, PR_REVIEW_REPORT_VERDICTS, readPrReviewTerminalCoverageForReport, rollbackPrReviewPartialBaseCoverageAdmission, } from '../pr-review/completion.js';
|
|
17
|
+
export { ensurePrWorkflowSafeParentDirectory, PrWorkflowCheckoutMutationTimeoutError, prWorkflowSessionFileStem, withPrWorkflowCheckoutMutationLock, writePrWorkflowAtomicJson, } from '../pr-review/persistence.js';
|
|
12
18
|
/**
|
|
13
19
|
* Re-exported for compatibility: the canonical six-dimension list is owned by
|
|
14
20
|
* the PR-review contract module (issue #2383 single-source rule; a
|
|
@@ -180,15 +186,6 @@ interface PrReviewBaseDispatchRecord {
|
|
|
180
186
|
}>;
|
|
181
187
|
validatedAt: string;
|
|
182
188
|
}
|
|
183
|
-
interface PrReviewResiliencePolicyRecord {
|
|
184
|
-
enabled: boolean;
|
|
185
|
-
canaryProbeMs: number;
|
|
186
|
-
statusProbeTimeoutMs: number;
|
|
187
|
-
correlatedFailureThreshold: number;
|
|
188
|
-
maxRetryAttemptsAfterInitial: number;
|
|
189
|
-
/** Issue #2382. Optional: policies persisted before the field existed parse unchanged. */
|
|
190
|
-
circuitOpenDurationMs?: number;
|
|
191
|
-
}
|
|
192
189
|
interface PrReviewResilienceAttemptRecord {
|
|
193
190
|
attempt: 0 | 1 | 2;
|
|
194
191
|
targetDimensions: PrReviewBaseDimensionId[];
|
|
@@ -563,78 +560,6 @@ export interface PrWorkflowGateState {
|
|
|
563
560
|
prFeedbackRebindCount?: number;
|
|
564
561
|
prFeedbackScopes?: PrFeedbackScopeDeclarationRecord[];
|
|
565
562
|
}
|
|
566
|
-
/**
|
|
567
|
-
* Normalized terminal state of one canonical base dimension (issue #2383).
|
|
568
|
-
* Every dimension ends in exactly one of these; completion requires every
|
|
569
|
-
* LAUNCHED lane to be terminal (COVERED/FAILED) or explicitly cancelled, with
|
|
570
|
-
* no in-flight lane and no late result creditable to the active generation.
|
|
571
|
-
*/
|
|
572
|
-
export type PrReviewDimensionTerminalState = 'COVERED' | 'FAILED' | 'CANCELLED' | 'NOT_LAUNCHED';
|
|
573
|
-
/** Gate-derived per-dimension terminal evidence for an unresolved dimension. */
|
|
574
|
-
export interface PrReviewUnresolvedDimensionRecord {
|
|
575
|
-
dimension: PrReviewBaseDimensionId;
|
|
576
|
-
terminalState: 'FAILED' | 'CANCELLED' | 'NOT_LAUNCHED';
|
|
577
|
-
reasonKind: 'lane_failure' | 'cancelled' | 'not_launched';
|
|
578
|
-
failureClass?: BackgroundDelegationWorkflowLaneFailureClass;
|
|
579
|
-
terminalEventId?: string;
|
|
580
|
-
/** Contributing lane/batch identity, when available. */
|
|
581
|
-
batchId?: string;
|
|
582
|
-
laneId?: string;
|
|
583
|
-
/**
|
|
584
|
-
* Bounded safe detail derived from the failure-class vocabulary — never
|
|
585
|
-
* lane output, prompts, or secrets.
|
|
586
|
-
*/
|
|
587
|
-
safeDetail?: string;
|
|
588
|
-
}
|
|
589
|
-
/** v2 terminal-settlement disclosure (issue #2383). The ONLY shape new writers emit. */
|
|
590
|
-
export interface PrReviewPartialBaseCoverageRecordV2 {
|
|
591
|
-
schemaVersion: 2;
|
|
592
|
-
runId: string;
|
|
593
|
-
prHeadSha: string;
|
|
594
|
-
revisionDigest: string;
|
|
595
|
-
unresolvedDimensions: PrReviewUnresolvedDimensionRecord[];
|
|
596
|
-
admittedAt: string;
|
|
597
|
-
}
|
|
598
|
-
/**
|
|
599
|
-
* Legacy v1 disclosure (pre-#2383): singular `missingDimension` with a typed
|
|
600
|
-
* terminal failure. Read-only — normalized to the v2 in-memory view at the
|
|
601
|
-
* single read boundary; never rewritten on disk.
|
|
602
|
-
*/
|
|
603
|
-
export interface PrReviewPartialBaseCoverageRecordV1 {
|
|
604
|
-
runId: string;
|
|
605
|
-
prHeadSha: string;
|
|
606
|
-
revisionDigest: string;
|
|
607
|
-
missingDimension: PrReviewBaseDimensionId;
|
|
608
|
-
failureClass: BackgroundDelegationWorkflowLaneFailureClass;
|
|
609
|
-
terminalEventId: string;
|
|
610
|
-
admittedAt: string;
|
|
611
|
-
}
|
|
612
|
-
export type PrReviewPartialBaseCoverageRecord = PrReviewPartialBaseCoverageRecordV2 | PrReviewPartialBaseCoverageRecordV1;
|
|
613
|
-
/** Terminal report kind of an N-of-6 settlement (issue #2383). */
|
|
614
|
-
export type PrReviewTerminalCoverageKind = 'COMPLETE' | 'PARTIAL' | 'NO_COVERAGE';
|
|
615
|
-
/** Controller-declared terminal verdict for a PR_REVIEW completion (issue #2383). */
|
|
616
|
-
export declare const PR_REVIEW_REPORT_VERDICTS: readonly ["APPROVE", "REQUEST_CHANGES", "INCOMPLETE"];
|
|
617
|
-
export type PrReviewReportVerdict = (typeof PR_REVIEW_REPORT_VERDICTS)[number];
|
|
618
|
-
/**
|
|
619
|
-
* Verdicts a terminal report may carry by coverage kind (issue #2383):
|
|
620
|
-
* PARTIAL may only request changes or declare itself incomplete; NO_COVERAGE
|
|
621
|
-
* is a forced INCOMPLETE operational report. Neither may ever APPROVE or
|
|
622
|
-
* claim a full review.
|
|
623
|
-
*/
|
|
624
|
-
export declare function allowedPrReviewReportVerdicts(kind: PrReviewTerminalCoverageKind): readonly PrReviewReportVerdict[];
|
|
625
|
-
export interface PrReviewTerminalCoverageSettlement {
|
|
626
|
-
kind: PrReviewTerminalCoverageKind;
|
|
627
|
-
coveredDimensions: PrReviewBaseDimensionId[];
|
|
628
|
-
unresolvedDimensions: PrReviewUnresolvedDimensionRecord[];
|
|
629
|
-
/** False while any dimension still has a live (in-flight) lane. */
|
|
630
|
-
allLaunchedTerminal: boolean;
|
|
631
|
-
}
|
|
632
|
-
/** Per-dimension explicit cancellation, written by armed recovery (issue #2383). */
|
|
633
|
-
export interface PrReviewDimensionCancellationRecord {
|
|
634
|
-
reason: string;
|
|
635
|
-
cancelledAt: string;
|
|
636
|
-
source: 'armed_recovery';
|
|
637
|
-
}
|
|
638
563
|
/**
|
|
639
564
|
* Bound on the PR_FEEDBACK inventory-amendment audit ledger (issue #2242 R3).
|
|
640
565
|
*
|
|
@@ -646,12 +571,6 @@ export interface PrReviewDimensionCancellationRecord {
|
|
|
646
571
|
* instead.
|
|
647
572
|
*/
|
|
648
573
|
export declare const MAX_PR_FEEDBACK_INVENTORY_AMENDMENTS = 128;
|
|
649
|
-
/**
|
|
650
|
-
* Normalize any disclosure record to the v2 in-memory view. A legacy v1
|
|
651
|
-
* record maps to exactly one FAILED entry; the durable file is never
|
|
652
|
-
* rewritten (its digest stays bound to the original bytes).
|
|
653
|
-
*/
|
|
654
|
-
export declare function normalizePrReviewPartialBaseCoverageRecord(record: PrReviewPartialBaseCoverageRecord): PrReviewPartialBaseCoverageRecordV2;
|
|
655
574
|
/**
|
|
656
575
|
* One appended PR_FEEDBACK inventory entry (issue #2242 R3). `batch` groups the
|
|
657
576
|
* entries appended by a single `declarePrFeedbackInventory` call so an auditor
|
|
@@ -1057,7 +976,6 @@ export declare class PrReviewResilienceRetryExhaustedError extends Error {
|
|
|
1057
976
|
readonly code: "PR_REVIEW_RESILIENCE_RETRY_EXHAUSTED";
|
|
1058
977
|
constructor(message: string);
|
|
1059
978
|
}
|
|
1060
|
-
declare function snapshotPrReviewResiliencePolicy(policy?: PrReviewResilienceConfig): PrReviewResiliencePolicyRecord;
|
|
1061
979
|
declare function effectivePrReviewResiliencePolicy(state: PrWorkflowGateState, requestedPolicy?: PrReviewResilienceConfig): PrReviewResiliencePolicyRecord;
|
|
1062
980
|
interface EnforcePrReviewBaseDimensionsOptions {
|
|
1063
981
|
batchId: string;
|
|
@@ -1071,29 +989,16 @@ interface EnforcePrReviewBaseDimensionsOptions {
|
|
|
1071
989
|
export declare function enforcePrReviewBaseDimensions(directory: string, sessionID: string, lanes: readonly PrWorkflowLaneSpec[], options: EnforcePrReviewBaseDimensionsOptions): Promise<PrWorkflowGateState>;
|
|
1072
990
|
export declare function rollbackPrReviewBaseAdmissionIfUnlaunched(directory: string, sessionID: string, batchId: string, contractRetry?: boolean): Promise<boolean>;
|
|
1073
991
|
declare function minimumConsolidatedLaneCover(sets: ReadonlyArray<readonly string[]>): number;
|
|
1074
|
-
export declare function admitPrReviewPartialBaseCoverage(directory: string, sessionID: string, runId: string, unresolvedDimensions: readonly PrReviewBaseDimensionId[]): Promise<PrWorkflowGateState>;
|
|
1075
|
-
/**
|
|
1076
|
-
* Undo a newly admitted partial-base disclosure when the findings checkpoint
|
|
1077
|
-
* cannot be completed. The compare-and-clear checks keep a stale writer from
|
|
1078
|
-
* deleting a disclosure that another writer has already committed.
|
|
1079
|
-
*/
|
|
1080
|
-
export declare function rollbackPrReviewPartialBaseCoverageAdmission(directory: string, sessionID: string, options: {
|
|
1081
|
-
runId: string;
|
|
1082
|
-
boundary: 'post_explorer' | 'post_reviewer' | 'post_critic';
|
|
1083
|
-
relativePath: string;
|
|
1084
|
-
digest: string;
|
|
1085
|
-
}): Promise<boolean>;
|
|
1086
992
|
/**
|
|
1087
|
-
*
|
|
1088
|
-
*
|
|
1089
|
-
*
|
|
1090
|
-
*
|
|
1091
|
-
*
|
|
1092
|
-
*
|
|
1093
|
-
*
|
|
1094
|
-
* revision) — the disclosure is immutable, so such a run must re-settle or
|
|
1095
|
-
* restart rather than silently re-crediting.
|
|
993
|
+
* Issue #2385: the coverage-disclosure admission/settlement state machine now
|
|
994
|
+
* lives in `src/pr-review/completion.ts`, which the gate feeds through the
|
|
995
|
+
* bound completion-helper seam (bound at module init below). The gate
|
|
996
|
+
* re-exposes the two state-returning entry points with their original
|
|
997
|
+
* full-state signatures: every state object the boundary returns was read and
|
|
998
|
+
* written through this gate's own bound readers and codec, so the widening
|
|
999
|
+
* cast is representation-preserving.
|
|
1096
1000
|
*/
|
|
1001
|
+
export declare function admitPrReviewPartialBaseCoverage(directory: string, sessionID: string, runId: string, unresolvedDimensions: readonly PrReviewBaseDimensionId[]): Promise<PrWorkflowGateState>;
|
|
1097
1002
|
export declare function assertPrReviewBaseCoverageSettled(directory: string, sessionID: string, gateContext?: PrReviewGateContext): Promise<{
|
|
1098
1003
|
state: PrWorkflowGateState;
|
|
1099
1004
|
settlement: PrReviewTerminalCoverageSettlement & {
|
|
@@ -1357,24 +1262,6 @@ export declare function validatePrFeedbackScopeBinding(directory: string, bindin
|
|
|
1357
1262
|
}): Promise<boolean>;
|
|
1358
1263
|
export declare function enforcePrWorkflowToolBefore(directory: string, sessionID: string, toolName: string, args: Record<string, unknown> | undefined, generatedAgentNames?: readonly string[], callID?: string): Promise<void>;
|
|
1359
1264
|
/** Validate the terminal PR workflow contract before removing its durable gate. */
|
|
1360
|
-
/**
|
|
1361
|
-
* Read-only terminal-coverage projection for the completion report surface
|
|
1362
|
-
* (issue #2383). Pure derivation over the CURRENT state; returns null when no
|
|
1363
|
-
* active PR_REVIEW gate exists. The completion tool reads this BEFORE the
|
|
1364
|
-
* terminal clear so the response carries the truthful settlement summary.
|
|
1365
|
-
*/
|
|
1366
|
-
export declare function readPrReviewTerminalCoverageForReport(directory: string, sessionID: string): Promise<{
|
|
1367
|
-
kind: PrReviewTerminalCoverageKind;
|
|
1368
|
-
coveredDimensions: PrReviewBaseDimensionId[];
|
|
1369
|
-
unresolvedDimensions: Array<{
|
|
1370
|
-
dimension: PrReviewBaseDimensionId;
|
|
1371
|
-
terminal_state: PrReviewUnresolvedDimensionRecord['terminalState'];
|
|
1372
|
-
reason_kind: PrReviewUnresolvedDimensionRecord['reasonKind'];
|
|
1373
|
-
failure_class?: BackgroundDelegationWorkflowLaneFailureClass;
|
|
1374
|
-
}>;
|
|
1375
|
-
liveDimensions: PrReviewBaseDimensionId[];
|
|
1376
|
-
allowedVerdicts: readonly PrReviewReportVerdict[];
|
|
1377
|
-
} | null>;
|
|
1378
1265
|
/**
|
|
1379
1266
|
* Read-only identity binding for reviewer re-entry authorization (issue
|
|
1380
1267
|
* #2383). Returns the exact active-session PR_REVIEW identity a one-use
|
|
@@ -1401,10 +1288,7 @@ export declare const _test_exports: {
|
|
|
1401
1288
|
extractCandidateIds: typeof extractCandidateIds;
|
|
1402
1289
|
parseCanonicalCandidateRows: typeof parseCanonicalCandidateRows;
|
|
1403
1290
|
resolvePrReviewRowFamily: typeof resolvePrReviewRowFamily;
|
|
1404
|
-
pipeFieldsCapped: typeof pipeFieldsCapped;
|
|
1405
1291
|
boundPublicationDiagnostic: typeof boundPublicationDiagnostic;
|
|
1406
|
-
indexVerdictRows: typeof indexVerdictRows;
|
|
1407
|
-
reviewerVerdictRowDigest: typeof reviewerVerdictRowDigest;
|
|
1408
1292
|
workflowGateStateRelativePath: typeof workflowGateStateRelativePath;
|
|
1409
1293
|
workflowGateStateLockRelativePath: typeof workflowGateStateLockRelativePath;
|
|
1410
1294
|
workflowCheckoutMutationLockRelativePath: typeof workflowCheckoutMutationLockRelativePath;
|
|
@@ -1427,8 +1311,8 @@ export declare const _test_exports: {
|
|
|
1427
1311
|
beforeSafeDirectoryCreate: ((parentPath: string, nextPath: string) => Promise<void>) | undefined;
|
|
1428
1312
|
beforeAtomicTempWrite: (() => Promise<void>) | undefined;
|
|
1429
1313
|
beforeAtomicRename: (() => Promise<void>) | undefined;
|
|
1430
|
-
openCheckoutLock: typeof
|
|
1431
|
-
removeCheckoutLock:
|
|
1314
|
+
openCheckoutLock: (lockPath: string) => ReturnType<typeof fsp.open>;
|
|
1315
|
+
removeCheckoutLock: (lockPath: string) => Promise<void>;
|
|
1432
1316
|
checkoutMutationActionTimeoutMs: number;
|
|
1433
1317
|
classifyPrWorkflowGitStateAsync: typeof classifyPrWorkflowGitState;
|
|
1434
1318
|
/**
|
|
@@ -1472,7 +1356,7 @@ export declare const _test_exports: {
|
|
|
1472
1356
|
* so `_test_exports` is the right seam (no `mock.module` needed).
|
|
1473
1357
|
*/
|
|
1474
1358
|
effectivePrReviewResiliencePolicy: typeof effectivePrReviewResiliencePolicy;
|
|
1475
|
-
snapshotPrReviewResiliencePolicy: typeof
|
|
1359
|
+
snapshotPrReviewResiliencePolicy: typeof resolvePrReviewResiliencePolicy;
|
|
1476
1360
|
resolveCurrentGitHead: typeof resolveCurrentGitHead;
|
|
1477
1361
|
resolveCurrentGitHeadAsync: typeof resolveCurrentGitHeadAsync;
|
|
1478
1362
|
resolveCurrentUpstreamPushTarget: typeof resolveCurrentUpstreamPushTarget;
|
|
@@ -1531,12 +1415,6 @@ export declare const _test_exports: {
|
|
|
1531
1415
|
resolveRemoteRefsContainingHead: typeof resolveRemoteRefsContainingHead;
|
|
1532
1416
|
resolveRemoteRefsContainingHeadAsync: typeof resolveRemoteRefsContainingHeadAsync;
|
|
1533
1417
|
parseCriticVerdict: typeof parseCriticVerdict;
|
|
1534
|
-
/**
|
|
1535
|
-
* Exact production verdict-row analysis and item composition parsers. Exposed
|
|
1536
|
-
* so the assignment-boundary regression can prove both paths remain linear.
|
|
1537
|
-
*/
|
|
1538
|
-
analyzePrReviewVerdictRowContract: typeof analyzePrReviewVerdictRowContract;
|
|
1539
|
-
parseLaneItemVerdicts: typeof parseLaneItemVerdicts;
|
|
1540
1418
|
/**
|
|
1541
1419
|
* Read-only view of the item-keyed composition for one session, including
|
|
1542
1420
|
* the diagnostics that settlement only logs (abandoned declared lanes,
|
|
@@ -1571,7 +1449,7 @@ export declare const _test_exports: {
|
|
|
1571
1449
|
* micro-sweep and trigger-ledger prerequisites those entry points require.
|
|
1572
1450
|
*/
|
|
1573
1451
|
derivePrReviewCandidateInventory: (directory: string, sessionID: string) => Promise<string[]>;
|
|
1574
|
-
isProcessAlive:
|
|
1452
|
+
isProcessAlive: (pid: number) => boolean;
|
|
1575
1453
|
isSafeStandaloneGitCommit: typeof isSafeStandaloneGitCommit;
|
|
1576
1454
|
rename: typeof fsp.rename;
|
|
1577
1455
|
nowMs: () => number;
|
|
@@ -1686,35 +1564,6 @@ interface CandidateArtifactParseResult {
|
|
|
1686
1564
|
declare function resolvePrReviewRowFamily(workflowLane: string | undefined, mode?: string): RowFormatFamily;
|
|
1687
1565
|
declare function parseCanonicalCandidateRows(text: string, fallbackFamily: RowFormatFamily): CandidateArtifactParseResult;
|
|
1688
1566
|
declare function extractCandidateIds(text: string, fallbackFamily: RowFormatFamily, scopeToLanes?: readonly string[]): string[];
|
|
1689
|
-
type PrReviewComposablePhase = 'reviewer' | 'critic';
|
|
1690
|
-
/** One item's admitted verdict plus the lane provenance that admitted it. */
|
|
1691
|
-
interface PrReviewItemClaim {
|
|
1692
|
-
batchId: string;
|
|
1693
|
-
laneId: string;
|
|
1694
|
-
workflowLane: string;
|
|
1695
|
-
/** Reviewer classification, or critic status. */
|
|
1696
|
-
classification: string;
|
|
1697
|
-
severity: string;
|
|
1698
|
-
/**
|
|
1699
|
-
* Typed risk metadata from the reviewer row (issue #2383). Reviewer claims
|
|
1700
|
-
* only; absent on critic claims, which never re-assess routing risk.
|
|
1701
|
-
*/
|
|
1702
|
-
riskImpact?: PrReviewRiskImpact;
|
|
1703
|
-
riskTags?: PrReviewRiskTag[];
|
|
1704
|
-
/**
|
|
1705
|
-
* sha256 of the full canonical `[REVIEWED]` row this claim was parsed from.
|
|
1706
|
-
* Reviewer claims only — this is what a critic batch binds to per item.
|
|
1707
|
-
*/
|
|
1708
|
-
rowDigest?: string;
|
|
1709
|
-
}
|
|
1710
|
-
interface PrReviewPhaseComposition {
|
|
1711
|
-
/** Item id -> winning claim. Most recent successful lane per item wins. */
|
|
1712
|
-
claims: Map<string, PrReviewItemClaim>;
|
|
1713
|
-
requiredInventory: string[];
|
|
1714
|
-
unclaimed: string[];
|
|
1715
|
-
contributingBatchIds: string[];
|
|
1716
|
-
diagnostics: string[];
|
|
1717
|
-
}
|
|
1718
1567
|
/**
|
|
1719
1568
|
* **B1 invariant — the accounting defect class's most dangerous recurrence.**
|
|
1720
1569
|
*
|
|
@@ -1793,70 +1642,6 @@ export declare function validatePrReviewDiscoveryLaneCompletion(input: PrReviewD
|
|
|
1793
1642
|
export declare function validatePrWorkflowTransportRecovery(input: PrWorkflowTransportRecoveryValidationInput): Promise<PrWorkflowTransportRecoveryValidationResult>;
|
|
1794
1643
|
/** Require at least one semantically valid discovery row or CLEAN attestation. */
|
|
1795
1644
|
export declare function prReviewDiscoveryArtifactCoversLane(text: string, expectedWorkflowLane: string, ownedWorkflowLanes?: readonly string[], mode?: string): boolean;
|
|
1796
|
-
interface IndexedVerdictRows {
|
|
1797
|
-
markerRows: string[][];
|
|
1798
|
-
rowsByItemId: Map<string, string[][]>;
|
|
1799
|
-
recoveries: Array<{
|
|
1800
|
-
marker: '[REVIEWED]' | '[CRITIC]';
|
|
1801
|
-
itemId: string;
|
|
1802
|
-
recovery: 'legacy-fidelity-safe' | 'legacy-lossy';
|
|
1803
|
-
}>;
|
|
1804
|
-
}
|
|
1805
|
-
declare function indexVerdictRows(text: string, marker: '[REVIEWED]' | '[CRITIC]'): IndexedVerdictRows;
|
|
1806
|
-
/**
|
|
1807
|
-
* Digest of the FULL canonical reviewer row, not the classification/severity
|
|
1808
|
-
* pair a reviewer verdict projects to. Only 2 of the 12 required fields survive
|
|
1809
|
-
* that projection, so a tuple binding would still match a row whose evidence,
|
|
1810
|
-
* file:line and root cause all changed. Fields are joined on NUL, which
|
|
1811
|
-
* `pipeFields` can never produce, so no field boundary is forgeable.
|
|
1812
|
-
*/
|
|
1813
|
-
declare function reviewerVerdictRowDigest(fields: readonly string[]): string;
|
|
1814
|
-
/**
|
|
1815
|
-
* Per-item verdicts an artifact actually carries, as a map rather than a
|
|
1816
|
-
* boolean. This is the granularity the composition needs: one unparseable item
|
|
1817
|
-
* must not discard its healthy siblings in the same lane.
|
|
1818
|
-
*/
|
|
1819
|
-
declare function parseLaneItemVerdicts(text: string, itemIds: readonly string[], phase: PrReviewComposablePhase, reviewerClaims?: ReadonlyMap<string, PrReviewItemClaim>): Map<string, {
|
|
1820
|
-
classification: string;
|
|
1821
|
-
severity: string;
|
|
1822
|
-
riskImpact?: PrReviewRiskImpact;
|
|
1823
|
-
riskTags?: PrReviewRiskTag[];
|
|
1824
|
-
rowDigest?: string;
|
|
1825
|
-
}>;
|
|
1826
|
-
/** Exact assigned-row contract used by both normal and recovered collection. */
|
|
1827
|
-
declare function analyzePrReviewVerdictRowContract(text: string, itemIds: readonly string[], phase: PrReviewComposablePhase, reviewerClaims?: ReadonlyMap<string, PrReviewItemClaim>): {
|
|
1828
|
-
ok: boolean;
|
|
1829
|
-
expected: string;
|
|
1830
|
-
actual: string;
|
|
1831
|
-
recoveries: IndexedVerdictRows['recoveries'];
|
|
1832
|
-
};
|
|
1833
|
-
declare function parseCriticVerdict(text: string, itemId: string, reviewerSeverity?: string): {
|
|
1834
|
-
status: string;
|
|
1835
|
-
severity: string;
|
|
1836
|
-
} | null;
|
|
1837
|
-
/**
|
|
1838
|
-
* `pipeFields` capped at the row's canonical field count: separators beyond the
|
|
1839
|
-
* expected count merge back into the trailing (free-text) field. Verdict rows
|
|
1840
|
-
* ([REVIEWED], [CRITIC], [FEEDBACK-VERIFIED]) carry prose evidence in their
|
|
1841
|
-
* last field, and prose containing literal pipes (regex text, `,;|`, shell
|
|
1842
|
-
* snippets) otherwise splits the row past its strict field-count check and the
|
|
1843
|
-
* whole verdict becomes unparseable. Deterministic: the enumerated leading
|
|
1844
|
-
* fields are never merged.
|
|
1845
|
-
*/
|
|
1846
|
-
declare function pipeFieldsCapped(line: string, expectedFieldCount: number): string[];
|
|
1847
|
-
declare function workflowCheckoutMutationLockRelativePath(): string;
|
|
1848
|
-
declare function openCheckoutLockFile(lockPath: string): Promise<fsp.FileHandle>;
|
|
1849
|
-
declare function removeCheckoutLockFile(lockPath: string): Promise<void>;
|
|
1850
|
-
/** A bounded checkout-mutation refusal that never permits unsafe late overlap. */
|
|
1851
|
-
export declare class PrWorkflowCheckoutMutationTimeoutError extends Error {
|
|
1852
|
-
readonly phase: 'queue' | 'action';
|
|
1853
|
-
readonly code: "PR_WORKFLOW_CHECKOUT_MUTATION_TIMEOUT";
|
|
1854
|
-
readonly retryable: false;
|
|
1855
|
-
constructor(phase: 'queue' | 'action');
|
|
1856
|
-
}
|
|
1857
|
-
/** Serialize project-wide checkout mutations before any session state lock. */
|
|
1858
|
-
export declare function withPrWorkflowCheckoutMutationLock<T>(directory: string, action: () => Promise<T>): Promise<T>;
|
|
1859
|
-
declare function isProcessAlive(pid: number): boolean;
|
|
1860
1645
|
/**
|
|
1861
1646
|
* Upper bound on the length of ONE quoted schema issue.
|
|
1862
1647
|
*
|
|
@@ -1916,13 +1701,3 @@ export interface PrWorkflowGateRecoveryRead {
|
|
|
1916
1701
|
* A salvaged view is never written to the tracked-state cache.
|
|
1917
1702
|
*/
|
|
1918
1703
|
export declare function readPrWorkflowGateStateForRecovery(directory: string, sessionID: string): Promise<PrWorkflowGateRecoveryRead | null>;
|
|
1919
|
-
declare function workflowGateStateLockRelativePath(sessionID: string): string;
|
|
1920
|
-
declare function workflowGateStateRelativePath(sessionID: string): string;
|
|
1921
|
-
export declare function prWorkflowSessionFileStem(sessionID: string): string;
|
|
1922
|
-
export declare function ensurePrWorkflowSafeParentDirectory(directory: string, filePath: string): Promise<string>;
|
|
1923
|
-
/**
|
|
1924
|
-
* Write a PR-workflow artifact with the gate's Windows-safe atomic persistence
|
|
1925
|
-
* contract. Checkout-preparation receipts must survive the same transient
|
|
1926
|
-
* rename contention as canonical gate state.
|
|
1927
|
-
*/
|
|
1928
|
-
export declare function writePrWorkflowAtomicJson(directory: string, filePath: string, value: unknown): Promise<void>;
|