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
@@ -1,4 +1,4 @@
1
- import { atomicWriteFsynced, type ReceiptLedgerPaths, type ReceiptStoreErrorCode } from './knowledge-receipt-ledger-storage.js';
1
+ import { appendFsynced, atomicWriteFsynced, type ReceiptLedgerPaths, type ReceiptStoreErrorCode } from './knowledge-receipt-ledger-storage.js';
2
2
  import { type KnowledgeReceiptTransitionObservation } from './knowledge-receipt-observability.js';
3
3
  /**
4
4
  * Canonical terminal-outcome vocabulary for the authoritative receipt ledger
@@ -27,7 +27,7 @@ export declare const RECEIPT_TERMINAL_OUTCOMES: ReadonlySet<ReceiptOutcome>;
27
27
  * preserved as `'unknown'` and is never coerced to delegate, ignored, or any
28
28
  * other class. New producers must stamp one of the closed values below.
29
29
  */
30
- export type ReceiptSourceCode = 'delegate' | 'reviewer' | 'architect' | 'architect_marker' | 'test_engineer' | 'phase_override' | 'application_gate_staleness_clear' | 'application_gate_denial_limit_clear' | 'manual' | 'migration' | 'unknown';
30
+ export type ReceiptSourceCode = 'delegate' | 'reviewer' | 'architect' | 'architect_marker' | 'test_engineer' | 'phase_override' | 'application_gate_staleness_release' | 'application_gate_denial_limit_release' | 'manual' | 'migration' | 'unknown';
31
31
  /** Closed set form of {@link ReceiptSourceCode}. */
32
32
  export declare const CANONICAL_RECEIPT_SOURCES: ReadonlySet<string>;
33
33
  /**
@@ -65,6 +65,13 @@ export interface ReceiptApplicationMarker {
65
65
  event_id: string;
66
66
  committed_at: string;
67
67
  }
68
+ export interface ReceiptGateRelease {
69
+ source: string;
70
+ reason?: string;
71
+ event_id: string;
72
+ committed_at: string;
73
+ membership_event_id: string;
74
+ }
68
75
  export interface ReceiptMembership {
69
76
  trace_id: string;
70
77
  entry_id: string;
@@ -84,11 +91,24 @@ export interface ReceiptMembership {
84
91
  /** Append-only audited terminal transitions; `terminal` is the current gate state. */
85
92
  terminal_history?: ReceiptTerminal[];
86
93
  application_marker?: ReceiptApplicationMarker;
94
+ gate_release?: ReceiptGateRelease;
87
95
  cohort_id?: string;
88
96
  source_link_id?: string;
89
97
  exposure_kind: ReceiptExposureKind;
90
98
  origin: 'v2' | 'legacy';
91
99
  }
100
+ export interface ReceiptRepairUncertainty {
101
+ phase: string;
102
+ session_id: string;
103
+ task_id?: string;
104
+ reason: string;
105
+ repair_id: string;
106
+ installed_at: string;
107
+ raw_journal_sha256: string;
108
+ raw_journal_bytes: number;
109
+ salvage_through_seq: number;
110
+ salvage_through_hash: string;
111
+ }
92
112
  export type ReceiptExposureKind = 'architect_directive' | 'delegate_directive' | 'manual_recall' | 'legacy_unknown';
93
113
  interface EmptyTrace {
94
114
  trace_id: string;
@@ -122,7 +142,7 @@ interface ReceiptAuditSummary {
122
142
  entry_ids?: string[];
123
143
  reason_codes?: string[];
124
144
  }
125
- export type ReceiptTransitionKind = 'membership_committed' | 'empty_retrieval_committed' | 'terminal_committed' | 'terminal_attempt_rejected' | 'terminal_attempt_idempotent' | 'authorized_transition_committed' | 'application_marker_committed' | 'phase_close_intent' | 'phase_closed' | 'legacy_imported' | 'legacy_unverifiable' | 'cutover_completed' | 'checkpoint';
145
+ export type ReceiptTransitionKind = 'membership_committed' | 'empty_retrieval_committed' | 'terminal_committed' | 'terminal_attempt_rejected' | 'terminal_attempt_idempotent' | 'authorized_transition_committed' | 'application_marker_committed' | 'gate_release_committed' | 'phase_close_intent' | 'phase_closed' | 'repair_uncertainty_installed' | 'repair_uncertainty_cleared' | 'legacy_imported' | 'legacy_unverifiable' | 'cutover_completed' | 'checkpoint';
126
146
  interface LedgerState {
127
147
  memberships: Map<string, ReceiptMembership>;
128
148
  traceIds: Set<string>;
@@ -132,6 +152,7 @@ interface LedgerState {
132
152
  legacyTraceRegistry: Set<string>;
133
153
  legacyUnverifiableTraceIds: Set<string>;
134
154
  phaseLifecycle: Map<string, PhaseLifecycle>;
155
+ repairUncertainties: Map<string, ReceiptRepairUncertainty>;
135
156
  auditTail: ReceiptAuditSummary[];
136
157
  lastSeq: number;
137
158
  lastHash: string;
@@ -149,6 +170,25 @@ export type ReceiptLedgerResult<T> = ({
149
170
  ok: true;
150
171
  } & T) | ReceiptUnavailable;
151
172
  declare function writeSnapshot(paths: ReceiptLedgerPaths, state: LedgerState): Promise<void>;
173
+ export interface RepairKnowledgeReceiptLedgerInput {
174
+ phase: string;
175
+ session_id: string;
176
+ task_id?: string;
177
+ reason: string;
178
+ grace_days?: number;
179
+ }
180
+ export interface ReceiptRepairReevaluationProof {
181
+ repair_id: string;
182
+ /** Exact producer assertion that this retrieval covered the full repaired scope. */
183
+ scope_complete: boolean;
184
+ }
185
+ export declare function repairKnowledgeReceiptLedger(directory: string, input: RepairKnowledgeReceiptLedgerInput): Promise<ReceiptLedgerResult<{
186
+ status: 'validated_projection' | 'repaired_authority' | 'pending_re_evaluation';
187
+ pending_re_evaluation: boolean;
188
+ repair_id?: string;
189
+ salvage_through_seq: number;
190
+ salvage_through_hash: string;
191
+ }>>;
152
192
  export interface CommitDisplayedMembershipInput {
153
193
  trace_id: string;
154
194
  session_id: string;
@@ -166,6 +206,8 @@ export interface CommitDisplayedMembershipInput {
166
206
  source_link_id?: string;
167
207
  /** Producer provenance used by application gates; omitted callers fail closed. */
168
208
  exposure_kind?: ReceiptExposureKind;
209
+ /** Explicit repair-bound proof; ordinary retrievals intentionally omit this. */
210
+ repair_re_evaluation?: ReceiptRepairReevaluationProof;
169
211
  }
170
212
  export declare function commitDisplayedMembership(directory: string, input: CommitDisplayedMembershipInput): Promise<ReceiptLedgerResult<{
171
213
  event_id: string;
@@ -261,6 +303,31 @@ declare function commitApplicationMarkerBatch(directory: string, input: Applicat
261
303
  reason: string;
262
304
  }>;
263
305
  }>>;
306
+ export interface GateReleaseBatchInput {
307
+ trace_id: string;
308
+ session_id: string;
309
+ grace_days?: number;
310
+ items: Array<{
311
+ entry_id: string;
312
+ source?: string;
313
+ reason?: string;
314
+ }>;
315
+ }
316
+ export declare function commitGateReleaseBatch(directory: string, input: GateReleaseBatchInput): Promise<ReceiptLedgerResult<{
317
+ committed: Array<{
318
+ entry_id: string;
319
+ event_id: string;
320
+ membership_event_id: string;
321
+ }>;
322
+ idempotent: Array<{
323
+ entry_id: string;
324
+ event_id: string;
325
+ }>;
326
+ rejected: Array<{
327
+ entry_id: string;
328
+ reason: string;
329
+ }>;
330
+ }>>;
264
331
  export interface ApplicationOutcomeBatchInput {
265
332
  trace_id: string;
266
333
  session_id: string;
@@ -334,10 +401,12 @@ export declare const _internals: {
334
401
  nowMs: () => number;
335
402
  writeSnapshot: typeof writeSnapshot;
336
403
  atomicWriteFsynced: typeof atomicWriteFsynced;
404
+ appendFsynced: typeof appendFsynced;
337
405
  /** Test-only migration fixture for pre-atomic marker-only state. */
338
406
  commitApplicationMarkerBatch: typeof commitApplicationMarkerBatch;
339
407
  maxJournalRecords: number;
340
408
  maxArchiveRecords: number;
341
409
  maxArchiveBytes: number;
410
+ maxRepairQuarantineRecords: number;
342
411
  };
343
412
  export {};
@@ -21,7 +21,7 @@ export declare const RECEIPT_SEMANTICS_VERSION = 2;
21
21
  * `no_relevant` tombstone that closes an empty retrieval (not a terminal).
22
22
  */
23
23
  export type ReceiptObservationOutcome = ReceiptOutcome | 'no_relevant';
24
- export type KnowledgeReceiptObservedTransition = 'membership_committed' | 'empty_retrieval_committed' | 'terminal_committed' | 'terminal_attempt_rejected' | 'terminal_attempt_idempotent' | 'authorized_transition_committed' | 'application_marker_committed' | 'phase_close_intent' | 'phase_closed' | 'legacy_imported' | 'legacy_unverifiable' | 'cutover_completed' | 'checkpoint';
24
+ export type KnowledgeReceiptObservedTransition = 'membership_committed' | 'empty_retrieval_committed' | 'terminal_committed' | 'terminal_attempt_rejected' | 'terminal_attempt_idempotent' | 'authorized_transition_committed' | 'application_marker_committed' | 'gate_release_committed' | 'phase_close_intent' | 'phase_closed' | 'repair_uncertainty_installed' | 'repair_uncertainty_cleared' | 'legacy_imported' | 'legacy_unverifiable' | 'cutover_completed' | 'checkpoint';
25
25
  export type KnowledgeReceiptObservationReasonCode = 'committed' | 'idempotent' | 'trace_not_found' | 'id_not_in_trace' | 'wrong_session' | 'wrong_phase' | 'wrong_task' | 'duplicate_conflicting_terminal' | 'event_id_conflict' | 'invalid_outcome' | 'empty_receipt' | 'lock_timeout' | 'store_unavailable' | 'store_corrupt' | 'legacy_unverifiable' | 'unauthorized_transition';
26
26
  export interface KnowledgeReceiptTransitionObservation {
27
27
  transition: KnowledgeReceiptObservedTransition;
@@ -17,6 +17,7 @@
17
17
  * surfaces as a block, never a silent pass.
18
18
  */
19
19
  export type DirectiveBlockReason = 'no_verdict' | 'unremediated_violation';
20
+ export type DirectiveGateFailureCode = 'RECEIPT_MISSING' | 'RECEIPT_CORRUPT' | 'RECEIPT_LOCK_TIMEOUT' | 'RECEIPT_WRONG_ROOT' | 'RECEIPT_PERMISSION' | 'RECEIPT_TRANSIENT' | 'RECEIPT_STORE_UNAVAILABLE';
20
21
  export interface DirectiveGateResult {
21
22
  blocked: boolean;
22
23
  unresolved: Array<{
@@ -27,6 +28,14 @@ export interface DirectiveGateResult {
27
28
  overridden: string[];
28
29
  /** True when the gate could not read its inputs (fail-closed → blocked). */
29
30
  failedClosed: boolean;
31
+ failure?: {
32
+ code: DirectiveGateFailureCode;
33
+ action_id: 'knowledge_receipt' | 'phase_complete' | 'repair_knowledge_receipt_ledger';
34
+ };
35
+ recovery?: {
36
+ kind: 'tool' | 'retry';
37
+ action: 'knowledge_receipt' | 'phase_complete' | 'repair_knowledge_receipt_ledger';
38
+ };
30
39
  }
31
40
  /**
32
41
  * Evaluate all critical directives shown during the phase. Fail-closed.