opencode-swarm 7.138.3 → 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 (56) hide show
  1. package/.opencode/skills/execute/SKILL.md +11 -2
  2. package/.opencode/skills/swarm-implement/SKILL.md +1 -1
  3. package/dist/cli/{config-doctor-2mwgdbsn.js → config-doctor-31yppse4.js} +2 -2
  4. package/dist/cli/{core-v6bte964.js → core-65c7rvqf.js} +1 -1
  5. package/dist/cli/{curation-policy-5dqexw5j.js → curation-policy-hs9pc1rp.js} +2 -2
  6. package/dist/cli/{curator-jjtp9hn2.js → curator-54n1y4j8.js} +16 -15
  7. package/dist/cli/{curator-llm-factory-wkjme59b.js → curator-llm-factory-wm27ra25.js} +16 -15
  8. package/dist/cli/{evidence-summary-service-6cttrkzw.js → evidence-summary-service-hrxcf29a.js} +1 -1
  9. package/dist/cli/{guardrail-explain-xppwfnxr.js → guardrail-explain-1729nse8.js} +17 -16
  10. package/dist/cli/{guardrail-log-swet7rch.js → guardrail-log-yjj5srkw.js} +4 -3
  11. package/dist/cli/{hive-promoter-xvq8jzbs.js → hive-promoter-es2x2b0e.js} +16 -15
  12. package/dist/cli/{index-1djv5684.js → index-1g6xpjk3.js} +4 -4
  13. package/dist/cli/{index-js7th5my.js → index-33q2gmgd.js} +1 -1
  14. package/dist/cli/{index-adde7nm2.js → index-50mwt8fx.js} +5 -5
  15. package/dist/cli/index-556ja8an.js +62 -0
  16. package/dist/cli/{index-93ky909v.js → index-57stye65.js} +1 -1
  17. package/dist/cli/{index-ab57h0yq.js → index-5q009kc4.js} +1 -1
  18. package/dist/cli/{index-99af5gvd.js → index-a18hk2fw.js} +211 -63
  19. package/dist/cli/{index-1v89yst3.js → index-a9xny52r.js} +2 -2
  20. package/dist/cli/{index-rjratees.js → index-c60whfgh.js} +1 -1
  21. package/dist/cli/{index-gda7cwqz.js → index-e1kgxchq.js} +30 -68
  22. package/dist/cli/{index-31vfewmn.js → index-gm3pjfhb.js} +271 -94
  23. package/dist/cli/{index-jhb8kjc5.js → index-jbge0dyh.js} +3 -3
  24. package/dist/cli/{index-xgmx9had.js → index-k27a4e5g.js} +18 -17
  25. package/dist/cli/{index-y6dvs5tt.js → index-m1pwkwfe.js} +1 -1
  26. package/dist/cli/{index-wqg74mwj.js → index-m40ea3zk.js} +1 -1
  27. package/dist/cli/{index-btx8j39p.js → index-m8txs2a9.js} +1 -1
  28. package/dist/cli/{index-y06a43sk.js → index-mycqmsz5.js} +4 -0
  29. package/dist/cli/index-smsy2p8n.js +1725 -0
  30. package/dist/cli/{index-tc61fybd.js → index-tjwz5tct.js} +2 -2
  31. package/dist/cli/{index-j0xx9wpj.js → index-y28n2wmq.js} +1 -1
  32. package/dist/cli/index.js +16 -15
  33. package/dist/cli/{knowledge-escalator-7n384ys1.js → knowledge-escalator-s6z1x65b.js} +3 -3
  34. package/dist/cli/{knowledge-events-yaj0yjd6.js → knowledge-events-nnyn6hst.js} +1 -1
  35. package/dist/cli/{knowledge-store-d99k0z2d.js → knowledge-store-x4yfc7v3.js} +1 -1
  36. package/dist/cli/{knowledge-validator-e5fqy9h4.js → knowledge-validator-1v047gsa.js} +4 -4
  37. package/dist/cli/{scan-cursor-9y9msabt.js → scan-cursor-jxajj6s7.js} +2 -2
  38. package/dist/cli/{schema-xg5f11md.js → schema-fj32eyae.js} +1 -1
  39. package/dist/cli/{scope-persistence-n1bryhzf.js → scope-persistence-w7zen2wz.js} +25 -2
  40. package/dist/cli/{skill-generator-arvwfdfh.js → skill-generator-rt0jqcsa.js} +5 -5
  41. package/dist/hooks/guardrails/destructive-command.d.ts +35 -0
  42. package/dist/hooks/guardrails/file-authority.d.ts +71 -26
  43. package/dist/hooks/guardrails/index.d.ts +2 -0
  44. package/dist/hooks/guardrails/tool-before.d.ts +5 -0
  45. package/dist/hooks/scope-guard.d.ts +3 -1
  46. package/dist/index.js +407 -395
  47. package/dist/scope/path-identity.d.ts +27 -0
  48. package/dist/scope/scope-binding.d.ts +90 -2
  49. package/dist/scope/scope-lease-renewal.d.ts +28 -0
  50. package/dist/scope/scope-persistence.d.ts +102 -19
  51. package/dist/scope/scope-resolution-diagnostic.d.ts +7 -0
  52. package/dist/tools/declare-scope.d.ts +3 -1
  53. package/dist/tools/save-plan.d.ts +2 -0
  54. package/dist/turbo/lean/lane-scope.d.ts +1 -1
  55. package/package.json +1 -1
  56. 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
@@ -12,8 +12,8 @@ import {
12
12
  shouldRunOnStartup,
13
13
  writeBackupArtifact,
14
14
  writeDoctorArtifact
15
- } from "./index-btx8j39p.js";
16
- import"./index-ab57h0yq.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-wqg74mwj.js";
7
+ } from "./index-m40ea3zk.js";
8
8
  import"./index-rtry5xyf.js";
9
- import"./index-93ky909v.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-99af5gvd.js";
17
+ } from "./index-a18hk2fw.js";
18
18
  import"./index-vm4xw9z3.js";
19
19
  import"./index-rrxcfxrd.js";
20
- import"./index-31vfewmn.js";
21
- import"./index-btx8j39p.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-jhb8kjc5.js";
28
- import"./index-adde7nm2.js";
29
- import"./index-rjratees.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-tc61fybd.js";
36
- import"./index-wqg74mwj.js";
35
+ import"./index-tjwz5tct.js";
36
+ import"./index-m40ea3zk.js";
37
37
  import"./index-rtry5xyf.js";
38
- import"./index-1djv5684.js";
39
- import"./index-93ky909v.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-y6dvs5tt.js";
43
+ import"./index-m1pwkwfe.js";
44
44
  import"./index-gprxjmm7.js";
45
45
  import"./index-n832052r.js";
46
- import"./index-ab57h0yq.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-99af5gvd.js";
4
+ } from "./index-a18hk2fw.js";
5
5
  import"./index-vm4xw9z3.js";
6
6
  import"./index-rrxcfxrd.js";
7
- import"./index-31vfewmn.js";
8
- import"./index-btx8j39p.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-jhb8kjc5.js";
15
- import"./index-adde7nm2.js";
16
- import"./index-rjratees.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-tc61fybd.js";
23
- import"./index-wqg74mwj.js";
22
+ import"./index-tjwz5tct.js";
23
+ import"./index-m40ea3zk.js";
24
24
  import"./index-rtry5xyf.js";
25
- import"./index-1djv5684.js";
26
- import"./index-93ky909v.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-y6dvs5tt.js";
30
+ import"./index-m1pwkwfe.js";
31
31
  import"./index-gprxjmm7.js";
32
32
  import"./index-n832052r.js";
33
- import"./index-ab57h0yq.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-gda7cwqz.js";
5
- import"./index-99af5gvd.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-31vfewmn.js";
9
- import"./index-btx8j39p.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-jhb8kjc5.js";
16
- import"./index-adde7nm2.js";
17
- import"./index-rjratees.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-tc61fybd.js";
24
- import"./index-wqg74mwj.js";
23
+ import"./index-tjwz5tct.js";
24
+ import"./index-m40ea3zk.js";
25
25
  import"./index-rtry5xyf.js";
26
- import"./index-1djv5684.js";
27
- import"./index-93ky909v.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-y6dvs5tt.js";
31
+ import"./index-m1pwkwfe.js";
32
32
  import"./index-gprxjmm7.js";
33
33
  import"./index-n832052r.js";
34
- import"./index-ab57h0yq.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-js7th5my.js";
5
- import"./index-31vfewmn.js";
6
- import"./index-ab57h0yq.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-99af5gvd.js";
10
+ } from "./index-a18hk2fw.js";
11
11
  import"./index-vm4xw9z3.js";
12
12
  import"./index-rrxcfxrd.js";
13
- import"./index-31vfewmn.js";
14
- import"./index-btx8j39p.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-jhb8kjc5.js";
21
- import"./index-adde7nm2.js";
22
- import"./index-rjratees.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-tc61fybd.js";
29
- import"./index-wqg74mwj.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-1djv5684.js";
34
- import"./index-93ky909v.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-y6dvs5tt.js";
38
+ import"./index-m1pwkwfe.js";
39
39
  import"./index-gprxjmm7.js";
40
40
  import"./index-n832052r.js";
41
- import"./index-ab57h0yq.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-yaj0yjd6.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-e5fqy9h4.js");
773
- const { KnowledgeConfigSchema } = await import("./schema-xg5f11md.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-1v89yst3.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-31vfewmn.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-1djv5684.js";
9
+ } from "./index-1g6xpjk3.js";
10
10
  import {
11
11
  countEntryContradictionsInWindow,
12
12
  countEntryViolationsInWindow,
13
13
  readKnowledgeEvents,
14
14
  recordKnowledgeEvent
15
- } from "./index-93ky909v.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-e5fqy9h4.js");
193
+ const { quarantineEntry } = await import("./knowledge-validator-1v047gsa.js");
194
194
  let policyConfig;
195
195
  try {
196
- const { KnowledgeConfigSchema } = await import("./schema-xg5f11md.js");
197
- const { loadPluginConfigWithMeta } = await import("./index-1v89yst3.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-d99k0z2d.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.3",
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",