opencode-swarm 7.181.1 → 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 (73) 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-ee8bmg83.js → coder-settlement-993vdsd2.js} +4 -4
  5. package/dist/cli/{config-doctor-mnmxzg86.js → config-doctor-nr27vfv6.js} +3 -3
  6. package/dist/cli/{core-m9yymv84.js → core-t3tg4397.js} +2 -2
  7. package/dist/cli/{curator-drift-q42fr0c9.js → curator-drift-hz3j3fad.js} +7 -7
  8. package/dist/cli/{curator-7nmwpcxy.js → curator-gk392717.js} +27 -27
  9. package/dist/cli/{curator-llm-factory-s1b2p162.js → curator-llm-factory-n01we8pa.js} +27 -27
  10. package/dist/cli/{evidence-summary-service-m2b0mxmr.js → evidence-summary-service-fkvj8ct1.js} +11 -11
  11. package/dist/cli/{gate-evidence-4y2x85g4.js → gate-evidence-1n6zffzb.js} +3 -3
  12. package/dist/cli/{guardrail-explain-nvmf3y7j.js → guardrail-explain-81jvm99e.js} +28 -28
  13. package/dist/cli/{guardrail-log-202rfw7b.js → guardrail-log-mw9x5j8g.js} +4 -4
  14. package/dist/cli/{guardrail-reset-7nt7z18b.js → guardrail-reset-6thsn6ad.js} +27 -27
  15. package/dist/cli/{hive-promoter-segsykns.js → hive-promoter-pym6se37.js} +27 -27
  16. package/dist/cli/{index-ztph1v9m.js → index-0h39trak.js} +1 -1
  17. package/dist/cli/{index-9j5jjqks.js → index-1wpnt86a.js} +3 -3
  18. package/dist/cli/{index-a7z6jygf.js → index-2sqfrvxj.js} +2 -2
  19. package/dist/cli/{index-y4zjbrqs.js → index-2t21pv2v.js} +1 -1
  20. package/dist/cli/{index-g9ax7jyf.js → index-5hxv1er2.js} +2 -2
  21. package/dist/cli/{index-jqjdejqe.js → index-5q3xsqwm.js} +2 -2
  22. package/dist/cli/{index-g5wjasjn.js → index-5v8zws0s.js} +3 -3
  23. package/dist/cli/{index-r6p6x0pb.js → index-5zy5k5w0.js} +1 -1
  24. package/dist/cli/{index-na3br902.js → index-6x36hhd3.js} +27 -27
  25. package/dist/cli/{index-hxe22tx3.js → index-7nr9p5bd.js} +5 -5
  26. package/dist/cli/{index-cyyvc1cd.js → index-cr61qv27.js} +1 -1
  27. package/dist/cli/{index-pee6ykkg.js → index-dpxg347z.js} +3 -3
  28. package/dist/cli/{index-kjstkfgh.js → index-ehvkz2zv.js} +3 -3
  29. package/dist/cli/{index-3qhx9dx0.js → index-ernt0wrg.js} +1228 -998
  30. package/dist/cli/{index-b2zbak7v.js → index-et28q7cp.js} +2 -2
  31. package/dist/cli/{index-nhxykfyy.js → index-et7tg13p.js} +1 -1
  32. package/dist/cli/{index-4h54k8h3.js → index-fmhd3zc8.js} +2 -2
  33. package/dist/cli/{index-rxs0rrv1.js → index-gmqf6bjj.js} +29 -29
  34. package/dist/cli/{index-rw0wy2y7.js → index-hbe56wtn.js} +3 -3
  35. package/dist/cli/{index-908yea8v.js → index-kzmd4gs7.js} +1 -1
  36. package/dist/cli/{index-tczqm089.js → index-m779twtf.js} +1 -1
  37. package/dist/cli/{index-basp4sxt.js → index-n5a9dq5s.js} +1 -1
  38. package/dist/cli/{index-edb3sgxg.js → index-pqtmzee6.js} +4 -4
  39. package/dist/cli/{index-yhx94xpr.js → index-qw9aqays.js} +4 -4
  40. package/dist/cli/{index-y30y1rkg.js → index-t93cp2tz.js} +2 -2
  41. package/dist/cli/{index-q1prchye.js → index-txx2mrsk.js} +7 -7
  42. package/dist/cli/{index-91dhg3wr.js → index-ved1325w.js} +2 -2
  43. package/dist/cli/{index-vs83acgx.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-gqe4sm73.js → index-wph45kyb.js} +1 -1
  47. package/dist/cli/{index-gydvqmtg.js → index-xz4q5vcg.js} +4 -4
  48. package/dist/cli/index.js +28 -28
  49. package/dist/cli/{knowledge-escalator-r9chkas8.js → knowledge-escalator-jmqbmfbf.js} +7 -7
  50. package/dist/cli/{knowledge-events-5j2n6age.js → knowledge-events-5ksqpf4g.js} +5 -5
  51. package/dist/cli/{knowledge-store-mybx9bmx.js → knowledge-store-q3yy56sc.js} +1 -1
  52. package/dist/cli/{knowledge-validator-v1sj9tv4.js → knowledge-validator-r5kaz53f.js} +2 -2
  53. package/dist/cli/{mcp-7yx5230p.js → mcp-h82hxnxr.js} +1 -1
  54. package/dist/cli/{model-preflight-ckvv1arg.js → model-preflight-5b81adsj.js} +1 -1
  55. package/dist/cli/{pending-delegations-amjfmc7t.js → pending-delegations-e4h6vjeb.js} +5 -5
  56. package/dist/cli/{pr-subscriptions-rctqs0gk.js → pr-subscriptions-j7hw3k6x.js} +5 -5
  57. package/dist/cli/{pr-workflow-gate-9he8ys4e.js → pr-workflow-gate-js8dcry2.js} +27 -27
  58. package/dist/cli/{scan-cursor-pxqkphrh.js → scan-cursor-yhf58mq2.js} +2 -2
  59. package/dist/cli/{schema-n8pk3f80.js → schema-0k4st1qt.js} +2 -2
  60. package/dist/cli/{scope-persistence-p992x2yd.js → scope-persistence-bpptmh1e.js} +9 -9
  61. package/dist/cli/{server-ywrd2q6z.js → server-axnran6h.js} +27 -27
  62. package/dist/cli/{skill-generator-cdppktqx.js → skill-generator-n2w032d1.js} +8 -8
  63. package/dist/cli/{snapshot-coordination-init-z42ev5g9.js → snapshot-coordination-init-kyf50x12.js} +27 -27
  64. package/dist/cli/{speckit-checkoff-6ynv46bn.js → speckit-checkoff-m4184e1x.js} +4 -4
  65. package/dist/cli/{worktree-collision-ownership-65971p3m.js → worktree-collision-ownership-1g2414pf.js} +5 -5
  66. package/dist/cli/{worktree-isolation-xf7dfc46.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/index.js +306 -299
  70. package/dist/session/restart-reconciliation.d.ts +74 -0
  71. package/dist/state.d.ts +6 -3
  72. package/dist/tools/get-qa-gate-profile.d.ts +13 -6
  73. package/package.json +1 -1
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Owner-named restart reconciliation (issue #2668).
3
+ *
4
+ * At the rehydrate boundary, ephemeral execution authority expires by design
5
+ * (`delegationActive` and friends are reset in
6
+ * `TRANSIENT_SESSION_FIELDS`) — but the expiry must not be silent. When a
7
+ * serialized session arrives with in-flight authority, the boundary records a
8
+ * bounded, owner-named reconciliation outcome so an operator (and the
9
+ * resumed session) can tell "interrupted mid-execution, outcome UNKNOWN"
10
+ * from "was idle": absence must never read as success.
11
+ *
12
+ * Two surfaces, written together inside the rehydrate populate loop (after
13
+ * the transient reset, before the caller proceeds to the projection write):
14
+ *
15
+ * 1. The durable artifact `.swarm/session/restart-reconciliation.json` — a
16
+ * bounded list (cap {@link MAX_RESTART_RECONCILIATION_ENTRIES}, FIFO
17
+ * overflow) deduped by `(sessionId, taskId)` so a repeated restart
18
+ * refreshes the entry instead of duplicating it.
19
+ * 2. A one-shot advisory string pushed into the rehydrated session's
20
+ * `pendingAdvisoryMessages` (per-restart; the next rehydrate re-derives
21
+ * it).
22
+ *
23
+ * The record deliberately COMPOSES the shipped recovery surfaces instead of
24
+ * duplicating them: guidance points operators at `/swarm recover` (stale
25
+ * coder-settlement WALs) and `/swarm status` (uncertain provider effects),
26
+ * and the #2665 `stale`/`ambiguous`/`live_wedge` classification for
27
+ * coder settlements remains owned by those stores.
28
+ */
29
+ /** Relative to the project root's `.swarm/` directory. */
30
+ export declare const RESTART_RECONCILIATION_FILE = "session/restart-reconciliation.json";
31
+ export declare const MAX_RESTART_RECONCILIATION_ENTRIES = 50;
32
+ export type RestartReconciliationClassification = 'interrupted';
33
+ export interface RestartReconciliationEntry {
34
+ sessionId: string;
35
+ agentName: string;
36
+ /** The task the interrupted execution was driving ('(unknown)' when the snapshot carried none). */
37
+ taskId: string;
38
+ classification: RestartReconciliationClassification;
39
+ observedAt: string;
40
+ guidance: string;
41
+ }
42
+ export interface RestartReconciliationFile {
43
+ version: 1;
44
+ entries: RestartReconciliationEntry[];
45
+ }
46
+ export declare const RESTART_RECONCILIATION_GUIDANCE = "outcome UNKNOWN \u2014 do not assume success; inspect /swarm status for uncertain provider effects; /swarm recover settles stale coder-settlement WALs; a human must resolve external effects (pushed commits, published PRs) manually";
47
+ /**
48
+ * Read the reconciliation artifact fail-closed: absent, corrupt, partial, or
49
+ * oversized files read as an empty list — the boundary then re-records what
50
+ * it observes and the artifact heals on the next append.
51
+ */
52
+ export declare function readRestartReconciliation(directory: string): RestartReconciliationFile;
53
+ /**
54
+ * Append (or refresh, keyed by `(sessionId, taskId)`) a reconciliation entry
55
+ * and persist the bounded list atomically. Fail-open: a write error is
56
+ * logged and swallowed — the reconciliation record must never fail the
57
+ * rehydrate that produces it.
58
+ */
59
+ export declare function recordInterruptedExecution(directory: string, entry: {
60
+ sessionId: string;
61
+ agentName: string;
62
+ taskId: string;
63
+ observedAt?: string;
64
+ guidance?: string;
65
+ }): Promise<RestartReconciliationEntry>;
66
+ /**
67
+ * The one-shot session advisory naming the owner of the interrupted effect.
68
+ * Pushed into `pendingAdvisoryMessages` AFTER the transient-field reset so
69
+ * it survives the rehydrate that produced it.
70
+ */
71
+ export declare function buildInterruptedAdvisoryDedupeKey(entry: Pick<RestartReconciliationEntry, 'sessionId' | 'taskId'>): string;
72
+ export declare function buildInterruptedAdvisoryMessage(entry: Pick<RestartReconciliationEntry, 'sessionId' | 'agentName' | 'taskId'> & {
73
+ guidance?: string;
74
+ }): string;
package/dist/state.d.ts CHANGED
@@ -417,9 +417,12 @@ export interface AgentSessionState {
417
417
  autoProceedNudgeDone?: boolean;
418
418
  /** Session-level QA gate overrides layered on top of the spec-level profile.
419
419
  * Overrides can only enable gates (true); false values are ignored by
420
- * getEffectiveGates. Cleared on session reset. Optional for backwards
421
- * compatibility with pre-existing session state fixtures; consumers
422
- * should read via `session.qaGateSessionOverrides ?? {}`. */
420
+ * getEffectiveGates. Durable runtime policy (#2668): the authoritative copy
421
+ * lives in the project DB (qa_gate_session_override), written durable-first
422
+ * by `/swarm qa-gates override`, restored by rehydrateState, and deleted in
423
+ * lockstep with the session (end/stale-eviction/reset). Optional for
424
+ * backwards compatibility with pre-existing session state fixtures;
425
+ * consumers should read via `session.qaGateSessionOverrides ?? {}`. */
423
426
  qaGateSessionOverrides?: Partial<QaGates>;
424
427
  /** Session-scoped Full Auto flag for autonomous multi-agent oversight */
425
428
  fullAutoMode: boolean;
@@ -3,12 +3,15 @@
3
3
  *
4
4
  * Read-only: uses plan.json identity when available or an explicit exact
5
5
  * swarm/title pair before plan creation, then looks up the profile in the
6
- * per-project DB. Returns the spec-level profile gates, lock state, and profile
7
- * hash. Callers layering session overrides should combine with
8
- * `getEffectiveGates` themselves this tool intentionally returns the
9
- * persisted/locked spec-level view.
6
+ * per-project DB. Returns the spec-level profile gates, lock state, and
7
+ * profile hash, plus when the caller carries a session context (#2668)
8
+ * the session's ratchet-tighter overrides and the EFFECTIVE gates (profile
9
+ * merged with those overrides) so an agent can inspect the effective
10
+ * runtime policy after a restart. The live session's override cache is
11
+ * authoritative when present; the durable `qa_gate_session_override` row is
12
+ * the restart authority consulted when the live session is absent.
10
13
  */
11
- import type { tool } from '@opencode-ai/plugin';
14
+ import type { ToolContext, tool } from '@opencode-ai/plugin';
12
15
  import { type QaGatePlanIdentityArgs } from './qa-gate-plan-identity.js';
13
16
  export type GetQaGateProfileArgs = QaGatePlanIdentityArgs;
14
17
  interface GetQaGateProfileResult {
@@ -25,7 +28,11 @@ interface GetQaGateProfileResult {
25
28
  created_at: string;
26
29
  profile_hash: string;
27
30
  };
31
+ /** Calling session's ratchet-tighter overrides (empty when no session context or none set). */
32
+ session_overrides?: Record<string, boolean>;
33
+ /** Effective gates: profile merged with the calling session's overrides (#2668). */
34
+ effective_gates?: Record<string, boolean>;
28
35
  }
29
- export declare function executeGetQaGateProfile(args: GetQaGateProfileArgs, directory: string): Promise<GetQaGateProfileResult>;
36
+ export declare function executeGetQaGateProfile(args: GetQaGateProfileArgs, directory: string, ctx?: ToolContext): Promise<GetQaGateProfileResult>;
30
37
  export declare const get_qa_gate_profile: ReturnType<typeof tool>;
31
38
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.181.1",
3
+ "version": "7.181.2",
4
4
  "description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",