opencode-swarm 7.181.0 → 7.181.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 (80) hide show
  1. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  2. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  3. package/dist/background/stage-b-gates.d.ts +4 -0
  4. package/dist/cli/{coder-settlement-pqrfkm9d.js → coder-settlement-993vdsd2.js} +4 -4
  5. package/dist/cli/{config-doctor-bjqg57jr.js → config-doctor-nr27vfv6.js} +3 -3
  6. package/dist/cli/{core-3t3dzkrc.js → core-t3tg4397.js} +2 -2
  7. package/dist/cli/{curator-drift-gay4fx5j.js → curator-drift-hz3j3fad.js} +7 -7
  8. package/dist/cli/{curator-y8qr4xgh.js → curator-gk392717.js} +27 -27
  9. package/dist/cli/{curator-llm-factory-1wx0bd8k.js → curator-llm-factory-n01we8pa.js} +27 -27
  10. package/dist/cli/{evidence-summary-service-jeewwfpg.js → evidence-summary-service-fkvj8ct1.js} +11 -11
  11. package/dist/cli/{gate-evidence-ncnfxz7t.js → gate-evidence-1n6zffzb.js} +3 -3
  12. package/dist/cli/{guardrail-explain-cg9e3rr8.js → guardrail-explain-81jvm99e.js} +28 -28
  13. package/dist/cli/{guardrail-log-tjcnpwhv.js → guardrail-log-mw9x5j8g.js} +4 -4
  14. package/dist/cli/{guardrail-reset-ey81kcdq.js → guardrail-reset-6thsn6ad.js} +27 -27
  15. package/dist/cli/{hive-promoter-ghcynvfv.js → hive-promoter-pym6se37.js} +27 -27
  16. package/dist/cli/{index-wxjvb4vq.js → index-0h39trak.js} +1 -1
  17. package/dist/cli/{index-t8hv63wy.js → index-1wpnt86a.js} +3 -3
  18. package/dist/cli/{index-ytxgr424.js → index-2sqfrvxj.js} +2 -2
  19. package/dist/cli/{index-w872yykk.js → index-2t21pv2v.js} +5 -1
  20. package/dist/cli/{index-rqm075jf.js → index-5hxv1er2.js} +2 -2
  21. package/dist/cli/{index-t5gqdkqx.js → index-5q3xsqwm.js} +2 -2
  22. package/dist/cli/{index-gm67qky7.js → index-5v8zws0s.js} +3 -3
  23. package/dist/cli/{index-n7syegpa.js → index-5zy5k5w0.js} +16 -7
  24. package/dist/cli/{index-mkpczxy7.js → index-6x36hhd3.js} +27 -27
  25. package/dist/cli/{index-jysjhvpv.js → index-7nr9p5bd.js} +5 -5
  26. package/dist/cli/{index-886rpw6w.js → index-cr61qv27.js} +1 -1
  27. package/dist/cli/{index-6aj0ej18.js → index-dpxg347z.js} +3 -3
  28. package/dist/cli/{index-xq9gsfsc.js → index-ehvkz2zv.js} +3 -3
  29. package/dist/cli/{index-m31a2q35.js → index-ernt0wrg.js} +1234 -999
  30. package/dist/cli/{index-gez80bfr.js → index-et28q7cp.js} +2 -2
  31. package/dist/cli/{index-nhxykfyy.js → index-et7tg13p.js} +1 -1
  32. package/dist/cli/{index-pb3vrqsf.js → index-fmhd3zc8.js} +2 -2
  33. package/dist/cli/{index-1rcwsfwz.js → index-gmqf6bjj.js} +29 -29
  34. package/dist/cli/{index-pc3cw1xm.js → index-hbe56wtn.js} +3 -3
  35. package/dist/cli/{index-06f6h0fv.js → index-kzmd4gs7.js} +1 -1
  36. package/dist/cli/{index-m7havzy4.js → index-m779twtf.js} +1 -1
  37. package/dist/cli/{index-0vvpe98m.js → index-n5a9dq5s.js} +1 -1
  38. package/dist/cli/{index-ge1w25n8.js → index-pqtmzee6.js} +4 -4
  39. package/dist/cli/{index-r1cnmq4j.js → index-qw9aqays.js} +4 -4
  40. package/dist/cli/{index-y30y1rkg.js → index-t93cp2tz.js} +2 -2
  41. package/dist/cli/{index-dn0wqvv2.js → index-txx2mrsk.js} +7 -7
  42. package/dist/cli/{index-91dhg3wr.js → index-ved1325w.js} +2 -2
  43. package/dist/cli/{index-yet4r7kp.js → index-vmwmwahh.js} +3 -3
  44. package/dist/cli/{index-bv4b8tpa.js → index-vvgpgcyn.js} +10 -0
  45. package/dist/cli/{index-vmthakz0.js → index-w1ydvzef.js} +1 -1
  46. package/dist/cli/{index-s5ghg4kg.js → index-wph45kyb.js} +1 -1
  47. package/dist/cli/{index-jzg3wrx6.js → index-xz4q5vcg.js} +4 -4
  48. package/dist/cli/index.js +28 -28
  49. package/dist/cli/{knowledge-escalator-jrkx2b6j.js → knowledge-escalator-jmqbmfbf.js} +7 -7
  50. package/dist/cli/{knowledge-events-bha1zpbk.js → knowledge-events-5ksqpf4g.js} +5 -5
  51. package/dist/cli/{knowledge-store-q438tkyd.js → knowledge-store-q3yy56sc.js} +1 -1
  52. package/dist/cli/{knowledge-validator-3nx18fst.js → knowledge-validator-r5kaz53f.js} +2 -2
  53. package/dist/cli/{mcp-98693syb.js → mcp-h82hxnxr.js} +1 -1
  54. package/dist/cli/{model-preflight-61xgqwcs.js → model-preflight-5b81adsj.js} +1 -1
  55. package/dist/cli/{pending-delegations-nkpvtkz4.js → pending-delegations-e4h6vjeb.js} +5 -5
  56. package/dist/cli/{pr-subscriptions-qrvhr6jw.js → pr-subscriptions-j7hw3k6x.js} +5 -5
  57. package/dist/cli/{pr-workflow-gate-k44gdrqd.js → pr-workflow-gate-js8dcry2.js} +27 -27
  58. package/dist/cli/{scan-cursor-qjdn8kv6.js → scan-cursor-yhf58mq2.js} +2 -2
  59. package/dist/cli/{schema-pyax2tq7.js → schema-0k4st1qt.js} +2 -2
  60. package/dist/cli/{scope-persistence-dyc17kze.js → scope-persistence-bpptmh1e.js} +9 -9
  61. package/dist/cli/{server-bmzj5vt2.js → server-axnran6h.js} +27 -27
  62. package/dist/cli/{skill-generator-mp29bht6.js → skill-generator-n2w032d1.js} +8 -8
  63. package/dist/cli/{snapshot-coordination-init-azkzphpy.js → snapshot-coordination-init-kyf50x12.js} +27 -27
  64. package/dist/cli/{speckit-checkoff-1cqfakw2.js → speckit-checkoff-m4184e1x.js} +4 -4
  65. package/dist/cli/{worktree-collision-ownership-58sab2m6.js → worktree-collision-ownership-1g2414pf.js} +5 -5
  66. package/dist/cli/{worktree-isolation-9egt1ccv.js → worktree-isolation-x07f7cfp.js} +27 -27
  67. package/dist/db/qa-gate-profile.d.ts +6 -3
  68. package/dist/db/qa-gate-session-override.d.ts +72 -0
  69. package/dist/gate-evidence.d.ts +21 -0
  70. package/dist/index.js +308 -301
  71. package/dist/session/restart-reconciliation.d.ts +74 -0
  72. package/dist/state.d.ts +6 -3
  73. package/dist/tools/get-qa-gate-profile.d.ts +13 -6
  74. package/dist/tools/index.d.ts +1 -0
  75. package/dist/tools/manifest.d.ts +1 -0
  76. package/dist/tools/recover-rework-task.d.ts +5 -0
  77. package/dist/tools/tool-metadata.d.ts +4 -0
  78. package/dist/workflow/rework-recovery.d.ts +38 -0
  79. package/dist/workflow/stage-a-repair.d.ts +42 -0
  80. package/package.json +1 -1
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Service layer for the `qa_gate_session_override` table in the per-project
3
+ * database (issue #2668).
4
+ *
5
+ * A session's ratchet-tighter QA gate overrides (`/swarm qa-gates override`)
6
+ * are durable runtime policy: they must survive a host restart, unlike the
7
+ * ephemeral execution authority (leases, child handles, in-flight timers) that
8
+ * expires at the rehydrate boundary. The in-memory
9
+ * `AgentSessionState.qaGateSessionOverrides` remains the live cache the
10
+ * enforcement sites read; this table is the restart authority, restored by
11
+ * `rehydrateState` and kept in lockstep (created by the durable-first write in
12
+ * the `/swarm qa-gates override` command, deleted at session end/stale
13
+ * eviction).
14
+ *
15
+ * Semantics mirror the spec-level profile ratchet: only `true` wins. A session
16
+ * with no `true` gates has NO row — an empty merge deletes it.
17
+ */
18
+ import { type QaGates } from './qa-gate-profile.js';
19
+ /**
20
+ * Test-only dependency-injection seam — see `gitignore-warning.ts:_internals`
21
+ * for the rationale (`mock.module` from `bun:test` leaks across files in
22
+ * Bun's shared test-runner process). Mutating this local object is
23
+ * file-scoped and trivially restorable via `afterEach`.
24
+ */
25
+ export declare const _internals: {
26
+ getOverrideForSession: typeof getOverrideForSession;
27
+ setOverrideForSession: typeof setOverrideForSession;
28
+ clearOverrideForSession: typeof clearOverrideForSession;
29
+ clearAllSessionOverrides: typeof clearAllSessionOverrides;
30
+ };
31
+ /**
32
+ * Read the durable ratchet-tighter overrides for a session.
33
+ *
34
+ * Read-only: if `.swarm/swarm.db` does not exist yet, returns `{}`
35
+ * without creating the DB file. A malformed row fails closed to `{}`
36
+ * (with a debug-gated warn naming the session) — corruption must not
37
+ * break rehydration or silently widen the effective gates.
38
+ */
39
+ export declare function getOverrideForSession(directory: string, sessionId: string): Partial<QaGates>;
40
+ /**
41
+ * Merge ratchet-tighter gates into a session's durable override row.
42
+ *
43
+ * Only `true` values win (mirrors `getEffectiveGates` semantics); a `false`
44
+ * input never disables. If the merged map has no `true` gates the row is
45
+ * DELETED (empty-overrides invariant, #2668) — an empty override is the
46
+ * absence of policy, not a policy.
47
+ */
48
+ export declare function setOverrideForSession(directory: string, sessionId: string, gates: Partial<QaGates>): Partial<QaGates>;
49
+ /**
50
+ * Delete a session's durable override row. Idempotent: clearing an absent
51
+ * row is a no-op. Returns true when a row was removed.
52
+ */
53
+ export declare function clearOverrideForSession(directory: string, sessionId: string): boolean;
54
+ /**
55
+ * Delete every durable override row in the project. Used by
56
+ * `/swarm reset-session`, which clears all in-memory sessions for the
57
+ * project — their durable policy rows go with them (bounded: one row per
58
+ * session). Returns the number of rows removed.
59
+ */
60
+ export declare function clearAllSessionOverrides(directory: string): number;
61
+ /**
62
+ * Delete override rows whose session is no longer live in this project
63
+ * (#2668 orphan-row reaper). `sweepStaleSessions` can evict a stale session
64
+ * in-memory WITHOUT being able to clear its durable row — the hot-path
65
+ * `ensureAgentSession` sweep runs with no `directory`, so the project DB is
66
+ * unreachable there. This reaper runs at the rehydrate boundary (which knows
67
+ * the directory) and removes every row whose session id is not in
68
+ * `keepSessionIds` — the restored/live sessions of the hydrating project.
69
+ * Bounded: one indexed scan over a session-keyed table. Returns the number
70
+ * of orphaned rows removed.
71
+ */
72
+ export declare function sweepOrphanOverrides(directory: string, keepSessionIds: ReadonlySet<string>): number;
@@ -53,6 +53,19 @@ export interface TaskWorkflowMetadata {
53
53
  * the same answer those files would have given anyway.
54
54
  */
55
55
  forcedCompletion?: boolean;
56
+ /**
57
+ * True when this task's current generation entered `pre_check_passed` via the
58
+ * architect-supervised `recover_rework_task` escape hatch (issue #2755) rather
59
+ * than the mechanical pre_check_batch recorder.
60
+ *
61
+ * Same rationale as `forcedCompletion`: the reducer consumes the event-scoped
62
+ * `supervisedRecovery` flag transiently, so without a persisted marker the
63
+ * evidence file becomes byte-identical to a mechanically-earned Stage A pass
64
+ * as soon as the next transition overwrites `lastTransitionId`. Preserved
65
+ * across subsequent transitions in the same generation, cleared by
66
+ * `repair_idle` (which opens a new generation for genuinely new work).
67
+ */
68
+ supervisedRecovery?: boolean;
56
69
  }
57
70
  export interface TaskWorkflowSnapshot extends TaskWorkflowMetadata {
58
71
  authoritative: boolean;
@@ -108,6 +121,14 @@ export type TaskWorkflowTransitionEvent = {
108
121
  transitionId?: string;
109
122
  } | {
110
123
  type: 'stage_a_passed';
124
+ /**
125
+ * Architect-supervised recovery only (issue #2755): the recover_rework_task
126
+ * tool sets this to admit stage_a_passed from rework_required when the
127
+ * Stage B verdict did not require a code change. Mechanical emitters
128
+ * (the guardrails recorder, stage-a-repair) never set it, so they still
129
+ * fail closed with TASK_WORKFLOW_CODER_MUTATION_REQUIRED from that state.
130
+ */
131
+ supervisedRecovery?: boolean;
111
132
  expectedGeneration: number;
112
133
  transitionId?: string;
113
134
  } | {