deadbyte-mcp 0.8.9 → 0.9.0

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 (349) hide show
  1. package/CONTEXT.md +41 -0
  2. package/MANIFEST.SHA256 +348 -83
  3. package/R34-BASELINE.json +9 -0
  4. package/README.txt +135 -9
  5. package/bench/fixtures/corpus.json +17 -0
  6. package/bin/WORKER-REGISTRY.txt +3 -3
  7. package/bin/appcontainer-stage.exe +0 -0
  8. package/bin/appcontainer-stage.obj +0 -0
  9. package/bin/bootstrap-advapi32.exe +0 -0
  10. package/bin/bootstrap-advapi32.obj +0 -0
  11. package/bin/bootstrap-exitcode.exe +0 -0
  12. package/bin/bootstrap-exitcode.obj +0 -0
  13. package/bin/bootstrap-kernel32.exe +0 -0
  14. package/bin/bootstrap-kernel32.obj +0 -0
  15. package/bin/child-control-probe.exe +0 -0
  16. package/bin/child-control-probe.obj +0 -0
  17. package/bin/child-control-stage.exe +0 -0
  18. package/bin/child-control-stage.obj +0 -0
  19. package/bin/contained-reverse-worker.exe +0 -0
  20. package/bin/contained-reverse-worker.obj +0 -0
  21. package/bin/contained-transform-worker.exe +0 -0
  22. package/bin/contained-transform-worker.obj +0 -0
  23. package/bin/containment-probe.exe +0 -0
  24. package/bin/containment-probe.obj +0 -0
  25. package/bin/deadbyte-contain.exe +0 -0
  26. package/bin/deadbyte-contain.obj +0 -0
  27. package/bin/deadbyte-exec.exe +0 -0
  28. package/bin/deadbyte-exec.obj +0 -0
  29. package/bin/deadbyte-process-host.exe +0 -0
  30. package/bin/deadbyte-process-host.obj +0 -0
  31. package/bin/deadbyte-tunnel-host.exe +0 -0
  32. package/bin/deadbyte-tunnel-host.obj +0 -0
  33. package/controller/README.TXT +10 -4
  34. package/controller/deadbyte-controller.config.psd1.example +14 -0
  35. package/controller/deadbyte-controller.ps1 +144 -19
  36. package/controller/deadbyte-process-policy.json +5 -5
  37. package/controller/deadbyte-semantic-lsp-config.json +95 -0
  38. package/deadbyte-mcp-0.8.9.tgz +0 -0
  39. package/docs/ADR-0001-PRODUCTION-BASELINE-SEAMS.md +29 -0
  40. package/docs/ARCHITECTURE.md +6 -5
  41. package/docs/superpowers/plans/2026-09-16-deadbyte-loop-engine.md +846 -0
  42. package/docs/superpowers/plans/2026-09-17-r35-production-successor.md +408 -0
  43. package/docs/superpowers/specs/2026-09-16-deadbyte-loop-engine-design.md +435 -0
  44. package/docs/superpowers/specs/2026-09-17-r35-production-successor-design.md +220 -0
  45. package/node_modules/typescript/LICENSE.txt +55 -0
  46. package/node_modules/typescript/README.md +50 -0
  47. package/node_modules/typescript/SECURITY.md +41 -0
  48. package/node_modules/typescript/ThirdPartyNoticeText.txt +193 -0
  49. package/node_modules/typescript/bin/tsc +2 -0
  50. package/node_modules/typescript/bin/tsserver +2 -0
  51. package/node_modules/typescript/lib/_tsc.js +133818 -0
  52. package/node_modules/typescript/lib/_tsserver.js +659 -0
  53. package/node_modules/typescript/lib/_typingsInstaller.js +222 -0
  54. package/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +2122 -0
  55. package/node_modules/typescript/lib/de/diagnosticMessages.generated.json +2122 -0
  56. package/node_modules/typescript/lib/es/diagnosticMessages.generated.json +2122 -0
  57. package/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +2122 -0
  58. package/node_modules/typescript/lib/it/diagnosticMessages.generated.json +2122 -0
  59. package/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +2122 -0
  60. package/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +2122 -0
  61. package/node_modules/typescript/lib/lib.d.ts +22 -0
  62. package/node_modules/typescript/lib/lib.decorators.d.ts +384 -0
  63. package/node_modules/typescript/lib/lib.decorators.legacy.d.ts +22 -0
  64. package/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +41 -0
  65. package/node_modules/typescript/lib/lib.dom.d.ts +39429 -0
  66. package/node_modules/typescript/lib/lib.dom.iterable.d.ts +571 -0
  67. package/node_modules/typescript/lib/lib.es2015.collection.d.ts +147 -0
  68. package/node_modules/typescript/lib/lib.es2015.core.d.ts +597 -0
  69. package/node_modules/typescript/lib/lib.es2015.d.ts +28 -0
  70. package/node_modules/typescript/lib/lib.es2015.generator.d.ts +77 -0
  71. package/node_modules/typescript/lib/lib.es2015.iterable.d.ts +605 -0
  72. package/node_modules/typescript/lib/lib.es2015.promise.d.ts +81 -0
  73. package/node_modules/typescript/lib/lib.es2015.proxy.d.ts +128 -0
  74. package/node_modules/typescript/lib/lib.es2015.reflect.d.ts +144 -0
  75. package/node_modules/typescript/lib/lib.es2015.symbol.d.ts +46 -0
  76. package/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +326 -0
  77. package/node_modules/typescript/lib/lib.es2016.array.include.d.ts +116 -0
  78. package/node_modules/typescript/lib/lib.es2016.d.ts +21 -0
  79. package/node_modules/typescript/lib/lib.es2016.full.d.ts +23 -0
  80. package/node_modules/typescript/lib/lib.es2016.intl.d.ts +31 -0
  81. package/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +21 -0
  82. package/node_modules/typescript/lib/lib.es2017.d.ts +26 -0
  83. package/node_modules/typescript/lib/lib.es2017.date.d.ts +31 -0
  84. package/node_modules/typescript/lib/lib.es2017.full.d.ts +23 -0
  85. package/node_modules/typescript/lib/lib.es2017.intl.d.ts +44 -0
  86. package/node_modules/typescript/lib/lib.es2017.object.d.ts +49 -0
  87. package/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +135 -0
  88. package/node_modules/typescript/lib/lib.es2017.string.d.ts +45 -0
  89. package/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +53 -0
  90. package/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +77 -0
  91. package/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +53 -0
  92. package/node_modules/typescript/lib/lib.es2018.d.ts +24 -0
  93. package/node_modules/typescript/lib/lib.es2018.full.d.ts +24 -0
  94. package/node_modules/typescript/lib/lib.es2018.intl.d.ts +83 -0
  95. package/node_modules/typescript/lib/lib.es2018.promise.d.ts +30 -0
  96. package/node_modules/typescript/lib/lib.es2018.regexp.d.ts +37 -0
  97. package/node_modules/typescript/lib/lib.es2019.array.d.ts +79 -0
  98. package/node_modules/typescript/lib/lib.es2019.d.ts +24 -0
  99. package/node_modules/typescript/lib/lib.es2019.full.d.ts +24 -0
  100. package/node_modules/typescript/lib/lib.es2019.intl.d.ts +23 -0
  101. package/node_modules/typescript/lib/lib.es2019.object.d.ts +33 -0
  102. package/node_modules/typescript/lib/lib.es2019.string.d.ts +37 -0
  103. package/node_modules/typescript/lib/lib.es2019.symbol.d.ts +24 -0
  104. package/node_modules/typescript/lib/lib.es2020.bigint.d.ts +765 -0
  105. package/node_modules/typescript/lib/lib.es2020.d.ts +27 -0
  106. package/node_modules/typescript/lib/lib.es2020.date.d.ts +42 -0
  107. package/node_modules/typescript/lib/lib.es2020.full.d.ts +24 -0
  108. package/node_modules/typescript/lib/lib.es2020.intl.d.ts +474 -0
  109. package/node_modules/typescript/lib/lib.es2020.number.d.ts +28 -0
  110. package/node_modules/typescript/lib/lib.es2020.promise.d.ts +47 -0
  111. package/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +99 -0
  112. package/node_modules/typescript/lib/lib.es2020.string.d.ts +44 -0
  113. package/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +41 -0
  114. package/node_modules/typescript/lib/lib.es2021.d.ts +23 -0
  115. package/node_modules/typescript/lib/lib.es2021.full.d.ts +24 -0
  116. package/node_modules/typescript/lib/lib.es2021.intl.d.ts +166 -0
  117. package/node_modules/typescript/lib/lib.es2021.promise.d.ts +48 -0
  118. package/node_modules/typescript/lib/lib.es2021.string.d.ts +33 -0
  119. package/node_modules/typescript/lib/lib.es2021.weakref.d.ts +78 -0
  120. package/node_modules/typescript/lib/lib.es2022.array.d.ts +121 -0
  121. package/node_modules/typescript/lib/lib.es2022.d.ts +25 -0
  122. package/node_modules/typescript/lib/lib.es2022.error.d.ts +75 -0
  123. package/node_modules/typescript/lib/lib.es2022.full.d.ts +24 -0
  124. package/node_modules/typescript/lib/lib.es2022.intl.d.ts +145 -0
  125. package/node_modules/typescript/lib/lib.es2022.object.d.ts +26 -0
  126. package/node_modules/typescript/lib/lib.es2022.regexp.d.ts +39 -0
  127. package/node_modules/typescript/lib/lib.es2022.string.d.ts +25 -0
  128. package/node_modules/typescript/lib/lib.es2023.array.d.ts +924 -0
  129. package/node_modules/typescript/lib/lib.es2023.collection.d.ts +21 -0
  130. package/node_modules/typescript/lib/lib.es2023.d.ts +22 -0
  131. package/node_modules/typescript/lib/lib.es2023.full.d.ts +24 -0
  132. package/node_modules/typescript/lib/lib.es2023.intl.d.ts +56 -0
  133. package/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +65 -0
  134. package/node_modules/typescript/lib/lib.es2024.collection.d.ts +29 -0
  135. package/node_modules/typescript/lib/lib.es2024.d.ts +26 -0
  136. package/node_modules/typescript/lib/lib.es2024.full.d.ts +24 -0
  137. package/node_modules/typescript/lib/lib.es2024.object.d.ts +29 -0
  138. package/node_modules/typescript/lib/lib.es2024.promise.d.ts +35 -0
  139. package/node_modules/typescript/lib/lib.es2024.regexp.d.ts +25 -0
  140. package/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +68 -0
  141. package/node_modules/typescript/lib/lib.es2024.string.d.ts +29 -0
  142. package/node_modules/typescript/lib/lib.es5.d.ts +4601 -0
  143. package/node_modules/typescript/lib/lib.es6.d.ts +23 -0
  144. package/node_modules/typescript/lib/lib.esnext.array.d.ts +35 -0
  145. package/node_modules/typescript/lib/lib.esnext.collection.d.ts +96 -0
  146. package/node_modules/typescript/lib/lib.esnext.d.ts +29 -0
  147. package/node_modules/typescript/lib/lib.esnext.decorators.d.ts +28 -0
  148. package/node_modules/typescript/lib/lib.esnext.disposable.d.ts +193 -0
  149. package/node_modules/typescript/lib/lib.esnext.error.d.ts +24 -0
  150. package/node_modules/typescript/lib/lib.esnext.float16.d.ts +445 -0
  151. package/node_modules/typescript/lib/lib.esnext.full.d.ts +24 -0
  152. package/node_modules/typescript/lib/lib.esnext.intl.d.ts +21 -0
  153. package/node_modules/typescript/lib/lib.esnext.iterator.d.ts +148 -0
  154. package/node_modules/typescript/lib/lib.esnext.promise.d.ts +34 -0
  155. package/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +25 -0
  156. package/node_modules/typescript/lib/lib.scripthost.d.ts +322 -0
  157. package/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +41 -0
  158. package/node_modules/typescript/lib/lib.webworker.d.ts +13150 -0
  159. package/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +23 -0
  160. package/node_modules/typescript/lib/lib.webworker.iterable.d.ts +340 -0
  161. package/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +2122 -0
  162. package/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +2122 -0
  163. package/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +2122 -0
  164. package/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +2122 -0
  165. package/node_modules/typescript/lib/tsc.js +8 -0
  166. package/node_modules/typescript/lib/tsserver.js +8 -0
  167. package/node_modules/typescript/lib/tsserverlibrary.d.ts +17 -0
  168. package/node_modules/typescript/lib/tsserverlibrary.js +21 -0
  169. package/node_modules/typescript/lib/typesMap.json +497 -0
  170. package/node_modules/typescript/lib/typescript.d.ts +11437 -0
  171. package/node_modules/typescript/lib/typescript.js +200276 -0
  172. package/node_modules/typescript/lib/typingsInstaller.js +8 -0
  173. package/node_modules/typescript/lib/watchGuard.js +53 -0
  174. package/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +2122 -0
  175. package/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +2122 -0
  176. package/node_modules/typescript/package.json +120 -0
  177. package/package.json +5 -3
  178. package/proof/CONTAINMENT-BUILD.txt +6 -6
  179. package/proof/R34-TASK8-SUPERVISOR-CHECKPOINT.json +29 -0
  180. package/proof/R34-TASK9-MCP-SURFACE-CHECKPOINT.json +28 -0
  181. package/scripts/capability-benchmark.mjs +27 -0
  182. package/scripts/deferred-slot-operation.mjs +4 -2
  183. package/scripts/final-closure-verify.mjs +10 -10
  184. package/scripts/final-closure.mjs +11 -11
  185. package/scripts/gate-windows.ps1 +3 -3
  186. package/scripts/release-parity.mjs +14 -14
  187. package/scripts/semantic-preflight.ps1 +73 -0
  188. package/scripts/tool-surface-snapshot.mjs +73 -0
  189. package/scripts/windows-gate-evidence.mjs +5 -5
  190. package/src/audit-verify.mjs +6 -2
  191. package/src/autonomous-action-reconcile.mjs +142 -0
  192. package/src/autonomous-context-engine.mjs +255 -0
  193. package/src/autonomous-live-state.mjs +17 -0
  194. package/src/autonomous-local-supervisor.mjs +249 -0
  195. package/src/autonomous-loop-state.mjs +304 -0
  196. package/src/autonomous-output-contracts.mjs +22 -3
  197. package/src/autonomous-plan.mjs +181 -0
  198. package/src/autonomous-planner-contracts.mjs +44 -0
  199. package/src/autonomous-planner.mjs +91 -6
  200. package/src/autonomous-policy.mjs +15 -2
  201. package/src/autonomous-progress.mjs +127 -0
  202. package/src/autonomous-runtime.mjs +601 -48
  203. package/src/autonomous-supervisor-host.mjs +70 -0
  204. package/src/autonomous-supervisor.mjs +31 -8
  205. package/src/capability-benchmark-runner.mjs +108 -0
  206. package/src/capability-benchmark.mjs +50 -0
  207. package/src/coding-mcp-tools.mjs +46 -3
  208. package/src/coding-output-contracts.mjs +45 -0
  209. package/src/context-provenance.mjs +86 -0
  210. package/src/deadbyte-cli.mjs +136 -30
  211. package/src/document-adapter.mjs +43 -0
  212. package/src/lsp-stdio-client.mjs +112 -0
  213. package/src/machine-fs-smoke-client.mjs +2 -1
  214. package/src/mcp-server.mjs +17 -3
  215. package/src/observation-smoke-client.mjs +3 -2
  216. package/src/operator-surface.mjs +37 -0
  217. package/src/provider-circuit.mjs +125 -0
  218. package/src/release-generation.mjs +44 -5
  219. package/src/remote-mcp-autonomous-smoke-client.mjs +53 -14
  220. package/src/remote-mcp-coding-smoke-client.mjs +5 -4
  221. package/src/remote-mcp-r24-disarmed-smoke-client.mjs +4 -2
  222. package/src/remote-mcp-r33-parity-client.mjs +1 -1
  223. package/src/remote-mcp-r34-parity-client.mjs +177 -0
  224. package/src/remote-mcp-smoke-client.mjs +2 -1
  225. package/src/remote-result-journal.mjs +114 -0
  226. package/src/runtime-update.mjs +58 -8
  227. package/src/semantic-backend-registry.mjs +39 -0
  228. package/src/semantic-code.mjs +179 -0
  229. package/src/semantic-lsp-backend.mjs +183 -0
  230. package/src/semantic-lsp-config.mjs +112 -0
  231. package/src/tool-surface-ledger.mjs +92 -0
  232. package/src/version.mjs +1 -1
  233. package/test/audit-verify.test.mjs +1 -1
  234. package/test/autonomous-action-reconcile.test.mjs +106 -0
  235. package/test/autonomous-adversarial.test.mjs +149 -6
  236. package/test/autonomous-context-engine.test.mjs +181 -0
  237. package/test/autonomous-live-state.test.mjs +27 -0
  238. package/test/autonomous-local-supervisor.test.mjs +403 -0
  239. package/test/autonomous-loop-state.test.mjs +126 -0
  240. package/test/autonomous-loop-v2.test.mjs +105 -0
  241. package/test/autonomous-loop.test.mjs +79 -1
  242. package/test/autonomous-output-contract.test.mjs +54 -0
  243. package/test/autonomous-plan.test.mjs +101 -0
  244. package/test/autonomous-progress.test.mjs +106 -0
  245. package/test/autonomous-r34-e2e.test.mjs +338 -0
  246. package/test/autonomous-runtime.test.mjs +3 -3
  247. package/test/autonomous-supervisor-integration.test.mjs +48 -3
  248. package/test/capability-benchmark-runner.test.mjs +49 -0
  249. package/test/capability-benchmark.test.mjs +47 -0
  250. package/test/cli-entrypoint.test.mjs +12 -0
  251. package/test/coding-catalog-consistency.test.mjs +24 -0
  252. package/test/coding-plane.test.mjs +3 -3
  253. package/test/context-provenance.test.mjs +61 -0
  254. package/test/controller-r27.test.mjs +4 -3
  255. package/test/controller.test.mjs +52 -0
  256. package/test/core.test.mjs +1 -1
  257. package/test/deferred-slot-operation-behavior.test.mjs +5 -1
  258. package/test/deferred-slot-operation.test.mjs +2 -1
  259. package/test/document-adapter.test.mjs +23 -0
  260. package/test/fixtures/lsp-framed-server.mjs +33 -0
  261. package/test/fixtures/semantic/cpp/compile_commands.json +4 -0
  262. package/test/fixtures/semantic/cpp/lib.cpp +2 -0
  263. package/test/fixtures/semantic/cpp/lib.hpp +2 -0
  264. package/test/fixtures/semantic/cpp/main.cpp +2 -0
  265. package/test/fixtures/semantic/python/lib.py +2 -0
  266. package/test/fixtures/semantic/python/main.py +2 -0
  267. package/test/fixtures/semantic/rust/Cargo.lock +7 -0
  268. package/test/fixtures/semantic/rust/Cargo.toml +8 -0
  269. package/test/fixtures/semantic/rust/src/lib.rs +3 -0
  270. package/test/fixtures/semantic/rust/src/main.rs +5 -0
  271. package/test/fixtures/semantic/rust/src/math.rs +3 -0
  272. package/test/fixtures/semantic/rust/target/.rustc_info.json +1 -0
  273. package/test/fixtures/semantic/rust/target/CACHEDIR.TAG +3 -0
  274. package/test/fixtures/semantic/rust/target/debug/.cargo-lock +0 -0
  275. package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-4c168fa33c79d09c/dep-test-lib-semantic_rust +0 -0
  276. package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-4c168fa33c79d09c/invoked.timestamp +1 -0
  277. package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-4c168fa33c79d09c/test-lib-semantic_rust +1 -0
  278. package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-4c168fa33c79d09c/test-lib-semantic_rust.json +1 -0
  279. package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-5dcd474439c54a26/dep-test-bin-semantic_rust_bin +0 -0
  280. package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-5dcd474439c54a26/invoked.timestamp +1 -0
  281. package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-5dcd474439c54a26/test-bin-semantic_rust_bin +1 -0
  282. package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-5dcd474439c54a26/test-bin-semantic_rust_bin.json +1 -0
  283. package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-6212ccd976aa3808/dep-lib-semantic_rust +0 -0
  284. package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-6212ccd976aa3808/invoked.timestamp +1 -0
  285. package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-6212ccd976aa3808/lib-semantic_rust +1 -0
  286. package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-6212ccd976aa3808/lib-semantic_rust.json +1 -0
  287. package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-d741378dccdef61c/bin-semantic_rust_bin +1 -0
  288. package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-d741378dccdef61c/bin-semantic_rust_bin.json +1 -0
  289. package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-d741378dccdef61c/dep-bin-semantic_rust_bin +0 -0
  290. package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-d741378dccdef61c/invoked.timestamp +1 -0
  291. package/test/fixtures/semantic/rust/target/debug/deps/libsemantic_rust-4c168fa33c79d09c.rmeta +0 -0
  292. package/test/fixtures/semantic/rust/target/debug/deps/libsemantic_rust-6212ccd976aa3808.rmeta +0 -0
  293. package/test/fixtures/semantic/rust/target/debug/deps/libsemantic_rust_bin-5dcd474439c54a26.rmeta +0 -0
  294. package/test/fixtures/semantic/rust/target/debug/deps/libsemantic_rust_bin-d741378dccdef61c.rmeta +0 -0
  295. package/test/fixtures/semantic/rust/target/debug/deps/semantic_rust-4c168fa33c79d09c.d +5 -0
  296. package/test/fixtures/semantic/rust/target/debug/deps/semantic_rust-6212ccd976aa3808.d +5 -0
  297. package/test/fixtures/semantic/rust/target/debug/deps/semantic_rust_bin-5dcd474439c54a26.d +6 -0
  298. package/test/fixtures/semantic/rust/target/debug/deps/semantic_rust_bin-d741378dccdef61c.d +6 -0
  299. package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust-1nzlugxi6lq16/s-hmdgo8b6hg-1n6glhc-1qb77z00k06rqw4jdkj92spax/dep-graph.bin +0 -0
  300. package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust-1nzlugxi6lq16/s-hmdgo8b6hg-1n6glhc-1qb77z00k06rqw4jdkj92spax/query-cache.bin +0 -0
  301. package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust-1nzlugxi6lq16/s-hmdgo8b6hg-1n6glhc-1qb77z00k06rqw4jdkj92spax/work-products.bin +0 -0
  302. package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust-1nzlugxi6lq16/s-hmdgo8b6hg-1n6glhc.lock +0 -0
  303. package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust-3s436v7g6f5xm/s-hmdgo8b58k-1ekj4lq-9twkpivsqnjon278x20bddozq/dep-graph.bin +0 -0
  304. package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust-3s436v7g6f5xm/s-hmdgo8b58k-1ekj4lq-9twkpivsqnjon278x20bddozq/metadata.rmeta +0 -0
  305. package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust-3s436v7g6f5xm/s-hmdgo8b58k-1ekj4lq-9twkpivsqnjon278x20bddozq/query-cache.bin +0 -0
  306. package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust-3s436v7g6f5xm/s-hmdgo8b58k-1ekj4lq-9twkpivsqnjon278x20bddozq/work-products.bin +0 -0
  307. package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust-3s436v7g6f5xm/s-hmdgo8b58k-1ekj4lq.lock +0 -0
  308. package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust_bin-1jxcbdeehal7q/s-hmdgo8bxlf-1qr24o3-cmu3jai030no72y8u9eurrnjj/dep-graph.bin +0 -0
  309. package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust_bin-1jxcbdeehal7q/s-hmdgo8bxlf-1qr24o3-cmu3jai030no72y8u9eurrnjj/query-cache.bin +0 -0
  310. package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust_bin-1jxcbdeehal7q/s-hmdgo8bxlf-1qr24o3-cmu3jai030no72y8u9eurrnjj/work-products.bin +0 -0
  311. package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust_bin-1jxcbdeehal7q/s-hmdgo8bxlf-1qr24o3.lock +0 -0
  312. package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust_bin-2ocx55p60ni6b/s-hmdgo8bxj8-0ir41qt-diy9mqvc2eoiblmhjs3stcgi3/dep-graph.bin +0 -0
  313. package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust_bin-2ocx55p60ni6b/s-hmdgo8bxj8-0ir41qt-diy9mqvc2eoiblmhjs3stcgi3/query-cache.bin +0 -0
  314. package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust_bin-2ocx55p60ni6b/s-hmdgo8bxj8-0ir41qt-diy9mqvc2eoiblmhjs3stcgi3/work-products.bin +0 -0
  315. package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust_bin-2ocx55p60ni6b/s-hmdgo8bxj8-0ir41qt.lock +0 -0
  316. package/test/fixtures/semantic/rust/target/flycheck0/stderr +1 -0
  317. package/test/fixtures/semantic/rust/target/flycheck0/stdout +5 -0
  318. package/test/fixtures/semantic/typescript/lib.ts +3 -0
  319. package/test/fixtures/semantic/typescript/main.ts +2 -0
  320. package/test/fixtures/tool-surface-stdio-server.mjs +14 -0
  321. package/test/helpers/autonomous-r34-fixture.mjs +120 -0
  322. package/test/lsp-stdio-client.test.mjs +72 -0
  323. package/test/multi-file-read.test.mjs +41 -0
  324. package/test/observation-integration.test.mjs +3 -3
  325. package/test/production-docs.test.mjs +48 -0
  326. package/test/prompts-resources.test.mjs +35 -0
  327. package/test/provider-circuit.test.mjs +93 -0
  328. package/test/public-autonomous-ingress-budget.test.mjs +28 -0
  329. package/test/r33-closeout-regression.test.mjs +3 -3
  330. package/test/r33-finalization.test.mjs +19 -16
  331. package/test/release-generation.test.mjs +23 -2
  332. package/test/release-version.test.mjs +24 -17
  333. package/test/remote-r24-catalog.test.mjs +5 -4
  334. package/test/remote-result-journal.test.mjs +58 -0
  335. package/test/remote-session-cli.test.mjs +150 -15
  336. package/test/runtime-self-update.test.mjs +63 -0
  337. package/test/semantic-backend-registry.test.mjs +29 -0
  338. package/test/semantic-code.test.mjs +66 -0
  339. package/test/semantic-lsp-backend.test.mjs +99 -0
  340. package/test/semantic-lsp-config.test.mjs +81 -0
  341. package/test/semantic-lsp-readiness.test.mjs +34 -0
  342. package/test/semantic-lsp-transient-empty.test.mjs +32 -0
  343. package/test/semantic-lsp-transient-null.test.mjs +31 -0
  344. package/test/semantic-multilang.test.mjs +72 -0
  345. package/test/semantic-runtime-routing.test.mjs +32 -0
  346. package/test/semantic-server-config-integration.test.mjs +66 -0
  347. package/test/tool-surface-ledger.test.mjs +59 -0
  348. package/test/tool-surface-snapshot.test.mjs +17 -0
  349. package/test/tracer-bullet.test.mjs +77 -0
@@ -0,0 +1,338 @@
1
+ import test from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { readFile, writeFile } from 'node:fs/promises';
4
+ import {
5
+ createR34Fixture,sendPlannerDecision,planCreateDecision,inspectDecision,patchDecision,
6
+ stepCompleteDecision,finishDecision
7
+ } from './helpers/autonomous-r34-fixture.mjs';
8
+
9
+ test('R34 loop executes plan -> inspect -> act -> verify -> step complete -> finish', async () => {
10
+ const f = await createR34Fixture();
11
+ try {
12
+ const goal = await f.runtime.submit({submissionId:'r34-happy',rootId:'project',title:'repair',
13
+ goal:'change x to y',acceptance:'x.txt contains y and release evidence verifies'});
14
+ let result = await f.runtime.run({goalId:goal.goal_id,maxCycles:4});
15
+ assert.equal(result.status,'input_required');
16
+
17
+ result = await sendPlannerDecision(f.runtime,goal.goal_id,result,planCreateDecision());
18
+ assert.equal(result.status,'input_required');
19
+ assert.equal(result.loop.phase,'INSPECTING');
20
+ let status = await f.runtime.status({goalId:goal.goal_id});
21
+ assert.equal(status.loop.phase,'INSPECTING');
22
+ assert.equal(status.loop.plan_version,1);
23
+ assert.equal(status.loop.current_step.step_id,'repair');
24
+
25
+ result = await sendPlannerDecision(f.runtime,goal.goal_id,result,inspectDecision());
26
+ assert.equal(result.status,'input_required');
27
+ status = await f.runtime.status({goalId:goal.goal_id});
28
+ assert.equal(status.loop.phase,'ACTING');
29
+
30
+ result = await sendPlannerDecision(f.runtime,goal.goal_id,result,patchDecision(f.initial_sha256));
31
+ assert.equal(result.status,'input_required');
32
+ assert.equal(await readFile(f.target,'utf8'),'y\n');
33
+ status = await f.runtime.status({goalId:goal.goal_id});
34
+ assert.equal(status.loop.phase,'VERIFYING');
35
+ const afterAct = await f.runtime.events({goalId:goal.goal_id,fromSeq:1,limit:200});
36
+ const committed = afterAct.events.find(event=>event.type==='native_diff_committed');
37
+ assert.ok(committed);
38
+ assert.ok(afterAct.events.some(event=>event.type==='progress_judged'&&event.payload.verdict==='progress'));
39
+
40
+ result = await sendPlannerDecision(f.runtime,goal.goal_id,result,stepCompleteDecision([{
41
+ kind:'native_diff',id:'repair-diff',sha256:committed.payload.diff_receipt_sha256
42
+ }]));
43
+ assert.equal(result.status,'input_required');
44
+ status = await f.runtime.status({goalId:goal.goal_id});
45
+ assert.equal(status.loop.phase,'PLANNING');
46
+ assert.equal(status.loop.current_step,null);
47
+
48
+ result = await sendPlannerDecision(f.runtime,goal.goal_id,result,finishDecision(),{maxCycles:8});
49
+ assert.equal(result.status,'completed');
50
+ status = await f.runtime.status({goalId:goal.goal_id});
51
+ assert.equal(status.state,'succeeded');
52
+ assert.equal(status.loop.phase,'COMPLETE');
53
+ assert.equal(status.loop.plan_version,1);
54
+ assert.equal((await f.runtime.verify({goalId:goal.goal_id})).ok,true);
55
+ } finally { await f.cleanup(); }
56
+ });
57
+
58
+ test('R34 missing authority waits durably and approval resumes the same phase after operator re-arm', async () => {
59
+ const f = await createR34Fixture();
60
+ try {
61
+ const goal = await f.runtime.submit({submissionId:'r34-authority-wait',rootId:'project',title:'repair',
62
+ goal:'change x to y',acceptance:'verified mutation'});
63
+ let result = await f.runtime.run({goalId:goal.goal_id,maxCycles:4});
64
+ result = await sendPlannerDecision(f.runtime,goal.goal_id,result,planCreateDecision());
65
+ result = await sendPlannerDecision(f.runtime,goal.goal_id,result,inspectDecision());
66
+ assert.equal(result.loop.phase,'ACTING');
67
+
68
+ await f.disarm();
69
+ result = await sendPlannerDecision(f.runtime,goal.goal_id,result,patchDecision(f.initial_sha256));
70
+ assert.equal(result.status,'paused');
71
+ assert.equal(result.loop.phase,'WAITING');
72
+ assert.equal(result.loop.wait_reason,'authority_unavailable');
73
+ assert.equal(await readFile(f.target,'utf8'),'x\n');
74
+ let journal = await f.runtime.events({goalId:goal.goal_id,fromSeq:1,limit:200});
75
+ assert.equal(journal.events.filter(event=>event.type==='action_started').length,0);
76
+
77
+ await f.arm();
78
+ const approved = await f.runtime.approve({goalId:goal.goal_id,decision:'approve'});
79
+ assert.equal(approved.status,'approved');
80
+ assert.equal(approved.loop.phase,'ACTING');
81
+ const resumed = await f.runtime.run({goalId:goal.goal_id,maxCycles:2});
82
+ assert.equal(resumed.status,'input_required');
83
+ assert.equal(resumed.loop.phase,'ACTING');
84
+ result = await sendPlannerDecision(f.runtime,goal.goal_id,resumed,patchDecision(f.initial_sha256));
85
+ assert.equal(result.loop.phase,'VERIFYING');
86
+ assert.equal(await readFile(f.target,'utf8'),'y\n');
87
+ } finally { await f.cleanup(); }
88
+ });
89
+
90
+ test('R34 finish is blocked while the active plan is incomplete', async () => {
91
+ const f = await createR34Fixture();
92
+ try {
93
+ const goal = await f.runtime.submit({submissionId:'r34-finish-blocked',rootId:'project',title:'repair',
94
+ goal:'change x to y',acceptance:'complete the plan first'});
95
+ let result = await f.runtime.run({goalId:goal.goal_id,maxCycles:4});
96
+ result = await sendPlannerDecision(f.runtime,goal.goal_id,result,planCreateDecision());
97
+ assert.equal(result.loop.phase,'INSPECTING');
98
+ result = await sendPlannerDecision(f.runtime,goal.goal_id,result,finishDecision());
99
+ assert.equal(result.status,'input_required');
100
+ assert.equal(result.loop.phase,'INSPECTING');
101
+ const journal = await f.runtime.events({goalId:goal.goal_id,fromSeq:1,limit:200});
102
+ const blocked = journal.events.find(event=>event.type==='plan_guard_blocked');
103
+ assert.ok(blocked);
104
+ assert.equal(blocked.payload.reason,'plan_incomplete_blocks_finish');
105
+ assert.equal(await readFile(f.target,'utf8'),'x\n');
106
+ } finally { await f.cleanup(); }
107
+ });
108
+
109
+ test('R34 failed verification enters REPLANNING with regressed progress evidence', async () => {
110
+ const f = await createR34Fixture({withFailingProfile:true});
111
+ try {
112
+ const goal = await f.runtime.submit({submissionId:'r34-verification-regressed',rootId:'project',title:'verify',
113
+ goal:'inspect then verify x.txt',acceptance:'verification must pass'});
114
+ let result = await f.runtime.run({goalId:goal.goal_id,maxCycles:4});
115
+ result = await sendPlannerDecision(f.runtime,goal.goal_id,result,planCreateDecision());
116
+ result = await sendPlannerDecision(f.runtime,goal.goal_id,result,inspectDecision());
117
+ assert.equal(result.loop.phase,'ACTING');
118
+
119
+ result = await sendPlannerDecision(f.runtime,goal.goal_id,result,{
120
+ schema:'deadbyte.autonomous-decision.v2',kind:'act',action:{kind:'run_profile',profile_id:'check'}
121
+ });
122
+ assert.equal(result.status,'input_required');
123
+ assert.equal(result.loop.phase,'REPLANNING');
124
+ assert.equal(await readFile(f.target,'utf8'),'x\n');
125
+ const journal = await f.runtime.events({goalId:goal.goal_id,fromSeq:1,limit:200});
126
+ const failed = journal.events.find(event=>event.type==='profile_completed'&&event.payload.profile_id==='check');
127
+ assert.ok(failed);
128
+ assert.equal(failed.payload.passed,false);
129
+ const progress = [...journal.events].reverse().find(event=>event.type==='progress_judged');
130
+ assert.ok(progress);
131
+ assert.equal(progress.payload.verdict,'regressed');
132
+ const critic = journal.events.find(event=>event.type==='critic_classified'&&event.payload.failure_class==='verification_failure');
133
+ assert.ok(critic);
134
+ assert.equal(critic.payload.evidence_fingerprint,progress.payload.fingerprint);
135
+ assert.ok(journal.events.some(event=>event.type==='phase_changed'&&event.payload.to==='CRITIC'));
136
+ } finally { await f.cleanup(); }
137
+ });
138
+
139
+ test('R34 operator reject cancels a waiting goal without requiring authority re-arm', async () => {
140
+ const f = await createR34Fixture();
141
+ try {
142
+ const goal = await f.runtime.submit({submissionId:'r34-reject-waiting',rootId:'project',title:'repair',
143
+ goal:'change x to y',acceptance:'verified mutation'});
144
+ let result = await f.runtime.run({goalId:goal.goal_id,maxCycles:4});
145
+ result = await sendPlannerDecision(f.runtime,goal.goal_id,result,planCreateDecision());
146
+ result = await sendPlannerDecision(f.runtime,goal.goal_id,result,inspectDecision());
147
+ await f.disarm();
148
+ result = await sendPlannerDecision(f.runtime,goal.goal_id,result,patchDecision(f.initial_sha256));
149
+ assert.equal(result.loop.phase,'WAITING');
150
+ const rejected = await f.runtime.approve({goalId:goal.goal_id,decision:'reject'});
151
+ assert.equal(rejected.status,'rejected');
152
+ assert.equal(rejected.state,'cancelled');
153
+ assert.equal(rejected.loop.phase,'WAITING');
154
+ assert.equal(rejected.loop.wait_reason,'resume_rejected');
155
+ assert.equal(rejected.loop.pending_approval,false);
156
+ assert.equal(await readFile(f.target,'utf8'),'x\n');
157
+ } finally { await f.cleanup(); }
158
+ });
159
+
160
+ test('R34 stale SHA returns to REPLANNING without force overwrite', async () => {
161
+ const f = await createR34Fixture();
162
+ try {
163
+ const goal = await f.runtime.submit({submissionId:'r34-stale-sha',rootId:'project',title:'repair',
164
+ goal:'change x to y',acceptance:'never overwrite drifted source'});
165
+ let result = await f.runtime.run({goalId:goal.goal_id,maxCycles:4});
166
+ result = await sendPlannerDecision(f.runtime,goal.goal_id,result,planCreateDecision());
167
+ result = await sendPlannerDecision(f.runtime,goal.goal_id,result,inspectDecision());
168
+ assert.equal(result.loop.phase,'ACTING');
169
+ await writeFile(f.target,'external\n');
170
+ result = await sendPlannerDecision(f.runtime,goal.goal_id,result,patchDecision(f.initial_sha256));
171
+ assert.equal(await readFile(f.target,'utf8'),'external\n');
172
+ assert.equal(result.status,'input_required');
173
+ assert.equal(result.loop.phase,'REPLANNING');
174
+ const journal = await f.runtime.events({goalId:goal.goal_id,fromSeq:1,limit:200});
175
+ assert.ok(journal.events.some(event=>event.type==='action_precondition_failed'&&event.payload.reason==='stale_sha'));
176
+ assert.ok(journal.events.some(event=>event.type==='critic_classified'&&event.payload.failure_class==='stale_precondition'));
177
+ assert.ok(journal.events.some(event=>event.type==='phase_changed'&&event.payload.to==='CRITIC'));
178
+ assert.equal(journal.events.filter(event=>event.type==='native_diff_committed').length,0);
179
+ } finally { await f.cleanup(); }
180
+ });
181
+
182
+ test('R34 forged profile receipt substitution enters WAITING without replay', async () => {
183
+ let receiptDurable=false;
184
+ let crashOnce=true;
185
+ let commandCalls=0;
186
+ const f = await createR34Fixture({withFailingProfile:true,codingRuntimeFactory:base=>Object.freeze({...base,
187
+ commandRun:async args=>{ commandCalls+=1; const result=await base.commandRun(args); receiptDurable=true; return result; },
188
+ verifyReceiptDetailed:async receiptId=>{
189
+ const checked=await base.verifyReceiptDetailed(receiptId);
190
+ if(receiptDurable&&crashOnce){ crashOnce=false; throw new Error('simulated crash after profile receipt'); }
191
+ return checked;
192
+ }
193
+ })});
194
+ try {
195
+ const goal=await f.runtime.submit({submissionId:'r34-forged-receipt',rootId:'project',title:'verify',
196
+ goal:'run verification profile',acceptance:'receipt identity must remain exact'});
197
+ let result=await f.runtime.run({goalId:goal.goal_id,maxCycles:4});
198
+ result=await sendPlannerDecision(f.runtime,goal.goal_id,result,planCreateDecision());
199
+ result=await sendPlannerDecision(f.runtime,goal.goal_id,result,inspectDecision());
200
+ assert.equal(result.loop.phase,'ACTING');
201
+ await assert.rejects(sendPlannerDecision(f.runtime,goal.goal_id,result,{
202
+ schema:'deadbyte.autonomous-decision.v2',kind:'act',action:{kind:'run_profile',profile_id:'check'}
203
+ }),/simulated crash after profile receipt/);
204
+ assert.equal(commandCalls,1);
205
+
206
+ const forged=Object.freeze({...f.baseCodingRuntime,
207
+ commandRun:async args=>{ commandCalls+=1; return f.baseCodingRuntime.commandRun(args); },
208
+ verifyReceiptDetailed:async receiptId=>{
209
+ const checked=await f.baseCodingRuntime.verifyReceiptDetailed(receiptId);
210
+ return checked.ok?{...checked,request_sha256:'f'.repeat(64)}:checked;
211
+ }
212
+ });
213
+ const restarted=f.createRuntime({codingRuntimeOverride:forged});
214
+ result=await restarted.run({goalId:goal.goal_id,maxCycles:2});
215
+ assert.equal(result.status,'paused');
216
+ assert.equal(result.loop.phase,'WAITING');
217
+ assert.equal(result.loop.wait_reason,'ambiguous_interrupted_action');
218
+ assert.equal(commandCalls,1,'forged recovery must not execute the profile twice');
219
+ const journal=await restarted.events({goalId:goal.goal_id,fromSeq:1,limit:200});
220
+ assert.ok(journal.events.some(event=>event.type==='waiting_entered'&&event.payload.reason==='ambiguous_interrupted_action'));
221
+ assert.equal(journal.events.filter(event=>event.type==='profile_completed').length,0);
222
+ } finally { await f.cleanup(); }
223
+ });
224
+
225
+ test('R34 multi-step fail replan repair finish emits independently verifiable release evidence', async () => {
226
+ const f=await createR34Fixture({withStatefulProfile:true});
227
+ try {
228
+ await writeFile(`${f.project}/context.txt`,'CONTEXT\n');
229
+ const goal=await f.runtime.submit({submissionId:'r34-real-multistep',rootId:'project',title:'repair after evidence',
230
+ goal:'inspect two files, observe the failing verifier, replan, repair x.txt, verify, and finish',
231
+ acceptance:'x.txt must be y and the required verification profile plus release receipt must verify'});
232
+ let result=await f.runtime.run({goalId:goal.goal_id,maxCycles:4});
233
+ result=await sendPlannerDecision(f.runtime,goal.goal_id,result,planCreateDecision());
234
+ result=await sendPlannerDecision(f.runtime,goal.goal_id,result,inspectDecision());
235
+ result=await sendPlannerDecision(f.runtime,goal.goal_id,result,{
236
+ schema:'deadbyte.autonomous-decision.v2',kind:'act',action:{kind:'run_profile',profile_id:'check'}
237
+ });
238
+ assert.equal(result.loop.phase,'REPLANNING');
239
+
240
+ result=await sendPlannerDecision(f.runtime,goal.goal_id,result,{
241
+ schema:'deadbyte.autonomous-decision.v2',kind:'replan',reason:'verification failed before repair',
242
+ steps:[{step_id:'repair2',intent:'inspect x.txt and context.txt then repair x.txt under exact SHA'}]
243
+ });
244
+ assert.equal(result.loop.phase,'INSPECTING');
245
+ assert.equal(result.loop.plan_version,2);
246
+ result=await sendPlannerDecision(f.runtime,goal.goal_id,result,{
247
+ schema:'deadbyte.autonomous-decision.v2',kind:'inspect',reads:[
248
+ {path:'x.txt',max_bytes:4096},{path:'context.txt',max_bytes:4096}
249
+ ]
250
+ });
251
+ assert.equal(result.loop.phase,'ACTING');
252
+ result=await sendPlannerDecision(f.runtime,goal.goal_id,result,patchDecision(f.initial_sha256));
253
+ assert.equal(result.loop.phase,'VERIFYING');
254
+ assert.equal(await readFile(f.target,'utf8'),'y\n');
255
+
256
+ let journal=await f.runtime.events({goalId:goal.goal_id,fromSeq:1,limit:200});
257
+ const commit=[...journal.events].reverse().find(event=>event.type==='native_diff_committed');
258
+ const passingProfile=[...journal.events].reverse().find(event=>event.type==='profile_completed'&&event.payload.profile_id==='check'&&event.payload.passed===true);
259
+ assert.ok(commit);
260
+ assert.ok(passingProfile);
261
+ const inspections=journal.events.filter(event=>event.type==='inspection_completed');
262
+ assert.equal(inspections.at(-1).payload.contexts.length,2);
263
+ assert.equal(journal.events.find(event=>event.type==='plan_created').payload.plan.plan_version,1);
264
+ assert.equal(journal.events.find(event=>event.type==='plan_replanned').payload.plan.plan_version,2);
265
+ const criticEvent=journal.events.find(event=>event.type==='critic_classified'&&event.payload.failure_class==='verification_failure');
266
+ const repairStarted=journal.events.find(event=>event.type==='repair_started');
267
+ const repairCompleted=journal.events.find(event=>event.type==='repair_completed');
268
+ assert.ok(criticEvent);
269
+ assert.ok(repairStarted);
270
+ assert.ok(repairCompleted);
271
+ assert.notEqual(repairCompleted.payload.previous_fingerprint,repairCompleted.payload.repair_fingerprint);
272
+ const criticPhase=journal.events.findIndex(event=>event.type==='phase_changed'&&event.payload.to==='CRITIC');
273
+ const repairPhase=journal.events.findIndex(event=>event.type==='phase_changed'&&event.payload.from==='CRITIC'&&event.payload.to==='REPAIR');
274
+ const repairedInspect=journal.events.findIndex(event=>event.type==='phase_changed'&&event.payload.from==='REPAIR'&&event.payload.to==='INSPECT');
275
+ assert.ok(criticPhase>=0&&repairPhase>criticPhase&&repairedInspect>repairPhase);
276
+ const verdicts=journal.events.filter(event=>event.type==='progress_judged').map(event=>event.payload.verdict);
277
+ assert.ok(verdicts.includes('regressed'));
278
+ assert.ok(verdicts.includes('progress'));
279
+
280
+ result=await sendPlannerDecision(f.runtime,goal.goal_id,result,{
281
+ schema:'deadbyte.autonomous-decision.v2',kind:'step_complete',step_id:'repair2',evidence:[
282
+ {kind:'native_diff',id:commit.payload.diff_id,sha256:commit.payload.diff_receipt_sha256},
283
+ {kind:'profile',id:passingProfile.payload.receipt_id,sha256:passingProfile.payload.receipt_sha256}
284
+ ]
285
+ });
286
+ assert.equal(result.loop.phase,'PLANNING');
287
+ result=await sendPlannerDecision(f.runtime,goal.goal_id,result,finishDecision(),{maxCycles:8});
288
+ assert.equal(result.status,'completed');
289
+ assert.equal(result.loop.phase,'COMPLETE');
290
+ assert.match(result.release.receipt_sha256,/^[0-9a-f]{64}$/);
291
+ const verified=await f.runtime.verify({goalId:goal.goal_id});
292
+ assert.equal(verified.ok,true,verified.reason);
293
+ assert.equal(verified.signature_valid,true);
294
+ assert.equal(verified.receipt_sha256,result.release.receipt_sha256);
295
+ assert.equal(verified.native_diffs_verified,1);
296
+ assert.equal(verified.required_profiles_verified,1);
297
+ } finally { await f.cleanup(); }
298
+ });
299
+
300
+ test('R34 v2 crash after durable mutation reconciles the same action without duplicate apply', async () => {
301
+ let applyCalls=0;
302
+ let crashOnce=true;
303
+ const f=await createR34Fixture({nativeDiffRuntimeFactory:base=>Object.freeze({
304
+ preview:args=>base.preview(args),verify:args=>base.verify(args),
305
+ async apply(args){
306
+ applyCalls+=1;
307
+ const result=await base.apply(args);
308
+ if(crashOnce){ crashOnce=false; throw new Error('simulated R34 crash after native diff apply'); }
309
+ return result;
310
+ }
311
+ })});
312
+ try {
313
+ const goal=await f.runtime.submit({submissionId:'r34-v2-crash-dedupe',rootId:'project',title:'crash recovery',
314
+ goal:'repair x.txt exactly once',acceptance:'restart must reconcile the same action identity'});
315
+ let result=await f.runtime.run({goalId:goal.goal_id,maxCycles:4});
316
+ result=await sendPlannerDecision(f.runtime,goal.goal_id,result,planCreateDecision());
317
+ result=await sendPlannerDecision(f.runtime,goal.goal_id,result,inspectDecision());
318
+ await assert.rejects(sendPlannerDecision(f.runtime,goal.goal_id,result,patchDecision(f.initial_sha256)),/simulated R34 crash after native diff apply/);
319
+ assert.equal(applyCalls,1);
320
+ assert.equal(await readFile(f.target,'utf8'),'y\n');
321
+ let journal=await f.runtime.events({goalId:goal.goal_id,fromSeq:1,limit:200});
322
+ const started=journal.events.find(event=>event.type==='action_started');
323
+ assert.ok(started);
324
+
325
+ const restarted=f.createRuntime();
326
+ result=await restarted.run({goalId:goal.goal_id,maxCycles:2});
327
+ assert.equal(applyCalls,1,'restart must not invoke Native Diff apply a second time');
328
+ assert.equal(result.loop.phase,'VERIFYING');
329
+ journal=await restarted.events({goalId:goal.goal_id,fromSeq:1,limit:200});
330
+ const reconciled=journal.events.find(event=>event.type==='action_reconciled');
331
+ assert.ok(reconciled);
332
+ assert.equal(reconciled.payload.action_id,started.payload.action_id);
333
+ assert.equal(reconciled.payload.classification,'executed_verified');
334
+ assert.equal(journal.events.filter(event=>event.type==='action_started').length,1);
335
+ assert.equal(journal.events.filter(event=>event.type==='native_diff_committed').length,1);
336
+ assert.equal(journal.events.filter(event=>event.type==='action_completed').length,1);
337
+ } finally { await f.cleanup(); }
338
+ });
@@ -23,8 +23,8 @@ const r23Tools = [
23
23
  'contained_transform','evidence_verify','file_read','proof_execute','workspace_open',
24
24
  'agent_task_approve','agent_task_cancel','agent_task_events','agent_task_run',
25
25
  'agent_task_status','agent_task_submit','agent_task_verify',
26
- 'coding_benchmark_run','coding_command_run','coding_file_read','coding_file_write',
27
- 'coding_receipt_verify','coding_search','coding_session_status','coding_stat',
26
+ 'coding_benchmark_run','coding_command_run','coding_file_read','coding_file_write','coding_files_read',
27
+ 'coding_receipt_verify','coding_search','coding_session_status','coding_stat','coding_symbol_definition','coding_symbol_outline','coding_symbol_references','coding_symbol_replace',
28
28
  'coding_task_approve','coding_task_cancel','coding_task_events','coding_task_run',
29
29
  'coding_task_status','coding_task_submit','coding_task_verify','coding_text_replace','coding_tree'
30
30
  ];
@@ -75,7 +75,7 @@ async function fixture() {
75
75
  return { root, client, transport };
76
76
  }
77
77
 
78
- test('R30 hermetic autonomous fixture exposes the exact 41-tool no-host catalog', async () => {
78
+ test('R34 hermetic autonomous fixture exposes the exact 46-tool no-host catalog', async () => {
79
79
  const f = await fixture();
80
80
  try {
81
81
  await f.client.connect(f.transport);
@@ -1,6 +1,7 @@
1
1
  import test from 'node:test';
2
2
  import assert from 'node:assert/strict';
3
3
  import { createHash, randomBytes } from 'node:crypto';
4
+ import { spawn } from 'node:child_process';
4
5
  import { createServer } from 'node:http';
5
6
  import { mkdtemp, mkdir, readFile, rm, writeFile } from 'node:fs/promises';
6
7
  import os from 'node:os';
@@ -15,6 +16,14 @@ const repoRoot = path.resolve(here, '..');
15
16
  const serverPath = path.join(repoRoot, 'src', 'mcp-server.mjs');
16
17
  const sha = bytes => createHash('sha256').update(bytes).digest('hex');
17
18
  const nonce = () => randomBytes(32).toString('hex');
19
+ const runChild = (command,args,options={}) => new Promise((resolve,reject)=>{
20
+ const child=spawn(command,args,{...options,stdio:['ignore','pipe','pipe'],shell:false});
21
+ const out=[],err=[];
22
+ child.stdout.on('data',chunk=>out.push(Buffer.from(chunk)));
23
+ child.stderr.on('data',chunk=>err.push(Buffer.from(chunk)));
24
+ child.on('error',reject);
25
+ child.on('exit',code=>resolve({code,stdout:Buffer.concat(out).toString('utf8'),stderr:Buffer.concat(err).toString('utf8')}));
26
+ });
18
27
 
19
28
  async function startPlanner() {
20
29
  let round = 0;
@@ -31,7 +40,7 @@ async function startPlanner() {
31
40
  });
32
41
  await new Promise(resolve => server.listen(0, '127.0.0.1', resolve));
33
42
  return { server, endpoint:`http://127.0.0.1:${server.address().port}/v1/chat/completions`, rounds:() => round };
34
- }async function fixture() {
43
+ }async function fixture({supervisorMode='in_process'}={}) {
35
44
  const root = await mkdtemp(path.join(os.tmpdir(), 'deadbyte-supervisor-mcp-'));
36
45
  const project = path.join(root, 'project');
37
46
  const trust = path.join(root, 'trust');
@@ -73,9 +82,10 @@ async function startPlanner() {
73
82
  env:{ ...getDefaultEnvironment(), DEADBYTE_SIGNING_KEY:keys.privateKeyPath,
74
83
  DEADBYTE_VERIFY_KEY:keys.publicKeyPath, DEADBYTE_CODING_RUNTIME:'1',
75
84
  DEADBYTE_CODING_POLICY:codingPath, DEADBYTE_AUTONOMOUS_RUNTIME:'1',
76
- DEADBYTE_AUTONOMOUS_POLICY:autonomousPath }
85
+ DEADBYTE_AUTONOMOUS_POLICY:autonomousPath,
86
+ DEADBYTE_AUTONOMOUS_SUPERVISOR_MODE:supervisorMode }
77
87
  });
78
- return { root, planner, client, transport };
88
+ return { root, planner, client, transport, codingPath, autonomousPath, keys };
79
89
  }test('provider-backed MCP server supervises submitted goal without client run calls', async () => {
80
90
  const f = await fixture();
81
91
  try {
@@ -103,4 +113,39 @@ async function startPlanner() {
103
113
  await new Promise(resolve => f.planner.server.close(resolve));
104
114
  await rm(f.root, { recursive:true, force:true });
105
115
  }
116
+ });
117
+
118
+ test('external supervisor mode leaves provider goal durable until standalone host advances it', async () => {
119
+ const f = await fixture({supervisorMode:'external'});
120
+ try {
121
+ await f.client.connect(f.transport);
122
+ const submit = await f.client.callTool({ name:'autonomous_goal_submit', arguments:{
123
+ submission_id:'external-owner-integration', root_id:'project', title:'external-owner',
124
+ goal:'Inspect source.txt and release after verified observation.', acceptance:'source.txt must remain READY',
125
+ max_iterations:8
126
+ } });
127
+ assert.equal(submit.isError,false);
128
+ const goalId=submit.structuredContent.goal_id;
129
+ await new Promise(resolve=>setTimeout(resolve,1200));
130
+ const before=await f.client.callTool({name:'autonomous_goal_status',arguments:{goal_id:goalId}});
131
+ assert.equal(before.isError,false);
132
+ assert.equal(before.structuredContent.state,'pending');
133
+ assert.equal(f.planner.rounds(),0);
134
+
135
+ const host=await runChild(process.execPath,[path.join(repoRoot,'src','autonomous-supervisor-host.mjs')],{
136
+ cwd:repoRoot,
137
+ env:{...process.env,DEADBYTE_SIGNING_KEY:f.keys.privateKeyPath,DEADBYTE_VERIFY_KEY:f.keys.publicKeyPath,
138
+ DEADBYTE_CODING_POLICY:f.codingPath,DEADBYTE_AUTONOMOUS_POLICY:f.autonomousPath,
139
+ DEADBYTE_SUPERVISOR_ONCE:'1',DEADBYTE_SUPERVISOR_MARKER:path.join(f.root,'external-supervisor-owner.json')}
140
+ });
141
+ assert.equal(host.code,0,host.stderr||host.stdout);
142
+ const after=await f.client.callTool({name:'autonomous_goal_status',arguments:{goal_id:goalId}});
143
+ assert.equal(after.isError,false);
144
+ assert.equal(after.structuredContent.state,'succeeded');
145
+ assert.ok(f.planner.rounds()>=2);
146
+ } finally {
147
+ await f.client.close().catch(()=>{});
148
+ await new Promise(resolve=>f.planner.server.close(resolve));
149
+ await rm(f.root,{recursive:true,force:true});
150
+ }
106
151
  });
@@ -0,0 +1,49 @@
1
+ import test from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import {
4
+ R35_BENCHMARK_CASE_IDS,
5
+ benchmarkCaseDefinitions,
6
+ fixtureIdentityForCase,
7
+ runCapabilityBenchmark
8
+ } from '../src/capability-benchmark-runner.mjs';
9
+
10
+ const REQUIRED=[
11
+ 'filesystem_bounded_read','exact_edit_stale_reject','paged_search','process_owned_lifecycle',
12
+ 'semantic_typescript','semantic_python','semantic_rust','semantic_cpp','context_provenance',
13
+ 'autonomous_fail_repair','remote_replay_dedupe'
14
+ ];
15
+
16
+ test('R35 benchmark corpus exposes the exact required offline case set',()=>{
17
+ assert.deepEqual([...R35_BENCHMARK_CASE_IDS],REQUIRED);
18
+ const defs=benchmarkCaseDefinitions();
19
+ assert.deepEqual(defs.map(item=>item.case_id),REQUIRED);
20
+ for(const item of defs){
21
+ assert.ok(Array.isArray(item.test_files)&&item.test_files.length>=1,item.case_id);
22
+ assert.ok(Number.isInteger(item.round_trips)&&item.round_trips>=1,item.case_id);
23
+ assert.equal(typeof item.stale_rejected,'boolean');
24
+ assert.equal(typeof item.recovery_success,'boolean');
25
+ }
26
+ });
27
+
28
+ test('fixture identity is deterministic and changes when any declared fixture byte changes',async()=>{
29
+ const root=new URL('../',import.meta.url);
30
+ const def={case_id:'fixture_probe',test_files:['test/capability-benchmark.test.mjs'],fixture_files:['test/capability-benchmark.test.mjs']};
31
+ const a=await fixtureIdentityForCase({rootUrl:root,definition:def});
32
+ const b=await fixtureIdentityForCase({rootUrl:root,definition:structuredClone(def)});
33
+ assert.match(a,/^[0-9a-f]{64}$/);assert.equal(a,b);
34
+ });
35
+
36
+ test('runner fails closed on a failed case and returns evidence-backed metrics for passing cases',async()=>{
37
+ const defs=[
38
+ {case_id:'pass_case',test_files:['test/capability-benchmark.test.mjs'],fixture_files:['test/capability-benchmark.test.mjs'],round_trips:1,stale_rejected:false,recovery_success:true},
39
+ {case_id:'fail_case',test_files:['test/__definitely_missing__.test.mjs'],fixture_files:['test/capability-benchmark.test.mjs'],round_trips:1,stale_rejected:false,recovery_success:false}
40
+ ];
41
+ const root=new URL('../',import.meta.url);
42
+ const result=await runCapabilityBenchmark({rootUrl:root,definitions:defs,env:{},timeoutMs:30_000});
43
+ assert.equal(result.schema,'deadbyte.r35-capability-benchmark.v1');
44
+ assert.equal(result.overall_correct,false);
45
+ const pass=result.cases.find(item=>item.case_id==='pass_case');
46
+ const fail=result.cases.find(item=>item.case_id==='fail_case');
47
+ assert.equal(pass.correct,true);assert.match(pass.evidence_sha256,/^[0-9a-f]{64}$/);assert.ok(pass.bytes_returned>0);assert.ok(pass.elapsed_ms>=0);
48
+ assert.equal(fail.correct,false);assert.match(fail.evidence_sha256,/^[0-9a-f]{64}$/);
49
+ });
@@ -0,0 +1,47 @@
1
+ import test from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import {
4
+ CAPABILITY_BENCHMARK_SCHEMA,
5
+ normalizeBenchmarkCase,
6
+ buildCapabilityBenchmark
7
+ } from '../src/capability-benchmark.mjs';
8
+
9
+ const H=c=>c.repeat(64);
10
+ const base={case_id:'filesystem_bounded_read',fixture_sha256:H('a'),correct:true,round_trips:2,bytes_returned:128,
11
+ elapsed_ms:12.5,stale_rejected:false,recovery_success:true,duplicate_side_effects:0,evidence_sha256:H('b')};
12
+
13
+ test('R35 benchmark schema is exact and preserves separate measurable dimensions',()=>{
14
+ assert.equal(CAPABILITY_BENCHMARK_SCHEMA,'deadbyte.r35-capability-benchmark.v1');
15
+ const value=normalizeBenchmarkCase(base);
16
+ assert.deepEqual(Object.keys(value).sort(),[
17
+ 'bytes_returned','case_id','correct','duplicate_side_effects','elapsed_ms','evidence_sha256','fixture_sha256',
18
+ 'recovery_success','round_trips','stale_rejected'
19
+ ].sort());
20
+ assert.equal(value.correct,true);assert.equal(value.round_trips,2);assert.equal(value.duplicate_side_effects,0);
21
+ });
22
+
23
+ test('benchmark rejects missing evidence and invalid measurements instead of manufacturing a score',()=>{
24
+ assert.throws(()=>normalizeBenchmarkCase({...base,evidence_sha256:undefined}),/evidence/i);
25
+ assert.throws(()=>normalizeBenchmarkCase({...base,elapsed_ms:-1}),/elapsed/i);
26
+ assert.throws(()=>normalizeBenchmarkCase({...base,round_trips:0}),/round.?trips/i);
27
+ assert.throws(()=>normalizeBenchmarkCase({...base,duplicate_side_effects:-1}),/duplicate/i);
28
+ });
29
+
30
+ test('aggregate identity is deterministic across timing changes while fixture/correctness verdicts remain inspectable',()=>{
31
+ const cases=[base,{...base,case_id:'remote_replay_dedupe',fixture_sha256:H('c'),evidence_sha256:H('d'),elapsed_ms:22}];
32
+ const first=buildCapabilityBenchmark({suite_id:'r35-offline-v1',cases});
33
+ const second=buildCapabilityBenchmark({suite_id:'r35-offline-v1',cases:cases.map(item=>({...item,elapsed_ms:item.elapsed_ms+100}))});
34
+ assert.equal(first.schema,CAPABILITY_BENCHMARK_SCHEMA);
35
+ assert.equal(first.fixture_identity_sha256,second.fixture_identity_sha256);
36
+ assert.deepEqual(first.cases.map(item=>[item.case_id,item.correct,item.fixture_sha256]),
37
+ second.cases.map(item=>[item.case_id,item.correct,item.fixture_sha256]));
38
+ assert.notEqual(first.observation_sha256,second.observation_sha256,'observed timings remain evidence, not hidden');
39
+ assert.equal(first.overall_correct,true);
40
+ assert.equal('score' in first,false);
41
+ });
42
+
43
+ test('aggregate fails closed on duplicate case ids or any incorrect case',()=>{
44
+ assert.throws(()=>buildCapabilityBenchmark({suite_id:'r35-offline-v1',cases:[base,base]}),/duplicate case/i);
45
+ const result=buildCapabilityBenchmark({suite_id:'r35-offline-v1',cases:[base,{...base,case_id:'broken',correct:false,evidence_sha256:H('e')} ]});
46
+ assert.equal(result.overall_correct,false);
47
+ });
@@ -27,6 +27,18 @@ test('npx CLI remote path invokes stable PS1 directly and never routes through C
27
27
  assert.match(source,/verifyAuditChain/);
28
28
  });
29
29
 
30
+ test('npx CLI exposes local supervisor lifecycle without any supervisor arm command',async()=>{
31
+ const source=await readFile(cliPath,'utf8');
32
+ assert.match(source,/SUPERVISOR_COMMANDS/);
33
+ assert.match(source,/supervisorstart/);
34
+ assert.match(source,/supervisorstop/);
35
+ assert.match(source,/supervisorstatus/);
36
+ assert.match(source,/supervisorrecover/);
37
+ const mapping=source.match(/const SUPERVISOR_COMMANDS=.*?;\n/s)?.[0]??'';
38
+ assert.doesNotMatch(mapping,/arm(?:coding|autonomous|process|host)/i);
39
+ assert.match(source,/npx deadbyte-mcp@latest supervisor status/);
40
+ });
41
+
30
42
  test('README makes npx the primary operator UX',async()=>{
31
43
  const readme=await readFile(path.join(root,'README.txt'),'utf8');
32
44
  assert.match(readme,/npx deadbyte-mcp@latest remote/);
@@ -0,0 +1,24 @@
1
+ import test from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { readFile } from 'node:fs/promises';
4
+ import path from 'node:path';
5
+ import { fileURLToPath } from 'node:url';
6
+
7
+ const root=path.resolve(fileURLToPath(new URL('..',import.meta.url)));
8
+ const expected=[
9
+ 'coding_benchmark_run','coding_command_run','coding_file_read','coding_file_write','coding_files_read',
10
+ 'coding_receipt_verify','coding_search','coding_session_status','coding_stat','coding_symbol_definition',
11
+ 'coding_symbol_outline','coding_symbol_references','coding_symbol_replace','coding_task_approve','coding_task_cancel',
12
+ 'coding_task_events','coding_task_run','coding_task_status','coding_task_submit','coding_task_verify','coding_text_replace','coding_tree'
13
+ ].sort();
14
+ function extract(source){
15
+ const m=source.match(/const (?:codingTools|coding)\s*=\s*\[([\s\S]*?)\];/);
16
+ assert.ok(m,'coding catalog array missing');
17
+ return [...m[1].matchAll(/'([^']+)'/g)].map(x=>x[1]).sort();
18
+ }
19
+ for(const rel of ['src/machine-fs-smoke-client.mjs','src/observation-smoke-client.mjs','src/remote-mcp-coding-smoke-client.mjs','src/remote-mcp-smoke-client.mjs']){
20
+ test(`${rel} uses the exact R34 22-tool coding catalog`,async()=>{
21
+ const source=await readFile(path.join(root,...rel.split('/')),'utf8');
22
+ assert.deepEqual(extract(source),expected);
23
+ });
24
+ }
@@ -14,8 +14,8 @@ const repoRoot = path.resolve(here, '..');
14
14
  const serverPath = path.join(repoRoot, 'src', 'mcp-server.mjs');
15
15
  const workspaceRoot = path.join(repoRoot, 'workspaces');
16
16
  const codingTools = [
17
- 'coding_benchmark_run', 'coding_command_run', 'coding_file_read', 'coding_file_write',
18
- 'coding_receipt_verify', 'coding_search', 'coding_session_status', 'coding_stat', 'coding_task_approve', 'coding_task_cancel',
17
+ 'coding_benchmark_run', 'coding_command_run', 'coding_file_read', 'coding_file_write', 'coding_files_read',
18
+ 'coding_receipt_verify', 'coding_search', 'coding_session_status', 'coding_stat', 'coding_symbol_definition', 'coding_symbol_outline', 'coding_symbol_references', 'coding_symbol_replace', 'coding_task_approve', 'coding_task_cancel',
19
19
  'coding_task_events', 'coding_task_run', 'coding_task_status', 'coding_task_submit',
20
20
  'coding_task_verify', 'coding_text_replace', 'coding_tree'
21
21
  ];
@@ -69,7 +69,7 @@ async function fixture() {
69
69
  return { root, client, transport };
70
70
  }
71
71
 
72
- test('R27 hermetic coding fixture exposes the exact 29-tool no-host catalog', async () => {
72
+ test('R34 hermetic coding fixture exposes the exact 34-tool no-host catalog', async () => {
73
73
  const f = await fixture();
74
74
  try {
75
75
  await f.client.connect(f.transport);