opencode-swarm 7.107.3 → 7.107.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 (61) hide show
  1. package/.opencode/skills/consult/SKILL.md +10 -0
  2. package/.opencode/skills/council/SKILL.md +10 -0
  3. package/.opencode/skills/engineering-conventions/SKILL.md +20 -0
  4. package/README.md +2 -2
  5. package/dist/agents/agent-output-schema.d.ts +1 -1
  6. package/dist/cli/{config-doctor-cntnpyvj.js → config-doctor-kdq3vae4.js} +3 -2
  7. package/dist/cli/{curator-llm-factory-x9tk7e6m.js → curator-llm-factory-abw56kg0.js} +16 -11
  8. package/dist/cli/{curator-1nr4qszq.js → curator-rb05fjjk.js} +16 -11
  9. package/dist/cli/{dispatch-e4ejrsz8.js → dispatch-anmxxhen.js} +56 -13
  10. package/dist/cli/{evidence-summary-service-9r28ds8t.js → evidence-summary-service-nwdfnbz1.js} +2 -2
  11. package/dist/cli/gate-evidence-ywys9vfs.js +1 -1
  12. package/dist/cli/{guardrail-explain-etdrhd4d.js → guardrail-explain-dayy7zw4.js} +17 -12
  13. package/dist/cli/{guardrail-log-2rns4g6d.js → guardrail-log-fjypsmek.js} +4 -3
  14. package/dist/cli/{hive-promoter-j4e6rfa6.js → hive-promoter-34bdmw1w.js} +16 -11
  15. package/dist/cli/{index-502f6np6.js → index-19vxtwa6.js} +21 -16
  16. package/dist/cli/{index-tgtmbf3r.js → index-4vsgp5a8.js} +1 -1
  17. package/dist/cli/index-bfwt3abw.js +14 -0
  18. package/dist/cli/{index-9wstcavp.js → index-bpgqbwmf.js} +115 -1019
  19. package/dist/cli/index-bq8kd9r9.js +199 -0
  20. package/dist/cli/index-dfdg4ws5.js +741 -0
  21. package/dist/cli/{index-w15984gg.js → index-f45hbd5x.js} +2 -2
  22. package/dist/cli/{index-cyzzdbvw.js → index-gyzxeza3.js} +354 -116
  23. package/dist/cli/index-kxm3bdjh.js +631 -0
  24. package/dist/cli/index-n1sptn1w.js +147 -0
  25. package/dist/cli/{index-2560cctg.js → index-pchpahdf.js} +11 -0
  26. package/dist/cli/{index-esg1554h.js → index-wvxhynxq.js} +1 -1
  27. package/dist/cli/{index-8w4d325g.js → index-xg18az81.js} +61 -22
  28. package/dist/cli/{index-f7nma02k.js → index-xmarctsf.js} +137 -175
  29. package/dist/cli/{index-m1xjr58n.js → index-zej8cy0j.js} +1 -1
  30. package/dist/cli/index.js +17 -12
  31. package/dist/cli/knowledge-escalator-3sgwrgy9.js +32 -0
  32. package/dist/cli/knowledge-events-kfc6xmkw.js +62 -0
  33. package/dist/cli/{knowledge-store-tsa8ezka.js → knowledge-store-kyacem71.js} +3 -1
  34. package/dist/cli/knowledge-validator-ez3ws8ef.js +57 -0
  35. package/dist/cli/{pr-subscriptions-0dpn4epk.js → pr-subscriptions-bpvazmsw.js} +2 -2
  36. package/dist/cli/{schema-vw2ffhe9.js → schema-x0ekqzvs.js} +2 -1
  37. package/dist/cli/{skill-generator-y6mmq8n5.js → skill-generator-x83re96d.js} +6 -2
  38. package/dist/commands/knowledge.d.ts +5 -1
  39. package/dist/commands/registry.d.ts +2 -2
  40. package/dist/config/evidence-schema.d.ts +9 -9
  41. package/dist/config/schema.d.ts +42 -12
  42. package/dist/hooks/knowledge-curator.d.ts +27 -0
  43. package/dist/hooks/knowledge-escalator.d.ts +16 -0
  44. package/dist/hooks/knowledge-events.d.ts +11 -0
  45. package/dist/hooks/knowledge-reader.d.ts +0 -17
  46. package/dist/hooks/knowledge-store.d.ts +16 -1
  47. package/dist/hooks/knowledge-types.d.ts +85 -0
  48. package/dist/hooks/knowledge-validator.d.ts +15 -0
  49. package/dist/hooks/skill-usage-log.d.ts +3 -0
  50. package/dist/index.js +307 -305
  51. package/dist/memory/consolidation.d.ts +1 -1
  52. package/dist/memory/schema.d.ts +4 -4
  53. package/dist/sast/rules/rust.d.ts +6 -0
  54. package/dist/tools/knowledge-archive.d.ts +6 -2
  55. package/dist/tools/lint.d.ts +2 -2
  56. package/dist/tools/secretscan.d.ts +16 -0
  57. package/dist/tools/test-runner.d.ts +1 -1
  58. package/package.json +1 -1
  59. package/dist/cli/{index-hkpw4wwa.js → index-4r5z8sgw.js} +3 -3
  60. package/dist/cli/{index-kzfkggjx.js → index-9b7a6agd.js} +3 -3
  61. package/dist/cli/{pending-delegations-ws51m1e1.js → pending-delegations-vfnpm8zt.js} +3 -3
@@ -14,3 +14,13 @@ Identify 1-3 relevant domains from the task requirements.
14
14
  Call the active swarm's sme agent once per domain, serially. Max 3 SME calls per project phase.
15
15
  Re-consult if a new domain emerges or if significant changes require fresh evaluation.
16
16
  Cache guidance in context.md.
17
+
18
+ ### Read-before-cite discipline
19
+
20
+ SME consultation answers are advisory. When the SME (or any agent synthesizing the final answer) cites source code, file paths, line ranges, API behavior, or CLI flags, it MUST read the actual file or tool output in the current revision. Specific anti-patterns to refuse:
21
+
22
+ - Quoting `src/foo.ts:123-145` without reading those lines.
23
+ - Restating an API signature from earlier conversation history after the source has been edited.
24
+ - Citing behavior from documentation that pre-dates the current version.
25
+
26
+ For uncertain claims, the SME must mark `confidence: LOW` and identify what additional evidence (a specific file read, a test run, a docs check) would resolve the uncertainty. Do NOT report `confidence: HIGH` for claims that could not be verified against current source this turn.
@@ -83,6 +83,16 @@ RESEARCH CONTEXT
83
83
  ...
84
84
  ```
85
85
 
86
+ #### Read-before-cite discipline
87
+
88
+ When citing source code, API behavior, CLI flags, file paths, or line ranges, the synthesizing agent MUST read the actual file or tool output first. Search snippets, file globs, conversation history, and prior-round memory are not sufficient evidence. Specific anti-patterns to refuse in synthesized output:
89
+
90
+ - Quoting a line range (e.g. `src/foo.ts:123-145`) without reading those lines in the current revision.
91
+ - Restating an API signature, error message, or option flag from prior context after the source has been edited.
92
+ - Citing `bunSpawnSync` / `child_process.spawnSync` behavior from documentation that pre-dates the current version.
93
+
94
+ The synthesized answer's `sources` array should reference URLs and tool outputs the agent actually retrieved during the current session, not sources inherited from prior rounds. Mark `confidence: LOW` for any claim the agent could not verify against current source this round.
95
+
86
96
  #### Round 1 - Parallel Independent Analysis
87
97
 
88
98
  3. Dispatch `the active swarm's council_generalist agent`,
@@ -107,3 +107,23 @@ The cross-tree skill mirror contract is the authoritative registry at `src/confi
107
107
  - **Adapter shim pattern:** for architect MODE skills like `swarm-pr-review` and `swarm-pr-feedback`, the `.claude` and `.agents` files are thin adapter shims that delegate to the canonical `.opencode` file via `expectedCanonicalRef`. When updating these, the canonical content goes in `.opencode`; the adapter shim typically needs no change unless the cross-tree delegation interface changes.
108
108
 
109
109
  **If your PR modifies a `.opencode/skills/<X>/SKILL.md` file:** check `src/config/skill-mirrors.ts` for the contract, then run `bun run drift:check` locally before pushing. Mirror drift is currently a soft-warn (`DRIFT_CHECK_ENFORCE=1` would make it hard-fail). The drift-check CI job surfaces drift as an issue comment, not a blocking check — but a drift between canonical and mirror means Claude Code agents reading the mirror get stale instructions.
110
+
111
+ ## Sandbox env overrides (subprocess-safety deep-dive)
112
+
113
+ When a sandbox executor (`src/sandbox/{linux,macos,win32}/*.ts`) interpolates environment variables into a sandbox profile, a bwrap rule, or a PowerShell `-EnvironmentVariables` block, the following rules apply — they exist because a future shell-injection regression in any new sandbox path would be a security vulnerability, not just a bug:
114
+
115
+ - **Keys must match POSIX env-var name syntax.** Every env key must be validated against the regex `/^[A-Za-z_][A-Za-z0-9_]*$/` (a leading letter or underscore, then letters/digits/underscores) before being interpolated. Define or reuse a single `isValidEnvKey(key: string): boolean` helper colocated with the `SandboxExecutor` interface in `src/sandbox/executor.ts` (around line 24+); do not duplicate the regex inline at every call site. Keys that fail validation must be silently dropped (not raised) so that one bad caller cannot wedge the sandbox path — but the drop must be observable in the advisory/observability layer (`pendingAdvisoryMessages` or structured log), never silent.
116
+ - **Values must be shell-quoted or treated as opaque single tokens.** On POSIX, prepend a leading single quote, escape any embedded single quotes by replacing `'` with `'\''`, and append a trailing single quote. On Windows PowerShell, **prefer single-quoted literal contexts (e.g. `'$env:NAME'`) and run values through a `psStringEscape`-style helper that escapes backtick, `$`, `"`, and `` ` ``** (the special characters in double-quoted PowerShell strings). Single-quoted PowerShell strings are literal — only `'` needs escaping, doubling it to `''`. If a context requires double-quoted PS values, escape embedded `"` as `` ` ``, backtick as `` `` ``, and `$` as `` ` `` (backtick is the PS escape character in double-quoted strings; `$` must be escaped to prevent variable expansion). On bwrap, always pass values as separate argv tokens after the `--setenv` flag (`--setenv KEY VALUE`, two tokens), never as a single concatenated `KEY=VALUE` token that an intermediate shell would interpret.
117
+ - **Use the array-form argv for every sandbox subprocess.** Never `shell:`-interpolate. The same invariant-3 rules (`array-form spawn`, `stdin: 'ignore'`, `cwd`, `timeout`, `proc.kill()` in `finally`) apply to sandbox spawns as to any other subprocess — see the `subprocess-safety` cross-link.
118
+
119
+ ## Sandbox fallback parity (Windows and Linux)
120
+
121
+ `sandbox/{linux,macos,win32}/*.ts` has primary executors plus legacy fallbacks (Windows `NativeWindowsSandboxExecutor` + `RestrictedEnvironmentExecutor` / PowerShell wrapper, Linux `BubblewrapSandboxExecutor` + no-sandbox fallback). When you modify any of the following on the primary executor, you MUST update the fallback path in the same change to keep behavior parity and add a parity test:
122
+
123
+ - `getEnvOverrides` signature or merge semantics.
124
+ - `wrapCommand` scoping rules (allowed roots, read-only mounts, temp-dir allocation).
125
+ - `isAvailable()` / capability probe logic.
126
+ - Failure-mode handling (does a missing sandbox envelope hard-fail or soft-fail to env-only isolation?).
127
+ - Scope-materialization for lane-scoped resources.
128
+
129
+ A divergence between primary and fallback that is not exercised by a parity test is a regression. The existing per-OS test files `tests/unit/sandbox/{linux,macos,win32}.test.ts` must continue to cover both the primary and fallback paths after every env-affecting change — extend these tests rather than relying on dedicated sandbox-envoverride test files that may or may not exist in your branch.
package/README.md CHANGED
@@ -542,7 +542,7 @@ Built-in tools verify every task before it ships:
542
542
 
543
543
  - **syntax_check** — Tree-sitter validation across the configured language grammar map
544
544
  - **placeholder_scan** — Catches TODOs, stubs, incomplete code
545
- - **sast_scan** — 65 security rules across 7 languages (offline)
545
+ - **sast_scan** — 68 security rules across 8 languages (offline)
546
546
  - **sbom_generate** — Dependency tracking (CycloneDX)
547
547
  - **quality_budget** — Complexity, duplication, test ratio limits
548
548
 
@@ -798,7 +798,7 @@ Every candidate passes a 3-gate pipeline before entering quarantine:
798
798
  |------|-------------|
799
799
  | syntax_check | Tree-sitter validation across the configured language grammar map |
800
800
  | placeholder_scan | Catches TODOs, FIXMEs, stubs, placeholder text |
801
- | sast_scan | Offline security analysis, 65 rules, 7 languages |
801
+ | sast_scan | Offline security analysis, 68 rules, 8 languages |
802
802
  | sbom_generate | CycloneDX dependency tracking, 8 ecosystems |
803
803
  | build_check | Runs your project's native build/typecheck |
804
804
  | incremental_verify | Post-coder hook for TS/JS, Go, Rust, Python, and C#; configured by `incremental_verify.*`, not invoked as a registered tool |
@@ -12,6 +12,7 @@ export declare const AgentOutputMemorySchema: z.ZodObject<{
12
12
  }>;
13
13
  kind: z.ZodOptional<z.ZodEnum<{
14
14
  evidence: "evidence";
15
+ todo: "todo";
15
16
  user_preference: "user_preference";
16
17
  project_fact: "project_fact";
17
18
  architecture_decision: "architecture_decision";
@@ -21,7 +22,6 @@ export declare const AgentOutputMemorySchema: z.ZodObject<{
21
22
  test_pattern: "test_pattern";
22
23
  failure_pattern: "failure_pattern";
23
24
  security_note: "security_note";
24
- todo: "todo";
25
25
  scratch: "scratch";
26
26
  }>>;
27
27
  text: z.ZodOptional<z.ZodString>;
@@ -12,8 +12,9 @@ import {
12
12
  shouldRunOnStartup,
13
13
  writeBackupArtifact,
14
14
  writeDoctorArtifact
15
- } from "./index-esg1554h.js";
16
- import"./index-2560cctg.js";
15
+ } from "./index-wvxhynxq.js";
16
+ import"./index-pchpahdf.js";
17
+ import"./index-bfwt3abw.js";
17
18
  import"./index-5e4e2hvv.js";
18
19
  import"./index-p0arc26j.js";
19
20
  import"./index-zgwm4ryv.js";
@@ -1,28 +1,33 @@
1
1
  // @bun
2
2
  import {
3
3
  createCuratorLLMDelegate
4
- } from "./index-cyzzdbvw.js";
5
- import"./index-esg1554h.js";
6
- import"./index-kzfkggjx.js";
7
- import"./index-8w4d325g.js";
8
- import"./index-tgtmbf3r.js";
9
- import"./index-09xpycan.js";
10
- import"./index-2560cctg.js";
11
- import"./index-9wstcavp.js";
12
- import"./index-f7nma02k.js";
4
+ } from "./index-gyzxeza3.js";
5
+ import"./index-4vsgp5a8.js";
13
6
  import"./index-c8s9a3zh.js";
7
+ import"./index-wvxhynxq.js";
8
+ import"./index-9b7a6agd.js";
14
9
  import"./index-91j1sqzm.js";
10
+ import"./index-xg18az81.js";
11
+ import"./index-09xpycan.js";
12
+ import"./index-pchpahdf.js";
13
+ import"./index-bpgqbwmf.js";
14
+ import"./index-dfdg4ws5.js";
15
+ import"./index-bq8kd9r9.js";
16
+ import"./index-kxm3bdjh.js";
17
+ import"./index-xmarctsf.js";
18
+ import"./index-n1sptn1w.js";
19
+ import"./index-bfwt3abw.js";
15
20
  import"./index-v4fcn4tr.js";
16
21
  import"./index-r8f89sm9.js";
17
22
  import"./index-9b7qp18e.js";
18
- import"./index-hkpw4wwa.js";
23
+ import"./index-4r5z8sgw.js";
19
24
  import"./index-57ymmh7h.js";
20
25
  import"./index-5e4e2hvv.js";
21
26
  import"./index-p0arc26j.js";
22
27
  import"./index-jtqkh8jf.js";
23
28
  import"./index-zgwm4ryv.js";
24
- import"./index-3naa2ajc.js";
25
29
  import"./index-293f68mj.js";
30
+ import"./index-3naa2ajc.js";
26
31
  import"./index-b9v501fr.js";
27
32
  import"./index-vn263hqt.js";
28
33
  import"./index-a76rekgs.js";
@@ -11,28 +11,33 @@ import {
11
11
  runCuratorInit,
12
12
  runCuratorPhase,
13
13
  writeCuratorSummary
14
- } from "./index-cyzzdbvw.js";
15
- import"./index-esg1554h.js";
16
- import"./index-kzfkggjx.js";
17
- import"./index-8w4d325g.js";
18
- import"./index-tgtmbf3r.js";
19
- import"./index-09xpycan.js";
20
- import"./index-2560cctg.js";
21
- import"./index-9wstcavp.js";
22
- import"./index-f7nma02k.js";
14
+ } from "./index-gyzxeza3.js";
15
+ import"./index-4vsgp5a8.js";
23
16
  import"./index-c8s9a3zh.js";
17
+ import"./index-wvxhynxq.js";
18
+ import"./index-9b7a6agd.js";
24
19
  import"./index-91j1sqzm.js";
20
+ import"./index-xg18az81.js";
21
+ import"./index-09xpycan.js";
22
+ import"./index-pchpahdf.js";
23
+ import"./index-bpgqbwmf.js";
24
+ import"./index-dfdg4ws5.js";
25
+ import"./index-bq8kd9r9.js";
26
+ import"./index-kxm3bdjh.js";
27
+ import"./index-xmarctsf.js";
28
+ import"./index-n1sptn1w.js";
29
+ import"./index-bfwt3abw.js";
25
30
  import"./index-v4fcn4tr.js";
26
31
  import"./index-r8f89sm9.js";
27
32
  import"./index-9b7qp18e.js";
28
- import"./index-hkpw4wwa.js";
33
+ import"./index-4r5z8sgw.js";
29
34
  import"./index-57ymmh7h.js";
30
35
  import"./index-5e4e2hvv.js";
31
36
  import"./index-p0arc26j.js";
32
37
  import"./index-jtqkh8jf.js";
33
38
  import"./index-zgwm4ryv.js";
34
- import"./index-3naa2ajc.js";
35
39
  import"./index-293f68mj.js";
40
+ import"./index-3naa2ajc.js";
36
41
  import"./index-b9v501fr.js";
37
42
  import"./index-vn263hqt.js";
38
43
  import"./index-a76rekgs.js";
@@ -11,7 +11,7 @@ import {
11
11
  defaultTestFilesFor,
12
12
  detectProjectLanguages,
13
13
  tokenizeCommand
14
- } from "./index-8w4d325g.js";
14
+ } from "./index-xg18az81.js";
15
15
  import"./index-5e4e2hvv.js";
16
16
  import"./index-p0arc26j.js";
17
17
  import"./index-zgwm4ryv.js";
@@ -19,8 +19,8 @@ import"./index-b9v501fr.js";
19
19
  import"./index-a76rekgs.js";
20
20
 
21
21
  // src/lang/dispatch.ts
22
- import * as fs3 from "fs";
23
- import * as path3 from "path";
22
+ import * as fs4 from "fs";
23
+ import * as path4 from "path";
24
24
 
25
25
  // src/lang/registry-backend.ts
26
26
  class LanguageBackendRegistry {
@@ -50,6 +50,10 @@ class LanguageBackendRegistry {
50
50
  }
51
51
  var LANGUAGE_BACKEND_REGISTRY = new LanguageBackendRegistry;
52
52
 
53
+ // src/lang/backends/php.ts
54
+ import * as fs2 from "fs";
55
+ import * as path2 from "path";
56
+
53
57
  // src/lang/framework-detector.ts
54
58
  import * as fs from "fs";
55
59
  import * as path from "path";
@@ -106,6 +110,44 @@ async function selectFramework(dir) {
106
110
  }
107
111
  return null;
108
112
  }
113
+ async function selectTestFramework(dir) {
114
+ if (detectLaravelProject(dir)) {
115
+ return {
116
+ name: "php-artisan",
117
+ cmd: ["php", "artisan", "test"],
118
+ cwd: dir,
119
+ detectedVia: "Laravel signals (artisan / composer.json / config/app.php)"
120
+ };
121
+ }
122
+ if (fs2.existsSync(path2.join(dir, "Pest.php"))) {
123
+ return {
124
+ name: "pest",
125
+ cmd: [phpVendorBin("pest")],
126
+ cwd: dir,
127
+ detectedVia: "Pest.php"
128
+ };
129
+ }
130
+ if (fs2.existsSync(path2.join(dir, "phpunit.xml"))) {
131
+ return {
132
+ name: "phpunit",
133
+ cmd: [phpVendorBin("phpunit")],
134
+ cwd: dir,
135
+ detectedVia: "phpunit.xml"
136
+ };
137
+ }
138
+ if (fs2.existsSync(path2.join(dir, "phpunit.xml.dist"))) {
139
+ return {
140
+ name: "phpunit",
141
+ cmd: [phpVendorBin("phpunit")],
142
+ cwd: dir,
143
+ detectedVia: "phpunit.xml.dist"
144
+ };
145
+ }
146
+ return null;
147
+ }
148
+ function phpVendorBin(name) {
149
+ return path2.join("vendor", "bin", process.platform === "win32" ? `${name}.bat` : name);
150
+ }
109
151
  function buildPhpBackend() {
110
152
  const profile = LANGUAGE_REGISTRY.get(PROFILE_ID);
111
153
  if (!profile) {
@@ -113,13 +155,14 @@ function buildPhpBackend() {
113
155
  }
114
156
  return {
115
157
  ...defaultBackendFor(profile),
116
- selectFramework
158
+ selectFramework,
159
+ selectTestFramework
117
160
  };
118
161
  }
119
162
 
120
163
  // src/lang/backends/typescript.ts
121
- import * as fs2 from "fs";
122
- import * as path2 from "path";
164
+ import * as fs3 from "fs";
165
+ import * as path3 from "path";
123
166
  var PROFILE_ID2 = "typescript";
124
167
  var IMPORT_REGEX_ES = /import\s+[\s\S]*?\s+from\s+['"]([^'"]+)['"]/g;
125
168
  var IMPORT_REGEX_BARE = /import\s+['"]([^'"]+)['"]/g;
@@ -128,7 +171,7 @@ var IMPORT_REGEX_DYNAMIC = /import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
128
171
  var IMPORT_REGEX_REEXPORT = /export\s+(?:\{[^}]*\}|\*)\s+from\s+['"]([^'"]+)['"]/g;
129
172
  function readPackageJsonRaw(dir) {
130
173
  try {
131
- const content = fs2.readFileSync(path2.join(dir, "package.json"), "utf-8");
174
+ const content = fs3.readFileSync(path3.join(dir, "package.json"), "utf-8");
132
175
  return JSON.parse(content);
133
176
  } catch {
134
177
  return null;
@@ -177,7 +220,7 @@ function selectionFromFramework(profile, fwName, dir, detectedVia) {
177
220
  filesIgnored: false
178
221
  };
179
222
  }
180
- async function selectTestFramework(dir) {
223
+ async function selectTestFramework2(dir) {
181
224
  const profile = LANGUAGE_REGISTRY.get(PROFILE_ID2);
182
225
  if (!profile)
183
226
  return null;
@@ -295,7 +338,7 @@ function buildTypescriptBackend() {
295
338
  }
296
339
  return {
297
340
  ...profile,
298
- selectTestFramework,
341
+ selectTestFramework: selectTestFramework2,
299
342
  buildTestCommand,
300
343
  parseTestOutput,
301
344
  extractImports,
@@ -356,7 +399,7 @@ var MANIFEST_FILES = [
356
399
  var _MANIFEST_SET = new Set(MANIFEST_FILES);
357
400
  function safeReaddirSet(dir) {
358
401
  try {
359
- return new Set(fs3.readdirSync(dir));
402
+ return new Set(fs4.readdirSync(dir));
360
403
  } catch {
361
404
  return new Set;
362
405
  }
@@ -370,7 +413,7 @@ function manifestHash(dir) {
370
413
  if (!entries.has(name))
371
414
  continue;
372
415
  try {
373
- const stat = fs3.statSync(path3.join(dir, name));
416
+ const stat = fs4.statSync(path4.join(dir, name));
374
417
  parts.push(`${name}:${stat.size}:${stat.mtimeMs}:${stat.ino}`);
375
418
  } catch {}
376
419
  }
@@ -378,7 +421,7 @@ function manifestHash(dir) {
378
421
  }
379
422
  var manifestRootCache = new Map;
380
423
  function findManifestRoot(start) {
381
- const resolved = path3.resolve(start);
424
+ const resolved = path4.resolve(start);
382
425
  const cached = manifestRootCache.get(resolved);
383
426
  if (cached !== undefined)
384
427
  return cached;
@@ -397,7 +440,7 @@ function findManifestRoot(start) {
397
440
  return cur;
398
441
  }
399
442
  }
400
- const parent = path3.dirname(cur);
443
+ const parent = path4.dirname(cur);
401
444
  if (parent === cur)
402
445
  break;
403
446
  cur = parent;
@@ -6,7 +6,7 @@ import {
6
6
  loadPlanJsonOnly,
7
7
  mergeDurableGateEntriesFromEvidence,
8
8
  readDurableGateEvidence
9
- } from "./index-kzfkggjx.js";
9
+ } from "./index-9b7a6agd.js";
10
10
  import"./index-91j1sqzm.js";
11
11
  import"./index-r8f89sm9.js";
12
12
  import"./index-9b7qp18e.js";
@@ -17,8 +17,8 @@ import"./index-jtqkh8jf.js";
17
17
  import {
18
18
  log
19
19
  } from "./index-zgwm4ryv.js";
20
- import"./index-3naa2ajc.js";
21
20
  import"./index-293f68mj.js";
21
+ import"./index-3naa2ajc.js";
22
22
  import"./index-b9v501fr.js";
23
23
  import"./index-vn263hqt.js";
24
24
  import"./index-a76rekgs.js";
@@ -11,8 +11,8 @@ import {
11
11
  recordGateEvidence
12
12
  } from "./index-r8f89sm9.js";
13
13
  import"./index-9b7qp18e.js";
14
- import"./index-3naa2ajc.js";
15
14
  import"./index-293f68mj.js";
15
+ import"./index-3naa2ajc.js";
16
16
  import"./index-b9v501fr.js";
17
17
  import"./index-vn263hqt.js";
18
18
  import"./index-a76rekgs.js";
@@ -1,29 +1,34 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-w15984gg.js";
5
- import"./index-cyzzdbvw.js";
6
- import"./index-esg1554h.js";
7
- import"./index-kzfkggjx.js";
8
- import"./index-8w4d325g.js";
9
- import"./index-tgtmbf3r.js";
10
- import"./index-09xpycan.js";
11
- import"./index-2560cctg.js";
12
- import"./index-9wstcavp.js";
13
- import"./index-f7nma02k.js";
4
+ } from "./index-f45hbd5x.js";
5
+ import"./index-gyzxeza3.js";
6
+ import"./index-4vsgp5a8.js";
14
7
  import"./index-c8s9a3zh.js";
8
+ import"./index-wvxhynxq.js";
9
+ import"./index-9b7a6agd.js";
15
10
  import"./index-91j1sqzm.js";
11
+ import"./index-xg18az81.js";
12
+ import"./index-09xpycan.js";
13
+ import"./index-pchpahdf.js";
14
+ import"./index-bpgqbwmf.js";
15
+ import"./index-dfdg4ws5.js";
16
+ import"./index-bq8kd9r9.js";
17
+ import"./index-kxm3bdjh.js";
18
+ import"./index-xmarctsf.js";
19
+ import"./index-n1sptn1w.js";
20
+ import"./index-bfwt3abw.js";
16
21
  import"./index-v4fcn4tr.js";
17
22
  import"./index-r8f89sm9.js";
18
23
  import"./index-9b7qp18e.js";
19
- import"./index-hkpw4wwa.js";
24
+ import"./index-4r5z8sgw.js";
20
25
  import"./index-57ymmh7h.js";
21
26
  import"./index-5e4e2hvv.js";
22
27
  import"./index-p0arc26j.js";
23
28
  import"./index-jtqkh8jf.js";
24
29
  import"./index-zgwm4ryv.js";
25
- import"./index-3naa2ajc.js";
26
30
  import"./index-293f68mj.js";
31
+ import"./index-3naa2ajc.js";
27
32
  import"./index-b9v501fr.js";
28
33
  import"./index-vn263hqt.js";
29
34
  import"./index-a76rekgs.js";
@@ -1,9 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailLog
4
- } from "./index-m1xjr58n.js";
5
- import"./index-tgtmbf3r.js";
6
- import"./index-2560cctg.js";
4
+ } from "./index-zej8cy0j.js";
5
+ import"./index-4vsgp5a8.js";
6
+ import"./index-pchpahdf.js";
7
+ import"./index-bfwt3abw.js";
7
8
  import"./index-5e4e2hvv.js";
8
9
  import"./index-p0arc26j.js";
9
10
  import"./index-zgwm4ryv.js";
@@ -5,28 +5,33 @@ import {
5
5
  isHiveEligible,
6
6
  promoteFromSwarm,
7
7
  promoteToHive
8
- } from "./index-cyzzdbvw.js";
9
- import"./index-esg1554h.js";
10
- import"./index-kzfkggjx.js";
11
- import"./index-8w4d325g.js";
12
- import"./index-tgtmbf3r.js";
13
- import"./index-09xpycan.js";
14
- import"./index-2560cctg.js";
15
- import"./index-9wstcavp.js";
16
- import"./index-f7nma02k.js";
8
+ } from "./index-gyzxeza3.js";
9
+ import"./index-4vsgp5a8.js";
17
10
  import"./index-c8s9a3zh.js";
11
+ import"./index-wvxhynxq.js";
12
+ import"./index-9b7a6agd.js";
18
13
  import"./index-91j1sqzm.js";
14
+ import"./index-xg18az81.js";
15
+ import"./index-09xpycan.js";
16
+ import"./index-pchpahdf.js";
17
+ import"./index-bpgqbwmf.js";
18
+ import"./index-dfdg4ws5.js";
19
+ import"./index-bq8kd9r9.js";
20
+ import"./index-kxm3bdjh.js";
21
+ import"./index-xmarctsf.js";
22
+ import"./index-n1sptn1w.js";
23
+ import"./index-bfwt3abw.js";
19
24
  import"./index-v4fcn4tr.js";
20
25
  import"./index-r8f89sm9.js";
21
26
  import"./index-9b7qp18e.js";
22
- import"./index-hkpw4wwa.js";
27
+ import"./index-4r5z8sgw.js";
23
28
  import"./index-57ymmh7h.js";
24
29
  import"./index-5e4e2hvv.js";
25
30
  import"./index-p0arc26j.js";
26
31
  import"./index-jtqkh8jf.js";
27
32
  import"./index-zgwm4ryv.js";
28
- import"./index-3naa2ajc.js";
29
33
  import"./index-293f68mj.js";
34
+ import"./index-3naa2ajc.js";
30
35
  import"./index-b9v501fr.js";
31
36
  import"./index-vn263hqt.js";
32
37
  import"./index-a76rekgs.js";
@@ -1,10 +1,10 @@
1
1
  // @bun
2
- import {
3
- handleGuardrailExplain
4
- } from "./index-w15984gg.js";
5
2
  import {
6
3
  handleGuardrailLog
7
- } from "./index-m1xjr58n.js";
4
+ } from "./index-zej8cy0j.js";
5
+ import {
6
+ handleGuardrailExplain
7
+ } from "./index-f45hbd5x.js";
8
8
  import {
9
9
  COMMAND_REGISTRY,
10
10
  SWARM_COMMAND_TOOL_ALLOWLIST,
@@ -80,32 +80,37 @@ import {
80
80
  handleWriteRetroCommand,
81
81
  normalizeSwarmCommandInput,
82
82
  resolveCommand
83
- } from "./index-cyzzdbvw.js";
84
- import"./index-esg1554h.js";
85
- import"./index-kzfkggjx.js";
86
- import"./index-8w4d325g.js";
87
- import"./index-tgtmbf3r.js";
83
+ } from "./index-gyzxeza3.js";
84
+ import"./index-4vsgp5a8.js";
85
+ import"./index-c8s9a3zh.js";
86
+ import"./index-wvxhynxq.js";
87
+ import"./index-9b7a6agd.js";
88
+ import"./index-91j1sqzm.js";
89
+ import"./index-xg18az81.js";
88
90
  import"./index-09xpycan.js";
89
91
  import {
90
92
  AGENT_TOOL_MAP,
91
93
  ORCHESTRATOR_NAME,
92
94
  stripKnownSwarmPrefix
93
- } from "./index-2560cctg.js";
94
- import"./index-9wstcavp.js";
95
- import"./index-f7nma02k.js";
96
- import"./index-c8s9a3zh.js";
97
- import"./index-91j1sqzm.js";
95
+ } from "./index-pchpahdf.js";
96
+ import"./index-bpgqbwmf.js";
97
+ import"./index-dfdg4ws5.js";
98
+ import"./index-bq8kd9r9.js";
99
+ import"./index-kxm3bdjh.js";
100
+ import"./index-xmarctsf.js";
101
+ import"./index-n1sptn1w.js";
102
+ import"./index-bfwt3abw.js";
98
103
  import"./index-v4fcn4tr.js";
99
104
  import"./index-r8f89sm9.js";
100
105
  import"./index-9b7qp18e.js";
101
- import"./index-hkpw4wwa.js";
106
+ import"./index-4r5z8sgw.js";
102
107
  import"./index-57ymmh7h.js";
103
108
  import"./index-5e4e2hvv.js";
104
109
  import"./index-p0arc26j.js";
105
110
  import"./index-jtqkh8jf.js";
106
111
  import"./index-zgwm4ryv.js";
107
- import"./index-3naa2ajc.js";
108
112
  import"./index-293f68mj.js";
113
+ import"./index-3naa2ajc.js";
109
114
  import"./index-b9v501fr.js";
110
115
  import"./index-vn263hqt.js";
111
116
  import"./index-a76rekgs.js";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  stripKnownSwarmPrefix
4
- } from "./index-2560cctg.js";
4
+ } from "./index-pchpahdf.js";
5
5
  import {
6
6
  init_logger,
7
7
  warn
@@ -0,0 +1,14 @@
1
+ // @bun
2
+ // src/hooks/knowledge-types.ts
3
+ var KNOWLEDGE_SCHEMA_VERSION = 2;
4
+ var INACTIVE_STATUSES = new Set([
5
+ "archived",
6
+ "quarantined",
7
+ "quarantined_unactionable"
8
+ ]);
9
+ var OUTCOME_BLOCK_THRESHOLD = -0.3;
10
+ function isActiveStatus(status) {
11
+ return !INACTIVE_STATUSES.has(status ?? "");
12
+ }
13
+
14
+ export { KNOWLEDGE_SCHEMA_VERSION, OUTCOME_BLOCK_THRESHOLD, isActiveStatus };