opencode-swarm 7.145.1 → 7.145.2

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 (93) hide show
  1. package/.opencode/skills/phase-wrap/SKILL.md +3 -2
  2. package/README.md +5 -1
  3. package/dist/cli/{config-doctor-96jmxr7s.js → config-doctor-j1r33f4q.js} +3 -3
  4. package/dist/cli/{core-w78pc1hh.js → core-c2zrd384.js} +2 -2
  5. package/dist/cli/{curation-policy-smyc2mrm.js → curation-policy-xv0j8zyt.js} +6 -6
  6. package/dist/cli/{curator-59hzdxrv.js → curator-gk2kmrk1.js} +28 -28
  7. package/dist/cli/{curator-llm-factory-g794pv51.js → curator-llm-factory-sat3mn5n.js} +28 -28
  8. package/dist/cli/{evidence-summary-service-41m0cna6.js → evidence-summary-service-0mhx0t0v.js} +12 -12
  9. package/dist/cli/{gate-evidence-7aywx7qa.js → gate-evidence-a5adh55x.js} +7 -7
  10. package/dist/cli/{guardrail-explain-j88dhm6w.js → guardrail-explain-r50fery8.js} +29 -29
  11. package/dist/cli/{guardrail-log-xcb3ke8s.js → guardrail-log-p69eys6d.js} +4 -4
  12. package/dist/cli/{hive-promoter-nnnx5692.js → hive-promoter-ay8a7sct.js} +28 -28
  13. package/dist/cli/{index-34tawmyx.js → index-0a0asz2s.js} +1 -1
  14. package/dist/cli/{index-ymyke19q.js → index-1g87esfp.js} +2 -2
  15. package/dist/cli/{index-17e73wac.js → index-2vefr1f8.js} +1 -1
  16. package/dist/cli/{index-2qrd8mfa.js → index-4p3qfb05.js} +1 -1
  17. package/dist/cli/{index-gey2257h.js → index-5e5a1y2r.js} +1 -1
  18. package/dist/cli/{index-tw8ck794.js → index-612rr70a.js} +2 -2
  19. package/dist/cli/{index-cqfp05jb.js → index-673axbjx.js} +3 -3
  20. package/dist/cli/{index-qpke2x5h.js → index-6wf75rcm.js} +6 -6
  21. package/dist/cli/{index-tm0bezd9.js → index-7y5akvc9.js} +1 -1
  22. package/dist/cli/{index-xz4x17z0.js → index-9080b3de.js} +30 -30
  23. package/dist/cli/{index-kxzgnz2h.js → index-917z76qr.js} +14 -7
  24. package/dist/cli/{index-rtkttser.js → index-97psh79d.js} +1 -1
  25. package/dist/cli/{index-b7ntt9cw.js → index-9gt8g2qj.js} +4 -4
  26. package/dist/cli/{index-19v4tccw.js → index-b9kxxd6k.js} +2 -2
  27. package/dist/cli/{index-gf03198s.js → index-bghwrr59.js} +1 -1
  28. package/dist/cli/{index-bst6epnr.js → index-cb2qtetk.js} +445 -82
  29. package/dist/cli/{index-v3y3qg48.js → index-cpg98bh1.js} +17 -1
  30. package/dist/cli/{index-ff66fbjt.js → index-cxn95n7q.js} +177 -29
  31. package/dist/cli/{index-neh8azwc.js → index-czde45km.js} +3 -3
  32. package/dist/cli/{index-7axx11dt.js → index-gpnv14kq.js} +2 -2
  33. package/dist/cli/{index-mpf01swm.js → index-j20fzn0w.js} +2 -2
  34. package/dist/cli/{index-mrkgxfeh.js → index-jgb7mq2y.js} +4 -4
  35. package/dist/cli/{index-8ef23wex.js → index-jpppcckq.js} +4 -4
  36. package/dist/cli/{index-4evasm2b.js → index-kggqpefz.js} +5 -5
  37. package/dist/cli/{index-41t3hgaa.js → index-n55a28zr.js} +247 -29
  38. package/dist/cli/{index-sfemjcb8.js → index-ncfjxz9n.js} +5 -5
  39. package/dist/cli/{index-evpgszmp.js → index-np4ytvvv.js} +2 -2
  40. package/dist/cli/{index-fwnhh6s7.js → index-nsr5b69r.js} +2 -2
  41. package/dist/cli/{index-dppzthm9.js → index-qyvjp0bq.js} +2 -2
  42. package/dist/cli/{index-zpp507z0.js → index-rk80jhef.js} +2 -2
  43. package/dist/cli/{index-90w06fqr.js → index-vav705md.js} +4 -4
  44. package/dist/cli/{index-dzan8czb.js → index-x8pm918t.js} +1 -1
  45. package/dist/cli/index.js +28 -28
  46. package/dist/cli/{knowledge-escalator-s6acdpwj.js → knowledge-escalator-22apj3dj.js} +12 -12
  47. package/dist/cli/{knowledge-events-jprkz49t.js → knowledge-events-bx8xba9z.js} +10 -10
  48. package/dist/cli/{knowledge-link-zvtmj756.js → knowledge-link-82ew2yc4.js} +5 -5
  49. package/dist/cli/{knowledge-store-mc4awds4.js → knowledge-store-nc71kfsg.js} +6 -6
  50. package/dist/cli/{knowledge-validator-pe4ncrvj.js → knowledge-validator-g8ne80v6.js} +8 -8
  51. package/dist/cli/{model-preflight-77dwxfv5.js → model-preflight-7ea00h34.js} +1 -1
  52. package/dist/cli/{pending-delegations-epzht3d7.js → pending-delegations-kkrczqv7.js} +3 -3
  53. package/dist/cli/{pr-subscriptions-2ahy8g87.js → pr-subscriptions-2xn238xt.js} +3 -3
  54. package/dist/cli/{runner-ra9pjhp2.js → runner-pqsf809k.js} +6 -6
  55. package/dist/cli/{scan-cursor-hdzhqwzj.js → scan-cursor-6ksgv514.js} +7 -7
  56. package/dist/cli/{schema-pg85z06v.js → schema-mpcm7nje.js} +2 -2
  57. package/dist/cli/{scope-persistence-v8we8ja7.js → scope-persistence-mj1w3hqw.js} +8 -8
  58. package/dist/cli/{skill-generator-ctskfct2.js → skill-generator-gsa6qwwt.js} +14 -14
  59. package/dist/cli/{telemetry-c21dgffc.js → telemetry-t109dhv7.js} +1 -1
  60. package/dist/cli/{worktree-collision-ownership-f7se4wbf.js → worktree-collision-ownership-2jtg2my1.js} +3 -3
  61. package/dist/cli/{worktree-isolation-j4qb7mgb.js → worktree-isolation-ajzyp2gm.js} +28 -28
  62. package/dist/config/schema.d.ts +2 -2
  63. package/dist/evidence/task-gate-repair.d.ts +26 -0
  64. package/dist/evidence/task-gate-requirements.d.ts +20 -0
  65. package/dist/gate-evidence.d.ts +7 -0
  66. package/dist/hooks/knowledge-receipt-ledger-storage.d.ts +2 -0
  67. package/dist/hooks/knowledge-receipt-ledger.d.ts +72 -3
  68. package/dist/hooks/knowledge-receipt-observability.d.ts +1 -1
  69. package/dist/hooks/phase-complete-directive-gate.d.ts +9 -0
  70. package/dist/index.js +455 -449
  71. package/dist/plan/manager.d.ts +8 -0
  72. package/dist/review/diff-source.d.ts +30 -0
  73. package/dist/review/engine.d.ts +1 -0
  74. package/dist/review/evidence.d.ts +16 -2
  75. package/dist/review/phase-runner.d.ts +1 -0
  76. package/dist/tools/completion-verify.d.ts +2 -0
  77. package/dist/tools/convene-council.d.ts +1 -1
  78. package/dist/tools/index.d.ts +4 -0
  79. package/dist/tools/manifest.d.ts +4 -0
  80. package/dist/tools/phase-complete/gates/final-review-gate.d.ts +3 -3
  81. package/dist/tools/phase-complete/gates/types.d.ts +2 -2
  82. package/dist/tools/phase-complete/preflight-report.d.ts +66 -0
  83. package/dist/tools/phase-complete/snapshot-identity.d.ts +1 -0
  84. package/dist/tools/phase-complete.d.ts +66 -3
  85. package/dist/tools/record-directive-override.d.ts +14 -0
  86. package/dist/tools/repair-gate-evidence.d.ts +6 -0
  87. package/dist/tools/repair-knowledge-receipt-ledger.d.ts +27 -0
  88. package/dist/tools/run-phase-review.d.ts +37 -0
  89. package/dist/tools/submit-phase-council-verdicts.d.ts +1 -1
  90. package/dist/tools/tool-metadata.d.ts +32 -16
  91. package/dist/tools/write-final-council-evidence.d.ts +1 -1
  92. package/dist/tools/write-retro.d.ts +2 -0
  93. package/package.json +1 -1
@@ -155,6 +155,14 @@ export declare function savePlan(directory: string, plan: Plan, options?: {
155
155
  expectedSeq: number;
156
156
  expectedLedgerHash: string;
157
157
  };
158
+ /**
159
+ * Optional synchronous CAS guard for a caller whose authoritative write is
160
+ * conditioned on external evidence. It is invoked immediately before every
161
+ * ledger/projection mutation and must throw when the captured identity is
162
+ * stale. Keep it synchronous so no writer can interleave in this process
163
+ * between the final check and the atomic filesystem operation.
164
+ */
165
+ preCommitCheck?: () => void;
158
166
  }): Promise<void>;
159
167
  /**
160
168
  * Rebuild plan from ledger events.
@@ -69,6 +69,34 @@ export interface ReviewDiffStalenessMetadata {
69
69
  includesWorkingTree: boolean;
70
70
  scopeHash: string;
71
71
  }
72
+ export interface ReviewManifestIdentity {
73
+ algorithm: 'sha256' | 'git-blob';
74
+ sha256?: string;
75
+ byte_length?: number;
76
+ git_blob_oid?: string;
77
+ git_object_format?: string;
78
+ }
79
+ export interface ReviewManifestPathRecord {
80
+ kind: ReviewDiffFileScope['kind'];
81
+ old_path?: string;
82
+ new_path?: string;
83
+ old_identity?: ReviewManifestIdentity;
84
+ new_identity?: ReviewManifestIdentity;
85
+ }
86
+ export interface ReviewDiffManifest {
87
+ schema_version: 2;
88
+ hash: string;
89
+ content_hash: string;
90
+ selector: ReviewDiffSelector;
91
+ selector_key: string;
92
+ review_target_kind: 'checkout-history-index-working-tree' | 'checkout-index-working-tree' | 'exact-committed-range';
93
+ completeness: {
94
+ complete: boolean;
95
+ truncated: boolean;
96
+ skip_reason_codes: ReviewDiffSkipCode[];
97
+ };
98
+ path_records: ReviewManifestPathRecord[];
99
+ }
72
100
  interface ReviewDiffScopeFields {
73
101
  selector: ReviewDiffSelector;
74
102
  canonicalText: string;
@@ -84,6 +112,7 @@ interface ReviewDiffScopeFields {
84
112
  files: Map<string, ReviewDiffFileScope>;
85
113
  completeness: ReviewDiffCompleteness;
86
114
  staleness: ReviewDiffStalenessMetadata;
115
+ manifest: ReviewDiffManifest;
87
116
  }
88
117
  export type ReviewDiffResult = ({
89
118
  status: 'ok';
@@ -132,5 +161,6 @@ export declare const _internals: {
132
161
  readSync: typeof fs.readSync;
133
162
  closeSync: typeof fs.closeSync;
134
163
  resolveGitExecutable: typeof resolveGitExecutableAsync;
164
+ now: () => number;
135
165
  };
136
166
  export {};
@@ -34,6 +34,7 @@ export interface ReviewEngineResult {
34
34
  receiptPath?: string;
35
35
  evidencePath?: string;
36
36
  scopeHash?: string;
37
+ manifestHash?: string;
37
38
  scopeComplete?: boolean;
38
39
  scopeWarnings?: string[];
39
40
  scopeFileList?: string[];
@@ -1,6 +1,8 @@
1
1
  import { type FindingValidation, type ReviewFinding } from '../agents/agent-output-schema.js';
2
+ import type { Plan } from '../config/plan-schema.js';
3
+ import type { AutoReviewConfig } from '../config/schema.js';
2
4
  import { type ReviewFindingSeverity, type ReviewReceipt } from '../hooks/review-receipt.js';
3
- import type { ReviewDiffCompleteness, ReviewDiffSelector } from './diff-source.js';
5
+ import type { ReviewDiffCompleteness, ReviewDiffManifest, ReviewDiffSelector } from './diff-source.js';
4
6
  export interface AutoReviewEvidenceFinding extends ReviewFinding {
5
7
  finding_id: string;
6
8
  duplicate_count: number;
@@ -9,8 +11,13 @@ export interface AutoReviewEvidenceFinding extends ReviewFinding {
9
11
  effective_severity: ReviewFindingSeverity;
10
12
  validation?: FindingValidation;
11
13
  }
14
+ export interface AutoReviewScopeManifest extends ReviewDiffManifest {
15
+ plan_requirements_hash: string;
16
+ review_policy_digest: string;
17
+ hash: string;
18
+ }
12
19
  export interface AutoReviewEvidence {
13
- schema_version: 1;
20
+ schema_version: 1 | 2;
14
21
  timestamp: string;
15
22
  trigger: 'task_completion' | 'phase_completion' | 'plan_completion' | 'manual';
16
23
  session_id: string;
@@ -25,12 +32,14 @@ export interface AutoReviewEvidence {
25
32
  range_to_sha?: string;
26
33
  review_text_bytes: number;
27
34
  completeness: ReviewDiffCompleteness;
35
+ manifest?: AutoReviewScopeManifest;
28
36
  };
29
37
  policy: {
30
38
  mode: 'advisory' | 'gate';
31
39
  min_confidence: number;
32
40
  structured_findings: boolean;
33
41
  validate_findings: boolean;
42
+ digest?: string;
34
43
  };
35
44
  review: {
36
45
  status: 'completed' | 'clean' | 'error';
@@ -57,6 +66,7 @@ export interface AutoReviewEvidence {
57
66
  cost_source: 'reported' | 'estimated' | 'unavailable';
58
67
  };
59
68
  }
69
+ export declare function computeAutoReviewManifestHash(manifest: Omit<AutoReviewScopeManifest, 'hash'>): string;
60
70
  export declare function autoReviewEvidenceRelativePath(trigger: AutoReviewEvidence['trigger'], scopeHash: string, phase?: number): string;
61
71
  export interface PersistAutoReviewEvidenceOptions {
62
72
  /** Rebuild the exact reviewed scope immediately before the atomic rename. */
@@ -65,6 +75,10 @@ export interface PersistAutoReviewEvidenceOptions {
65
75
  export declare function persistAutoReviewEvidence(directory: string, evidence: AutoReviewEvidence, options?: PersistAutoReviewEvidenceOptions): Promise<string>;
66
76
  export declare function readAutoReviewEvidenceForPhase(directory: string, phase: number): AutoReviewEvidence | null;
67
77
  export declare function isAutoReviewEvidence(value: unknown): value is AutoReviewEvidence;
78
+ export declare function computePlanRequirementsHash(directory: string): Promise<string>;
79
+ export declare function computeAutoReviewPolicyDigest(config: AutoReviewConfig): string;
80
+ export declare function materializeAutoReviewManifest(directory: string, manifest: ReviewDiffManifest, config: AutoReviewConfig): Promise<AutoReviewScopeManifest>;
81
+ export declare function computeReviewPlanRequirementsHash(plan: Plan): string;
68
82
  export interface AutoReviewEvidenceExpectation {
69
83
  scopeHash: string;
70
84
  phase: number;
@@ -18,6 +18,7 @@ export interface RunPhaseAutoReviewInput {
18
18
  export interface PhaseAutoReviewResult {
19
19
  trigger?: 'phase_completion' | 'plan_completion';
20
20
  scopeHash?: string;
21
+ manifestHash?: string;
21
22
  scopeComplete?: boolean;
22
23
  blocked?: boolean;
23
24
  blockReason?: ReviewEngineResult['blockReason'];
@@ -14,6 +14,8 @@ export interface CompletionVerifyArgs {
14
14
  sessionID?: string;
15
15
  /** Explicit project root directory override */
16
16
  working_directory?: string;
17
+ /** Internal observational mode used by aggregate phase preflight. */
18
+ writeEvidence?: boolean;
17
19
  }
18
20
  /**
19
21
  * Execute the completion verification check
@@ -8,9 +8,9 @@ export declare const ArgsSchema: z.ZodObject<{
8
8
  verdicts: z.ZodArray<z.ZodObject<{
9
9
  agent: z.ZodEnum<{
10
10
  reviewer: "reviewer";
11
+ test_engineer: "test_engineer";
11
12
  critic: "critic";
12
13
  explorer: "explorer";
13
- test_engineer: "test_engineer";
14
14
  sme: "sme";
15
15
  }>;
16
16
  verdict: z.ZodEnum<{
@@ -54,11 +54,15 @@ export { pr_workflow_status } from './pr-workflow-status';
54
54
  export { type PreCheckBatchInput, type PreCheckBatchResult, pre_check_batch, runPreCheckBatch, type ToolResult, } from './pre-check-batch';
55
55
  export { executePreparePrFeedbackScope, prepare_pr_feedback_scope, } from './prepare-pr-feedback-scope';
56
56
  export { type QualityBudgetInput, type QualityBudgetResult, quality_budget, qualityBudget, } from './quality-budget';
57
+ export { executeRecordDirectiveOverride, record_directive_override, } from './record-directive-override';
58
+ export { executeRepairGateEvidence, repair_gate_evidence, } from './repair-gate-evidence';
59
+ export { executeRepairKnowledgeReceiptLedger, repair_knowledge_receipt_ledger, } from './repair-knowledge-receipt-ledger';
57
60
  export { buildWorkspaceGraph, type GraphEdge, type GraphNode, loadGraph, loadOrCreateGraph, type RepoGraph, resolveModuleSpecifier, saveGraph, updateGraphForFiles, } from './repo-graph';
58
61
  export { repo_map } from './repo-map';
59
62
  export { req_coverage } from './req-coverage';
60
63
  export { retrieve_lane_output } from './retrieve-lane-output';
61
64
  export { retrieve_summary } from './retrieve-summary';
65
+ export { createRunPhaseReviewTool, executeRunPhaseReview, run_phase_review, } from './run-phase-review';
62
66
  export { type SastScanFinding, type SastScanInput, type SastScanResult, sast_scan, sastScan, } from './sast-scan';
63
67
  export type { SavePlanArgs, SavePlanResult } from './save-plan';
64
68
  export { save_plan } from './save-plan';
@@ -74,6 +74,10 @@ export declare const TOOL_MANIFEST: {
74
74
  retrieve_lane_output: () => ToolDefinition;
75
75
  extract_code_blocks: () => ToolDefinition;
76
76
  phase_complete: () => ToolDefinition;
77
+ run_phase_review: () => ToolDefinition;
78
+ repair_gate_evidence: () => ToolDefinition;
79
+ repair_knowledge_receipt_ledger: () => ToolDefinition;
80
+ record_directive_override: () => ToolDefinition;
77
81
  save_plan: () => ToolDefinition;
78
82
  update_task_status: () => ToolDefinition;
79
83
  lint_spec: () => ToolDefinition;
@@ -3,10 +3,10 @@ import type { GateContext, GateResult } from './types.js';
3
3
  /**
4
4
  * Evidence-only final review gate.
5
5
  *
6
- * The model dispatch belongs to the phase_complete tool body. This gate performs
6
+ * Model dispatch belongs to the explicit run_phase_review recovery tool. This gate performs
7
7
  * one bounded, model-free scope collection at the terminal decision point, then
8
- * verifies that the persisted artifact and in-memory result both describe that
9
- * current scope and that the configured blocking policy is satisfied.
8
+ * verifies that the persisted artifact describes that current scope and that
9
+ * the configured blocking policy is satisfied.
10
10
  */
11
11
  export declare function runFinalReviewGate(ctx: GateContext): Promise<GateResult>;
12
12
  /**
@@ -40,13 +40,13 @@ export interface GateContext {
40
40
  loadedRetroBundle?: import('../../../config/evidence-schema').EvidenceBundle | null;
41
41
  /** Task id for the accepted retrospective bundle, if one was loaded */
42
42
  loadedRetroTaskId?: string | null;
43
- /** Exact scope produced by the model-dispatching phase_complete body. */
43
+ /** Legacy compatibility field; current final review derives persisted scope. */
44
44
  autoReviewScopeHash?: string;
45
45
  /** Completeness of the freshly collected in-memory review scope. */
46
46
  autoReviewScopeComplete?: boolean;
47
47
  /** Distinguishes ordinary phase review from the final durable plan phase. */
48
48
  autoReviewTrigger?: 'phase_completion' | 'plan_completion';
49
- /** Fresh in-memory disposition from the review run owned by phase_complete. */
49
+ /** Legacy compatibility field for callers carrying a fresh disposition. */
50
50
  autoReviewBlocked?: boolean;
51
51
  /** Machine-readable reason from the current review run, when blocked. */
52
52
  autoReviewBlockReason?: import('../../../review/engine').ReviewEngineResult['blockReason'];
@@ -0,0 +1,66 @@
1
+ import type { GateResult } from './gates/types.js';
2
+ export type PhaseGateOutcome = 'pass' | 'block' | 'error' | 'not_applicable';
3
+ export interface PhaseGateRecovery {
4
+ kind: 'tool' | 'command' | 'retry' | 'user_action';
5
+ action: string;
6
+ args?: Record<string, unknown>;
7
+ }
8
+ export interface PhaseGateEntry {
9
+ id: string;
10
+ code: string;
11
+ outcome: PhaseGateOutcome;
12
+ detail?: string;
13
+ evidenceRefs: string[];
14
+ responsibleActor: string;
15
+ recovery?: PhaseGateRecovery;
16
+ requiredRecoveryKind?: PhaseGateRecovery['kind'];
17
+ agentsDispatched: string[];
18
+ agentsMissing: string[];
19
+ warnings: string[];
20
+ recoveryGuidance?: string;
21
+ phase_council_required?: boolean;
22
+ final_council_required?: boolean;
23
+ retrospective_gate?: {
24
+ schema_valid: boolean;
25
+ gate_pass: boolean;
26
+ verdict?: 'pass' | 'fail';
27
+ };
28
+ }
29
+ export interface PhaseGateReport {
30
+ schemaVersion: 1;
31
+ phase: number;
32
+ outcome: 'pass' | 'block';
33
+ reportHash: string;
34
+ entries: PhaseGateEntry[];
35
+ }
36
+ export interface PhaseGateCheck {
37
+ id: string;
38
+ responsibleActor: string;
39
+ applicable?: boolean;
40
+ notApplicableDetail?: string;
41
+ run: () => Promise<GateResult>;
42
+ timeoutMs?: number;
43
+ }
44
+ export declare function collectPhaseGateReport(input: {
45
+ phase: number;
46
+ checks: readonly PhaseGateCheck[];
47
+ }): Promise<PhaseGateReport>;
48
+ export declare function formatPhaseGateCompatibility(report: PhaseGateReport): {
49
+ success: boolean;
50
+ phase: number;
51
+ status: 'success' | 'blocked' | 'incomplete';
52
+ reason?: string;
53
+ message?: string;
54
+ agentsDispatched: string[];
55
+ agentsMissing: string[];
56
+ warnings: string[];
57
+ gate_report: PhaseGateReport;
58
+ retrospective_gate?: {
59
+ schema_valid: boolean;
60
+ gate_pass: boolean;
61
+ verdict?: 'pass' | 'fail';
62
+ };
63
+ recovery_guidance?: string;
64
+ phase_council_required?: boolean;
65
+ final_council_required?: boolean;
66
+ };
@@ -0,0 +1 @@
1
+ export declare function computePhaseEvidenceSnapshot(directory: string): string;
@@ -3,6 +3,10 @@
3
3
  * Core implementation - gathers data, enforces policy, writes event, resets state.
4
4
  */
5
5
  import type { ToolDefinition } from '@opencode-ai/plugin/tool';
6
+ import { savePlan } from '../plan/manager';
7
+ import type { ReviewModelDispatcher } from '../review/contracts.js';
8
+ import type { ReviewAgentModelRegistry } from '../review/runtime.js';
9
+ import { runArchitectureSupervisorGate, runCompletionVerifyGate, runDriftGate, runFinalCouncilGate, runFinalReviewGate, runHallucinationGate, runMutationGate, runPhaseCouncilGate } from './phase-complete/gates/index.js';
6
10
  /** Narrow seam for receipt/plan ordering tests. */
7
11
  export declare const phaseCompleteReceiptInternals: {
8
12
  recordPhaseCloseIntent: (directory: string, phase: string, sessionId?: string, taskId?: string) => Promise<import("../hooks/knowledge-receipt-ledger.js").ReceiptLedgerResult<{
@@ -12,8 +16,67 @@ export declare const phaseCompleteReceiptInternals: {
12
16
  event_id: string;
13
17
  }>>;
14
18
  };
15
- import type { ReviewModelDispatcher } from '../review/contracts.js';
16
- import type { ReviewAgentModelRegistry } from '../review/runtime.js';
19
+ /** Narrow seam for guarded-plan commit tests. */
20
+ export declare const phaseCompleteCommitInternals: {
21
+ savePlan: (directory: string, plan: {
22
+ schema_version: "1.0.0";
23
+ title: string;
24
+ swarm: string;
25
+ phases: {
26
+ id: number;
27
+ name: string;
28
+ status: "blocked" | "complete" | "completed" | "pending" | "in_progress" | "closed";
29
+ tasks: {
30
+ id: string;
31
+ phase: number;
32
+ status: "blocked" | "completed" | "pending" | "in_progress" | "closed";
33
+ size: "small" | "medium" | "large";
34
+ description: string;
35
+ depends: string[];
36
+ files_touched: string[];
37
+ acceptance?: string | undefined;
38
+ evidence_path?: string | undefined;
39
+ blocked_reason?: string | undefined;
40
+ fr_refs?: string[] | undefined;
41
+ }[];
42
+ type?: "code" | "non-code" | undefined;
43
+ required_agents?: string[] | undefined;
44
+ }[];
45
+ current_phase?: number | undefined;
46
+ migration_status?: "migrated" | "native" | "migration_failed" | undefined;
47
+ specMtime?: string | undefined;
48
+ specHash?: string | undefined;
49
+ execution_profile?: {
50
+ parallelization_enabled: boolean;
51
+ max_concurrent_tasks: number;
52
+ council_parallel: boolean;
53
+ locked: boolean;
54
+ auto_proceed: boolean;
55
+ commit_after_each_completed_task: boolean;
56
+ planning_profile?: "balanced" | "strict" | undefined;
57
+ } | undefined;
58
+ }, options?: {
59
+ preserveCompletedStatuses?: boolean;
60
+ acknowledged_removals?: import("../plan/manager").AcknowledgedRemovals;
61
+ planLockAlreadyHeld?: boolean;
62
+ staleProjectionReconcile?: {
63
+ expectedSeq: number;
64
+ expectedLedgerHash: string;
65
+ };
66
+ preCommitCheck?: () => void;
67
+ } | undefined) => Promise<void>;
68
+ };
69
+ /** Injectable observational gates for aggregate-preflight regression tests. */
70
+ export declare const phaseCompletePreflightInternals: {
71
+ runCompletionVerifyGate: typeof runCompletionVerifyGate;
72
+ runDriftGate: typeof runDriftGate;
73
+ runHallucinationGate: typeof runHallucinationGate;
74
+ runMutationGate: typeof runMutationGate;
75
+ runPhaseCouncilGate: typeof runPhaseCouncilGate;
76
+ runArchitectureSupervisorGate: typeof runArchitectureSupervisorGate;
77
+ runFinalReviewGate: typeof runFinalReviewGate;
78
+ runFinalCouncilGate: typeof runFinalCouncilGate;
79
+ };
17
80
  /**
18
81
  * Arguments for the phase_complete tool
19
82
  */
@@ -52,7 +115,7 @@ declare function allCompletedTasksHavePassedGateEvidence(directory: string, task
52
115
  * Execute the phase_complete tool
53
116
  * Gathers data, enforces policy, writes event, resets state
54
117
  */
55
- export declare function executePhaseComplete(args: PhaseCompleteArgs, workingDirectory?: string, directory?: string, runtime?: PhaseCompleteRuntime): Promise<string>;
118
+ export declare function executePhaseComplete(args: PhaseCompleteArgs, workingDirectory?: string, directory?: string, _runtime?: PhaseCompleteRuntime): Promise<string>;
56
119
  /** @internal exported for testing only */
57
120
  export declare function _buildOutputJson(outputData: {
58
121
  phase: number;
@@ -0,0 +1,14 @@
1
+ import type { ToolContext, ToolDefinition } from '@opencode-ai/plugin/tool';
2
+ import { recordDirectiveOverrides } from '../hooks/phase-complete-directive-gate.js';
3
+ import { loadPlan } from '../plan/manager.js';
4
+ export interface RecordDirectiveOverrideArgs {
5
+ directive_ids: string[];
6
+ justification: string;
7
+ phase: number;
8
+ }
9
+ export declare const recordDirectiveOverrideInternals: {
10
+ loadPlan: typeof loadPlan;
11
+ recordDirectiveOverrides: typeof recordDirectiveOverrides;
12
+ };
13
+ export declare function executeRecordDirectiveOverride(args: RecordDirectiveOverrideArgs, directory: string, ctx?: Pick<ToolContext, 'sessionID' | 'agent'>): Promise<Record<string, unknown>>;
14
+ export declare const record_directive_override: ToolDefinition;
@@ -0,0 +1,6 @@
1
+ import type { ToolContext, ToolDefinition } from '@opencode-ai/plugin/tool';
2
+ import { type RepairGateEvidenceArgs } from '../evidence/task-gate-repair.js';
3
+ export declare function executeRepairGateEvidence(args: RepairGateEvidenceArgs & {
4
+ working_directory?: string;
5
+ }, directory: string, _ctx?: ToolContext): Promise<import("../evidence/task-gate-repair.js").RepairGateEvidenceResult>;
6
+ export declare const repair_gate_evidence: ToolDefinition;
@@ -0,0 +1,27 @@
1
+ import type { ToolContext, ToolDefinition } from '@opencode-ai/plugin/tool';
2
+ import { type RepairKnowledgeReceiptLedgerInput } from '../hooks/knowledge-receipt-ledger.js';
3
+ export declare function executeRepairKnowledgeReceiptLedger(args: RepairKnowledgeReceiptLedgerInput & {
4
+ working_directory?: string;
5
+ }, directory: string, _ctx?: ToolContext): Promise<{
6
+ success: boolean;
7
+ message: string;
8
+ errors: string[];
9
+ code?: undefined;
10
+ } | {
11
+ success: boolean;
12
+ message: string;
13
+ errors: string[];
14
+ code: import("../hooks/knowledge-receipt-ledger-storage.js").ReceiptStoreErrorCode | "legacy_unverifiable";
15
+ } | {
16
+ ok: true;
17
+ status: "validated_projection" | "repaired_authority" | "pending_re_evaluation";
18
+ pending_re_evaluation: boolean;
19
+ repair_id?: string;
20
+ salvage_through_seq: number;
21
+ salvage_through_hash: string;
22
+ success: boolean;
23
+ message: string;
24
+ errors?: undefined;
25
+ code?: undefined;
26
+ }>;
27
+ export declare const repair_knowledge_receipt_ledger: ToolDefinition;
@@ -0,0 +1,37 @@
1
+ import type { ToolDefinition } from '@opencode-ai/plugin/tool';
2
+ import { loadPluginConfigWithMeta as loadPluginConfigWithMeta_import } from '../config/index.js';
3
+ import type { ReviewModelDispatcher } from '../review/contracts.js';
4
+ import { type ReviewAgentModelRegistry } from '../review/runtime.js';
5
+ export interface RunPhaseReviewArgs {
6
+ phase: number;
7
+ sessionID: string;
8
+ is_final_plan_phase?: boolean;
9
+ }
10
+ export interface RunPhaseReviewResult {
11
+ success: boolean;
12
+ trigger?: 'phase_completion' | 'plan_completion';
13
+ status?: 'completed' | 'clean' | 'error';
14
+ blocked?: boolean;
15
+ blockReason?: string;
16
+ scopeHash?: string;
17
+ manifestHash?: string;
18
+ scopeComplete?: boolean;
19
+ evidencePath?: string;
20
+ receiptPath?: string;
21
+ message: string;
22
+ }
23
+ /**
24
+ * Test-only dependency-injection seam.
25
+ * @tool-opt-out Test-only dependency-injection seam; not a public tool.
26
+ */
27
+ export declare const _internals: {
28
+ loadPluginConfigWithMeta: typeof loadPluginConfigWithMeta_import;
29
+ };
30
+ export declare function executeRunPhaseReview(directory: string, args: RunPhaseReviewArgs, options?: {
31
+ dispatcher?: ReviewModelDispatcher;
32
+ generatedAgentNames?: readonly string[];
33
+ agentModelRegistry?: ReviewAgentModelRegistry;
34
+ activeAgentName?: string;
35
+ }): Promise<RunPhaseReviewResult>;
36
+ export declare function createRunPhaseReviewTool(dispatcher?: ReviewModelDispatcher, generatedAgentNames?: readonly string[], agentModelRegistry?: ReviewAgentModelRegistry, getActiveAgentName?: (sessionID: string) => string | undefined): ToolDefinition;
37
+ export declare const run_phase_review: ToolDefinition;
@@ -8,9 +8,9 @@ export declare const ArgsSchema: z.ZodObject<{
8
8
  verdicts: z.ZodArray<z.ZodObject<{
9
9
  agent: z.ZodEnum<{
10
10
  reviewer: "reviewer";
11
+ test_engineer: "test_engineer";
11
12
  critic: "critic";
12
13
  explorer: "explorer";
13
- test_engineer: "test_engineer";
14
14
  sme: "sme";
15
15
  }>;
16
16
  verdict: z.ZodEnum<{