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,435 @@
1
+ # R34 DEADBYTE Loop Engine Design
2
+
3
+ ## Goal
4
+
5
+ R34 turns the existing autonomous production runtime into a durable Windows-native engineering supervisor that can accept a goal, build and maintain an explicit plan, repeatedly inspect/decide/act/observe/verify, replan when evidence invalidates the plan, survive process/runtime crashes without duplicating mutations, detect lack of progress, expose live phase/state, and finish only through independently verifiable release evidence.
6
+
7
+ R34 is a successor to the sealed R33 / `0.8.10` public baseline. The R33 release and candidate are immutable. Development happens only in `D:\Projects\deadbyte-mcp-r34-loop-engine`, created from the exact R33 `0.8.10` source baseline with `package.json` SHA-256 `99bb03660e5f1915c92d6c12e1526fcde23e15838ee62589a2117e2458178765`.
8
+
9
+ The engine remains Windows-only. It does not add a Linux/macOS backend or cross-platform abstraction layer.
10
+
11
+ ## Product Intent
12
+
13
+ R34 combines the strengths the project is targeting without copying their architecture:
14
+
15
+ - Desktop Commander-style operational breadth remains delegated to existing bounded process/filesystem/observation runtimes.
16
+ - Serena-style semantic intelligence is explicitly deferred to R35.
17
+ - Remote Desktop Commander-style multi-machine control is explicitly deferred to R36.
18
+ - Manus-style planner + execution loop is adopted as a control pattern, but all execution remains inside DEADBYTE's authority, signed-receipt, fail-closed, Windows-native model.
19
+
20
+ The defining R34 property is not "the model loops." The defining property is that every loop transition is durable, bounded, evidence-driven, crash-reconcilable, authority-gated, and independently auditable.
21
+
22
+ ## Scope
23
+
24
+ In scope:
25
+
26
+ - durable initial plan creation before nontrivial mutation;
27
+ - one supervisor loop with explicit phases `PLANNING`, `INSPECTING`, `ACTING`, `VERIFYING`, `REPLANNING`, `WAITING`, `COMPLETE`;
28
+ - typed structured planner decisions with no JSON embedded inside prose;
29
+ - plan creation, step completion, replan, pause and finish contracts;
30
+ - durable current-plan identity and versioning;
31
+ - recent working context plus compacted historical evidence plus durable project memory;
32
+ - progress scoring from observed evidence/state changes rather than repeated planner text;
33
+ - bounded no-progress detection and forced replan/pause;
34
+ - crash reconciliation before every new action;
35
+ - duplicate-mutation prevention using signed prior-action evidence and request identity;
36
+ - per-action authority checks; planner output can never arm or widen authority;
37
+ - resumable waiting/approval/rejection state;
38
+ - live phase and event timeline through existing autonomous status/event surfaces;
39
+ - independent final verification before success;
40
+ - an out-of-band supervisor/recovery design that does not depend on the managed MCP bridge staying alive;
41
+ - adversarial tests for stale state, repeated decisions, crash boundaries, interrupted actions, revoked authority and forged evidence.
42
+
43
+ Out of scope:
44
+
45
+ - semantic/LSP code intelligence and semantic rename (R35);
46
+ - multi-machine pairing/fabric (R36);
47
+ - broad persistent commander runtime additions beyond what R34 needs (R37);
48
+ - competitor benchmark/final comparison harness (R38);
49
+ - automatic authority arming;
50
+ - raw arbitrary shell/executable/environment injection;
51
+ - Docker-per-task isolation;
52
+ - Linux/macOS support;
53
+ - changing or republishing R33 `0.8.10`.
54
+
55
+ ## Baseline Integration
56
+
57
+ R33 already provides substantial primitives that R34 must reuse instead of replacing:
58
+
59
+ - signed autonomous goal and event journals;
60
+ - durable planner request/decision events;
61
+ - active plan state with immutable completed prefix;
62
+ - planner contract rejection and repair;
63
+ - Native Diff preview/apply/verify with exact SHA preconditions;
64
+ - profile execution with signed receipts;
65
+ - delegated process/filesystem/observation operations;
66
+ - authority gating for coding/autonomous mutations;
67
+ - crash reconciliation for profile receipts;
68
+ - release gate and signed autonomous release receipt;
69
+ - repeated identical-decision pause guard;
70
+ - provider-backed or client-sampling planner backends.
71
+
72
+ R34 therefore evolves the existing `autonomous-runtime`, `autonomous-planner`, supervisor and tests instead of building a second autonomous stack.
73
+
74
+ ## Public Surface Decision
75
+
76
+ R34 does not add new MCP tool names by default. It reuses the existing autonomous control surface:
77
+
78
+ - `autonomous_goal_submit`
79
+ - `autonomous_goal_run`
80
+ - `autonomous_goal_status`
81
+ - `autonomous_goal_events`
82
+ - `autonomous_goal_approve`
83
+ - `autonomous_goal_cancel`
84
+ - `autonomous_goal_verify`
85
+ - `autonomous_release_gate`
86
+
87
+ The returned schemas may gain R34 loop-state fields only where strict backward-compatible output evolution is possible. If strict output compatibility cannot be preserved, R34 must version the affected output schema explicitly rather than silently changing semantics.
88
+
89
+ No public tool may directly arm Process, Coding, Autonomous or Host authority.
90
+
91
+ ## Architecture
92
+
93
+ R34 is split into focused modules so each responsibility is independently testable.
94
+
95
+ ### 1. Loop State Reducer
96
+
97
+ A pure reducer derives current loop state exclusively from the verified signed event journal. It owns no I/O.
98
+
99
+ Derived fields include:
100
+
101
+ - `phase`;
102
+ - `plan_id` and `plan_version`;
103
+ - active/completed/current step;
104
+ - mutation epoch;
105
+ - observation/evidence head;
106
+ - progress state;
107
+ - pending action;
108
+ - pending approval;
109
+ - last verified action receipt binding;
110
+ - planner round;
111
+ - replan count;
112
+ - terminal/wait reason.
113
+
114
+ The reducer is the only authority for reconstructed state after restart. No mutable sidecar state outranks the signed journal.
115
+
116
+ ### 2. Typed Planner Contract
117
+
118
+ The planner produces one native structured decision object validated against a strict schema. R34 must not recover a contract by scraping JSON from prose or Markdown.
119
+
120
+ Planner operations are conceptually:
121
+
122
+ - `plan_create` — establish the first durable plan;
123
+ - `inspect` — request bounded source/runtime evidence;
124
+ - `act` — request one bounded action already supported by DEADBYTE runtimes;
125
+ - `step_complete` — mark the active plan step complete with evidence references;
126
+ - `replan` — replace only the mutable suffix of the plan, preserving completed history;
127
+ - `pause` — enter durable waiting state with reason;
128
+ - `finish` — request final verification/release gate.
129
+
130
+ Provider adapters may represent these through native structured/tool-call APIs where supported. Internally every decision is normalized into one canonical R34 decision schema before it enters the journal.
131
+
132
+ Planner rationale may be retained as bounded metadata, but rationale never authorizes execution and is not treated as proof.
133
+
134
+ ### 3. Plan Store
135
+
136
+ The plan is journal-backed, versioned and content-addressed.
137
+
138
+ A plan contains:
139
+
140
+ - immutable `plan_id` for the goal;
141
+ - monotonic `plan_version`;
142
+ - title and bounded steps;
143
+ - each step's stable `step_id`, intent, status and optional evidence bindings;
144
+ - creation/replan reason hash;
145
+ - parent plan version for replans.
146
+
147
+ Rules:
148
+
149
+ - completed prefix is immutable;
150
+ - at most one step is active;
151
+ - replan may only modify the active/pending suffix;
152
+ - a step becomes completed only after its completion evidence verifies;
153
+ - `finish` is blocked until all required plan steps are complete;
154
+ - once all steps are complete, non-verification mutation requires an explicit replan first.
155
+
156
+ ### 4. Context Engine
157
+
158
+ The planner view is built from three layers.
159
+
160
+ **Working context** contains recent source reads, current observations, active process/search identities, current plan and recent decisions.
161
+
162
+ **Historical evidence summary** contains compacted older events. Compaction must preserve machine-useful identity, including hashes, receipt ids/hashes, request ids, failure causes, mutation epochs, plan transitions, unresolved constraints and verification verdicts. Raw stale payload bytes may be dropped.
163
+
164
+ **Durable project memory** contains stable project facts explicitly produced by the engine for the current goal/workspace: acceptance constraints, proven invariants, rejected approaches, important file identities and unresolved blockers. It is goal/workspace scoped, not account-personality memory.
165
+
166
+ Compaction is deterministic and budgeted. It must never summarize away a SHA precondition, receipt binding, failure cause, unresolved constraint or authority state required to make the next safe decision.
167
+
168
+ ### 5. Progress Judge
169
+
170
+ The Progress Judge computes progress from machine-observed deltas, not planner self-report.
171
+
172
+ Progress signals include:
173
+
174
+ - new verified source/context identity;
175
+ - new passing/failing profile evidence;
176
+ - changed mutation epoch with verified Native Diff;
177
+ - resolved failed acceptance condition;
178
+ - completed plan step with evidence;
179
+ - new diagnostic narrowing a blocker;
180
+ - successful recovery of an interrupted action;
181
+ - final release-readiness improvement.
182
+
183
+ No-progress signals include:
184
+
185
+ - repeated equivalent decisions with no new evidence;
186
+ - repeated reads of identical SHA/content without a changed hypothesis;
187
+ - repeated failing command/profile with identical receipt outcome and no source mutation;
188
+ - repeated replan that leaves the executable next action materially unchanged;
189
+ - oscillation between plan states.
190
+
191
+ The judge produces a deterministic bounded verdict such as `progress`, `stalled`, or `regressed` plus machine-derived reason codes. After a configurable small number of stalled cycles, the engine must force `REPLANNING`; repeated stall after replan must enter `WAITING` instead of spinning indefinitely.
192
+
193
+ The planner cannot override a stall verdict.
194
+
195
+ ### 6. Action Executor
196
+
197
+ The executor accepts exactly one normalized action at a time.
198
+
199
+ Before action start it must:
200
+
201
+ 1. verify goal and event journal;
202
+ 2. reconcile any previously started action;
203
+ 3. verify current authority for the requested root/runtime;
204
+ 4. validate exact action schema and identity;
205
+ 5. bind a deterministic action/request id;
206
+ 6. append durable `action_started` evidence before side effects.
207
+
208
+ After execution it must independently verify the resulting receipt/journal/state and append `action_completed` only after verification.
209
+
210
+ Mutations continue to use Native Diff and exact SHA preconditions. Process and observation operations continue to use their existing ownership/evidence models.
211
+
212
+ ### 7. Crash Reconciler
213
+
214
+ Crash reconciliation runs before every new action and on supervisor takeover.
215
+
216
+ For a prior `action_started` without `action_completed`, it must classify the action into one of these states:
217
+
218
+ - `not_executed` — no matching signed receipt/state evidence exists; action may be retried with the same deterministic request identity;
219
+ - `executed_verified` — matching receipt/state proves the action already happened; append recovered completion and do not execute again;
220
+ - `executed_failed_verified` — matching evidence proves a failed outcome; record it and continue through verification/replan rules;
221
+ - `ambiguous` — evidence is missing, conflicting or unverifiable; pause fail-closed and require operator approval/recovery.
222
+
223
+ No mutation may be replayed merely because the process crashed before recording completion.
224
+
225
+ ### 8. Authority Gate
226
+
227
+ Authority remains outside planner control.
228
+
229
+ Every action that requires Process/Coding/Autonomous/Host authority checks the live grant immediately before execution. A plan may describe an action whose authority is unavailable, but the engine must enter `WAITING`/`authority_unavailable` instead of arming itself.
230
+
231
+ Planner contracts cannot contain arm operations, authority-file paths, arbitrary environment variables or policy widening.
232
+
233
+ Revocation during a loop stops the next privileged action. Already-started actions are reconciled from evidence before any resume.
234
+
235
+ ### 9. Waiting, Approval and Takeover
236
+
237
+ `WAITING` is a durable phase, not an exception path.
238
+
239
+ Waiting reasons include:
240
+
241
+ - authority unavailable/revoked;
242
+ - ambiguous interrupted action;
243
+ - explicit planner checkpoint;
244
+ - repeated no-progress after replan;
245
+ - external dependency unavailable;
246
+ - operator-requested pause.
247
+
248
+ Approve/reject uses existing authenticated goal approval semantics. Approval resumes from the verified journal head; rejection cancels or preserves the blocked goal according to the reason contract.
249
+
250
+ Supervisor takeover is safe only after proving the prior supervisor instance is gone or ownership expired according to signed/runtime identity. A new supervisor never assumes an in-memory predecessor state.
251
+
252
+ ### 10. Out-of-Band Supervisor Control
253
+
254
+ R33 public-closeout testing exposed a control-plane weakness: parking or restarting the managed MCP bridge can remove the same transport the agent is using to supervise recovery.
255
+
256
+ R34 must separate the loop supervisor's local recovery authority from the managed public MCP bridge. The minimum R34 design is a Windows-local supervisor process/state path that can:
257
+
258
+ - observe the managed bridge/runtime status;
259
+ - resume/reconcile a loop after managed bridge restart;
260
+ - restore the runtime to an ONLINE + authority-disarmed state after lifecycle tests or controlled recovery;
261
+ - write durable supervisor events/receipts outside the bridge process lifetime.
262
+
263
+ This channel is local-machine only in R34. Multi-machine remote supervisor control belongs to R36.
264
+
265
+ It must not become an unauthenticated backdoor. It uses existing pinned executable/script identity and explicit local authority policy. It cannot arm privileged planes automatically.
266
+
267
+ ## Loop State Machine
268
+
269
+ The canonical loop is:
270
+
271
+ `PLANNING -> INSPECTING -> ACTING -> VERIFYING -> (INSPECTING | REPLANNING | WAITING | COMPLETE)`
272
+
273
+ Detailed behavior:
274
+
275
+ 1. `PLANNING`: create the initial plan if none exists; otherwise select/maintain the active step.
276
+ 2. `INSPECTING`: gather bounded evidence needed for the active step.
277
+ 3. `ACTING`: perform at most one bounded action after authority and crash reconciliation gates.
278
+ 4. `VERIFYING`: independently verify the action result and evaluate acceptance/progress.
279
+ 5. `REPLANNING`: update only the mutable plan suffix when evidence invalidates the current route or progress stalls.
280
+ 6. `WAITING`: stop execution durably until authority, operator decision or external condition permits resume.
281
+ 7. `COMPLETE`: reached only after finish request, required release profiles, Native Diff/current-state verification and signed final receipt all pass.
282
+
283
+ Every transition is represented by a signed event. A process restart reconstructs the same phase from the journal.
284
+
285
+ ## Event Model
286
+
287
+ R34 extends the autonomous event vocabulary with explicit loop semantics. Event names may be refined during implementation, but the semantic set is fixed:
288
+
289
+ - loop/supervisor started or taken over;
290
+ - phase changed;
291
+ - plan created;
292
+ - plan replanned;
293
+ - step activated;
294
+ - inspection requested/completed;
295
+ - action started;
296
+ - action reconciled;
297
+ - action completed;
298
+ - verification completed;
299
+ - progress judged;
300
+ - step completed;
301
+ - waiting entered/resumed;
302
+ - finish requested;
303
+ - final verification/release completed.
304
+
305
+ Events remain hash-chained and Ed25519-signed using the existing autonomous journal model. New events must preserve replay determinism: deriving state from the same verified journal must produce the same logical loop state.
306
+
307
+ ## Structured Output and Provider Adapters
308
+
309
+ R34 prefers provider-native structured/tool calling where the provider supports it. Provider-specific response envelopes do not enter core state directly.
310
+
311
+ Each provider adapter must output the same canonical R34 decision object. The adapter records provider/model identity and a hash of the raw provider response, while the normalized decision is validated independently.
312
+
313
+ For client-sampling MCP mode, the client receives the typed schema/contract and returns one normalized response bound to the planner request id.
314
+
315
+ Malformed or schema-invalid responses are rejected and may be repaired a bounded number of times. Repeated contract failure enters `WAITING` rather than consuming unbounded turns.
316
+
317
+ ## Error Handling
318
+
319
+ R34 is fail-closed.
320
+
321
+ - Journal/signature failure: stop immediately; no action.
322
+ - Authority missing: `WAITING`, no auto-arm.
323
+ - SHA precondition failure: return to inspection/replan; never force overwrite.
324
+ - Missing receipt after an interrupted mutation: classify as ambiguous unless current state plus signed evidence proves exactly what occurred.
325
+ - Provider outage: bounded retry/backoff, then `WAITING` with durable reason.
326
+ - Runtime/tool error with verified receipt: record observed failure, judge progress, then inspect/replan.
327
+ - Repeated planner contract error: bounded repair attempts, then `WAITING`.
328
+ - Repeated no-progress: forced replan; repeated stall after replan -> `WAITING`.
329
+ - Supervisor crash: new supervisor reconstructs from signed journal and reconciles the last action before doing anything else.
330
+
331
+ No error path may silently delete evidence, reset plan history, arm authority or mark a step complete without verification.
332
+
333
+ ## Security Invariants
334
+
335
+ R34 must preserve these invariants:
336
+
337
+ - no planner-controlled authority widening;
338
+ - no raw arbitrary command execution path introduced by the Loop Engine;
339
+ - no raw PID/executable/environment acceptance where existing runtimes intentionally use owned identities/profiles;
340
+ - all source mutations remain SHA-preconditioned and Native-Diff verified;
341
+ - completed plan history is immutable;
342
+ - every side effect has durable pre-side-effect intent evidence;
343
+ - every claimed completion has independently checked post-side-effect evidence;
344
+ - crash ambiguity pauses instead of guessing;
345
+ - release success requires current-state verification, not only historical receipts;
346
+ - public runtime recovery cannot bypass local security policy;
347
+ - Windows-only semantics remain first-class rather than hidden behind a cross-platform abstraction.
348
+
349
+ ## Testing Strategy
350
+
351
+ Implementation follows TDD. Each capability begins with a failing focused test before production code changes.
352
+
353
+ Required focused suites:
354
+
355
+ 1. Plan lifecycle
356
+ - initial plan required for nontrivial goal;
357
+ - immutable completed prefix;
358
+ - one active step;
359
+ - replan mutates only suffix;
360
+ - incomplete plan blocks finish.
361
+
362
+ 2. Phase reducer
363
+ - every phase transition derives deterministically from journal;
364
+ - restart reconstructs identical state;
365
+ - malformed/tampered journal fails closed.
366
+
367
+ 3. Context engine
368
+ - deterministic compaction;
369
+ - preserves SHA/receipt/failure/unresolved-constraint identities;
370
+ - stays inside byte budget;
371
+ - does not expose forbidden raw secrets.
372
+
373
+ 4. Progress judge
374
+ - recognizes verified progress;
375
+ - catches repeated equivalent decision/no-new-evidence loops;
376
+ - forces replan;
377
+ - repeated post-replan stall pauses.
378
+
379
+ 5. Crash reconciliation
380
+ - crash before side effect;
381
+ - crash after side effect before completion event;
382
+ - verified success recovery without duplicate mutation;
383
+ - verified failure recovery;
384
+ - ambiguous evidence pauses;
385
+ - stale/forged receipt rejected.
386
+
387
+ 6. Authority
388
+ - missing/revoked Coding/Autonomous/Process/Host authority blocks relevant action;
389
+ - planner cannot arm;
390
+ - resume after operator arm continues from same journal head;
391
+ - revocation mid-loop prevents the next privileged action.
392
+
393
+ 7. Supervisor
394
+ - takeover after dead owner;
395
+ - refuses takeover of live verified owner;
396
+ - bridge restart does not lose loop state;
397
+ - local recovery returns managed runtime ONLINE while leaving privileged authority DISARMED.
398
+
399
+ 8. End-to-end loop
400
+ - inspect -> patch -> verify -> step complete -> finish;
401
+ - observed test failure -> diagnose -> replan -> fix -> verify;
402
+ - persistent process/session observation delegated safely;
403
+ - cancellation and approval paths;
404
+ - signed final release receipt independently verifies.
405
+
406
+ Adversarial cases must include malicious paths, stale hashes, receipt substitution, event deletion/reorder, PID reuse, stale supervisor identity, duplicate action replay, provider repeated garbage, large context pressure and authority loss.
407
+
408
+ ## Acceptance Gate
409
+
410
+ R34 is not complete until all of the following are observed on the exact candidate bytes:
411
+
412
+ - full pre-existing R33 suite remains green;
413
+ - all new R34 focused/adversarial tests pass;
414
+ - deterministic journal replay proves identical derived loop state across restart;
415
+ - a real multi-step workspace task completes through the full loop with signed evidence;
416
+ - injected crash after mutation but before completion does not duplicate the mutation;
417
+ - no-progress scenario forces replan and then pauses when still stalled;
418
+ - authority revoke prevents further privileged actions without corrupting goal state;
419
+ - out-of-band local supervisor restores managed MCP after bridge lifecycle loss while leaving all privileged planes DISARMED;
420
+ - final autonomous release receipt independently verifies current Native Diff head and required profiles;
421
+ - exact public tool catalog change, if any, is explicitly reviewed rather than accidental;
422
+ - Windows gate passes on exact release bytes;
423
+ - immutable release/package generation and final closure follow the proven R33 release process.
424
+
425
+ ## Versioning and Release Discipline
426
+
427
+ R34 development starts from R33 `0.8.10` but must receive a new package version only when its release candidate is cut. The design does not preselect that semantic version.
428
+
429
+ No R34 test or helper may mutate or republish R33 `0.8.10`.
430
+
431
+ The project remains NON-GIT in this environment. Superpowers documentation is still written under `docs/superpowers`, but no Git commit/HEAD may be invented as evidence.
432
+
433
+ ## R34 Done Definition
434
+
435
+ R34 is done when DEADBYTE MCP can run a durable engineering goal through an explicit, evidence-driven plan loop; survive/reconcile crashes without duplicate side effects; detect and stop non-progress; respect live authority without self-arming; keep context bounded without losing proof identity; expose reconstructable live phases; recover the managed MCP runtime through a separate local supervisor path; and produce an independently verified final release receipt on the exact candidate state.
@@ -0,0 +1,220 @@
1
+ # DEADBYTE MCP R35 Production Successor Design
2
+
3
+ ## Identity and parent authority
4
+
5
+ R35 is `V0.9.0 / R35`. Its immutable parent is the sealed R34 Production Final Baseline:
6
+
7
+ - release id: `v0.8.11-6c01e5285e065220`
8
+ - manifest SHA-256: `6c01e5285e065220db07d7719f78bb6aa4fde88365419281b33be1b1d59dd3c5`
9
+ - manifest entries: `1560`
10
+ - public MCP tools: `73`
11
+ - source regression: `452/452 PASS`
12
+ - closure SHA-256: `5102fd0d3735dbbc324f3de6d208f2e37b72562980d9b965d4a923887a9950f3`
13
+ - independent verify SHA-256: `a49a8641a3c102c7715e220b03ee6057e1cd833eb184e8051596c6e1dfeefab6`
14
+
15
+ R34 bytes are read-only authority. R35 must be created as a separate workspace and every release proof must be able to roll back to this exact R34 release.
16
+
17
+ ## Mission
18
+
19
+ R35 extends DEADBYTE MCP without weakening R34 safety or operator ergonomics. The release keeps the R34 public tool names stable unless a versioned schema change is proven necessary, while improving semantic breadth, context provenance, durable loop reliability, provider failure handling, remote resume behavior, and evidence-based comparative benchmarks.
20
+
21
+ The engineering loop remains single-agent and evidence-first:
22
+
23
+ `PLAN -> INSPECT -> ACT -> VERIFY -> CRITIC -> REPAIR -> RELEASE`
24
+
25
+ No phase may claim success from prose. Release completion requires observed tests, signed evidence, immutable slot activation, rollback to sealed R34, restore to R35, all authority planes DISARMED, signed closure, and independent verification.
26
+
27
+ ## Global invariants
28
+
29
+ 1. R34 sealed release is never modified in place.
30
+ 2. Workspace allowlists remain on by default.
31
+ 3. Process, coding, autonomous, and host authority remain independently revocable and never auto-arm.
32
+ 4. Raw shell command strings remain forbidden at privileged boundaries.
33
+ 5. Public tool names stay compatible with the R34 73-tool surface unless an explicit R35 versioned contract test approves a change.
34
+ 6. Context is retrieved progressively. Whole-repository dumping is not a planner primitive.
35
+ 7. Retries must change a hypothesis or wait for an observed state transition; identical blind retries are rejected.
36
+ 8. Full audit payloads stay on disk; compact terminal UX must not expose long SHA/payload noise by default.
37
+ 9. GPL implementation code is not vendored or copied. External projects may inform behavior and acceptance tests only.
38
+ 10. R35 Final cannot be declared until rollback/restore and independent final verification pass.
39
+
40
+ ## R35-A: Tool Surface Archaeology
41
+
42
+ Add a canonical public-surface ledger that records each MCP tool name plus canonical input-schema and output-schema hashes. The R34 73-tool surface becomes the compatibility baseline.
43
+
44
+ The ledger must support:
45
+
46
+ - deterministic canonicalization of schemas;
47
+ - duplicate-name rejection;
48
+ - exact tool-set comparison;
49
+ - classification of changes as `unchanged`, `added`, `removed`, or `schema_changed`;
50
+ - a hard release failure for accidental removal/schema drift;
51
+ - an explicit versioned allowlist for intentional R35 additions.
52
+
53
+ The ledger is evidence, not a marketing report. It must be generated from the same registered tool definitions used by the server.
54
+
55
+ ## R35-B: Generic semantic backend
56
+
57
+ Keep the four R34 public semantic operations stable:
58
+
59
+ - outline
60
+ - definition
61
+ - references
62
+ - replace-by-symbol
63
+
64
+ Refactor `src/semantic-code.mjs` into an engine-neutral runtime with backend selection by source language. The existing TypeScript language service becomes one backend rather than the architecture itself.
65
+
66
+ Required R35 tracer languages are:
67
+
68
+ - TypeScript/JavaScript
69
+ - Python
70
+ - Rust
71
+ - C/C++
72
+
73
+ Go remains an optional adapter/benchmark language. It may be exercised when a pinned `gopls` is available, but missing or failing Go coverage does not block R35 Final because it is not part of the primary DEADBYTE workflow.
74
+
75
+ Backend requirements:
76
+
77
+ - bounded project/file discovery;
78
+ - workspace allowlist and deny-path enforcement before server launch/read;
79
+ - deterministic symbol/location normalization;
80
+ - stale file/symbol preconditions for mutation;
81
+ - diagnostics capability exposed internally for acceptance and future public use;
82
+ - no uncontrolled language-server download at runtime;
83
+ - server executable identity must be configured/pinned if an external LSP process is used.
84
+
85
+ R35 does not claim Serena-equivalent language breadth from this focused set. Final requires the four workflow-relevant tracer languages to pass the same acceptance corpus; optional Go evidence is reported separately and does not inflate the breadth claim.
86
+
87
+ ## R35-C: Context provenance ledger
88
+
89
+ Extend the autonomous context engine so each retained context or observation carries a compact provenance envelope:
90
+
91
+ - `source_kind`
92
+ - `source_id`
93
+ - `source_sha256` when bytes are available
94
+ - `observed_at_utc`
95
+ - `byte_count`
96
+ - `trust_class`
97
+ - `relevance_epoch`
98
+
99
+ Compaction must preserve provenance even when payload text is elided. Repeated identical source evidence must be deduplicated by stable identity, not by model-written rationale.
100
+
101
+ The planner receives compact provenance and current evidence, not entire historical payloads. Secret redaction remains before hashing/presentation where exposing a digest would create a secret oracle.
102
+
103
+ ## R35-D: Looped Engineering V2
104
+
105
+ The durable autonomous loop remains single-agent. Add explicit machine phases and critic/repair state without introducing multi-agent chat orchestration.
106
+
107
+ Required state transitions:
108
+
109
+ - PLAN selects or revises a bounded plan.
110
+ - INSPECT gathers evidence.
111
+ - ACT performs one preconditioned mutation/action.
112
+ - VERIFY executes the narrow acceptance probe.
113
+ - CRITIC classifies observed failure or insufficient proof.
114
+ - REPAIR changes the plan/hypothesis.
115
+ - RELEASE runs required profiles and produces signed terminal evidence.
116
+
117
+ Progress fingerprints must ignore rationale text and depend on observed state, evidence identities, mutation epoch, plan completion, and resolved blockers. Identical decision + identical evidence must stall and replan rather than loop forever.
118
+
119
+ Todo projection must be derivable from the signed journal so a restart can resume without trusting mutable prompt memory.
120
+
121
+ ## R35-E: Provider circuit state
122
+
123
+ Add a signed provider-health state machine only for network/provider calls:
124
+
125
+ - `CLOSED`
126
+ - `OPEN`
127
+ - `HALF_OPEN`
128
+
129
+ A circuit state includes provider id, failure class, failure count, opened time, next probe time, and last successful observation. Opening a circuit never grants authority and never triggers an unconfigured provider fallback.
130
+
131
+ Local deterministic tools do not use this circuit breaker.
132
+
133
+ Half-open probes are bounded and explicit. Success closes the circuit; failure reopens it with a bounded backoff policy. State must survive restart through authenticated evidence.
134
+
135
+ ## R35-F: Capability benchmark corpus
136
+
137
+ Create reproducible offline fixtures and metrics for:
138
+
139
+ - filesystem correctness and bounded reads;
140
+ - surgical edit precision and stale-precondition rejection;
141
+ - search pagination and deterministic ordering;
142
+ - process lifecycle and resume;
143
+ - semantic navigation/edit correctness for the four required tracer languages, with optional Go reported separately;
144
+ - context bytes retained/elided with provenance intact;
145
+ - autonomous recovery after deliberate tool/test failure;
146
+ - remote reconnect/resume and result deduplication.
147
+
148
+ Metrics include correctness, round trips, bytes returned, elapsed time, stale-precondition rejection, recovery success, and duplicate side-effect count.
149
+
150
+ Competitor comparisons in README/docs may only claim advantages supported by reproducible measurements. Serena remains acknowledged as broader in language ecosystem until R35 evidence proves otherwise.
151
+
152
+ ## R35-G: Remote reliability
153
+
154
+ Preserve R34 compact default terminal logging and `--verbose` forensic mode.
155
+
156
+ Add resumable remote-session identity:
157
+
158
+ - stable session id;
159
+ - monotonically increasing result cursor;
160
+ - bounded replay from a cursor;
161
+ - duplicate-result suppression by request/result identity;
162
+ - reconnect tests across Bridge restart;
163
+ - no authority auto-arm during reconnect.
164
+
165
+ A reconnect may observe or resume only authority that is already valid under local standing-grant policy.
166
+
167
+ ## R35-H: Release and final proof
168
+
169
+ R35 release closure requires, in order:
170
+
171
+ 1. focused slice tests green;
172
+ 2. full source regression green;
173
+ 3. exact public-surface ledger comparison against R34;
174
+ 4. four required semantic tracer languages green (TypeScript/JavaScript, Python, Rust, C/C++), with Go reported as optional evidence;
175
+ 5. benchmark corpus green with recorded evidence;
176
+ 6. canonical Windows gate PASS on one exact manifest;
177
+ 7. immutable R35 slot activation;
178
+ 8. public parity against exact R35 tool surface;
179
+ 9. supervisor `RUNNING [verified]`;
180
+ 10. signed rollback to sealed R34 `v0.8.11-6c01e5285e065220`;
181
+ 11. R34 public verification;
182
+ 12. exact R35 restore;
183
+ 13. R35 public verification;
184
+ 14. process/coding/autonomous/host all DISARMED;
185
+ 15. signed R35 final closure;
186
+ 16. independent final verifier PASS.
187
+
188
+ ## Error handling
189
+
190
+ Every new subsystem fails closed:
191
+
192
+ - unknown semantic language/backend -> typed unsupported-language error, no grep fallback masquerading as semantic;
193
+ - missing LSP executable pin -> explicit configuration error;
194
+ - provenance budget overflow -> deterministic compaction then explicit budget error;
195
+ - circuit state corruption/signature failure -> provider unavailable, no silent reset;
196
+ - remote cursor outside retained window -> explicit replay-window error;
197
+ - schema ledger drift -> release gate failure;
198
+ - benchmark flake -> preserve raw diagnostic evidence and stop release; do not auto-waive.
199
+
200
+ ## Testing strategy
201
+
202
+ All behavior changes use RED -> GREEN TDD. Focused tests precede full regression. Flaky timing tests must wait on the exact terminal condition they assert, not an earlier proxy condition. Windows sharing and process-lifecycle tests use bounded retries only around known OS races and preserve the original failure if the bound is exceeded.
203
+
204
+ Test layers:
205
+
206
+ - pure deterministic unit tests for ledger/provenance/circuit/progress logic;
207
+ - tool-layer integration tests for semantic and remote contracts;
208
+ - crash/restart tests for durable loop/circuit/session state;
209
+ - four required-language fixture tests, plus optional Go fixture evidence when available;
210
+ - public MCP tracer/parity tests;
211
+ - Windows containment/release gate;
212
+ - rollback/restore/final closure verification.
213
+
214
+ ## Versioning and public compatibility
215
+
216
+ R35 version is `0.9.0`. R34's 73 public tool names are the baseline. New public tools are not required for the first R35 Final; internal capability may expand behind existing tools/resources. If a new public tool becomes necessary, its addition must be recorded in the surface ledger and all parity clients must derive from the canonical R35 surface authority rather than duplicating hand-maintained arrays.
217
+
218
+ ## Definition of Done
219
+
220
+ R35 is Final only when the product is installable and operable by real MCP clients, the R34 tracer bullet still works, the R35 slices above have objective tests, no hot-path placeholder is exposed, public compatibility is machine-checked, the four required semantic tracer languages are green with Go reported separately as optional evidence, remote reconnect/resume is proven, benchmark evidence is reproducible, Windows gate is manifest-bound PASS, rollback to sealed R34 and exact restore succeed, all privileged planes finish DISARMED, and the independent R35 closure verifier passes.