opencode-swarm 7.188.3 → 7.188.5

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 (100) 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/cli/{auto-checkpoint-9scxvjvr.js → auto-checkpoint-6z6dhqak.js} +8 -8
  4. package/dist/cli/{checkpoint-rq5eqyft.js → checkpoint-99vqentz.js} +16 -16
  5. package/dist/cli/{coder-settlement-9rkvamnp.js → coder-settlement-07dkrqvy.js} +12 -12
  6. package/dist/cli/{config-doctor-ewbdfafa.js → config-doctor-0pqexbab.js} +15 -15
  7. package/dist/cli/{core-ytxbej6s.js → core-zx4az38t.js} +3 -3
  8. package/dist/cli/{curation-policy-n5kzg460.js → curation-policy-nxcx99yp.js} +6 -6
  9. package/dist/cli/{curator-drift-jbjjkkbg.js → curator-drift-0ne6gnj0.js} +8 -8
  10. package/dist/cli/curator-llm-factory-gdedzs6k.js +82 -0
  11. package/dist/cli/{curator-60ftt4mg.js → curator-s08eqma1.js} +42 -42
  12. package/dist/cli/{doctor-knowledge-receipt-phase-id-f1b7ah16.js → doctor-knowledge-receipt-phase-id-kpzaepq8.js} +8 -8
  13. package/dist/cli/{evidence-summary-service-vgtsevph.js → evidence-summary-service-xadab4ym.js} +19 -19
  14. package/dist/cli/{gate-evidence-2reyjm1v.js → gate-evidence-c3d7ewv4.js} +7 -7
  15. package/dist/cli/guardrail-explain-enbr5ne9.js +83 -0
  16. package/dist/cli/{guardrail-log-9c078ms0.js → guardrail-log-0g59n4ae.js} +7 -7
  17. package/dist/cli/{guardrail-reset-h844v5k3.js → guardrail-reset-e0m3p15n.js} +42 -42
  18. package/dist/cli/{hive-promoter-hndtg0g9.js → hive-promoter-1jb0t5g2.js} +42 -42
  19. package/dist/cli/{index-ebhxj1dk.js → index-03ng9y76.js} +11 -11
  20. package/dist/cli/{index-2y4v88xp.js → index-0cdkb7e8.js} +7 -7
  21. package/dist/cli/{index-vz6cjc6f.js → index-1kd2cbcz.js} +5 -5
  22. package/dist/cli/{index-q2nydddh.js → index-1tgkj4mf.js} +3 -3
  23. package/dist/cli/{index-685ypb7s.js → index-3b71hf2k.js} +2 -2
  24. package/dist/cli/{index-p9y1t8tk.js → index-3jn6155r.js} +3 -3
  25. package/dist/cli/{index-63pm3wa2.js → index-4ak3ewt2.js} +4 -4
  26. package/dist/cli/{index-jh7s55h1.js → index-4m7cywkf.js} +148 -101
  27. package/dist/cli/{index-bt11gbj8.js → index-4zran0jk.js} +1 -1
  28. package/dist/cli/{index-e3ddxfh4.js → index-5nwfz9bn.js} +2 -2
  29. package/dist/cli/{index-bejxkee0.js → index-7hr5m7yp.js} +1 -1
  30. package/dist/cli/{index-82q5nv5h.js → index-85npnq5t.js} +6 -6
  31. package/dist/cli/{index-tqdjsvrm.js → index-8f0j6kf2.js} +4 -4
  32. package/dist/cli/{index-jgkcsykf.js → index-98zfmfnn.js} +5 -5
  33. package/dist/cli/{index-78vg2tgj.js → index-9f7y0rym.js} +42 -42
  34. package/dist/cli/{index-322afz1z.js → index-9qbn3chx.js} +1 -1
  35. package/dist/cli/{index-9hag235h.js → index-9tvjwv01.js} +1 -1
  36. package/dist/cli/{index-s51gwkgd.js → index-ar33mkxc.js} +7 -7
  37. package/dist/cli/{index-rw8bq18z.js → index-bjh6cw86.js} +4 -4
  38. package/dist/cli/{index-h3sty9qx.js → index-br33a6v7.js} +2 -2
  39. package/dist/cli/{index-pah0zema.js → index-cjekszvy.js} +2 -2
  40. package/dist/cli/{index-q1ymkdnc.js → index-d95b3yce.js} +7 -7
  41. package/dist/cli/{index-pya6v67j.js → index-dd258pfn.js} +3 -3
  42. package/dist/cli/{index-yd36m8y5.js → index-dmdg2zay.js} +2 -2
  43. package/dist/cli/{index-z7k42wpb.js → index-dmnvgc03.js} +5 -5
  44. package/dist/cli/{index-1xedjkyy.js → index-f1wqew85.js} +2 -2
  45. package/dist/cli/{index-a8gvszr2.js → index-f6exny9m.js} +2 -2
  46. package/dist/cli/{index-1wfychd6.js → index-fbwerevq.js} +2 -2
  47. package/dist/cli/{index-qx0npayj.js → index-h83221w1.js} +3 -3
  48. package/dist/cli/{index-ats43ttc.js → index-hq7mfqe5.js} +1 -1
  49. package/dist/cli/{index-9kaerjtj.js → index-j9swvmt3.js} +2 -2
  50. package/dist/cli/{index-rysj8e3x.js → index-jc2ndtdt.js} +1 -1
  51. package/dist/cli/{index-0vhaejxa.js → index-jevq7a7b.js} +1 -1
  52. package/dist/cli/{index-mf19yqss.js → index-kaqdzhj3.js} +2 -2
  53. package/dist/cli/{index-5jm1nkv7.js → index-n7vy4gb3.js} +6 -6
  54. package/dist/cli/{index-cc1vzq4m.js → index-ntda6tje.js} +1 -1
  55. package/dist/cli/{index-r6e8syr3.js → index-p2tqzwh6.js} +2 -2
  56. package/dist/cli/{index-91ajdtc6.js → index-p746x44z.js} +4 -4
  57. package/dist/cli/{index-nbmvxaa2.js → index-sg2agtt5.js} +1 -1
  58. package/dist/cli/{index-7n7775g7.js → index-txr48a64.js} +44 -44
  59. package/dist/cli/{index-gjnt7sfc.js → index-vktygb4k.js} +5 -5
  60. package/dist/cli/{index-crkx7tta.js → index-vn8phy76.js} +1 -1
  61. package/dist/cli/{index-vzd1a06e.js → index-w5p9crxx.js} +3 -3
  62. package/dist/cli/{index-r06m1jps.js → index-wx43mc8h.js} +1 -1
  63. package/dist/cli/{index-m1qy7f1e.js → index-x1eh2636.js} +1 -1
  64. package/dist/cli/{index-rszpn3zf.js → index-ykaaejka.js} +7 -7
  65. package/dist/cli/{index-9dp2zhvj.js → index-z11watrb.js} +2 -2
  66. package/dist/cli/index.js +43 -43
  67. package/dist/cli/{knowledge-escalator-n0k4zjgy.js → knowledge-escalator-c65r55bv.js} +14 -14
  68. package/dist/cli/{knowledge-events-ywqkth1n.js → knowledge-events-exc94dr2.js} +12 -12
  69. package/dist/cli/{knowledge-link-rv41fqwp.js → knowledge-link-kgt3zx0c.js} +5 -5
  70. package/dist/cli/{knowledge-store-0svng5s4.js → knowledge-store-b2qm637m.js} +6 -6
  71. package/dist/cli/{knowledge-validator-s2ddkgxg.js → knowledge-validator-44pn1xrn.js} +8 -8
  72. package/dist/cli/{mcp-2xhqha8p.js → mcp-6qjt8ey7.js} +1 -1
  73. package/dist/cli/{model-preflight-zz20c518.js → model-preflight-dh9dadg8.js} +42 -42
  74. package/dist/cli/{pending-delegations-72k8zeye.js → pending-delegations-vcqw78d8.js} +12 -12
  75. package/dist/cli/{pr-subscriptions-9eftakcv.js → pr-subscriptions-2vp2sxjb.js} +12 -12
  76. package/dist/cli/{pr-workflow-gate-90j60vp7.js → pr-workflow-gate-cy24tc3c.js} +42 -42
  77. package/dist/cli/{runner-zhnj544n.js → runner-zeqpd2c2.js} +6 -6
  78. package/dist/cli/{scan-cursor-swrnhys8.js → scan-cursor-3hyz0qnh.js} +7 -7
  79. package/dist/cli/{schema-g5qw8zv2.js → schema-4s2nnpqt.js} +1 -1
  80. package/dist/cli/{scope-persistence-nd32ryps.js → scope-persistence-1bvaeene.js} +15 -15
  81. package/dist/cli/{server-nez5478r.js → server-zb4j57w6.js} +51 -43
  82. package/dist/cli/{skill-generator-tr5femt4.js → skill-generator-fqh79jr7.js} +16 -16
  83. package/dist/cli/{snapshot-coordination-init-c82a9gd1.js → snapshot-coordination-init-v50k6v2v.js} +42 -42
  84. package/dist/cli/{speckit-checkoff-fr3jnnah.js → speckit-checkoff-mcxxpmy4.js} +4 -4
  85. package/dist/cli/{telemetry-wb54p3hn.js → telemetry-eq1cwq2x.js} +1 -1
  86. package/dist/cli/{workspace-snapshot-y60ay5eq.js → workspace-snapshot-30kdf018.js} +3 -3
  87. package/dist/cli/{worktree-collision-ownership-q0kn3g0k.js → worktree-collision-ownership-fk6spbrf.js} +13 -13
  88. package/dist/cli/{worktree-isolation-zz26e66q.js → worktree-isolation-ht89tqrc.js} +42 -42
  89. package/dist/context-map/capsule-builder.d.ts +14 -1
  90. package/dist/context-map/persistence.d.ts +9 -0
  91. package/dist/context-map/post-agent-update.d.ts +74 -0
  92. package/dist/full-auto/evidence-names.d.ts +24 -0
  93. package/dist/full-auto/oversight.d.ts +0 -1
  94. package/dist/full-auto/state.d.ts +35 -0
  95. package/dist/index.js +31 -31
  96. package/dist/tools/syntax-check.d.ts +14 -0
  97. package/dist/types/context-capsule.d.ts +12 -0
  98. package/package.json +1 -1
  99. package/dist/cli/curator-llm-factory-6r5vkvts.js +0 -82
  100. package/dist/cli/guardrail-explain-b1ck5ey3.js +0 -83
@@ -19,6 +19,48 @@ import * as fs from 'node:fs';
19
19
  import type { ContextMap, DecisionEntry } from '../types/context-map';
20
20
  import { extractFileSummary } from './file-summary';
21
21
  import { appendDecision, appendTaskHistory, createEmptyContextMap, loadContextMap, saveContextMap } from './persistence';
22
+ /**
23
+ * A decision extracted from `.swarm/context.md`'s `## Decisions` section,
24
+ * ready to be persisted as a `DecisionEntry` by `updateContextMapAfterAgent`.
25
+ */
26
+ export interface PostAgentDecision {
27
+ /** The decision text (bullet text before the first `: ` separator) */
28
+ decision: string;
29
+ /** Rationale text (after the first `: ` separator; empty when absent) */
30
+ rationale: string;
31
+ /** Phase number when the bullet carried or inherited one, else absent */
32
+ phase?: number;
33
+ }
34
+ /**
35
+ * Options for {@link extractContextDecisionsFromContextMd}.
36
+ */
37
+ export interface ExtractContextDecisionsOptions {
38
+ /**
39
+ * Session agent role used to gate the sync. `.swarm/context.md` is
40
+ * architect-maintained (subagents are forbidden from writing it), so when
41
+ * a role is supplied and is not an architect role — bare `'architect'`
42
+ * (`ORCHESTRATOR_NAME`) or a multi-swarm prefixed form ending in
43
+ * `'_architect'` — the sync returns no decisions without reading the file.
44
+ * Omit to extract regardless of role.
45
+ */
46
+ agent_role?: string;
47
+ }
48
+ /**
49
+ * Maximum number of context.md decisions one sync records. The architect
50
+ * appends newest decisions at the bottom of the file, so the window keeps the
51
+ * MOST RECENT entries; older entries beyond the window are never
52
+ * retroactively recorded.
53
+ */
54
+ export declare const MAX_CONTEXT_MD_DECISIONS = 50;
55
+ /**
56
+ * Character bound for the context.md content handed to the shared extractor
57
+ * (PR #3023 feedback FB-005). The shared extractor's own cap slices a PREFIX
58
+ * (oldest-first), which would invert the most-recent window for pathological
59
+ * file sizes and silently drop a `## Decisions` heading lying beyond the
60
+ * slice; this module slices from the TAIL instead so the most recent content
61
+ * is what gets scanned.
62
+ */
63
+ export declare const MAX_CONTEXT_MD_CONTENT_CHARS = 1000000;
22
64
  /**
23
65
  * Parameters for updating the Context Map after an agent completes a task.
24
66
  * Captures all relevant context from the agent's work session so that
@@ -45,6 +87,7 @@ export interface PostAgentUpdateParams {
45
87
  decisions?: Array<{
46
88
  decision: string;
47
89
  rationale: string;
90
+ phase?: number;
48
91
  }>;
49
92
  /** Project root directory */
50
93
  directory: string;
@@ -64,6 +107,37 @@ export interface PostAgentUpdateParams {
64
107
  * rather than crashing allocation.
65
108
  */
66
109
  export declare function allocateDecisionId(decisions: readonly DecisionEntry[]): string;
110
+ /**
111
+ * Extract decisions from `.swarm/context.md`'s `## Decisions` section.
112
+ *
113
+ * The context file is the repo's decisions-recording convention (architect
114
+ * prompt `src/agents/architect.ts`; shared `## Decisions` grammar parsed by
115
+ * `extractContextDecisions`, the #2493 consolidation). Each bullet
116
+ * `- <decision>: <rationale>` becomes a {@link PostAgentDecision}: the text
117
+ * before the FIRST `: ` is the decision, the remainder the rationale (a
118
+ * rationale may itself contain colons; a bullet without a separator yields an
119
+ * empty rationale). Bullets whose decision text is empty after the
120
+ * extractor's marker stripping are dropped.
121
+ *
122
+ * Bounded: keeps the most recent {@link MAX_CONTEXT_MD_DECISIONS} entries —
123
+ * entries beyond that window are never retroactively recorded.
124
+ *
125
+ * When `options.agent_role` is supplied and is not an architect role, returns
126
+ * `[]` without touching the filesystem (the file is architect-maintained;
127
+ * subagent-only sessions do not adopt its decisions).
128
+ *
129
+ * Never throws — a missing or unreadable file yields `[]`.
130
+ */
131
+ export declare function extractContextDecisionsFromContextMd(directory: string, options?: ExtractContextDecisionsOptions): PostAgentDecision[];
132
+ /**
133
+ * Upper bound for the PERSISTED decisions log in `.swarm/context-map.json`
134
+ * (PR #3023 feedback FB-002). The log is append-only within this window:
135
+ * after each update the most recent entries are kept and older ones are
136
+ * trimmed at save time, so reworded decision variants cannot grow the file
137
+ * without bound. The capsule read surface is additionally capped by
138
+ * `MAX_CAPSULE_DECISIONS` in the capsule builder.
139
+ */
140
+ export declare const MAX_PERSISTED_DECISIONS = 200;
67
141
  /**
68
142
  * Test-only dependency-injection seam. Production code calls through this
69
143
  * object so tests can replace the underlying implementations without
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Single source of truth for the Full-Auto oversight evidence filename
3
+ * grammar (issue #3011).
4
+ *
5
+ * `.swarm/evidence/{phase}/full-auto-{seq}.json` is BOTH written by
6
+ * `writeFullAutoOversightEvidence` (`src/full-auto/oversight.ts`) and scanned
7
+ * by `nextFullAutoOversightSequence` (`src/full-auto/state.ts`) when the
8
+ * durable counter catches up to persisted evidence. Defining the grammar once
9
+ * here — instead of an inline template in the writer and a separate regex in
10
+ * the scanner — makes writer/scanner drift impossible.
11
+ *
12
+ * Leaf module: imports nothing at all (pure string/regex builders), so both
13
+ * `oversight.ts` and `state.ts` can share it without an import cycle.
14
+ */
15
+ /**
16
+ * Filename for one oversight evidence record: `full-auto-{seq}.json`.
17
+ */
18
+ export declare function fullAutoOversightEvidenceFileName(sequence: number): string;
19
+ /**
20
+ * Matches (and captures the sequence digits of) an oversight evidence
21
+ * filename. Anchored to the full basename so `full-auto-1.json.bak`-style
22
+ * neighbors and unrelated files are ignored.
23
+ */
24
+ export declare const FULL_AUTO_OVERSIGHT_EVIDENCE_FILE_RE: RegExp;
@@ -96,7 +96,6 @@ export declare function dispatchFullAutoOversight(input: DispatchFullAutoOversig
96
96
  * Test-only DI seam.
97
97
  */
98
98
  export declare const _internals: {
99
- resetSequence: () => void;
100
99
  now: () => number;
101
100
  sleep: typeof sleep;
102
101
  setTimer: typeof setTimeout;
@@ -183,8 +183,42 @@ export declare function resetFullAutoDenials(directory: string, sessionID: strin
183
183
  * Atomically increment and return the durable oversight-evidence sequence
184
184
  * counter. Used by `writeFullAutoOversightEvidence` to produce stable,
185
185
  * non-colliding evidence filenames across process restarts. (C4 fix.)
186
+ *
187
+ * #3011: before allocating, the counter is caught up to the highest sequence
188
+ * observable in persisted evidence filenames
189
+ * (`.swarm/evidence/<numeric-phase>/full-auto-N.json`), so a directory
190
+ * written by an older process that stamped sequences without advancing the
191
+ * durable counter (the pre-#3011 reactive mirror) can never have an evidence
192
+ * file reissued over it. The scan runs inside the same `withStateLock` as the
193
+ * read-modify-write, so concurrent allocations stay serialized.
194
+ *
195
+ * #3024 feedback hardening:
196
+ * - The walk descends ONLY into numeric phase directories — the evidence
197
+ * tree also holds one directory per task id (plus gate-audit/ and sbom/)
198
+ * that the oversight writer never uses, so skipping non-numeric names
199
+ * keeps the locked walk bounded by plan phase count instead of the full
200
+ * evidence-tree size (PR #3024 review F3: measured ~1 ms/dir under lock).
201
+ * - Both the persisted counter and every scanned filename value are treated
202
+ * as valid only when they are non-negative safe integers (F2): a corrupt
203
+ * persisted value is ignored (forcing the scan to re-derive from disk),
204
+ * unsafe filename values are skipped, and an allocation would exceed
205
+ * `Number.MAX_SAFE_INTEGER` fails closed rather than silently sticking.
206
+ * - A missing evidence directory scans as 0; a non-directory at the evidence
207
+ * path also scans as 0 (no readable evidence records exist behind it — the
208
+ * evidence writer's own `mkdirSync` fails closed downstream); an unexpected
209
+ * scan failure throws a stable typed error (raw fs detail goes to the debug
210
+ * log only, matching the `makeLockError` convention in this module).
186
211
  */
187
212
  export declare function nextFullAutoOversightSequence(directory: string): number;
213
+ /**
214
+ * Highest oversight sequence encoded in a persisted evidence filename under
215
+ * `.swarm/evidence/<numeric-phase>/`, or 0 when none exist. Filename grammar
216
+ * comes from `evidence-names.ts` (the same module the evidence writer builds
217
+ * names with), so writer and scanner cannot drift. Runs under the caller's
218
+ * state lock. Exposed on `_internals` for direct unit testing and for
219
+ * failure-injection tests of the allocator's fail-closed path.
220
+ */
221
+ declare function maxPersistedOversightEvidenceSequence(directory: string): number;
188
222
  export declare function recordFullAutoOversight(directory: string, sessionID: string, verdict: string, reason: string): FullAutoRunState | undefined;
189
223
  /**
190
224
  * Issue #1781 E2: persist the most recent oversight-escalation detail
@@ -220,5 +254,6 @@ export declare const _internals: {
220
254
  readPersisted: typeof readPersistedForMutation;
221
255
  writePersisted: typeof writePersisted;
222
256
  lockfile: StateLockFile;
257
+ scanOversightEvidenceSequence: typeof maxPersistedOversightEvidenceSequence;
223
258
  };
224
259
  export {};