opencode-swarm 7.157.1 → 7.158.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 (79) hide show
  1. package/.opencode/skills/swarm-pr-review/SKILL.md +24 -26
  2. package/.opencode/skills/swarm-pr-review/references/findings-persistence-contract.md +11 -3
  3. package/.opencode/skills/swarm-pr-review/references/parser-dry-run.md +1 -1
  4. package/.opencode/skills/swarm-pr-review/references/prompt-templates.md +3 -3
  5. package/dist/background/candidate-contract.d.ts +20 -3
  6. package/dist/background/candidate-parser.d.ts +8 -1
  7. package/dist/background/pr-review-contract.d.ts +93 -5
  8. package/dist/cli/{coder-settlement-tqh28pr3.js → coder-settlement-5sexsmqz.js} +9 -9
  9. package/dist/cli/{config-doctor-9rsk8ags.js → config-doctor-ewn2kw6d.js} +3 -3
  10. package/dist/cli/{core-7zwdc0sk.js → core-72wdmzps.js} +3 -3
  11. package/dist/cli/{curation-policy-72qx868r.js → curation-policy-vn3m5nq2.js} +4 -4
  12. package/dist/cli/curator-drift-g6w4ga1q.js +1 -1
  13. package/dist/cli/{curator-fdj5ftfz.js → curator-g06sa98p.js} +31 -31
  14. package/dist/cli/{curator-llm-factory-rtkeb1y1.js → curator-llm-factory-r8q84m4g.js} +31 -31
  15. package/dist/cli/{evidence-summary-service-bhqvx9qe.js → evidence-summary-service-ttd0ntm0.js} +12 -12
  16. package/dist/cli/{gate-evidence-rp0r5phx.js → gate-evidence-agnxf7md.js} +6 -6
  17. package/dist/cli/{guardrail-explain-17me709w.js → guardrail-explain-qf4k176t.js} +32 -32
  18. package/dist/cli/{guardrail-log-te4a5fmn.js → guardrail-log-g4qc595v.js} +4 -4
  19. package/dist/cli/{guardrail-reset-5n76tj7e.js → guardrail-reset-zpxk0p1j.js} +31 -31
  20. package/dist/cli/{hive-promoter-e0zrkgns.js → hive-promoter-zxy07gjg.js} +31 -31
  21. package/dist/cli/{index-rgkwg6d7.js → index-1vxmqvpt.js} +1 -1
  22. package/dist/cli/{index-hq3m47kh.js → index-5tchehv7.js} +2 -2
  23. package/dist/cli/{index-b5xm177r.js → index-5zgf140g.js} +1 -1
  24. package/dist/cli/{index-gg70afs7.js → index-663wnh64.js} +6 -6
  25. package/dist/cli/{index-pr6a7669.js → index-6xxpwk5x.js} +1 -1
  26. package/dist/cli/{index-w7s5vgb6.js → index-745dh1z1.js} +34 -34
  27. package/dist/cli/{index-ngn6jmad.js → index-7s1hmrfh.js} +1 -1
  28. package/dist/cli/{index-dwkrdpz2.js → index-8fqb0ynp.js} +1 -1
  29. package/dist/cli/{index-e7m7g2f9.js → index-a1884hh4.js} +5 -5
  30. package/dist/cli/{index-pbh1rmb9.js → index-bv24pbaj.js} +4 -4
  31. package/dist/cli/{index-r4qxngnx.js → index-c57cyrwn.js} +8 -8
  32. package/dist/cli/{index-1vjjh2gp.js → index-dmfbmnp7.js} +4 -4
  33. package/dist/cli/{index-sdde1nvx.js → index-f036tggv.js} +5 -5
  34. package/dist/cli/{index-14awxpgt.js → index-f776m4r5.js} +2 -2
  35. package/dist/cli/{index-ybvtfthv.js → index-fwe1wh6r.js} +2 -2
  36. package/dist/cli/{index-n3362zjr.js → index-gm10kvne.js} +3 -3
  37. package/dist/cli/{index-xe6zbfps.js → index-h52hs4e9.js} +1 -1
  38. package/dist/cli/{index-80qxscrc.js → index-nvta6kcv.js} +3 -3
  39. package/dist/cli/{index-gpf3cjre.js → index-pfnj5pvs.js} +1 -1
  40. package/dist/cli/{index-1gk7ctgp.js → index-pvs2zw1y.js} +2 -2
  41. package/dist/cli/{index-tt350s4g.js → index-rac2gkvr.js} +859 -459
  42. package/dist/cli/{index-r98wqjw4.js → index-rc93mm6e.js} +3 -5
  43. package/dist/cli/{index-b3cwazk2.js → index-rd324153.js} +2 -2
  44. package/dist/cli/{index-xttdbb6d.js → index-vwx0by4y.js} +5 -5
  45. package/dist/cli/{index-91ybfvy2.js → index-x4ftmdha.js} +1 -1
  46. package/dist/cli/{index-q24ffxx6.js → index-x71shq8j.js} +6 -6
  47. package/dist/cli/{index-n9hecanw.js → index-y3hdwh66.js} +4 -4
  48. package/dist/cli/{index-az2sga91.js → index-yfbp4q09.js} +1 -1
  49. package/dist/cli/{index-9r7gp6cp.js → index-yt75r1er.js} +4 -0
  50. package/dist/cli/{index-t0kxka8n.js → index-z54qw70y.js} +1 -1
  51. package/dist/cli/{index-qy6rcnjg.js → index-zawd71cg.js} +6 -6
  52. package/dist/cli/{index-6sbx96v6.js → index-zcmwwp1x.js} +5 -4
  53. package/dist/cli/index.js +32 -32
  54. package/dist/cli/{knowledge-escalator-wrpk82b9.js → knowledge-escalator-22zaj224.js} +11 -11
  55. package/dist/cli/{knowledge-events-4z6yzntf.js → knowledge-events-xbx1k408.js} +9 -9
  56. package/dist/cli/{knowledge-link-z9cchqdj.js → knowledge-link-cj2abbae.js} +3 -3
  57. package/dist/cli/{knowledge-store-z9686tpv.js → knowledge-store-fnm8xh9c.js} +4 -4
  58. package/dist/cli/{knowledge-validator-rqb0b436.js → knowledge-validator-t2jztjy1.js} +6 -6
  59. package/dist/cli/{model-preflight-cv9kvw8h.js → model-preflight-w85ecyxh.js} +1 -1
  60. package/dist/cli/{pending-delegations-g10v5k22.js → pending-delegations-29rtv1gb.js} +1 -1
  61. package/dist/cli/pr-review-reentry-authorization-25dep81m.js +299 -0
  62. package/dist/cli/{pr-subscriptions-76vg2xya.js → pr-subscriptions-cgac3ydd.js} +2 -2
  63. package/dist/cli/{runner-eagt6gf8.js → runner-sj5sf36c.js} +4 -4
  64. package/dist/cli/{scan-cursor-7s1bz7ew.js → scan-cursor-8acs9kwe.js} +5 -5
  65. package/dist/cli/{schema-78pdxc8f.js → schema-rjhassd0.js} +2 -2
  66. package/dist/cli/{scope-persistence-7ad69qmq.js → scope-persistence-jb1a5dzh.js} +7 -7
  67. package/dist/cli/{skill-generator-7cxf53ye.js → skill-generator-frgppk1w.js} +13 -13
  68. package/dist/cli/{worktree-collision-ownership-ry7xnaae.js → worktree-collision-ownership-f5sj6ffa.js} +4 -4
  69. package/dist/cli/{worktree-isolation-1jcc8ynj.js → worktree-isolation-5b0w6bha.js} +31 -31
  70. package/dist/hooks/pr-review-reentry-authorization.d.ts +97 -0
  71. package/dist/hooks/pr-workflow-gate.d.ts +211 -8
  72. package/dist/index.js +467 -460
  73. package/dist/tools/authorize-pr-review-reentry.d.ts +16 -0
  74. package/dist/tools/complete-pr-workflow.d.ts +2 -1
  75. package/dist/tools/index.d.ts +1 -0
  76. package/dist/tools/manifest.d.ts +1 -0
  77. package/dist/tools/tool-metadata.d.ts +4 -0
  78. package/dist/tools/write-pr-review-artifact.d.ts +18 -0
  79. package/package.json +1 -1
@@ -3,12 +3,18 @@ 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
5
  import { type BackgroundDelegationRecord, type BackgroundDelegationResult, type BackgroundDelegationWorkflowLaneFailureClass, type BackgroundDelegationWorkflowLaneRecovery, findByBatchId, sweepStaleDelegations } from '../background/pending-delegations.js';
6
+ import { PR_REVIEW_BASE_DIMENSION_IDS, type PrReviewRiskImpact, type PrReviewRiskTag } from '../background/pr-review-contract.js';
6
7
  import { type PrReviewInlineTriggerRow } from '../background/pr-review-trigger-contract.js';
7
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';
8
9
  import { type PrReviewResilienceConfig } from '../config/schema.js';
9
10
  import { classifyPrWorkflowGitState, type PrWorkflowGitState } from '../git/pr-workflow-state.js';
10
11
  import { classifyPrReviewCircuitSignal, type PrReviewCircuitLegacyRecord, type PrReviewCircuitRecordV2 } from './pr-review-resilience-circuit.js';
11
- export declare const PR_REVIEW_BASE_DIMENSION_IDS: readonly ["intent-architecture", "correctness-state", "tests-falsifiability", "security-trust", "reliability-performance", "compatibility-delivery"];
12
+ /**
13
+ * Re-exported for compatibility: the canonical six-dimension list is owned by
14
+ * the PR-review contract module (issue #2383 single-source rule; a
15
+ * source-scan guard test enforces it).
16
+ */
17
+ export { PR_REVIEW_BASE_DIMENSION_IDS };
12
18
  export declare const PR_REVIEW_REQUIRED_MICRO_LANE_IDS: ("auth-identity-secrets" | "untrusted-input-boundaries" | "subprocess-platform" | "concurrency-state" | "dependencies-build-release" | "api-schema-migrations" | "test-infrastructure" | "ui-accessibility-i18n" | "privacy-observability" | "generated-provenance" | "unclassified-risk")[];
13
19
  export type PrReviewBaseDimensionId = (typeof PR_REVIEW_BASE_DIMENSION_IDS)[number];
14
20
  export type PrWorkflowMode = 'PR_REVIEW' | 'PR_FEEDBACK';
@@ -362,6 +368,14 @@ type PrReviewArtifactRecord = {
362
368
  * omitted severity as a mismatch rather than skipping the check (issue #2279).
363
369
  */
364
370
  severity?: FindingsSeverity;
371
+ /**
372
+ * Typed risk metadata (issue #2383). Optional in the TYPE for the same
373
+ * legacy-read reason as `severity`; the WRITE boundary requires both on
374
+ * every CONFIRMED record, and this validator compares CONFIRMED records
375
+ * against the authoritative reviewer verdict's typed values.
376
+ */
377
+ risk_impact?: PrReviewRiskImpact;
378
+ risk_tags?: PrReviewRiskTag[];
365
379
  };
366
380
  interface PrFeedbackScopeDeclarationRecord {
367
381
  taskId: string;
@@ -486,6 +500,13 @@ export interface PrWorkflowGateState {
486
500
  prReviewPartialBaseCoverage?: PrReviewPartialBaseCoverageRecord;
487
501
  prReviewCoverageDisclosurePath?: string;
488
502
  prReviewCoverageDisclosureDigest?: string;
503
+ /**
504
+ * Explicit per-dimension cancellations (issue #2383), written only by the
505
+ * audited armed-recovery operation. A cancelled dimension is terminal for
506
+ * settlement purposes and never counts as covered. Bounded to the six
507
+ * canonical dimensions by key.
508
+ */
509
+ prReviewDimensionCancellations?: Partial<Record<PrReviewBaseDimensionId, PrReviewDimensionCancellationRecord>>;
489
510
  prReviewHandoffPath?: string;
490
511
  prReviewHandoffRequired?: boolean;
491
512
  checkoutRecovery?: PrWorkflowCheckoutRecoveryRecord;
@@ -522,6 +543,13 @@ export interface PrWorkflowGateState {
522
543
  * older binaries, via the root `.passthrough()`) loads unchanged.
523
544
  */
524
545
  prFeedbackPublication?: PrFeedbackPublicationState;
546
+ /**
547
+ * Issue #2383: audited armed-recovery marker. Present only after an armed
548
+ * workflow was explicitly recovered — lanes settled, one bounded audit
549
+ * event appended, staged publication authorization invalidated — leaving a
550
+ * recoverable terminal state that preserves validated work.
551
+ */
552
+ prFeedbackArmedRecovery?: PrFeedbackArmedRecoveryRecord;
525
553
  /**
526
554
  * Issue #2131 criterion C2: count of controlled base-sync/rebind transitions.
527
555
  * Each rebind moves the immutable intake head to a new verified remote PR
@@ -532,7 +560,44 @@ export interface PrWorkflowGateState {
532
560
  prFeedbackRebindCount?: number;
533
561
  prFeedbackScopes?: PrFeedbackScopeDeclarationRecord[];
534
562
  }
535
- export interface PrReviewPartialBaseCoverageRecord {
563
+ /**
564
+ * Normalized terminal state of one canonical base dimension (issue #2383).
565
+ * Every dimension ends in exactly one of these; completion requires every
566
+ * LAUNCHED lane to be terminal (COVERED/FAILED) or explicitly cancelled, with
567
+ * no in-flight lane and no late result creditable to the active generation.
568
+ */
569
+ export type PrReviewDimensionTerminalState = 'COVERED' | 'FAILED' | 'CANCELLED' | 'NOT_LAUNCHED';
570
+ /** Gate-derived per-dimension terminal evidence for an unresolved dimension. */
571
+ export interface PrReviewUnresolvedDimensionRecord {
572
+ dimension: PrReviewBaseDimensionId;
573
+ terminalState: 'FAILED' | 'CANCELLED' | 'NOT_LAUNCHED';
574
+ reasonKind: 'lane_failure' | 'cancelled' | 'not_launched';
575
+ failureClass?: BackgroundDelegationWorkflowLaneFailureClass;
576
+ terminalEventId?: string;
577
+ /** Contributing lane/batch identity, when available. */
578
+ batchId?: string;
579
+ laneId?: string;
580
+ /**
581
+ * Bounded safe detail derived from the failure-class vocabulary — never
582
+ * lane output, prompts, or secrets.
583
+ */
584
+ safeDetail?: string;
585
+ }
586
+ /** v2 terminal-settlement disclosure (issue #2383). The ONLY shape new writers emit. */
587
+ export interface PrReviewPartialBaseCoverageRecordV2 {
588
+ schemaVersion: 2;
589
+ runId: string;
590
+ prHeadSha: string;
591
+ revisionDigest: string;
592
+ unresolvedDimensions: PrReviewUnresolvedDimensionRecord[];
593
+ admittedAt: string;
594
+ }
595
+ /**
596
+ * Legacy v1 disclosure (pre-#2383): singular `missingDimension` with a typed
597
+ * terminal failure. Read-only — normalized to the v2 in-memory view at the
598
+ * single read boundary; never rewritten on disk.
599
+ */
600
+ export interface PrReviewPartialBaseCoverageRecordV1 {
536
601
  runId: string;
537
602
  prHeadSha: string;
538
603
  revisionDigest: string;
@@ -541,6 +606,32 @@ export interface PrReviewPartialBaseCoverageRecord {
541
606
  terminalEventId: string;
542
607
  admittedAt: string;
543
608
  }
609
+ export type PrReviewPartialBaseCoverageRecord = PrReviewPartialBaseCoverageRecordV2 | PrReviewPartialBaseCoverageRecordV1;
610
+ /** Terminal report kind of an N-of-6 settlement (issue #2383). */
611
+ export type PrReviewTerminalCoverageKind = 'COMPLETE' | 'PARTIAL' | 'NO_COVERAGE';
612
+ /** Controller-declared terminal verdict for a PR_REVIEW completion (issue #2383). */
613
+ export declare const PR_REVIEW_REPORT_VERDICTS: readonly ["APPROVE", "REQUEST_CHANGES", "INCOMPLETE"];
614
+ export type PrReviewReportVerdict = (typeof PR_REVIEW_REPORT_VERDICTS)[number];
615
+ /**
616
+ * Verdicts a terminal report may carry by coverage kind (issue #2383):
617
+ * PARTIAL may only request changes or declare itself incomplete; NO_COVERAGE
618
+ * is a forced INCOMPLETE operational report. Neither may ever APPROVE or
619
+ * claim a full review.
620
+ */
621
+ export declare function allowedPrReviewReportVerdicts(kind: PrReviewTerminalCoverageKind): readonly PrReviewReportVerdict[];
622
+ export interface PrReviewTerminalCoverageSettlement {
623
+ kind: PrReviewTerminalCoverageKind;
624
+ coveredDimensions: PrReviewBaseDimensionId[];
625
+ unresolvedDimensions: PrReviewUnresolvedDimensionRecord[];
626
+ /** False while any dimension still has a live (in-flight) lane. */
627
+ allLaunchedTerminal: boolean;
628
+ }
629
+ /** Per-dimension explicit cancellation, written by armed recovery (issue #2383). */
630
+ export interface PrReviewDimensionCancellationRecord {
631
+ reason: string;
632
+ cancelledAt: string;
633
+ source: 'armed_recovery';
634
+ }
544
635
  /**
545
636
  * Bound on the PR_FEEDBACK inventory-amendment audit ledger (issue #2242 R3).
546
637
  *
@@ -552,6 +643,12 @@ export interface PrReviewPartialBaseCoverageRecord {
552
643
  * instead.
553
644
  */
554
645
  export declare const MAX_PR_FEEDBACK_INVENTORY_AMENDMENTS = 128;
646
+ /**
647
+ * Normalize any disclosure record to the v2 in-memory view. A legacy v1
648
+ * record maps to exactly one FAILED entry; the durable file is never
649
+ * rewritten (its digest stays bound to the original bytes).
650
+ */
651
+ export declare function normalizePrReviewPartialBaseCoverageRecord(record: PrReviewPartialBaseCoverageRecord): PrReviewPartialBaseCoverageRecordV2;
555
652
  /**
556
653
  * One appended PR_FEEDBACK inventory entry (issue #2242 R3). `batch` groups the
557
654
  * entries appended by a single `declarePrFeedbackInventory` call so an auditor
@@ -834,6 +931,55 @@ export declare function abortPrWorkflow(directory: string, sessionID: string, op
834
931
  stateSalvageDisclosure?: string;
835
932
  casEscapeDisclosure?: string;
836
933
  }>;
934
+ /** Marker record left by an audited armed recovery (issue #2383). */
935
+ export interface PrFeedbackArmedRecoveryRecord {
936
+ recoveredAt: string;
937
+ prHeadSha: string;
938
+ /** Revision digest of the invalidated staged publication authorization. */
939
+ revisionDigest: string;
940
+ /** Gate state revision (CAS generation) at recovery time. */
941
+ generation: number;
942
+ reason: string;
943
+ }
944
+ /**
945
+ * Audited armed recovery (issue #2383): the explicit, identity-correlated
946
+ * escape for a publication-armed workflow whose exact publication cannot
947
+ * proceed.
948
+ *
949
+ * Requires the exact active session (state is session-keyed; a foreign session
950
+ * finds no armed state), workflow identity, base/head SHA, the staged
951
+ * authorization's revision digest, and the CURRENT gate-state generation.
952
+ * Every mismatch fails closed. There is deliberately NO `force` parameter —
953
+ * force never bypasses identity or revision checks. Exact approved publication
954
+ * remains available and preferred: this operation never runs when publication
955
+ * can still proceed by the normal path.
956
+ *
957
+ * Order of effects, all under the session-state mutation lock with CAS:
958
+ * 1. settle/cancel remaining lanes FIRST (fresh open lanes refuse recovery);
959
+ * 2. append exactly ONE bounded audit event (`pr_workflow_armed_recovery`);
960
+ * 3. invalidate the staged publication authorization;
961
+ * 4. transition to a recoverable terminal state — the state is PRESERVED
962
+ * (not cleared) with a `prFeedbackArmedRecovery` marker, so validated
963
+ * work survives and the controller can re-arm after repair or abort
964
+ * cleanly.
965
+ */
966
+ export declare function recoverArmedPrWorkflow(directory: string, sessionID: string, request: {
967
+ expectedMode?: PrWorkflowMode;
968
+ prHeadSha: string;
969
+ /** Exact merge-base SHA; REQUIRED when the active state carries one. */
970
+ baseSha?: string;
971
+ revisionDigest: string;
972
+ generation: number;
973
+ workflowInstanceId?: string;
974
+ reason: string;
975
+ }): Promise<{
976
+ mode: PrWorkflowMode;
977
+ prHeadSha: string;
978
+ openLanes: number;
979
+ settledLanes: number;
980
+ cancelledDimensions: PrReviewBaseDimensionId[];
981
+ recoveredAt: string;
982
+ }>;
837
983
  /** Bind an active PR workflow to one immutable PR head. */
838
984
  export declare function bindPrWorkflowHead(directory: string, sessionID: string, prHeadSha: string): Promise<PrWorkflowGateState>;
839
985
  /**
@@ -903,7 +1049,7 @@ interface EnforcePrReviewBaseDimensionsOptions {
903
1049
  export declare function enforcePrReviewBaseDimensions(directory: string, sessionID: string, lanes: readonly PrWorkflowLaneSpec[], options: EnforcePrReviewBaseDimensionsOptions): Promise<PrWorkflowGateState>;
904
1050
  export declare function rollbackPrReviewBaseAdmissionIfUnlaunched(directory: string, sessionID: string, batchId: string, contractRetry?: boolean): Promise<boolean>;
905
1051
  declare function minimumConsolidatedLaneCover(sets: ReadonlyArray<readonly string[]>): number;
906
- export declare function admitPrReviewPartialBaseCoverage(directory: string, sessionID: string, runId: string, missingDimension: PrReviewBaseDimensionId): Promise<PrWorkflowGateState>;
1052
+ export declare function admitPrReviewPartialBaseCoverage(directory: string, sessionID: string, runId: string, unresolvedDimensions: readonly PrReviewBaseDimensionId[]): Promise<PrWorkflowGateState>;
907
1053
  /**
908
1054
  * Undo a newly admitted partial-base disclosure when the findings checkpoint
909
1055
  * cannot be completed. The compare-and-clear checks keep a stale writer from
@@ -915,8 +1061,23 @@ export declare function rollbackPrReviewPartialBaseCoverageAdmission(directory:
915
1061
  relativePath: string;
916
1062
  digest: string;
917
1063
  }): Promise<boolean>;
918
- /** Validate durable exact-six or explicitly admitted N-1 PR review evidence. */
919
- export declare function assertPrReviewBaseCoverageSettled(directory: string, sessionID: string, gateContext?: PrReviewGateContext): Promise<PrWorkflowGateState>;
1064
+ /**
1065
+ * Validate durable terminal N-of-6 coverage evidence (issue #2383).
1066
+ *
1067
+ * Returns the settlement: COMPLETE when all six dimensions are covered, or
1068
+ * PARTIAL / NO_COVERAGE when an admitted, still-accurate disclosure exactly
1069
+ * matches the currently derived terminal settlement. Throws while any
1070
+ * unresolved dimension still has a live lane, or when the disclosure has been
1071
+ * invalidated by later evidence (e.g. a late success landing on the same
1072
+ * revision) — the disclosure is immutable, so such a run must re-settle or
1073
+ * restart rather than silently re-crediting.
1074
+ */
1075
+ export declare function assertPrReviewBaseCoverageSettled(directory: string, sessionID: string, gateContext?: PrReviewGateContext): Promise<{
1076
+ state: PrWorkflowGateState;
1077
+ settlement: PrReviewTerminalCoverageSettlement & {
1078
+ liveDimensions: PrReviewBaseDimensionId[];
1079
+ };
1080
+ }>;
920
1081
  /** Persist a council/reviewer/critic validation batch before launch. */
921
1082
  export declare function recordPrReviewValidationBatch(directory: string, sessionID: string, phase: PrReviewValidationPhase, lanes: readonly PrWorkflowLaneSpec[], options: {
922
1083
  batchId: string;
@@ -1173,7 +1334,42 @@ export declare function validatePrFeedbackScopeBinding(directory: string, bindin
1173
1334
  }): Promise<boolean>;
1174
1335
  export declare function enforcePrWorkflowToolBefore(directory: string, sessionID: string, toolName: string, args: Record<string, unknown> | undefined, generatedAgentNames?: readonly string[], callID?: string): Promise<void>;
1175
1336
  /** Validate the terminal PR workflow contract before removing its durable gate. */
1176
- export declare function completePrWorkflow(directory: string, sessionID: string, expectedMode: PrWorkflowMode, prHeadSha: string): Promise<PrWorkflowCompletionStatus>;
1337
+ /**
1338
+ * Read-only terminal-coverage projection for the completion report surface
1339
+ * (issue #2383). Pure derivation over the CURRENT state; returns null when no
1340
+ * active PR_REVIEW gate exists. The completion tool reads this BEFORE the
1341
+ * terminal clear so the response carries the truthful settlement summary.
1342
+ */
1343
+ export declare function readPrReviewTerminalCoverageForReport(directory: string, sessionID: string): Promise<{
1344
+ kind: PrReviewTerminalCoverageKind;
1345
+ coveredDimensions: PrReviewBaseDimensionId[];
1346
+ unresolvedDimensions: Array<{
1347
+ dimension: PrReviewBaseDimensionId;
1348
+ terminal_state: PrReviewUnresolvedDimensionRecord['terminalState'];
1349
+ reason_kind: PrReviewUnresolvedDimensionRecord['reasonKind'];
1350
+ failure_class?: BackgroundDelegationWorkflowLaneFailureClass;
1351
+ }>;
1352
+ liveDimensions: PrReviewBaseDimensionId[];
1353
+ allowedVerdicts: readonly PrReviewReportVerdict[];
1354
+ } | null>;
1355
+ /**
1356
+ * Read-only identity binding for reviewer re-entry authorization (issue
1357
+ * #2383). Returns the exact active-session PR_REVIEW identity a one-use
1358
+ * authorization must be issued against and re-verified under at consume time:
1359
+ * bound head SHA, current worktree revision digest, gate generation (CAS
1360
+ * revision), workflow instance id, and the active run id. Null when no active
1361
+ * head-bound PR_REVIEW gate exists for the session.
1362
+ */
1363
+ export declare function readPrReviewReentryBindingContext(directory: string, sessionID: string): Promise<{
1364
+ prHeadSha: string;
1365
+ revisionDigest: string;
1366
+ generation: number;
1367
+ workflowInstanceId?: string;
1368
+ runId?: string;
1369
+ } | null>;
1370
+ export declare function completePrWorkflow(directory: string, sessionID: string, expectedMode: PrWorkflowMode, prHeadSha: string, options?: {
1371
+ reportVerdict?: PrReviewReportVerdict;
1372
+ }): Promise<PrWorkflowCompletionStatus>;
1177
1373
  export declare const _test_exports: {
1178
1374
  classifyPrReviewCircuitSignal: typeof classifyPrReviewCircuitSignal;
1179
1375
  minimumConsolidatedLaneCover: typeof minimumConsolidatedLaneCover;
@@ -1475,6 +1671,12 @@ interface PrReviewItemClaim {
1475
1671
  /** Reviewer classification, or critic status. */
1476
1672
  classification: string;
1477
1673
  severity: string;
1674
+ /**
1675
+ * Typed risk metadata from the reviewer row (issue #2383). Reviewer claims
1676
+ * only; absent on critic claims, which never re-assess routing risk.
1677
+ */
1678
+ riskImpact?: PrReviewRiskImpact;
1679
+ riskTags?: PrReviewRiskTag[];
1478
1680
  /**
1479
1681
  * sha256 of the full canonical `[REVIEWED]` row this claim was parsed from.
1480
1682
  * Reviewer claims only — this is what a critic batch binds to per item.
@@ -1579,7 +1781,7 @@ interface IndexedVerdictRows {
1579
1781
  declare function indexVerdictRows(text: string, marker: '[REVIEWED]' | '[CRITIC]'): IndexedVerdictRows;
1580
1782
  /**
1581
1783
  * Digest of the FULL canonical reviewer row, not the classification/severity
1582
- * pair a reviewer verdict projects to. Only 2 of the 10 required fields survive
1784
+ * pair a reviewer verdict projects to. Only 2 of the 12 required fields survive
1583
1785
  * that projection, so a tuple binding would still match a row whose evidence,
1584
1786
  * file:line and root cause all changed. Fields are joined on NUL, which
1585
1787
  * `pipeFields` can never produce, so no field boundary is forgeable.
@@ -1593,6 +1795,8 @@ declare function reviewerVerdictRowDigest(fields: readonly string[]): string;
1593
1795
  declare function parseLaneItemVerdicts(text: string, itemIds: readonly string[], phase: PrReviewComposablePhase, reviewerClaims?: ReadonlyMap<string, PrReviewItemClaim>): Map<string, {
1594
1796
  classification: string;
1595
1797
  severity: string;
1798
+ riskImpact?: PrReviewRiskImpact;
1799
+ riskTags?: PrReviewRiskTag[];
1596
1800
  rowDigest?: string;
1597
1801
  }>;
1598
1802
  /** Exact assigned-row contract used by both normal and recovered collection. */
@@ -1698,4 +1902,3 @@ export declare function ensurePrWorkflowSafeParentDirectory(directory: string, f
1698
1902
  * rename contention as canonical gate state.
1699
1903
  */
1700
1904
  export declare function writePrWorkflowAtomicJson(directory: string, filePath: string, value: unknown): Promise<void>;
1701
- export {};