opencode-swarm 7.138.2 → 7.138.4

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 (59) hide show
  1. package/.opencode/skills/execute/SKILL.md +11 -2
  2. package/.opencode/skills/swarm-implement/SKILL.md +1 -1
  3. package/.opencode/skills/swarm-pr-review/SKILL.md +5 -1
  4. package/dist/background/pr-review-trigger-contract.d.ts +38 -1
  5. package/dist/cli/{config-doctor-hzb0bck9.js → config-doctor-31yppse4.js} +2 -2
  6. package/dist/cli/{core-v6bte964.js → core-65c7rvqf.js} +1 -1
  7. package/dist/cli/{curation-policy-aj37yvz8.js → curation-policy-hs9pc1rp.js} +2 -2
  8. package/dist/cli/{curator-jt6dza8y.js → curator-54n1y4j8.js} +16 -15
  9. package/dist/cli/{curator-llm-factory-m9f4h8t4.js → curator-llm-factory-wm27ra25.js} +16 -15
  10. package/dist/cli/{evidence-summary-service-6cttrkzw.js → evidence-summary-service-hrxcf29a.js} +1 -1
  11. package/dist/cli/{guardrail-explain-rks41rpx.js → guardrail-explain-1729nse8.js} +17 -16
  12. package/dist/cli/{guardrail-log-h39jxftx.js → guardrail-log-yjj5srkw.js} +4 -3
  13. package/dist/cli/{hive-promoter-34y2x4vt.js → hive-promoter-es2x2b0e.js} +16 -15
  14. package/dist/cli/{index-49ygvqvm.js → index-1g6xpjk3.js} +4 -4
  15. package/dist/cli/{index-bakfqtye.js → index-33q2gmgd.js} +1 -1
  16. package/dist/cli/{index-xm07cqy2.js → index-50mwt8fx.js} +5 -5
  17. package/dist/cli/index-556ja8an.js +62 -0
  18. package/dist/cli/{index-r9pn41rj.js → index-57stye65.js} +1 -1
  19. package/dist/cli/{index-exq36v6w.js → index-5q009kc4.js} +1 -1
  20. package/dist/cli/{index-89dwrz8n.js → index-a18hk2fw.js} +225 -63
  21. package/dist/cli/{index-8emf08eb.js → index-a9xny52r.js} +2 -2
  22. package/dist/cli/{index-yxswbd1t.js → index-c60whfgh.js} +1 -1
  23. package/dist/cli/{index-gpxg7wx8.js → index-e1kgxchq.js} +30 -68
  24. package/dist/cli/{index-qt3jjjw9.js → index-gm3pjfhb.js} +271 -94
  25. package/dist/cli/{index-qg5smxv9.js → index-jbge0dyh.js} +3 -3
  26. package/dist/cli/{index-s7ac0xrf.js → index-k27a4e5g.js} +18 -17
  27. package/dist/cli/{index-k6cq9wwh.js → index-m1pwkwfe.js} +1 -1
  28. package/dist/cli/{index-ze4we97d.js → index-m40ea3zk.js} +1 -1
  29. package/dist/cli/{index-da98750t.js → index-m8txs2a9.js} +1 -1
  30. package/dist/cli/{index-y06a43sk.js → index-mycqmsz5.js} +4 -0
  31. package/dist/cli/index-smsy2p8n.js +1725 -0
  32. package/dist/cli/{index-d01d4102.js → index-tjwz5tct.js} +2 -2
  33. package/dist/cli/{index-j0xx9wpj.js → index-y28n2wmq.js} +1 -1
  34. package/dist/cli/index.js +16 -15
  35. package/dist/cli/{knowledge-escalator-qmpfh5yz.js → knowledge-escalator-s6z1x65b.js} +3 -3
  36. package/dist/cli/{knowledge-events-7neg8x0p.js → knowledge-events-nnyn6hst.js} +1 -1
  37. package/dist/cli/{knowledge-store-a6d4625r.js → knowledge-store-x4yfc7v3.js} +1 -1
  38. package/dist/cli/{knowledge-validator-q1qrdyvx.js → knowledge-validator-1v047gsa.js} +4 -4
  39. package/dist/cli/{scan-cursor-3tqshkb2.js → scan-cursor-jxajj6s7.js} +2 -2
  40. package/dist/cli/{schema-mtyaeh18.js → schema-fj32eyae.js} +1 -1
  41. package/dist/cli/{scope-persistence-n1bryhzf.js → scope-persistence-w7zen2wz.js} +25 -2
  42. package/dist/cli/{skill-generator-t3m5qajm.js → skill-generator-rt0jqcsa.js} +5 -5
  43. package/dist/hooks/guardrails/destructive-command.d.ts +35 -0
  44. package/dist/hooks/guardrails/file-authority.d.ts +71 -26
  45. package/dist/hooks/guardrails/index.d.ts +2 -0
  46. package/dist/hooks/guardrails/tool-before.d.ts +5 -0
  47. package/dist/hooks/scope-guard.d.ts +3 -1
  48. package/dist/index.js +408 -396
  49. package/dist/scope/path-identity.d.ts +27 -0
  50. package/dist/scope/scope-binding.d.ts +90 -2
  51. package/dist/scope/scope-lease-renewal.d.ts +28 -0
  52. package/dist/scope/scope-persistence.d.ts +102 -19
  53. package/dist/scope/scope-resolution-diagnostic.d.ts +7 -0
  54. package/dist/tools/declare-scope.d.ts +3 -1
  55. package/dist/tools/save-plan.d.ts +2 -0
  56. package/dist/tools/write-pr-review-trigger-eval.d.ts +2 -2
  57. package/dist/turbo/lean/lane-scope.d.ts +1 -1
  58. package/package.json +1 -1
  59. package/dist/cli/index-2y4jy0de.js +0 -642
@@ -12,6 +12,15 @@ This protocol is loaded on demand by the architect runtime. The architect prompt
12
12
  ### MODE: EXECUTE
13
13
  For each task (respecting dependencies):
14
14
 
15
+ SCOPE SOURCE AND RECOVERY CONTRACT:
16
+ - Resolve scope in this exact precedence: active `declare_scope` binding > plan task `files_touched` > complete one-path-per-line `FILE:` directives. Every present lower-precedence source must be a subset of the authoritative source; precedence never means silently ignoring disagreement.
17
+ - Prefer the durable plan scope authored by `save_plan`. Before dispatch, copy that exact scope into both the delegation's `FILE:` lines and `declare_scope`; include generated outputs and lockfiles.
18
+ - `SCOPE_CONFLICT`: read the diagnostic's named source sets, repair stale plan scope with `save_plan` and/or repair the `FILE:` lines, then call `declare_scope({ taskId, files: <reconciled exact list>, replace_existing: true, working_directory: <active lane root> })`. Do not widen scope just to make the sets agree.
19
+ - `SCOPE_BINDING_EXPIRED` or `SCOPE_BINDING_AMBIGUOUS`: re-read the current task and call `declare_scope` with its intended exact files plus `replace_existing: true`, then retry the delegation once.
20
+ - `SCOPE_WORKSPACE_MISMATCH`: use the diagnostic's active lane/worktree root as `working_directory`; all scope entries and `FILE:` lines remain project-relative to that root. Never reuse a parent/root-worktree binding in a child lane.
21
+ - `SCOPE_ROOT_ESCAPE`: retry the intended operation relative to the active root only if the diagnostic identifies a safe relative path. Never add the outside absolute path to scope. If no safe relative path is supplied, stop and correct the command or lane root.
22
+ - `SCOPE_NOT_DECLARED`: call `declare_scope` with `replace_existing: true` before retrying. A verifier-config or effective-authority denial is not repaired by redeclaration; change the task/role or request the appropriate reviewer-owned operation.
23
+
15
24
  RETRY PROTOCOL — when returning to coder after any gate failure:
16
25
  1. Provide structured rejection: "GATE FAILED: [gate name] | REASON: [details] | REQUIRED FIX: [specific action required]"
17
26
  2. Re-enter at step 5b (the active swarm's coder agent) with full failure context
@@ -32,7 +41,7 @@ WRONG responses to gate failure:
32
41
 
33
42
  RIGHT response to gate failure:
34
43
  ✓ Print "GATE FAILED: [gate name] | REASON: [details]"
35
- ✓ BEFORE the retry delegation: call `declare_scope` with the file list the retry will touch. Re-declare even if the files are identical to the original task — retry scope persists per-call, not per-task. See Rule 1a.
44
+ ✓ BEFORE the retry delegation: call `declare_scope` with the file list the retry will touch and `replace_existing: true`. Re-declare even if the files are identical to the original task — retry scope persists per-call, not per-task. See Rule 1a.
36
45
  ✓ Delegate to the active swarm's coder agent with:
37
46
  TASK: Fix [gate name] failure
38
47
  FILE: [affected file(s)]
@@ -51,7 +60,7 @@ All other gates: failure → return to coder. No self-fixes. No workarounds.
51
60
 
52
61
  5a-bis. **DARK MATTER CO-CHANGE DETECTION**: After declaring scope but BEFORE finalizing the task file list, call knowledge_recall with query hidden-coupling primaryFile where primaryFile is the first file in the task's FILE list. Extract primaryFile from the task's FILE list (first file = primary). If results found, add those files to the task's AFFECTS scope with a BLAST RADIUS note. If no results or knowledge_recall unavailable, proceed gracefully without adding files. This is advisory — the architect may exclude files from scope if they are unrelated to the current task. Delegate to the active swarm's coder agent only after scope is declared.
53
62
 
54
- 5b-PRE (required): Call `declare_scope({ taskId, files })` with the EXACT file list for this task — including any co-change files surfaced by 5a-bis. Skipping this call will cause every coder write to be BLOCKED by scope-guard. No `declare_scope` → no 5b delegation. See Rule 1a.
63
+ 5b-PRE (required): Call `declare_scope({ taskId, files, replace_existing: true })` with the EXACT file list for this task — including any co-change files surfaced by 5a-bis. Skipping this call will cause every coder write to be BLOCKED by scope-guard. No `declare_scope` → no 5b delegation. See Rule 1a.
55
64
  5b-BASE (required, once per task): Call `sast_scan` with `{ capture_baseline: true, phase: <N>, changed_files: <files from 5b-PRE> }` where `<N>` is the current phase number (extract from current task ID: task "3.2" → phase 3, task "1.5" → phase 1). The tool maintains `.swarm/evidence/{phase}/sast-baseline.json` as a phase-scoped, incrementally merged baseline of pre-existing SAST findings. Calling twice for the same files is safe (idempotent merge). Do NOT re-capture mid-task.
56
65
  → REQUIRED: Print "sast-baseline: [WRITTEN — N fingerprints | MERGED — N fingerprints | SKIPPED — gate disabled | ERROR — details]"
57
66
  → Subsequent `pre_check_batch` calls with `phase: <N>` will automatically diff against this baseline — only NEW findings (not in baseline) drive the fail verdict.
@@ -115,7 +115,7 @@ whether reviewer and critic passes are required.
115
115
 
116
116
  Implement in coherent, reviewable chunks. Follow existing repository patterns.
117
117
 
118
- **`declare_scope` discipline.** Before every coder or test-engineer delegation (and before every retry of one), call `declare_scope({ taskId, files })` with the exact file list the delegated agent is allowed to modify — including generated/lockfile paths the change will produce (e.g. `dist/*`, `package-lock.json`, `bun.lock`). Scope is enforced at the Edit/Write/Patch tool layer only — bash-based writes (`sed -i`, `echo >`, `cat > <<HEREDOC`, heredoc-to-file redirects) bypass the check (see issue #520), so do not rely on `declare_scope` to bound shell-redirect writes. If the file list is not 100% obvious from the prompt, declare the containing directories instead. Repeat the declaration before every retry, even when files appear unchanged — scope state is per-attempt, not per-task.
118
+ **`declare_scope` discipline.** Before every coder or test-engineer delegation (and before every retry), call `declare_scope({ taskId, files, replace_existing: true })` with the exact workspace-relative file list the delegated agent may modify — including generated or lockfile paths the change will produce (for example, `dist/*`, `package-lock.json`, or `bun.lock`). Direct and shell writes are both scope-enforced. If the file list is not completely obvious, declare the containing workspace-relative directories instead. Treat `SCOPE_CONFLICT`, `SCOPE_BINDING_EXPIRED`, `SCOPE_BINDING_AMBIGUOUS`, and `SCOPE_WORKSPACE_MISMATCH` as architect-owned recovery signals: reconcile the named scope sources or lane root, replace the declaration, then redispatch. Never instruct the delegated agent to bypass the gate or switch write mechanisms.
119
119
 
120
120
  If the project exposes `sast_scan` with `capture_baseline`, capture the
121
121
  phase-scoped SAST baseline before first coder delegation so later scans fail only
@@ -1057,7 +1057,11 @@ the complete ledger with `write_pr_review_trigger_eval`; its rows use the stable
1057
1057
  trigger IDs below. Every `MATCHED` row includes its returned `source_batch_id`
1058
1058
  and `source_lane_id`; every `NOT_TRIGGERED` row must omit both fields. Missing,
1059
1059
  extra, duplicate, malformed, or incorrectly provenanced rows make persistence
1060
- fail and Phase 4 BLOCKED. The tool atomically writes
1060
+ fail and Phase 4 BLOCKED. Evidence is frozen by the first micro dispatch and is
1061
+ authoritative thereafter. The final writer may omit its duplicate `evidence`
1062
+ fields; if it includes reworded evidence, the writer ignores that copy and
1063
+ persists the frozen values. It still requires the exact frozen classifications,
1064
+ plus provenance for every `MATCHED` row. The tool atomically writes
1061
1065
  `.swarm/pr-review/<run_id>/trigger-eval.json`, separate from `findings.jsonl`;
1062
1066
  pass the exact reviewed merge-base as `base_sha`, the exact live base branch
1063
1067
  tip/ref used to compute it as `base_ref`, and the same `pr_head_sha` to the
@@ -125,8 +125,44 @@ export declare const PrReviewPersistedInputRowSchema: z.ZodDiscriminatedUnion<[z
125
125
  result: z.ZodLiteral<"NOT_TRIGGERED">;
126
126
  evidence: z.ZodString;
127
127
  }, z.core.$strict>], "result">;
128
+ export declare const PrReviewWriterInputRowSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
129
+ trigger_id: z.ZodEnum<{
130
+ "auth-identity-secrets": "auth-identity-secrets";
131
+ "untrusted-input-boundaries": "untrusted-input-boundaries";
132
+ "subprocess-platform": "subprocess-platform";
133
+ "concurrency-state": "concurrency-state";
134
+ "dependencies-build-release": "dependencies-build-release";
135
+ "api-schema-migrations": "api-schema-migrations";
136
+ "test-infrastructure": "test-infrastructure";
137
+ "ui-accessibility-i18n": "ui-accessibility-i18n";
138
+ "privacy-observability": "privacy-observability";
139
+ "generated-provenance": "generated-provenance";
140
+ "unclassified-risk": "unclassified-risk";
141
+ }>;
142
+ result: z.ZodLiteral<"MATCHED">;
143
+ evidence: z.ZodOptional<z.ZodString>;
144
+ source_batch_id: z.ZodString;
145
+ source_lane_id: z.ZodString;
146
+ }, z.core.$strict>, z.ZodObject<{
147
+ trigger_id: z.ZodEnum<{
148
+ "auth-identity-secrets": "auth-identity-secrets";
149
+ "untrusted-input-boundaries": "untrusted-input-boundaries";
150
+ "subprocess-platform": "subprocess-platform";
151
+ "concurrency-state": "concurrency-state";
152
+ "dependencies-build-release": "dependencies-build-release";
153
+ "api-schema-migrations": "api-schema-migrations";
154
+ "test-infrastructure": "test-infrastructure";
155
+ "ui-accessibility-i18n": "ui-accessibility-i18n";
156
+ "privacy-observability": "privacy-observability";
157
+ "generated-provenance": "generated-provenance";
158
+ "unclassified-risk": "unclassified-risk";
159
+ }>;
160
+ result: z.ZodLiteral<"NOT_TRIGGERED">;
161
+ evidence: z.ZodOptional<z.ZodString>;
162
+ }, z.core.$strict>], "result">;
128
163
  export type PrReviewInlineTriggerRow = z.infer<typeof PrReviewInlineTriggerRowSchema>;
129
164
  export type PrReviewPersistedInputRow = z.infer<typeof PrReviewPersistedInputRowSchema>;
165
+ export type PrReviewWriterInputRow = z.infer<typeof PrReviewWriterInputRowSchema>;
130
166
  interface ValidatedTriggerLedger<TRow> {
131
167
  rows: TRow[];
132
168
  matchedIds: PrReviewTriggerId[];
@@ -134,6 +170,7 @@ interface ValidatedTriggerLedger<TRow> {
134
170
  }
135
171
  export declare function validatePrReviewInlineTriggerLedger(input: unknown): ValidatedTriggerLedger<PrReviewInlineTriggerRow>;
136
172
  export declare function validatePrReviewPersistedInputLedger(input: unknown): ValidatedTriggerLedger<PrReviewPersistedInputRow>;
173
+ export declare function validatePrReviewWriterInputLedger(input: unknown): ValidatedTriggerLedger<PrReviewWriterInputRow>;
137
174
  export interface BuildPrReviewTriggerReceiptV2Args {
138
175
  run_id: string;
139
176
  pr_head_sha: string;
@@ -184,7 +221,7 @@ export interface ParsedPrReviewTriggerReceipt {
184
221
  }>[];
185
222
  }
186
223
  /**
187
- * Bind every micro dispatch and the final receipt to one semantic ledger.
224
+ * Bind every micro dispatch to one semantic ledger at bind time.
188
225
  * Callers pass rows after exact-set validation; the tuple representation makes
189
226
  * the identity stable and independent of post-dispatch provenance fields.
190
227
  */
@@ -12,8 +12,8 @@ import {
12
12
  shouldRunOnStartup,
13
13
  writeBackupArtifact,
14
14
  writeDoctorArtifact
15
- } from "./index-da98750t.js";
16
- import"./index-exq36v6w.js";
15
+ } from "./index-m8txs2a9.js";
16
+ import"./index-5q009kc4.js";
17
17
  import"./index-bk5tah7q.js";
18
18
  import"./index-3jcyn8g6.js";
19
19
  import"./index-bpmtbmy9.js";
@@ -14,7 +14,7 @@ import {
14
14
  resolveWorktreeBaseDir,
15
15
  shortenWorktreePath,
16
16
  writeLaneProfileToDiskReal
17
- } from "./index-j0xx9wpj.js";
17
+ } from "./index-y28n2wmq.js";
18
18
  import"./index-4rhhvd1a.js";
19
19
  import"./index-3jcyn8g6.js";
20
20
  import"./index-z6xqpmqg.js";
@@ -4,9 +4,9 @@ import {
4
4
  authorizeCuration,
5
5
  buildConfigFingerprintInput,
6
6
  readCohortConfigFingerprint
7
- } from "./index-ze4we97d.js";
7
+ } from "./index-m40ea3zk.js";
8
8
  import"./index-rtry5xyf.js";
9
- import"./index-r9pn41rj.js";
9
+ import"./index-57stye65.js";
10
10
  import"./index-ae75rja9.js";
11
11
  import"./index-en4fb04r.js";
12
12
  import"./index-tqshdzaw.js";
@@ -14,46 +14,47 @@ import {
14
14
  runCuratorInit,
15
15
  runCuratorPhase,
16
16
  writeCuratorSummary
17
- } from "./index-89dwrz8n.js";
17
+ } from "./index-a18hk2fw.js";
18
18
  import"./index-vm4xw9z3.js";
19
19
  import"./index-rrxcfxrd.js";
20
- import"./index-qt3jjjw9.js";
21
- import"./index-da98750t.js";
22
- import"./index-y06a43sk.js";
20
+ import"./index-gm3pjfhb.js";
21
+ import"./index-m8txs2a9.js";
22
+ import"./index-mycqmsz5.js";
23
23
  import"./index-ngqxzkqm.js";
24
24
  import"./index-y8552snf.js";
25
25
  import"./index-4905hd2m.js";
26
26
  import"./index-134d35c1.js";
27
- import"./index-qg5smxv9.js";
28
- import"./index-xm07cqy2.js";
29
- import"./index-yxswbd1t.js";
27
+ import"./index-jbge0dyh.js";
28
+ import"./index-50mwt8fx.js";
29
+ import"./index-c60whfgh.js";
30
30
  import"./index-6mjf4vr1.js";
31
31
  import"./index-c8s9a3zh.js";
32
32
  import"./index-9ss2m4rs.js";
33
33
  import"./index-wsdnttf4.js";
34
34
  import"./index-39k6y018.js";
35
- import"./index-d01d4102.js";
36
- import"./index-ze4we97d.js";
35
+ import"./index-tjwz5tct.js";
36
+ import"./index-m40ea3zk.js";
37
37
  import"./index-rtry5xyf.js";
38
- import"./index-49ygvqvm.js";
39
- import"./index-r9pn41rj.js";
38
+ import"./index-1g6xpjk3.js";
39
+ import"./index-57stye65.js";
40
40
  import"./index-ae75rja9.js";
41
41
  import"./index-en4fb04r.js";
42
42
  import"./index-tqshdzaw.js";
43
- import"./index-k6cq9wwh.js";
43
+ import"./index-m1pwkwfe.js";
44
44
  import"./index-gprxjmm7.js";
45
45
  import"./index-n832052r.js";
46
- import"./index-exq36v6w.js";
46
+ import"./index-5q009kc4.js";
47
47
  import"./index-bk5tah7q.js";
48
48
  import"./index-8fwhhayc.js";
49
49
  import"./index-q1exe2b3.js";
50
50
  import"./index-z7jgvm9b.js";
51
- import"./index-2y4jy0de.js";
51
+ import"./index-smsy2p8n.js";
52
+ import"./index-556ja8an.js";
52
53
  import"./index-4fmztnrq.js";
53
54
  import"./index-1kz6da87.js";
54
55
  import"./index-x20cgr2q.js";
55
56
  import"./index-b8zgtz81.js";
56
- import"./index-j0xx9wpj.js";
57
+ import"./index-y28n2wmq.js";
57
58
  import"./index-4rhhvd1a.js";
58
59
  import"./index-3jcyn8g6.js";
59
60
  import"./index-q344kj84.js";
@@ -1,46 +1,47 @@
1
1
  // @bun
2
2
  import {
3
3
  createCuratorLLMDelegate
4
- } from "./index-89dwrz8n.js";
4
+ } from "./index-a18hk2fw.js";
5
5
  import"./index-vm4xw9z3.js";
6
6
  import"./index-rrxcfxrd.js";
7
- import"./index-qt3jjjw9.js";
8
- import"./index-da98750t.js";
9
- import"./index-y06a43sk.js";
7
+ import"./index-gm3pjfhb.js";
8
+ import"./index-m8txs2a9.js";
9
+ import"./index-mycqmsz5.js";
10
10
  import"./index-ngqxzkqm.js";
11
11
  import"./index-y8552snf.js";
12
12
  import"./index-4905hd2m.js";
13
13
  import"./index-134d35c1.js";
14
- import"./index-qg5smxv9.js";
15
- import"./index-xm07cqy2.js";
16
- import"./index-yxswbd1t.js";
14
+ import"./index-jbge0dyh.js";
15
+ import"./index-50mwt8fx.js";
16
+ import"./index-c60whfgh.js";
17
17
  import"./index-6mjf4vr1.js";
18
18
  import"./index-c8s9a3zh.js";
19
19
  import"./index-9ss2m4rs.js";
20
20
  import"./index-wsdnttf4.js";
21
21
  import"./index-39k6y018.js";
22
- import"./index-d01d4102.js";
23
- import"./index-ze4we97d.js";
22
+ import"./index-tjwz5tct.js";
23
+ import"./index-m40ea3zk.js";
24
24
  import"./index-rtry5xyf.js";
25
- import"./index-49ygvqvm.js";
26
- import"./index-r9pn41rj.js";
25
+ import"./index-1g6xpjk3.js";
26
+ import"./index-57stye65.js";
27
27
  import"./index-ae75rja9.js";
28
28
  import"./index-en4fb04r.js";
29
29
  import"./index-tqshdzaw.js";
30
- import"./index-k6cq9wwh.js";
30
+ import"./index-m1pwkwfe.js";
31
31
  import"./index-gprxjmm7.js";
32
32
  import"./index-n832052r.js";
33
- import"./index-exq36v6w.js";
33
+ import"./index-5q009kc4.js";
34
34
  import"./index-bk5tah7q.js";
35
35
  import"./index-8fwhhayc.js";
36
36
  import"./index-q1exe2b3.js";
37
37
  import"./index-z7jgvm9b.js";
38
- import"./index-2y4jy0de.js";
38
+ import"./index-smsy2p8n.js";
39
+ import"./index-556ja8an.js";
39
40
  import"./index-4fmztnrq.js";
40
41
  import"./index-1kz6da87.js";
41
42
  import"./index-x20cgr2q.js";
42
43
  import"./index-b8zgtz81.js";
43
- import"./index-j0xx9wpj.js";
44
+ import"./index-y28n2wmq.js";
44
45
  import"./index-4rhhvd1a.js";
45
46
  import"./index-3jcyn8g6.js";
46
47
  import"./index-q344kj84.js";
@@ -6,7 +6,7 @@ import {
6
6
  loadPlanJsonOnly,
7
7
  mergeDurableGateEntriesFromEvidence,
8
8
  readDurableGateEvidence
9
- } from "./index-y06a43sk.js";
9
+ } from "./index-mycqmsz5.js";
10
10
  import"./index-ngqxzkqm.js";
11
11
  import"./index-y8552snf.js";
12
12
  import"./index-9ss2m4rs.js";
@@ -1,47 +1,48 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-gpxg7wx8.js";
5
- import"./index-89dwrz8n.js";
4
+ } from "./index-e1kgxchq.js";
5
+ import"./index-a18hk2fw.js";
6
6
  import"./index-vm4xw9z3.js";
7
7
  import"./index-rrxcfxrd.js";
8
- import"./index-qt3jjjw9.js";
9
- import"./index-da98750t.js";
10
- import"./index-y06a43sk.js";
8
+ import"./index-gm3pjfhb.js";
9
+ import"./index-m8txs2a9.js";
10
+ import"./index-mycqmsz5.js";
11
11
  import"./index-ngqxzkqm.js";
12
12
  import"./index-y8552snf.js";
13
13
  import"./index-4905hd2m.js";
14
14
  import"./index-134d35c1.js";
15
- import"./index-qg5smxv9.js";
16
- import"./index-xm07cqy2.js";
17
- import"./index-yxswbd1t.js";
15
+ import"./index-jbge0dyh.js";
16
+ import"./index-50mwt8fx.js";
17
+ import"./index-c60whfgh.js";
18
18
  import"./index-6mjf4vr1.js";
19
19
  import"./index-c8s9a3zh.js";
20
20
  import"./index-9ss2m4rs.js";
21
21
  import"./index-wsdnttf4.js";
22
22
  import"./index-39k6y018.js";
23
- import"./index-d01d4102.js";
24
- import"./index-ze4we97d.js";
23
+ import"./index-tjwz5tct.js";
24
+ import"./index-m40ea3zk.js";
25
25
  import"./index-rtry5xyf.js";
26
- import"./index-49ygvqvm.js";
27
- import"./index-r9pn41rj.js";
26
+ import"./index-1g6xpjk3.js";
27
+ import"./index-57stye65.js";
28
28
  import"./index-ae75rja9.js";
29
29
  import"./index-en4fb04r.js";
30
30
  import"./index-tqshdzaw.js";
31
- import"./index-k6cq9wwh.js";
31
+ import"./index-m1pwkwfe.js";
32
32
  import"./index-gprxjmm7.js";
33
33
  import"./index-n832052r.js";
34
- import"./index-exq36v6w.js";
34
+ import"./index-5q009kc4.js";
35
35
  import"./index-bk5tah7q.js";
36
36
  import"./index-8fwhhayc.js";
37
37
  import"./index-q1exe2b3.js";
38
38
  import"./index-z7jgvm9b.js";
39
- import"./index-2y4jy0de.js";
39
+ import"./index-smsy2p8n.js";
40
+ import"./index-556ja8an.js";
40
41
  import"./index-4fmztnrq.js";
41
42
  import"./index-1kz6da87.js";
42
43
  import"./index-x20cgr2q.js";
43
44
  import"./index-b8zgtz81.js";
44
- import"./index-j0xx9wpj.js";
45
+ import"./index-y28n2wmq.js";
45
46
  import"./index-4rhhvd1a.js";
46
47
  import"./index-3jcyn8g6.js";
47
48
  import"./index-q344kj84.js";
@@ -1,10 +1,11 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailLog
4
- } from "./index-bakfqtye.js";
5
- import"./index-qt3jjjw9.js";
6
- import"./index-exq36v6w.js";
4
+ } from "./index-33q2gmgd.js";
5
+ import"./index-gm3pjfhb.js";
6
+ import"./index-5q009kc4.js";
7
7
  import"./index-bk5tah7q.js";
8
+ import"./index-556ja8an.js";
8
9
  import"./index-3jcyn8g6.js";
9
10
  import"./index-bpmtbmy9.js";
10
11
  import"./index-z6xqpmqg.js";
@@ -7,48 +7,49 @@ import {
7
7
  isHiveEligible,
8
8
  promoteFromSwarm,
9
9
  promoteToHive
10
- } from "./index-89dwrz8n.js";
10
+ } from "./index-a18hk2fw.js";
11
11
  import"./index-vm4xw9z3.js";
12
12
  import"./index-rrxcfxrd.js";
13
- import"./index-qt3jjjw9.js";
14
- import"./index-da98750t.js";
15
- import"./index-y06a43sk.js";
13
+ import"./index-gm3pjfhb.js";
14
+ import"./index-m8txs2a9.js";
15
+ import"./index-mycqmsz5.js";
16
16
  import"./index-ngqxzkqm.js";
17
17
  import"./index-y8552snf.js";
18
18
  import"./index-4905hd2m.js";
19
19
  import"./index-134d35c1.js";
20
- import"./index-qg5smxv9.js";
21
- import"./index-xm07cqy2.js";
22
- import"./index-yxswbd1t.js";
20
+ import"./index-jbge0dyh.js";
21
+ import"./index-50mwt8fx.js";
22
+ import"./index-c60whfgh.js";
23
23
  import"./index-6mjf4vr1.js";
24
24
  import"./index-c8s9a3zh.js";
25
25
  import"./index-9ss2m4rs.js";
26
26
  import"./index-wsdnttf4.js";
27
27
  import"./index-39k6y018.js";
28
- import"./index-d01d4102.js";
29
- import"./index-ze4we97d.js";
28
+ import"./index-tjwz5tct.js";
29
+ import"./index-m40ea3zk.js";
30
30
  import"./index-rtry5xyf.js";
31
31
  import {
32
32
  resolveHiveKnowledgePath
33
- } from "./index-49ygvqvm.js";
34
- import"./index-r9pn41rj.js";
33
+ } from "./index-1g6xpjk3.js";
34
+ import"./index-57stye65.js";
35
35
  import"./index-ae75rja9.js";
36
36
  import"./index-en4fb04r.js";
37
37
  import"./index-tqshdzaw.js";
38
- import"./index-k6cq9wwh.js";
38
+ import"./index-m1pwkwfe.js";
39
39
  import"./index-gprxjmm7.js";
40
40
  import"./index-n832052r.js";
41
- import"./index-exq36v6w.js";
41
+ import"./index-5q009kc4.js";
42
42
  import"./index-bk5tah7q.js";
43
43
  import"./index-8fwhhayc.js";
44
44
  import"./index-q1exe2b3.js";
45
45
  import"./index-z7jgvm9b.js";
46
- import"./index-2y4jy0de.js";
46
+ import"./index-smsy2p8n.js";
47
+ import"./index-556ja8an.js";
47
48
  import"./index-4fmztnrq.js";
48
49
  import"./index-1kz6da87.js";
49
50
  import"./index-x20cgr2q.js";
50
51
  import"./index-b8zgtz81.js";
51
- import"./index-j0xx9wpj.js";
52
+ import"./index-y28n2wmq.js";
52
53
  import"./index-4rhhvd1a.js";
53
54
  import"./index-3jcyn8g6.js";
54
55
  import"./index-q344kj84.js";
@@ -702,7 +702,7 @@ async function applyConfidenceFloorAction(directory, touched, options) {
702
702
  const recovered = touched.filter((e) => e.confidence > CONFIDENCE_FLOOR + FLOOR_EPSILON && e.confidence_floor_demoted);
703
703
  if (atFloor.length === 0 && recovered.length === 0)
704
704
  return;
705
- const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-7neg8x0p.js");
705
+ const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-nnyn6hst.js");
706
706
  const rollups = await readKnowledgeCounterRollups(directory);
707
707
  const flagIds = new Set;
708
708
  for (const e of atFloor) {
@@ -769,11 +769,11 @@ async function applyConfidenceFloorAction(directory, touched, options) {
769
769
  });
770
770
  }
771
771
  if (action === "quarantine" && toQuarantine.length > 0) {
772
- const { quarantineEntry } = await import("./knowledge-validator-q1qrdyvx.js");
773
- const { KnowledgeConfigSchema } = await import("./schema-mtyaeh18.js");
772
+ const { quarantineEntry } = await import("./knowledge-validator-1v047gsa.js");
773
+ const { KnowledgeConfigSchema } = await import("./schema-fj32eyae.js");
774
774
  let config;
775
775
  try {
776
- const { loadPluginConfigWithMeta } = await import("./index-8emf08eb.js");
776
+ const { loadPluginConfigWithMeta } = await import("./index-a9xny52r.js");
777
777
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
778
778
  config = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
779
779
  } catch {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  redactPath,
4
4
  redactShellCommand
5
- } from "./index-qt3jjjw9.js";
5
+ } from "./index-gm3pjfhb.js";
6
6
 
7
7
  // src/services/guardrail-log-service.ts
8
8
  import * as fs from "fs/promises";
@@ -6,13 +6,13 @@ import {
6
6
  resolveSwarmKnowledgePath,
7
7
  transactKnowledge,
8
8
  wordBigrams
9
- } from "./index-49ygvqvm.js";
9
+ } from "./index-1g6xpjk3.js";
10
10
  import {
11
11
  countEntryContradictionsInWindow,
12
12
  countEntryViolationsInWindow,
13
13
  readKnowledgeEvents,
14
14
  recordKnowledgeEvent
15
- } from "./index-r9pn41rj.js";
15
+ } from "./index-57stye65.js";
16
16
  import {
17
17
  init_knowledge_types,
18
18
  isActiveStatus
@@ -190,11 +190,11 @@ async function maybeQuarantineOnContradiction(directory, entryId, threshold, win
190
190
  alreadyInactive: true
191
191
  };
192
192
  }
193
- const { quarantineEntry } = await import("./knowledge-validator-q1qrdyvx.js");
193
+ const { quarantineEntry } = await import("./knowledge-validator-1v047gsa.js");
194
194
  let policyConfig;
195
195
  try {
196
- const { KnowledgeConfigSchema } = await import("./schema-mtyaeh18.js");
197
- const { loadPluginConfigWithMeta } = await import("./index-8emf08eb.js");
196
+ const { KnowledgeConfigSchema } = await import("./schema-fj32eyae.js");
197
+ const { loadPluginConfigWithMeta } = await import("./index-a9xny52r.js");
198
198
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
199
199
  policyConfig = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
200
200
  } catch {
@@ -0,0 +1,62 @@
1
+ // @bun
2
+ // src/scope/path-identity.ts
3
+ import * as path from "path";
4
+ var BIDI_CONTROL_CHARACTERS = /[\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/u;
5
+ function isControlCharacter(character) {
6
+ const codePoint = character.codePointAt(0) ?? 0;
7
+ return codePoint <= 31 || codePoint >= 127 && codePoint <= 159;
8
+ }
9
+ function isBidiControlCharacter(character) {
10
+ return BIDI_CONTROL_CHARACTERS.test(character);
11
+ }
12
+ function getPathFlavor(pathLib = path) {
13
+ return pathLib.sep === "\\" ? "win32" : "posix";
14
+ }
15
+ function pathImplementation(flavor) {
16
+ return flavor === "win32" ? path.win32 : path.posix;
17
+ }
18
+ function normalizePathIdentity(value, flavor = getPathFlavor()) {
19
+ const pathImpl = pathImplementation(flavor);
20
+ const normalized = pathImpl.normalize(flavor === "win32" ? value.replace(/\//g, "\\") : value);
21
+ return flavor === "win32" ? normalized.toLowerCase() : normalized;
22
+ }
23
+ function pathIdentitiesEqual(a, b, flavor = getPathFlavor()) {
24
+ return normalizePathIdentity(a, flavor) === normalizePathIdentity(b, flavor);
25
+ }
26
+ function isPathIdentityWithin(target, container, flavor = getPathFlavor()) {
27
+ const pathImpl = pathImplementation(flavor);
28
+ const targetIdentity = normalizePathIdentity(target, flavor);
29
+ const containerIdentity = normalizePathIdentity(container, flavor);
30
+ if (targetIdentity === containerIdentity)
31
+ return true;
32
+ const relative = pathImpl.relative(containerIdentity, targetIdentity);
33
+ return relative.length > 0 && relative !== ".." && !relative.startsWith(`..${pathImpl.sep}`) && !pathImpl.isAbsolute(relative);
34
+ }
35
+ function isPathWithinDeclaredScope(filePath, scopeEntries, cwd = process.cwd(), flavor = getPathFlavor()) {
36
+ const pathImpl = pathImplementation(flavor);
37
+ const resolvedFile = pathImpl.resolve(cwd, filePath);
38
+ return scopeEntries.some((scope) => isPathIdentityWithin(resolvedFile, pathImpl.resolve(cwd, scope), flavor));
39
+ }
40
+ function isOnDifferentPathRoot(target, cwd, flavor = getPathFlavor()) {
41
+ const pathImpl = pathImplementation(flavor);
42
+ const targetRoot = pathImpl.parse(pathImpl.normalize(target)).root;
43
+ const cwdRoot = pathImpl.parse(pathImpl.normalize(cwd)).root;
44
+ return !pathIdentitiesEqual(targetRoot, cwdRoot, flavor);
45
+ }
46
+ function unsafePathTextReason(value) {
47
+ if ([...value].some(isControlCharacter)) {
48
+ return "control characters are not allowed in paths";
49
+ }
50
+ if ([...value].some(isBidiControlCharacter)) {
51
+ return "bidirectional control characters are not allowed in paths";
52
+ }
53
+ return null;
54
+ }
55
+ function sanitizeDiagnosticText(value, maxLength = 256) {
56
+ const rendered = String(value).split("").map((character) => isControlCharacter(character) || isBidiControlCharacter(character) ? "?" : character).join("").replace(/\s+/gu, " ").trim();
57
+ if (rendered.length <= maxLength)
58
+ return rendered;
59
+ return `${rendered.slice(0, Math.max(0, maxLength - 1))}\u2026`;
60
+ }
61
+
62
+ export { getPathFlavor, pathIdentitiesEqual, isPathIdentityWithin, isPathWithinDeclaredScope, isOnDifferentPathRoot, unsafePathTextReason, sanitizeDiagnosticText };
@@ -625,7 +625,7 @@ async function applyKnowledgeVerdictFeedback(directory, options) {
625
625
  deltas.push({ id, delta });
626
626
  }
627
627
  if (deltas.length > 0) {
628
- const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-a6d4625r.js");
628
+ const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-x4yfc7v3.js");
629
629
  await bumpKnowledgeConfidenceBatch(directory, deltas, options?.floorOptions);
630
630
  }
631
631
  return {
@@ -21,7 +21,7 @@ var package_default;
21
21
  var init_package = __esm(() => {
22
22
  package_default = {
23
23
  name: "opencode-swarm",
24
- version: "7.138.2",
24
+ version: "7.138.4",
25
25
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
26
26
  main: "dist/index.js",
27
27
  types: "dist/index.d.ts",