opencode-swarm 7.152.1 → 7.153.1

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 (121) hide show
  1. package/.opencode/skills/swarm-pr-review/SKILL.md +10 -10
  2. package/dist/background/pending-delegations.d.ts +7 -0
  3. package/dist/cli/{capability-probe-va4kk8vg.js → capability-probe-5wa7mcp6.js} +3 -2
  4. package/dist/cli/{config-doctor-bbqmye7a.js → config-doctor-ze21qs6b.js} +3 -3
  5. package/dist/cli/{core-fh4e6ex0.js → core-qdmhh1kx.js} +2 -2
  6. package/dist/cli/{curation-policy-nem98yc9.js → curation-policy-twa6agf8.js} +7 -7
  7. package/dist/cli/{curator-909s9dvs.js → curator-hxb3wsxr.js} +32 -33
  8. package/dist/cli/curator-llm-factory-s8atmc2n.js +64 -0
  9. package/dist/cli/{evidence-summary-service-kqw4y0yr.js → evidence-summary-service-wzzym9r7.js} +15 -15
  10. package/dist/cli/{gate-evidence-ycts62pj.js → gate-evidence-f71dn9vv.js} +8 -8
  11. package/dist/cli/guardrail-explain-5kzeem4m.js +65 -0
  12. package/dist/cli/{guardrail-log-e1tmdxxa.js → guardrail-log-38jnajpa.js} +6 -6
  13. package/dist/cli/{guardrail-reset-gdnaxxvb.js → guardrail-reset-wzvtmpn2.js} +32 -33
  14. package/dist/cli/{hive-promoter-d0xydg6r.js → hive-promoter-55qcqgfx.js} +32 -33
  15. package/dist/cli/{index-x6803sxh.js → index-0tyc8kdg.js} +2 -2
  16. package/dist/cli/{index-z8s2asdk.js → index-0tzv5zg2.js} +22 -150
  17. package/dist/cli/{index-3djxegsc.js → index-1akn19mp.js} +1 -1
  18. package/dist/cli/{index-q77e475x.js → index-1dtshrzg.js} +5 -5
  19. package/dist/cli/{index-73pmnsjg.js → index-1gzdnjg9.js} +2 -2
  20. package/dist/cli/{index-4tvvh7pn.js → index-23rneydq.js} +36 -35
  21. package/dist/cli/{index-z4bg1hv8.js → index-2mqmvxac.js} +9 -2
  22. package/dist/cli/index-3cegckkq.js +239 -0
  23. package/dist/cli/{index-pvrap7xg.js → index-3ttktt56.js} +1 -1
  24. package/dist/cli/{index-85gkedsf.js → index-4fwbbad3.js} +521 -15
  25. package/dist/cli/{index-qqrdmaxq.js → index-4g0g3dqz.js} +2 -2
  26. package/dist/cli/{index-44xdtqz8.js → index-4pjkdcgc.js} +1 -1
  27. package/dist/cli/{index-29vd7v3e.js → index-6vgb5fyb.js} +1 -1
  28. package/dist/cli/{index-sg2sx2q7.js → index-6ybjrqf7.js} +13095 -9360
  29. package/dist/cli/{index-txbd25bc.js → index-891g7hbf.js} +1 -1
  30. package/dist/cli/{index-02ajc6d1.js → index-8v9sj4aq.js} +2 -2
  31. package/dist/cli/{index-z9fyd0d6.js → index-9v8d3c0k.js} +450 -48
  32. package/dist/cli/{index-26vyr198.js → index-af0cqe6n.js} +16 -16
  33. package/dist/cli/{index-ryecg2st.js → index-ajkxx2k6.js} +3 -3
  34. package/dist/cli/{index-k3d919yf.js → index-gn26q90p.js} +85 -24
  35. package/dist/cli/{index-0tfgn5x0.js → index-k10qtq71.js} +9 -9
  36. package/dist/cli/{index-xyfdmrv7.js → index-mb7b1gye.js} +3 -3
  37. package/dist/cli/{index-0q2mjxp2.js → index-meg33yyv.js} +1 -1
  38. package/dist/cli/{index-cpg98bh1.js → index-myt57pht.js} +1 -1
  39. package/dist/cli/{index-2e1294d1.js → index-n5pxkera.js} +16 -10
  40. package/dist/cli/{index-n0vc5b5t.js → index-n823qsae.js} +16 -7
  41. package/dist/cli/{index-6zkm4p7p.js → index-pk1gbqmq.js} +1 -1
  42. package/dist/cli/{index-nd8tkb3g.js → index-smqsp8hs.js} +5 -5
  43. package/dist/cli/{index-7fh82sm1.js → index-td0jz8xe.js} +6 -6
  44. package/dist/cli/{index-dn6yt0xg.js → index-tdzbm974.js} +7 -7
  45. package/dist/cli/{index-rq6aetkv.js → index-v689bmr2.js} +4 -4
  46. package/dist/cli/{index-79g6edht.js → index-x3y6zhgj.js} +1 -1
  47. package/dist/cli/{index-aw492hpn.js → index-x8vw6ap1.js} +58 -41
  48. package/dist/cli/{index-96m8ckpq.js → index-xkjrg9k4.js} +4 -4
  49. package/dist/cli/{index-mken64yj.js → index-zppxpc3y.js} +2 -2
  50. package/dist/cli/index.js +32 -33
  51. package/dist/cli/{knowledge-escalator-4egcr928.js → knowledge-escalator-w05ztgvk.js} +13 -13
  52. package/dist/cli/{knowledge-events-kdyv4jzn.js → knowledge-events-pwm9jc0m.js} +11 -11
  53. package/dist/cli/{knowledge-link-h8cwj7af.js → knowledge-link-ge0rddxw.js} +6 -6
  54. package/dist/cli/{knowledge-store-dq3cvg53.js → knowledge-store-4xv65tj2.js} +7 -7
  55. package/dist/cli/{knowledge-validator-4bhtden9.js → knowledge-validator-0ttfsca7.js} +9 -9
  56. package/dist/cli/{model-preflight-7ea00h34.js → model-preflight-b95w8wxy.js} +1 -1
  57. package/dist/cli/{pending-delegations-a2nmssr1.js → pending-delegations-nk78wx7h.js} +4 -4
  58. package/dist/cli/{pr-subscriptions-7879nq5k.js → pr-subscriptions-dq1f61ye.js} +4 -4
  59. package/dist/cli/{runner-w81n9js3.js → runner-n50w1y4w.js} +7 -7
  60. package/dist/cli/{scan-cursor-2eezv81a.js → scan-cursor-b6n15w8d.js} +8 -8
  61. package/dist/cli/{schema-v4qcqhek.js → schema-jkbfwqr2.js} +2 -2
  62. package/dist/cli/{scope-persistence-y2r227r0.js → scope-persistence-5xt2m5ep.js} +10 -10
  63. package/dist/cli/{skill-generator-hhzxvb3h.js → skill-generator-3keadpf7.js} +15 -15
  64. package/dist/cli/{telemetry-52pw5xac.js → telemetry-hh1j99za.js} +1 -1
  65. package/dist/cli/{worktree-collision-ownership-p31zm5k0.js → worktree-collision-ownership-4drcjymy.js} +15 -10
  66. package/dist/cli/{worktree-isolation-ve338ez6.js → worktree-isolation-1ymaxn4h.js} +32 -33
  67. package/dist/commands/approve-write.d.ts +1 -0
  68. package/dist/commands/index.d.ts +1 -0
  69. package/dist/commands/lanes.d.ts +25 -0
  70. package/dist/commands/registry.d.ts +7 -0
  71. package/dist/config/schema.d.ts +39 -4
  72. package/dist/consensus/contracts.d.ts +14 -0
  73. package/dist/consensus/corpus.d.ts +16 -0
  74. package/dist/hooks/delegation-gate/worktree-isolation.d.ts +50 -3
  75. package/dist/hooks/delegation-gate/worktree-provisioning-owner.d.ts +40 -2
  76. package/dist/hooks/delegation-gate/worktree-recovery-authority.d.ts +201 -0
  77. package/dist/hooks/full-auto-permission.d.ts +7 -0
  78. package/dist/hooks/guardrails/index.d.ts +2 -1
  79. package/dist/hooks/guardrails/tool-before.d.ts +4 -0
  80. package/dist/hooks/init-orphan-recovery.d.ts +5 -1
  81. package/dist/hooks/pr-workflow-gate.d.ts +12 -0
  82. package/dist/hooks/scope-guard.d.ts +1 -3
  83. package/dist/hooks/trajectory-logger.d.ts +22 -6
  84. package/dist/hooks/trajectory-step-state.d.ts +43 -2
  85. package/dist/index.js +645 -622
  86. package/dist/learning/provenance.d.ts +9 -0
  87. package/dist/observability/catalog.d.ts +6 -4
  88. package/dist/prm/index.d.ts +3 -3
  89. package/dist/prm/replay.d.ts +29 -2
  90. package/dist/prm/trajectory-store.d.ts +210 -20
  91. package/dist/sandbox/capability-probe.d.ts +40 -1
  92. package/dist/sandbox/executor.d.ts +26 -1
  93. package/dist/sandbox/linux/bubblewrap-executor.d.ts +3 -1
  94. package/dist/sandbox/macos/sandbox-exec-executor.d.ts +3 -1
  95. package/dist/sandbox/skip-state.d.ts +24 -0
  96. package/dist/sandbox/win32/native-sandbox-executor.d.ts +5 -1
  97. package/dist/security/command-classifier.d.ts +22 -0
  98. package/dist/security/protected-input-integrity.d.ts +19 -0
  99. package/dist/security/protected-path-policy.d.ts +9 -0
  100. package/dist/security/write-authority.d.ts +46 -0
  101. package/dist/services/diagnose-service.d.ts +1 -1
  102. package/dist/services/skill-generator.d.ts +2 -0
  103. package/dist/services/skill-improver.d.ts +69 -0
  104. package/dist/telemetry.d.ts +21 -1
  105. package/dist/tools/dispatch-lanes.d.ts +47 -0
  106. package/dist/tools/repo-graph/query.d.ts +2 -1
  107. package/dist/tools/repo-graph/types.d.ts +64 -0
  108. package/dist/tools/repo-graph.d.ts +1 -1
  109. package/dist/tools/skill-improve.d.ts +7 -0
  110. package/dist/utils/atomic-write.d.ts +2 -0
  111. package/dist/utils/canonical-root.d.ts +31 -0
  112. package/dist/workflow/coder-settlement.d.ts +2 -0
  113. package/dist/worktree/index.d.ts +2 -2
  114. package/dist/worktree/merge.d.ts +47 -0
  115. package/package.json +2 -1
  116. package/dist/cli/curator-llm-factory-462rysph.js +0 -65
  117. package/dist/cli/guardrail-explain-7620hasq.js +0 -66
  118. package/dist/cli/index-3g0xk6tk.js +0 -219
  119. package/dist/cli/index-fxvgaeq4.js +0 -125
  120. package/dist/cli/worktree-provisioning-owner-cve95q4f.js +0 -22
  121. package/dist/cli/{curator-drift-2h1d2fnq.js → curator-drift-h57z6tm3.js} +1 -1
@@ -9,6 +9,13 @@
9
9
  */
10
10
  export interface TrajectoryConfig {
11
11
  enabled: boolean;
12
+ /**
13
+ * Line budget for BOTH the session store's in-memory cache trim AND its
14
+ * on-disk compaction (issue #2041): over budget, the newest
15
+ * floor(max_lines/2) entries are retained on disk and in cache, and the
16
+ * derived byte ceiling is sovereign. The task-evidence copy below uses the
17
+ * same value for its own write-side truncation.
18
+ */
12
19
  max_lines: number;
13
20
  }
14
21
  export interface TrajectoryEntry {
@@ -64,8 +71,8 @@ declare function extractTarget(tool: string, args?: Record<string, unknown>): st
64
71
  /**
65
72
  * Creates the trajectory logger hook pair.
66
73
  *
67
- * @param config - TrajectoryConfig { enabled: boolean (default true), max_lines: number (default 500) }
68
- * @param _directory - Reserved for future use (evidence path derived from session taskId)
74
+ * @param config - TrajectoryConfig { enabled: boolean (default true), max_lines: number (default 500) — bounds the session store's cache AND disk compaction plus the task-evidence truncation }
75
+ * @param _directory - Workspace root (session store + evidence paths derive from it)
69
76
  * @returns Object with toolAfter handler
70
77
  */
71
78
  export declare function createTrajectoryLoggerHook(config: Partial<TrajectoryConfig>, _directory: string): {
@@ -90,8 +97,9 @@ export declare function createTrajectoryLoggerHook(config: Partial<TrajectoryCon
90
97
  * the record of it.
91
98
  *
92
99
  * Contract:
93
- * - The step is minted with the SHARED `nextTrajectoryStep(sessionId)`. Any
94
- * private counter would desynchronise the `prmTrajectoryStep` window and
100
+ * - The step is minted with the SHARED `nextTrajectoryStep(sessionId, directory)`
101
+ * (seeded from the persisted high-water mark see ensureSessionStepSeeded).
102
+ * Any private counter would desynchronise the `prmTrajectoryStep` window and
95
103
  * silently break PRM's step-range filtering.
96
104
  * - `session.delegationActive` gates recording at all (the architect session
97
105
  * is deliberately out of scope); the task-evidence copy additionally
@@ -117,13 +125,18 @@ export declare function recordDeniedToolCall(sessionID: string, input: {
117
125
  export declare function clearDeniedCallMarkers(): void;
118
126
  /**
119
127
  * Resets the step counter for a session. Called when a new session starts
120
- * or when trajectory tracking should restart from step 1.
128
+ * or when trajectory tracking should restart from step 1. The restart-seed
129
+ * gate is invalidated so the next mint re-seeds from the persisted
130
+ * high-water mark (issue #2041 monotonicity).
121
131
  *
122
132
  * @param sessionId - Session identifier
133
+ * @param directory - Workspace root owning the session's trajectory store
123
134
  */
124
- export declare function resetTrajectoryStep(sessionId: string): void;
135
+ export declare function resetTrajectoryStep(sessionId: string, directory?: string): void;
125
136
  /**
126
137
  * Clears trajectory step counters for one session, or all sessions when omitted.
138
+ * The restart-seed gate is invalidated alongside so a cleared session re-seeds
139
+ * from disk on its next mint (issue #2041 monotonicity).
127
140
  *
128
141
  * @param sessionId - Optional session identifier
129
142
  */
@@ -140,6 +153,7 @@ export declare function recordToolCallStart(sessionId: string, callID: string, s
140
153
  /**
141
154
  * Tier-0 pure-function test seam (writing-tests skill). These helpers take no
142
155
  * external dependencies, so testing them directly needs no mocks at all.
156
+ * The seed-gate accessors cover the restart-seeding state machine (issue #2041).
143
157
  */
144
158
  export declare const _test_exports: {
145
159
  readonly deriveAction: typeof deriveAction;
@@ -147,5 +161,7 @@ export declare const _test_exports: {
147
161
  readonly MAX_DENIED_CALL_MARKERS: 500;
148
162
  readonly DENIED_CALL_TTL_MS: number;
149
163
  readonly deniedCallMarkerCount: () => number;
164
+ readonly stepSeedGateSize: () => number;
165
+ readonly clearStepSeedGate: () => void;
150
166
  };
151
167
  export {};
@@ -1,11 +1,52 @@
1
1
  /**
2
2
  * Module-level trajectory step counters shared by runtime reset code and the
3
3
  * trajectory logger without creating a state <-> hook import cycle.
4
+ *
5
+ * Keys are canonical-root + session id (issue #2041 Required 6): the counters
6
+ * are process-global module state, so a host that loads one plugin module
7
+ * instance for several project roots must not let two roots' sessions with
8
+ * the same host session id share a counter — nor let two aliases of one root
9
+ * diverge. The shared `src/utils/canonical-root.ts` helper owns the keying so
10
+ * the trajectory store, these counters, and the logger's restart-seed gate
11
+ * cannot drift. `directory` is required on the minting/seed path; the clear
12
+ * paths may omit it and suffix-scan every root, because the reset entry
13
+ * points legitimately lack a directory.
14
+ */
15
+ /** Current step-counter generation (changes on every clear/reset). */
16
+ export declare function trajectoryStepGeneration(): number;
17
+ /**
18
+ * Mints the next sequential step for a session. Restart continuity is the
19
+ * logger's job (`ensureSessionStepSeeded` in trajectory-logger.ts seeds the
20
+ * counter from the bounded store before the first mint), not this counter's.
21
+ */
22
+ export declare function nextTrajectoryStep(sessionId: string, directory: string): number;
23
+ /**
24
+ * Raises a session's counter to `step` when it is higher than the current
25
+ * value. Used by the restart-seed path so a resumed session continues minting
26
+ * monotonically after the on-disk high-water mark instead of restarting at 1
27
+ * (which would duplicate step numbers against the persisted trajectory).
28
+ * A lower value never lowers the counter (issue #2041 monotonicity).
29
+ */
30
+ export declare function seedTrajectoryStepCounter(sessionId: string, directory: string, step: number): void;
31
+ /**
32
+ * Resets the step counter for a session to zero (module-level semantics —
33
+ * "restart at step one"). The production reset entry points go through
34
+ * trajectory-logger.ts, which also invalidates the per-process restart-seed
35
+ * gate so the next mint re-seeds from disk and steps stay monotonic against
36
+ * the persisted trajectory.
37
+ */
38
+ export declare function resetTrajectoryStepCounter(sessionId: string, directory: string): void;
39
+ /**
40
+ * Clears trajectory step counters for one session (every canonical root — the
41
+ * reset entry points legitimately lack a directory), or all sessions when
42
+ * omitted.
4
43
  */
5
- export declare function nextTrajectoryStep(sessionId: string): number;
6
- export declare function resetTrajectoryStepCounter(sessionId: string): void;
7
44
  export declare function clearTrajectoryStepCounters(sessionId?: string): void;
8
45
  export declare const _test_exports: {
9
46
  MAX_TRACKED_STEP_SESSIONS: number;
10
47
  getTrackedStepSessionCount: () => number;
48
+ /** Whether a counter exists for this session+root in this process. */
49
+ hasTrajectoryStepCounter: (sessionId: string, directory: string) => boolean;
50
+ /** Current generation (test seam: gate-invalidation assertions). */
51
+ getStepCounterGeneration: () => number;
11
52
  };