opencode-swarm 7.162.0 → 7.163.0

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.
Files changed (88) hide show
  1. package/dist/background/pr-review-contract.d.ts +1 -24
  2. package/dist/cli/authorization-vstrh7ra.js +23 -0
  3. package/dist/cli/{coder-settlement-s8cskxk7.js → coder-settlement-g2g5kkv5.js} +10 -10
  4. package/dist/cli/{config-doctor-636h188h.js → config-doctor-p16xr78z.js} +2 -2
  5. package/dist/cli/{core-h3hsczyq.js → core-g088v0zt.js} +1 -1
  6. package/dist/cli/{curation-policy-ayq5kmnf.js → curation-policy-j12j2gvc.js} +6 -6
  7. package/dist/cli/{curator-p0dwpn2x.js → curator-3m8a8qsn.js} +33 -31
  8. package/dist/cli/curator-llm-factory-p00hks4v.js +69 -0
  9. package/dist/cli/{evidence-summary-service-hvbqyb4g.js → evidence-summary-service-4ghqakhx.js} +13 -13
  10. package/dist/cli/{gate-evidence-dhgmnsh0.js → gate-evidence-4v8apasx.js} +6 -6
  11. package/dist/cli/guardrail-explain-smqenqtm.js +70 -0
  12. package/dist/cli/{guardrail-log-qc7rfhv2.js → guardrail-log-mmh4b4k4.js} +7 -7
  13. package/dist/cli/{guardrail-reset-cxkf5h0x.js → guardrail-reset-zge5hg4p.js} +33 -31
  14. package/dist/cli/{hive-promoter-ppbrv8m1.js → hive-promoter-vxez5s7m.js} +33 -31
  15. package/dist/cli/{index-jw7z3gem.js → index-0103w5pf.js} +2 -2
  16. package/dist/cli/{index-fx3em0dr.js → index-2zgjcmmc.js} +139 -45
  17. package/dist/cli/{index-qw893zqp.js → index-3ab9tczn.js} +8 -8
  18. package/dist/cli/{index-q87ht62k.js → index-3b762978.js} +5 -2
  19. package/dist/cli/{index-5wq0dd30.js → index-3rjxbe1p.js} +2 -2
  20. package/dist/cli/{index-z4n60b0a.js → index-453tzvkg.js} +1 -1
  21. package/dist/cli/{index-pde4zn7j.js → index-4t68xs0p.js} +3 -3
  22. package/dist/cli/{index-sjkxrf06.js → index-4xggfhge.js} +4 -4
  23. package/dist/cli/{index-8vwe2qjh.js → index-5hgn302x.js} +9 -9
  24. package/dist/cli/{index-bdmg6yvj.js → index-7n9jznv0.js} +4 -4
  25. package/dist/cli/{index-2rhs7j4r.js → index-7wb2v7jg.js} +2152 -2622
  26. package/dist/cli/{index-kk9yk7an.js → index-8ada7ag7.js} +2 -2
  27. package/dist/cli/{index-nqbqkx4c.js → index-9crtmnqg.js} +1 -1
  28. package/dist/cli/{index-3gwkmq53.js → index-axx3t3k7.js} +2 -2
  29. package/dist/cli/{index-80pmq6q2.js → index-cqgpvx2d.js} +2 -2
  30. package/dist/cli/{index-vcv9m2q5.js → index-eqkdjfqa.js} +4 -4
  31. package/dist/cli/{index-77syzssw.js → index-f7t5fn4z.js} +4 -4
  32. package/dist/cli/{index-9wrmzsnk.js → index-fckfgptr.js} +1 -1
  33. package/dist/cli/{index-0h63swrc.js → index-g4bvsapf.js} +5 -5
  34. package/dist/cli/{index-ydbd41sv.js → index-hm239n1p.js} +1 -1
  35. package/dist/cli/{index-qn4w0gar.js → index-m4nhy4fp.js} +1 -1
  36. package/dist/cli/{index-2ze7yqm8.js → index-m7yt3xmk.js} +1 -1
  37. package/dist/cli/index-mmngnxev.js +883 -0
  38. package/dist/cli/{index-7z9gyts0.js → index-n2mhyect.js} +1 -1
  39. package/dist/cli/{index-db520vnn.js → index-n67vx5zw.js} +2 -2
  40. package/dist/cli/{index-25xvw7hq.js → index-nwa7ctyf.js} +35 -33
  41. package/dist/cli/{index-4wmpv2kn.js → index-ptsmms01.js} +6 -6
  42. package/dist/cli/{index-mfewnd7j.js → index-pykfqsk0.js} +5 -5
  43. package/dist/cli/{index-r7rn6e5f.js → index-qy2rm1f6.js} +6 -6
  44. package/dist/cli/{index-tnj464kq.js → index-rqh25ns3.js} +1 -1
  45. package/dist/cli/{index-tjaawnws.js → index-s8c6f9rr.js} +6 -4
  46. package/dist/cli/{index-vkaqrrsc.js → index-t4hs3qk6.js} +15 -644
  47. package/dist/cli/{index-1wapt173.js → index-w0yn4rmh.js} +3 -3
  48. package/dist/cli/{index-1mbwgw4p.js → index-w1mc7gcm.js} +2 -2
  49. package/dist/cli/index-w7ekntej.js +643 -0
  50. package/dist/cli/{index-acnwj4pc.js → index-xyhmt813.js} +1 -1
  51. package/dist/cli/{index-6w468bjy.js → index-zgz81a8x.js} +1 -1
  52. package/dist/cli/index.js +33 -31
  53. package/dist/cli/{knowledge-escalator-nyeg4ndw.js → knowledge-escalator-91d1n291.js} +12 -12
  54. package/dist/cli/{knowledge-events-z7smbnff.js → knowledge-events-xrd9es3p.js} +10 -10
  55. package/dist/cli/{knowledge-link-0byjmj0w.js → knowledge-link-vmdj5e5d.js} +5 -5
  56. package/dist/cli/{knowledge-store-p14t72y5.js → knowledge-store-2brg88cx.js} +6 -6
  57. package/dist/cli/{knowledge-validator-jg6zhx9s.js → knowledge-validator-s1v7kry2.js} +8 -8
  58. package/dist/cli/{pending-delegations-0111ywd2.js → pending-delegations-b341397j.js} +6 -5
  59. package/dist/cli/{pr-subscriptions-4e64sbwg.js → pr-subscriptions-2mkdt0ak.js} +5 -5
  60. package/dist/cli/{runner-rddddxmq.js → runner-3gw2njnx.js} +6 -6
  61. package/dist/cli/{scan-cursor-wjad4yd7.js → scan-cursor-jm7j3w1c.js} +7 -7
  62. package/dist/cli/{schema-9ebqj7mv.js → schema-6cpgnq4s.js} +1 -1
  63. package/dist/cli/{scope-persistence-j5hz4mnd.js → scope-persistence-q713ck5n.js} +9 -9
  64. package/dist/cli/{skill-generator-x6b05jz6.js → skill-generator-z9bs6vdt.js} +14 -14
  65. package/dist/cli/{telemetry-cmbjv240.js → telemetry-x4zggfd7.js} +1 -1
  66. package/dist/cli/{worktree-collision-ownership-g5n5xbqy.js → worktree-collision-ownership-drtv7jjp.js} +7 -6
  67. package/dist/cli/{worktree-isolation-ha70bwes.js → worktree-isolation-534h3c2f.js} +33 -31
  68. package/dist/council/council-observability.d.ts +42 -0
  69. package/dist/hooks/pr-workflow-gate.d.ts +20 -245
  70. package/dist/index.js +374 -374
  71. package/dist/observability/catalog.d.ts +8 -4
  72. package/dist/observability/ids.d.ts +1 -1
  73. package/dist/observability/legacy.d.ts +6 -4
  74. package/dist/observability/observe.d.ts +1 -1
  75. package/dist/{hooks/pr-review-reentry-authorization.d.ts → pr-review/authorization.d.ts} +32 -10
  76. package/dist/{hooks/pr-review-resilience-circuit.d.ts → pr-review/circuit.d.ts} +60 -3
  77. package/dist/pr-review/completion.d.ts +373 -0
  78. package/dist/pr-review/critic-routing.d.ts +37 -0
  79. package/dist/pr-review/guardrails.d.ts +67 -0
  80. package/dist/pr-review/legacy-transcript-adapter.d.ts +276 -0
  81. package/dist/pr-review/persistence.d.ts +107 -0
  82. package/dist/pr-review/reducer.d.ts +54 -0
  83. package/dist/pr-review/types.d.ts +225 -0
  84. package/dist/telemetry.d.ts +1 -1
  85. package/package.json +1 -1
  86. package/dist/cli/curator-llm-factory-g65xmh8f.js +0 -67
  87. package/dist/cli/guardrail-explain-s0dzn8c6.js +0 -68
  88. 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 BackgroundDelegationWorkflowLaneFailureClass, type BackgroundDelegationWorkflowLaneRecovery, findByBatchId, sweepStaleDelegations } from '../background/pending-delegations.js';
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 './pr-review-resilience-circuit.js';
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
- * Validate durable terminal N-of-6 coverage evidence (issue #2383).
1088
- *
1089
- * Returns the settlement: COMPLETE when all six dimensions are covered, or
1090
- * PARTIAL / NO_COVERAGE when an admitted, still-accurate disclosure exactly
1091
- * matches the currently derived terminal settlement. Throws while any
1092
- * unresolved dimension still has a live lane, or when the disclosure has been
1093
- * invalidated by later evidence (e.g. a late success landing on the same
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 openCheckoutLockFile;
1431
- removeCheckoutLock: typeof removeCheckoutLockFile;
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 snapshotPrReviewResiliencePolicy;
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: typeof 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>;