opencode-swarm 7.192.1 → 7.192.2

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 (115) hide show
  1. package/.opencode/skills/critic-gate/SKILL.md +2 -1
  2. package/.opencode/skills/execute/SKILL.md +1 -1
  3. package/README.md +5 -3
  4. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  5. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  6. package/dist/agents/critic.d.ts +2 -2
  7. package/dist/cli/{auto-checkpoint-kkakqktp.js → auto-checkpoint-735m8sz7.js} +8 -8
  8. package/dist/cli/{capability-probe-3mgxcfr9.js → capability-probe-rty1315z.js} +1 -1
  9. package/dist/cli/{checkpoint-cefw75xe.js → checkpoint-ptzc5jev.js} +16 -16
  10. package/dist/cli/{coder-settlement-tgdjczyp.js → coder-settlement-hh5165m1.js} +12 -12
  11. package/dist/cli/{config-doctor-sns7gbj2.js → config-doctor-wzzvhpcr.js} +15 -15
  12. package/dist/cli/{core-q8xvp8bw.js → core-0jarm64k.js} +3 -3
  13. package/dist/cli/{curation-policy-2q5xs0xg.js → curation-policy-yzdznz4z.js} +6 -6
  14. package/dist/cli/{curator-drift-1n3akmda.js → curator-drift-f4aqxz9e.js} +8 -8
  15. package/dist/cli/{curator-mgdsxrpv.js → curator-f7crssw2.js} +43 -43
  16. package/dist/cli/curator-llm-factory-kxnzvhje.js +82 -0
  17. package/dist/cli/{doctor-knowledge-receipt-phase-id-33bp8fcs.js → doctor-knowledge-receipt-phase-id-qvp1h3xv.js} +8 -8
  18. package/dist/cli/{evidence-summary-service-sb888pg8.js → evidence-summary-service-379skych.js} +19 -19
  19. package/dist/cli/{gate-evidence-rmk87c6m.js → gate-evidence-b4cfrrgn.js} +7 -7
  20. package/dist/cli/guardrail-explain-tcnfc3te.js +83 -0
  21. package/dist/cli/{guardrail-log-d18dcweh.js → guardrail-log-xe1evybk.js} +7 -7
  22. package/dist/cli/{guardrail-reset-1xeeetk7.js → guardrail-reset-jwx5hsgp.js} +43 -43
  23. package/dist/cli/{hive-promoter-44grgbq4.js → hive-promoter-nks9a9s8.js} +43 -43
  24. package/dist/cli/{index-xjqa26fs.js → index-0e1nxkte.js} +1 -1
  25. package/dist/cli/{index-63v3gmgr.js → index-1n7sf9gz.js} +2 -2
  26. package/dist/cli/{index-ajp4dabz.js → index-25zjz6kv.js} +5 -5
  27. package/dist/cli/{index-af3nmk6c.js → index-29z0w323.js} +7 -7
  28. package/dist/cli/{index-fsm9gv1p.js → index-2y7y0bxf.js} +43 -43
  29. package/dist/cli/{index-advcaree.js → index-4qreeddq.js} +4 -4
  30. package/dist/cli/{index-nb1c3342.js → index-4tfr4j1a.js} +7 -7
  31. package/dist/cli/{index-k6h66zm3.js → index-4twjbsfw.js} +2 -2
  32. package/dist/cli/{index-xw19x0t7.js → index-5dws7eyb.js} +1 -1
  33. package/dist/cli/{index-t0se5zwe.js → index-5gy5dc2n.js} +2 -2
  34. package/dist/cli/{index-pkgbrrn7.js → index-5s74qd5b.js} +1 -1
  35. package/dist/cli/{index-f32hs2vt.js → index-7a92gwbg.js} +4 -4
  36. package/dist/cli/{index-3txrbsa1.js → index-7bppy3ve.js} +4 -4
  37. package/dist/cli/{index-km4x7yfb.js → index-878ksabw.js} +11 -11
  38. package/dist/cli/{index-6shk3n43.js → index-89826pb5.js} +2 -2
  39. package/dist/cli/{index-ga1pcs49.js → index-8zj647hc.js} +1 -1
  40. package/dist/cli/{index-w52xyp9v.js → index-914wsfyy.js} +2 -2
  41. package/dist/cli/{index-b79a8pc2.js → index-a83gmv2e.js} +2 -2
  42. package/dist/cli/{index-d4cjbm4p.js → index-a9m7h5v0.js} +2 -2
  43. package/dist/cli/{index-50b8f6qz.js → index-asm2r4g2.js} +4 -4
  44. package/dist/cli/{index-yfmgbhwz.js → index-ba87gkb4.js} +20 -6
  45. package/dist/cli/{index-kvtwwj8b.js → index-bgzpw6ge.js} +1 -1
  46. package/dist/cli/{index-2wps5fec.js → index-br28jc6d.js} +3 -3
  47. package/dist/cli/{index-sgxbqba0.js → index-bzfn85kq.js} +119 -55
  48. package/dist/cli/{index-ysazjncb.js → index-cf003krm.js} +6 -6
  49. package/dist/cli/{index-4cm1p2kj.js → index-dt4cjxbz.js} +1 -1
  50. package/dist/cli/{index-f6e44xh2.js → index-dtet46e6.js} +7 -7
  51. package/dist/cli/{index-8bx6vhzk.js → index-e8k0v19e.js} +1 -1
  52. package/dist/cli/{index-mhqh2dc9.js → index-eaess7dm.js} +1 -1
  53. package/dist/cli/{index-r3gphy10.js → index-ejq082zj.js} +5 -5
  54. package/dist/cli/{index-ejfmgkt0.js → index-f54stv77.js} +3 -3
  55. package/dist/cli/{index-t433r606.js → index-fzqn2kk8.js} +2 -2
  56. package/dist/cli/{index-28zgn6sm.js → index-g8jd3h4r.js} +2 -2
  57. package/dist/cli/{index-s81tvz98.js → index-hcsz7bhg.js} +3 -3
  58. package/dist/cli/{index-jdw63xyd.js → index-k96fx4yw.js} +2 -2
  59. package/dist/cli/{index-9b6bxe9b.js → index-mbn4vn3z.js} +1 -1
  60. package/dist/cli/{index-7vnr5cmp.js → index-mtqwyjrg.js} +1 -1
  61. package/dist/cli/{index-025wg2re.js → index-nwswxes7.js} +3 -3
  62. package/dist/cli/{index-cje7tt58.js → index-q0bctx7k.js} +1 -1
  63. package/dist/cli/{index-vf6pqke0.js → index-qp3twbdz.js} +45 -45
  64. package/dist/cli/{index-vt8hk0pt.js → index-qta3x82z.js} +244 -106
  65. package/dist/cli/{index-v3bmeqqh.js → index-w8e73tp0.js} +12 -7
  66. package/dist/cli/{index-0yrsvwdf.js → index-w917g452.js} +6 -6
  67. package/dist/cli/{index-ney8qpg3.js → index-w9y482mp.js} +1 -1
  68. package/dist/cli/{index-edk2sgse.js → index-xen0j48x.js} +2 -2
  69. package/dist/cli/{index-867d9dhf.js → index-xf5v44qh.js} +3 -3
  70. package/dist/cli/{index-bwh9196c.js → index-ypvz2c60.js} +7 -7
  71. package/dist/cli/{index-95hc7xn4.js → index-yte4hqhv.js} +3 -3
  72. package/dist/cli/index.d.ts +2 -2
  73. package/dist/cli/index.js +60 -54
  74. package/dist/cli/{knowledge-escalator-naq700x5.js → knowledge-escalator-gzzr7cy2.js} +14 -14
  75. package/dist/cli/{knowledge-events-mmh5cya6.js → knowledge-events-b16yc189.js} +12 -12
  76. package/dist/cli/{knowledge-link-76egdqc9.js → knowledge-link-a5tvjqdt.js} +5 -5
  77. package/dist/cli/{knowledge-store-9dxr9jb9.js → knowledge-store-arj3by4h.js} +6 -6
  78. package/dist/cli/{knowledge-validator-eze3s6fn.js → knowledge-validator-b3qhjg0t.js} +8 -8
  79. package/dist/cli/{mcp-1x2tpk71.js → mcp-972t0jt0.js} +1 -1
  80. package/dist/cli/{model-preflight-hgb7kf5d.js → model-preflight-f1xvxk6e.js} +43 -43
  81. package/dist/cli/{pending-delegations-zg4q1k5q.js → pending-delegations-fv5xz799.js} +12 -12
  82. package/dist/cli/{pr-subscriptions-zw8aev5s.js → pr-subscriptions-4mcwj33s.js} +12 -12
  83. package/dist/cli/{pr-workflow-gate-dcbpd451.js → pr-workflow-gate-ap5cp211.js} +43 -43
  84. package/dist/cli/{runner-y529qa4d.js → runner-8qybgy4n.js} +6 -6
  85. package/dist/cli/{scan-cursor-pdxmndd0.js → scan-cursor-tceyckdx.js} +7 -7
  86. package/dist/cli/{schema-hzz32642.js → schema-pqevpe3m.js} +1 -1
  87. package/dist/cli/{scope-persistence-h4b6p951.js → scope-persistence-ta6ydymv.js} +15 -15
  88. package/dist/cli/{server-7gd7tqt5.js → server-s9bfax7h.js} +43 -43
  89. package/dist/cli/{skill-generator-7g7sca90.js → skill-generator-xdg4626x.js} +16 -16
  90. package/dist/cli/{snapshot-coordination-init-4q5ykq22.js → snapshot-coordination-init-wn0hnwyv.js} +43 -43
  91. package/dist/cli/{speckit-checkoff-5bfxs8r7.js → speckit-checkoff-8x139jpf.js} +4 -4
  92. package/dist/cli/{telemetry-9szfdfqv.js → telemetry-qaymh4gg.js} +1 -1
  93. package/dist/cli/{workspace-snapshot-nre732xt.js → workspace-snapshot-vfpnxjsp.js} +3 -3
  94. package/dist/cli/{worktree-collision-ownership-327d06qw.js → worktree-collision-ownership-as8hnnff.js} +13 -13
  95. package/dist/cli/{worktree-isolation-zqzs3wkk.js → worktree-isolation-7vrs8t9b.js} +49 -43
  96. package/dist/commands/turbo.d.ts +4 -3
  97. package/dist/config/constants.d.ts +2 -2
  98. package/dist/config/plan-schema.d.ts +16 -0
  99. package/dist/epic/phase-readiness.d.ts +4 -2
  100. package/dist/evaluation/ephemeral-agent-dispatcher.d.ts +11 -0
  101. package/dist/failures/provider-message-error.d.ts +32 -0
  102. package/dist/hooks/delegation-gate/worktree-isolation.d.ts +40 -0
  103. package/dist/hooks/delegation-gate.d.ts +13 -0
  104. package/dist/hooks/extractors.d.ts +2 -0
  105. package/dist/hooks/guardrails/index.d.ts +2 -0
  106. package/dist/hooks/guardrails/parallel-gate-attribution.d.ts +10 -0
  107. package/dist/index.js +415 -412
  108. package/dist/plan/ledger.d.ts +21 -3
  109. package/dist/sandbox/linux/bubblewrap-executor.d.ts +24 -0
  110. package/dist/services/skill-optimizer/store.d.ts +2 -2
  111. package/dist/tools/phase-complete.d.ts +4 -0
  112. package/opencode-swarm.schema.json +1 -1
  113. package/package.json +1 -1
  114. package/dist/cli/curator-llm-factory-tfn0cp68.js +0 -82
  115. package/dist/cli/guardrail-explain-n9ndp99q.js +0 -83
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  readKnowledge,
4
4
  transactKnowledge
5
- } from "./index-af3nmk6c.js";
5
+ } from "./index-29z0w323.js";
6
6
  import {
7
7
  resolveKnowledgeStoreDir
8
- } from "./index-kvtwwj8b.js";
8
+ } from "./index-bgzpw6ge.js";
9
9
  import {
10
10
  init_git_executable,
11
11
  resolveGitExecutableAsync
@@ -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.192.1",
24
+ version: "7.192.2",
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",
@@ -1932,7 +1932,7 @@ var init_schema = __esm(() => {
1932
1932
  worktree: WorktreeIsolationConfigSchema.optional().describe("Worktree isolation policy for parallel coder dispatch lanes (general surface; Lean Turbo keeps its legacy per-mode fields)."),
1933
1933
  turbo: TurboConfigSchema.optional().describe("Turbo execution strategy block (Phase 1). Absent means current behavior unchanged."),
1934
1934
  epic: EpicConfigSchema.optional().describe("Epic Mode block: one plan = one epic delivered in conflict-free parallel waves. Opt in with `mode.enabled: true`, then `/swarm epic start`. Needs no `turbo` block (legacy `turbo.epic` is still accepted and migrated here)."),
1935
- turbo_mode: exports_external.boolean().default(false).optional().describe("Bypass reviewer/test gates for rapid iteration (v6.40). When true, new sessions start with turbo mode on (session default); /swarm turbo still toggles per session. Directory-less constructions default off."),
1935
+ turbo_mode: exports_external.boolean().default(false).optional().describe("Turbo mode for rapid iteration (v6.40): skips phase_complete Gates 1\u20135 and lets a non-Tier-3 task be re-dispatched to the coder before Stage A passes; per-task Stage A and Stage B (reviewer + test_engineer) are still required. When true, new sessions start with turbo mode on (session default); /swarm turbo still toggles per session. Directory-less constructions default off."),
1936
1936
  quiet: exports_external.boolean().default(true).optional().describe("Suppress non-critical startup warnings (default true keeps the TUI clean). Set false to restore verbose warnings for debugging."),
1937
1937
  version_check: exports_external.boolean().default(true).optional().describe("Background staleness check against npm, throttled to once per 24h (issue #675). Set false to fully disable the network call."),
1938
1938
  full_auto: exports_external.object({
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  observeStoreHealth
4
- } from "./index-k6h66zm3.js";
4
+ } from "./index-4twjbsfw.js";
5
5
  import {
6
6
  telemetry
7
- } from "./index-7vnr5cmp.js";
7
+ } from "./index-mtqwyjrg.js";
8
8
  import {
9
9
  init_logger,
10
10
  warn
@@ -5,18 +5,18 @@ import {
5
5
  import {
6
6
  effectiveRetrievalOutcomes,
7
7
  readAuthoritativeKnowledgeCounterRollups
8
- } from "./index-advcaree.js";
8
+ } from "./index-4qreeddq.js";
9
9
  import {
10
10
  ALLOWED_SKILL_PATH_PREFIXES,
11
11
  validateSkillPath
12
- } from "./index-3txrbsa1.js";
12
+ } from "./index-7bppy3ve.js";
13
13
  import {
14
14
  computeOutcomeSignal,
15
15
  readKnowledge,
16
16
  resolveHiveKnowledgePath,
17
17
  resolveSwarmKnowledgePath,
18
18
  transactKnowledge
19
- } from "./index-af3nmk6c.js";
19
+ } from "./index-29z0w323.js";
20
20
  import {
21
21
  appendCappedJsonl,
22
22
  resolveRetentionCap
@@ -27,7 +27,7 @@ import {
27
27
  import {
28
28
  atomicWriteFileAnyRoot,
29
29
  atomicWriteSwarmFile
30
- } from "./index-025wg2re.js";
30
+ } from "./index-nwswxes7.js";
31
31
  import {
32
32
  advisoryWarn,
33
33
  init_warning_buffer
@@ -4,20 +4,20 @@ import {
4
4
  projectDbExists,
5
5
  withImmediateTransaction,
6
6
  withProjectDbReadOnly
7
- } from "./index-ga1pcs49.js";
7
+ } from "./index-8zj647hc.js";
8
8
  import {
9
9
  derivePlanId,
10
10
  derivePlanIdentityHash
11
11
  } from "./index-7pmbnjvj.js";
12
12
  import {
13
13
  withEvidenceLock
14
- } from "./index-8bx6vhzk.js";
14
+ } from "./index-e8k0v19e.js";
15
15
  import {
16
16
  assertProjectRoot
17
17
  } from "./index-t7hmqgjy.js";
18
18
  import {
19
19
  emit
20
- } from "./index-7vnr5cmp.js";
20
+ } from "./index-mtqwyjrg.js";
21
21
  import {
22
22
  ExecutionProfileSchema,
23
23
  PlanSchema,
@@ -27,11 +27,11 @@ import {
27
27
  import {
28
28
  init_loader,
29
29
  loadPluginConfig
30
- } from "./index-ney8qpg3.js";
30
+ } from "./index-w9y482mp.js";
31
31
  import {
32
32
  init_package,
33
33
  package_default
34
- } from "./index-b79a8pc2.js";
34
+ } from "./index-a83gmv2e.js";
35
35
  import {
36
36
  criticalWarn,
37
37
  init_logger,
@@ -1976,6 +1976,20 @@ async function loadLastApprovedPlan(directory, expectedPlanId) {
1976
1976
  const integrity = await readLedgerEventsWithIntegrity(directory);
1977
1977
  return findLastApprovedSnapshot(integrity.events, expectedPlanId);
1978
1978
  }
1979
+ function approvedSnapshotCoversPlan(approved, plan) {
1980
+ const current = computePlanStructureHash(plan);
1981
+ if (approved.payloadHash === current)
1982
+ return true;
1983
+ if (approved.plan.current_phase === plan.current_phase)
1984
+ return false;
1985
+ if (computePlanStructureHash(approved.plan) !== approved.payloadHash) {
1986
+ return false;
1987
+ }
1988
+ return computePlanStructureHash({
1989
+ ...approved.plan,
1990
+ current_phase: plan.current_phase
1991
+ }) === current;
1992
+ }
1979
1993
  async function loadLastPlanCriticApprovedSnapshot(directory, expectedPlanId) {
1980
1994
  const integrity = await readLedgerEventsWithIntegrity(directory);
1981
1995
  return findLastApprovedSnapshot(integrity.events, expectedPlanId, (payload) => payload.approval?.source === "plan_critic_gate");
@@ -2050,4 +2064,4 @@ var _internals = {
2050
2064
  randomUUID: () => crypto.randomUUID()
2051
2065
  };
2052
2066
 
2053
- export { renderPlanningProfileDirective, resolvePlanningProfile, normalizeExecutionProfileForHash, LedgerStaleWriterError, computePlanLedgerHash, computePlanStructureHash, computeCurrentPlanHash, ledgerExists, getLatestLedgerSeq, readLedgerEvents, initLedger, readPlanEpochIdentity, getOrAdoptPlanEpochUnderLock, appendLedgerEvent, takeSnapshotWithRetry, takeSnapshotEvent, replaceTruncatedLedgerWithRecoveryRoot, clearPlanLedgerForReset, replacePlanLedgerWithRoot, replayFromLedger, peekPlanFromLedger, replayFromLedgerWithStatus, readLedgerEventsWithIntegrity, loadLastApprovedPlan, loadLastPlanCriticApprovedSnapshot };
2067
+ export { renderPlanningProfileDirective, resolvePlanningProfile, normalizeExecutionProfileForHash, LedgerStaleWriterError, computePlanLedgerHash, computePlanStructureHash, computeCurrentPlanHash, ledgerExists, getLatestLedgerSeq, readLedgerEvents, initLedger, readPlanEpochIdentity, getOrAdoptPlanEpochUnderLock, appendLedgerEvent, takeSnapshotWithRetry, takeSnapshotEvent, replaceTruncatedLedgerWithRecoveryRoot, clearPlanLedgerForReset, replacePlanLedgerWithRoot, replayFromLedger, peekPlanFromLedger, replayFromLedgerWithStatus, readLedgerEventsWithIntegrity, loadLastApprovedPlan, approvedSnapshotCoversPlan, loadLastPlanCriticApprovedSnapshot };
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  atomicWriteFile
4
- } from "./index-63v3gmgr.js";
4
+ } from "./index-1n7sf9gz.js";
5
5
  import {
6
6
  canonicalRootKeyFresh
7
7
  } from "./index-fzpt2djt.js";
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  readEffectiveSpecSync
4
- } from "./index-pkgbrrn7.js";
4
+ } from "./index-5s74qd5b.js";
5
5
  import {
6
6
  readSwarmFileAsync
7
- } from "./index-mhqh2dc9.js";
7
+ } from "./index-eaess7dm.js";
8
8
  import {
9
9
  DURABILITY_CLASSES,
10
10
  DbWriteError,
@@ -13,7 +13,7 @@ import {
13
13
  classifyDbWriteError,
14
14
  getProjectDb,
15
15
  projectDbExists
16
- } from "./index-ga1pcs49.js";
16
+ } from "./index-8zj647hc.js";
17
17
  import {
18
18
  _internals,
19
19
  canonicalRootKeyFresh
@@ -1047,7 +1047,7 @@ async function _createExecutor() {
1047
1047
  return null;
1048
1048
  }
1049
1049
  async function _createLinuxExecutor() {
1050
- const { SandboxCapabilityProbe: SandboxCapabilityProbe2, isBubblewrapAvailable } = await import("./capability-probe-3mgxcfr9.js");
1050
+ const { SandboxCapabilityProbe: SandboxCapabilityProbe2, isBubblewrapAvailable } = await import("./capability-probe-rty1315z.js");
1051
1051
  await new SandboxCapabilityProbe2().detect();
1052
1052
  if (!isBubblewrapAvailable()) {
1053
1053
  return null;
@@ -1067,7 +1067,7 @@ async function _createMacOSExecutor() {
1067
1067
  }
1068
1068
  return null;
1069
1069
  }
1070
- const { SandboxCapabilityProbe: SandboxCapabilityProbe2, isSandboxExecAvailable } = await import("./capability-probe-3mgxcfr9.js");
1070
+ const { SandboxCapabilityProbe: SandboxCapabilityProbe2, isSandboxExecAvailable } = await import("./capability-probe-rty1315z.js");
1071
1071
  await new SandboxCapabilityProbe2().detect();
1072
1072
  if (!isSandboxExecAvailable()) {
1073
1073
  return null;
@@ -1080,7 +1080,7 @@ async function _createMacOSExecutor() {
1080
1080
  }
1081
1081
  }
1082
1082
  async function _createWindowsExecutor() {
1083
- const { SandboxCapabilityProbe: SandboxCapabilityProbe2, isWindowsSandboxAvailable } = await import("./capability-probe-3mgxcfr9.js");
1083
+ const { SandboxCapabilityProbe: SandboxCapabilityProbe2, isWindowsSandboxAvailable } = await import("./capability-probe-rty1315z.js");
1084
1084
  await new SandboxCapabilityProbe2().detect();
1085
1085
  if (!isWindowsSandboxAvailable()) {
1086
1086
  return null;
@@ -1111,6 +1111,7 @@ var init_executor = __esm(() => {
1111
1111
  // src/sandbox/linux/bubblewrap-executor.ts
1112
1112
  import { spawnSync as spawnSync4 } from "child_process";
1113
1113
  import { existsSync as existsSync3 } from "fs";
1114
+ import { tmpdir as tmpdir5 } from "os";
1114
1115
  function resolveBwrapBinary() {
1115
1116
  try {
1116
1117
  if (existsSync3(BWRAP_ABSOLUTE)) {
@@ -1119,10 +1120,84 @@ function resolveBwrapBinary() {
1119
1120
  } catch {}
1120
1121
  return "bwrap";
1121
1122
  }
1123
+ function shellQuote(s) {
1124
+ return `'${shellEscape2(s)}'`;
1125
+ }
1126
+ function buildBwrapArgs(input) {
1127
+ const { quote } = input;
1128
+ const roBindArgs = input.readonlyRoots.flatMap((p) => [
1129
+ "--ro-bind",
1130
+ quote(p),
1131
+ quote(p)
1132
+ ]);
1133
+ const bindArgs = input.scopes.flatMap((p) => ["--bind", quote(p), quote(p)]);
1134
+ const args = [
1135
+ "--unshare-user",
1136
+ "--unshare-ipc",
1137
+ "--die-with-parent",
1138
+ "--new-session",
1139
+ "--cap-drop",
1140
+ "ALL",
1141
+ ...roBindArgs,
1142
+ ...bindArgs,
1143
+ "--dev",
1144
+ "/dev",
1145
+ "--size",
1146
+ String(TMPFS_SIZE_BYTES),
1147
+ "--tmpfs",
1148
+ quote(input.temp),
1149
+ "--ro-bind",
1150
+ "/etc",
1151
+ "/etc",
1152
+ "--ro-bind",
1153
+ "/usr",
1154
+ "/usr",
1155
+ "--ro-bind",
1156
+ "/lib",
1157
+ "/lib",
1158
+ "--ro-bind",
1159
+ "/lib64",
1160
+ "/lib64",
1161
+ "--proc",
1162
+ "/proc",
1163
+ "--unshare-pid",
1164
+ ...input.envArgs,
1165
+ "--",
1166
+ "bash",
1167
+ "-c",
1168
+ quote(input.command)
1169
+ ];
1170
+ if ((input.networkMode ?? "off") === "off") {
1171
+ args.splice(1, 0, "--unshare-net");
1172
+ }
1173
+ return args;
1174
+ }
1175
+ function probeBwrapNamespace(binary) {
1176
+ try {
1177
+ const result = spawnSync4(binary, [...BWRAP_NAMESPACE_SMOKE_ARGS], {
1178
+ cwd: tmpdir5(),
1179
+ windowsHide: true,
1180
+ encoding: "utf-8",
1181
+ timeout: 5000,
1182
+ stdio: ["ignore", "ignore", "pipe"]
1183
+ });
1184
+ if (!result.error && result.status === 0)
1185
+ return { ok: true };
1186
+ const reason = result.error?.message ?? (result.stderr?.trim().split(`
1187
+ `)[0] || `exit ${result.status}`);
1188
+ return { ok: false, reason };
1189
+ } catch (err) {
1190
+ return {
1191
+ ok: false,
1192
+ reason: err instanceof Error ? err.message : String(err)
1193
+ };
1194
+ }
1195
+ }
1122
1196
  function probeBwrap() {
1123
1197
  try {
1124
1198
  const binary = _internals4.resolveBwrapBinary();
1125
1199
  const result = spawnSync4(binary, ["--version"], {
1200
+ cwd: tmpdir5(),
1126
1201
  windowsHide: true,
1127
1202
  encoding: "utf-8",
1128
1203
  timeout: 5000,
@@ -1137,7 +1212,15 @@ function probeBwrap() {
1137
1212
  warn(`Sandbox disabled: bwrap spawn error (${result.error.message}). Falling through to tool-layer enforcement.`);
1138
1213
  return false;
1139
1214
  }
1140
- return result.status === BWRAP_VERSION_EXIT && result.stdout.trim().length > 0;
1215
+ if (result.status !== BWRAP_VERSION_EXIT || result.stdout.trim().length === 0) {
1216
+ return false;
1217
+ }
1218
+ const smoke = _internals4.probeBwrapNamespace(binary);
1219
+ if (!smoke.ok) {
1220
+ warn(`Sandbox disabled: bwrap cannot create a sandbox on this host (${smoke.reason}). ` + "Unprivileged user namespaces may be restricted (Ubuntu 24.04+: " + "kernel.apparmor_restrict_unprivileged_userns=1). Falling through to tool-layer enforcement.");
1221
+ return false;
1222
+ }
1223
+ return true;
1141
1224
  } catch (err) {
1142
1225
  const message = err instanceof Error ? err.message : String(err);
1143
1226
  warn(`Sandbox disabled: probe threw (${message}). Falling through to tool-layer enforcement.`);
@@ -1190,16 +1273,6 @@ class BubblewrapSandboxExecutor {
1190
1273
  const readonlyRoots = [
1191
1274
  ...new Set((policy?.readonly_roots ?? []).filter((p) => typeof p === "string" && p.startsWith("/") && p !== "/"))
1192
1275
  ];
1193
- const roBindArgs = readonlyRoots.flatMap((p) => [
1194
- "--ro-bind",
1195
- `'${shellEscape2(p)}'`,
1196
- `'${shellEscape2(p)}'`
1197
- ]);
1198
- const bindArgs = allScopes.flatMap((p) => [
1199
- "--bind",
1200
- `'${shellEscape2(p)}'`,
1201
- `'${shellEscape2(p)}'`
1202
- ]);
1203
1276
  const envArgs = [];
1204
1277
  if (envOverrides) {
1205
1278
  for (const [key, value] of Object.entries(envOverrides)) {
@@ -1209,49 +1282,19 @@ class BubblewrapSandboxExecutor {
1209
1282
  if (value === null) {
1210
1283
  envArgs.push("--unsetenv", key);
1211
1284
  } else {
1212
- envArgs.push("--setenv", key, `'${shellEscape2(value)}'`);
1285
+ envArgs.push("--setenv", key, shellQuote(value));
1213
1286
  }
1214
1287
  }
1215
1288
  }
1216
- const args = [
1217
- "--unshare-user",
1218
- "--unshare-ipc",
1219
- "--die-with-parent",
1220
- "--new-session",
1221
- "--cap-drop",
1222
- "ALL",
1223
- ...roBindArgs,
1224
- ...bindArgs,
1225
- "--dev",
1226
- "/dev",
1227
- "--size",
1228
- String(TMPFS_SIZE_BYTES),
1229
- "--tmpfs",
1230
- `'${shellEscape2(temp)}'`,
1231
- "--ro-bind",
1232
- "/etc",
1233
- "/etc",
1234
- "--ro-bind",
1235
- "/usr",
1236
- "/usr",
1237
- "--ro-bind",
1238
- "/lib",
1239
- "/lib",
1240
- "--ro-bind",
1241
- "/lib64",
1242
- "/lib64",
1243
- "--proc",
1244
- "/proc",
1245
- "--unshare-pid",
1246
- ...envArgs,
1247
- "--",
1248
- "bash",
1249
- "-c",
1250
- `'${shellEscape2(command)}'`
1251
- ];
1252
- if ((policy?.network_mode ?? "off") === "off") {
1253
- args.splice(1, 0, "--unshare-net");
1254
- }
1289
+ const args = buildBwrapArgs({
1290
+ quote: shellQuote,
1291
+ temp,
1292
+ readonlyRoots,
1293
+ scopes: allScopes,
1294
+ envArgs,
1295
+ networkMode: policy?.network_mode,
1296
+ command
1297
+ });
1255
1298
  const binary = _internals4.resolveBwrapBinary();
1256
1299
  return `${binary} ${args.join(" ")}`;
1257
1300
  }
@@ -1259,13 +1302,23 @@ class BubblewrapSandboxExecutor {
1259
1302
  return {};
1260
1303
  }
1261
1304
  }
1262
- var BWRAP_VERSION_EXIT = 0, BWRAP_UNAVAILABLE_CODES, BWRAP_ABSOLUTE = "/usr/bin/bwrap", TMPFS_SIZE_BYTES = 524288000, _internals4;
1305
+ var BWRAP_VERSION_EXIT = 0, BWRAP_UNAVAILABLE_CODES, BWRAP_ABSOLUTE = "/usr/bin/bwrap", TMPFS_SIZE_BYTES = 524288000, BWRAP_NAMESPACE_SMOKE_ARGS, _internals4;
1263
1306
  var init_bubblewrap_executor = __esm(() => {
1264
1307
  init_logger();
1265
1308
  init_executor();
1266
1309
  BWRAP_UNAVAILABLE_CODES = new Set(["ENOENT", "EACCES", "ENOSPC"]);
1310
+ BWRAP_NAMESPACE_SMOKE_ARGS = buildBwrapArgs({
1311
+ quote: (value) => value,
1312
+ temp: "/tmp",
1313
+ readonlyRoots: [],
1314
+ scopes: [],
1315
+ envArgs: [],
1316
+ networkMode: "off",
1317
+ command: "true"
1318
+ });
1267
1319
  _internals4 = {
1268
1320
  probeBwrap,
1321
+ probeBwrapNamespace,
1269
1322
  resolveBwrapBinary
1270
1323
  };
1271
1324
  });
@@ -1604,6 +1657,17 @@ async function probeLinux() {
1604
1657
  const binary = _internals4.resolveBwrapBinary();
1605
1658
  const output = await _internals5.withProbeTimeout(binary, ["--version"], 2000);
1606
1659
  if (output.length > 0) {
1660
+ try {
1661
+ await _internals5.withProbeTimeout(binary, [...BWRAP_NAMESPACE_SMOKE_ARGS], 2000);
1662
+ } catch (smokeError) {
1663
+ const detail = smokeError instanceof Error ? smokeError.message : String(smokeError);
1664
+ return {
1665
+ status: "disabled",
1666
+ mechanism: "Bubblewrap",
1667
+ platform: "linux",
1668
+ error: `bwrap cannot create a sandbox on this host (unprivileged user namespaces may be restricted): ${detail}`
1669
+ };
1670
+ }
1607
1671
  return {
1608
1672
  status: "enabled",
1609
1673
  strength: "strong",
@@ -4,7 +4,7 @@ import {
4
4
  ensureTaskCheckpointReceipt,
5
5
  loadPlan,
6
6
  updateTaskCheckpointReceipt
7
- } from "./index-km4x7yfb.js";
7
+ } from "./index-878ksabw.js";
8
8
  import {
9
9
  tool
10
10
  } from "./index-9nyqt3kb.js";
@@ -17,13 +17,13 @@ import {
17
17
  } from "./index-g4fs6z4e.js";
18
18
  import {
19
19
  validateSwarmPath
20
- } from "./index-mhqh2dc9.js";
20
+ } from "./index-eaess7dm.js";
21
21
  import {
22
22
  readLedgerEvents
23
- } from "./index-yfmgbhwz.js";
23
+ } from "./index-ba87gkb4.js";
24
24
  import {
25
25
  appendCoreEventSync
26
- } from "./index-d4cjbm4p.js";
26
+ } from "./index-a9m7h5v0.js";
27
27
  import {
28
28
  derivePlanId,
29
29
  derivePlanIdentityHash
@@ -38,10 +38,10 @@ import {
38
38
  } from "./index-ejhxgyvm.js";
39
39
  import {
40
40
  atomicWriteSwarmFileSync
41
- } from "./index-025wg2re.js";
41
+ } from "./index-nwswxes7.js";
42
42
  import {
43
43
  loadPluginConfigWithMeta
44
- } from "./index-ney8qpg3.js";
44
+ } from "./index-w9y482mp.js";
45
45
  import {
46
46
  init_git_executable,
47
47
  resolveGitExecutable
@@ -4,7 +4,7 @@ import {
4
4
  getProjectDb,
5
5
  projectDbExists,
6
6
  withImmediateTransaction
7
- } from "./index-ga1pcs49.js";
7
+ } from "./index-8zj647hc.js";
8
8
  import {
9
9
  derivePlanId,
10
10
  derivePlanIdentityHash
@@ -1,27 +1,27 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-mhqh2dc9.js";
4
+ } from "./index-eaess7dm.js";
5
5
  import {
6
6
  deleteCoordinationState,
7
7
  importCoordinationOnce,
8
8
  listCoordinationStates,
9
9
  transitionCoordinationState,
10
10
  withCoordinationTransaction
11
- } from "./index-9b6bxe9b.js";
11
+ } from "./index-mbn4vn3z.js";
12
12
  import {
13
13
  getProjectDb,
14
14
  projectDbExists
15
- } from "./index-ga1pcs49.js";
15
+ } from "./index-8zj647hc.js";
16
16
  import {
17
17
  observeStoreHealth
18
- } from "./index-k6h66zm3.js";
18
+ } from "./index-4twjbsfw.js";
19
19
  import {
20
20
  withEvidenceLock
21
- } from "./index-8bx6vhzk.js";
21
+ } from "./index-e8k0v19e.js";
22
22
  import {
23
23
  telemetry
24
- } from "./index-7vnr5cmp.js";
24
+ } from "./index-mtqwyjrg.js";
25
25
  import {
26
26
  canonicalRootKey,
27
27
  canonicalRootKeyFresh,
@@ -29,7 +29,7 @@ import {
29
29
  } from "./index-fzpt2djt.js";
30
30
  import {
31
31
  atomicWriteSwarmFileSync
32
- } from "./index-025wg2re.js";
32
+ } from "./index-nwswxes7.js";
33
33
  import {
34
34
  exports_external,
35
35
  init_zod
@@ -4,7 +4,7 @@ import {
4
4
  } from "./index-t7hmqgjy.js";
5
5
  import {
6
6
  emit
7
- } from "./index-7vnr5cmp.js";
7
+ } from "./index-mtqwyjrg.js";
8
8
  import {
9
9
  tryAcquireLock
10
10
  } from "./index-ejhxgyvm.js";
@@ -10,7 +10,7 @@ import {
10
10
  readCachedTextFile,
11
11
  wasObservedToExist,
12
12
  wasRecentlyWrittenByThisProcess
13
- } from "./index-025wg2re.js";
13
+ } from "./index-nwswxes7.js";
14
14
  import {
15
15
  warn
16
16
  } from "./index-zgwm4ryv.js";
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  computePlanStructureHash
4
- } from "./index-yfmgbhwz.js";
4
+ } from "./index-ba87gkb4.js";
5
5
  import {
6
6
  appendCoreEventSync
7
- } from "./index-d4cjbm4p.js";
7
+ } from "./index-a9m7h5v0.js";
8
8
  import {
9
9
  deleteCoordinationState,
10
10
  importCoordinationOnce,
@@ -12,10 +12,10 @@ import {
12
12
  transitionCoordinationState,
13
13
  transitionCoordinationStateWithinTransaction,
14
14
  withCoordinationTransaction
15
- } from "./index-9b6bxe9b.js";
15
+ } from "./index-mbn4vn3z.js";
16
16
  import {
17
17
  getProjectDb
18
- } from "./index-ga1pcs49.js";
18
+ } from "./index-8zj647hc.js";
19
19
  import {
20
20
  canonicalExistingFilesystemPath,
21
21
  legacyCanonicalExistingFilesystemPath
@@ -32,7 +32,7 @@ import {
32
32
  import {
33
33
  atomicWriteSwarmFile,
34
34
  atomicWriteSwarmFileSync
35
- } from "./index-025wg2re.js";
35
+ } from "./index-nwswxes7.js";
36
36
  import {
37
37
  PlanSchema
38
38
  } from "./index-gx2vp8gx.js";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-mhqh2dc9.js";
4
+ } from "./index-eaess7dm.js";
5
5
  import {
6
6
  bunSpawn
7
7
  } from "./index-2s7dvzff.js";
@@ -10,7 +10,7 @@ import {
10
10
  } from "./index-fzpt2djt.js";
11
11
  import {
12
12
  atomicWriteSwarmFileSync
13
- } from "./index-025wg2re.js";
13
+ } from "./index-nwswxes7.js";
14
14
  import {
15
15
  advisoryWarn,
16
16
  init_git_executable,
@@ -242,7 +242,7 @@ var _internals2 = {
242
242
  symlinkSync: fs2.symlinkSync
243
243
  },
244
244
  writeScopeToDisk: async (directory, taskId, files) => {
245
- const { writeScopeToDisk: realWrite } = await import("./scope-persistence-h4b6p951.js");
245
+ const { writeScopeToDisk: realWrite } = await import("./scope-persistence-ta6ydymv.js");
246
246
  return realWrite(directory, taskId, files);
247
247
  },
248
248
  writeLaneProfileToDisk: async (_worktreePath, _laneIndex, _envOverrides) => {
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-mhqh2dc9.js";
4
+ } from "./index-eaess7dm.js";
5
5
  import {
6
6
  bunSpawn
7
7
  } from "./index-2s7dvzff.js";
@@ -11,7 +11,7 @@ import {
11
11
  } from "./index-fzpt2djt.js";
12
12
  import {
13
13
  atomicWriteSwarmFile
14
- } from "./index-025wg2re.js";
14
+ } from "./index-nwswxes7.js";
15
15
  import {
16
16
  init_git_executable,
17
17
  resolveGitExecutable
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-mhqh2dc9.js";
4
+ } from "./index-eaess7dm.js";
5
5
  import {
6
6
  atomicWriteSwarmFileSync
7
- } from "./index-025wg2re.js";
7
+ } from "./index-nwswxes7.js";
8
8
 
9
9
  // src/hooks/delegation-gate/worktree-provisioning-owner.ts
10
10
  import { createHash } from "crypto";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  _internals,
4
4
  resolveWorktreeIsolationConfig
5
- } from "./index-6shk3n43.js";
5
+ } from "./index-89826pb5.js";
6
6
  import {
7
7
  ApprovalEvidenceSchema,
8
8
  BaseEvidenceSchema,
@@ -46,7 +46,7 @@ import {
46
46
  loadPluginConfigWithMeta,
47
47
  loadPluginConfigWithMetaAsync,
48
48
  resetConfigAdvisoryDedup
49
- } from "./index-ney8qpg3.js";
49
+ } from "./index-w9y482mp.js";
50
50
  import"./index-zxdawwc7.js";
51
51
  import {
52
52
  AUTO_REVIEW_V8_BURN_IN_DECISION,
@@ -72,7 +72,7 @@ import {
72
72
  TurboConfigSchema,
73
73
  WorktreeIsolationConfigSchema,
74
74
  resolveAutoReviewConfig
75
- } from "./index-b79a8pc2.js";
75
+ } from "./index-a83gmv2e.js";
76
76
  import {
77
77
  ALL_AGENT_NAMES,
78
78
  ALL_SUBAGENT_NAMES,