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.
- package/CONTEXT.md +41 -0
- package/MANIFEST.SHA256 +348 -83
- package/R34-BASELINE.json +9 -0
- package/README.txt +135 -9
- package/bench/fixtures/corpus.json +17 -0
- package/bin/WORKER-REGISTRY.txt +3 -3
- package/bin/appcontainer-stage.exe +0 -0
- package/bin/appcontainer-stage.obj +0 -0
- package/bin/bootstrap-advapi32.exe +0 -0
- package/bin/bootstrap-advapi32.obj +0 -0
- package/bin/bootstrap-exitcode.exe +0 -0
- package/bin/bootstrap-exitcode.obj +0 -0
- package/bin/bootstrap-kernel32.exe +0 -0
- package/bin/bootstrap-kernel32.obj +0 -0
- package/bin/child-control-probe.exe +0 -0
- package/bin/child-control-probe.obj +0 -0
- package/bin/child-control-stage.exe +0 -0
- package/bin/child-control-stage.obj +0 -0
- package/bin/contained-reverse-worker.exe +0 -0
- package/bin/contained-reverse-worker.obj +0 -0
- package/bin/contained-transform-worker.exe +0 -0
- package/bin/contained-transform-worker.obj +0 -0
- package/bin/containment-probe.exe +0 -0
- package/bin/containment-probe.obj +0 -0
- package/bin/deadbyte-contain.exe +0 -0
- package/bin/deadbyte-contain.obj +0 -0
- package/bin/deadbyte-exec.exe +0 -0
- package/bin/deadbyte-exec.obj +0 -0
- package/bin/deadbyte-process-host.exe +0 -0
- package/bin/deadbyte-process-host.obj +0 -0
- package/bin/deadbyte-tunnel-host.exe +0 -0
- package/bin/deadbyte-tunnel-host.obj +0 -0
- package/controller/README.TXT +10 -4
- package/controller/deadbyte-controller.config.psd1.example +14 -0
- package/controller/deadbyte-controller.ps1 +144 -19
- package/controller/deadbyte-process-policy.json +5 -5
- package/controller/deadbyte-semantic-lsp-config.json +95 -0
- package/deadbyte-mcp-0.8.9.tgz +0 -0
- package/docs/ADR-0001-PRODUCTION-BASELINE-SEAMS.md +29 -0
- package/docs/ARCHITECTURE.md +6 -5
- package/docs/superpowers/plans/2026-09-16-deadbyte-loop-engine.md +846 -0
- package/docs/superpowers/plans/2026-09-17-r35-production-successor.md +408 -0
- package/docs/superpowers/specs/2026-09-16-deadbyte-loop-engine-design.md +435 -0
- package/docs/superpowers/specs/2026-09-17-r35-production-successor-design.md +220 -0
- package/node_modules/typescript/LICENSE.txt +55 -0
- package/node_modules/typescript/README.md +50 -0
- package/node_modules/typescript/SECURITY.md +41 -0
- package/node_modules/typescript/ThirdPartyNoticeText.txt +193 -0
- package/node_modules/typescript/bin/tsc +2 -0
- package/node_modules/typescript/bin/tsserver +2 -0
- package/node_modules/typescript/lib/_tsc.js +133818 -0
- package/node_modules/typescript/lib/_tsserver.js +659 -0
- package/node_modules/typescript/lib/_typingsInstaller.js +222 -0
- package/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/de/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/es/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/it/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/lib.d.ts +22 -0
- package/node_modules/typescript/lib/lib.decorators.d.ts +384 -0
- package/node_modules/typescript/lib/lib.decorators.legacy.d.ts +22 -0
- package/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +41 -0
- package/node_modules/typescript/lib/lib.dom.d.ts +39429 -0
- package/node_modules/typescript/lib/lib.dom.iterable.d.ts +571 -0
- package/node_modules/typescript/lib/lib.es2015.collection.d.ts +147 -0
- package/node_modules/typescript/lib/lib.es2015.core.d.ts +597 -0
- package/node_modules/typescript/lib/lib.es2015.d.ts +28 -0
- package/node_modules/typescript/lib/lib.es2015.generator.d.ts +77 -0
- package/node_modules/typescript/lib/lib.es2015.iterable.d.ts +605 -0
- package/node_modules/typescript/lib/lib.es2015.promise.d.ts +81 -0
- package/node_modules/typescript/lib/lib.es2015.proxy.d.ts +128 -0
- package/node_modules/typescript/lib/lib.es2015.reflect.d.ts +144 -0
- package/node_modules/typescript/lib/lib.es2015.symbol.d.ts +46 -0
- package/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +326 -0
- package/node_modules/typescript/lib/lib.es2016.array.include.d.ts +116 -0
- package/node_modules/typescript/lib/lib.es2016.d.ts +21 -0
- package/node_modules/typescript/lib/lib.es2016.full.d.ts +23 -0
- package/node_modules/typescript/lib/lib.es2016.intl.d.ts +31 -0
- package/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +21 -0
- package/node_modules/typescript/lib/lib.es2017.d.ts +26 -0
- package/node_modules/typescript/lib/lib.es2017.date.d.ts +31 -0
- package/node_modules/typescript/lib/lib.es2017.full.d.ts +23 -0
- package/node_modules/typescript/lib/lib.es2017.intl.d.ts +44 -0
- package/node_modules/typescript/lib/lib.es2017.object.d.ts +49 -0
- package/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +135 -0
- package/node_modules/typescript/lib/lib.es2017.string.d.ts +45 -0
- package/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +53 -0
- package/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +77 -0
- package/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +53 -0
- package/node_modules/typescript/lib/lib.es2018.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2018.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2018.intl.d.ts +83 -0
- package/node_modules/typescript/lib/lib.es2018.promise.d.ts +30 -0
- package/node_modules/typescript/lib/lib.es2018.regexp.d.ts +37 -0
- package/node_modules/typescript/lib/lib.es2019.array.d.ts +79 -0
- package/node_modules/typescript/lib/lib.es2019.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2019.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2019.intl.d.ts +23 -0
- package/node_modules/typescript/lib/lib.es2019.object.d.ts +33 -0
- package/node_modules/typescript/lib/lib.es2019.string.d.ts +37 -0
- package/node_modules/typescript/lib/lib.es2019.symbol.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2020.bigint.d.ts +765 -0
- package/node_modules/typescript/lib/lib.es2020.d.ts +27 -0
- package/node_modules/typescript/lib/lib.es2020.date.d.ts +42 -0
- package/node_modules/typescript/lib/lib.es2020.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2020.intl.d.ts +474 -0
- package/node_modules/typescript/lib/lib.es2020.number.d.ts +28 -0
- package/node_modules/typescript/lib/lib.es2020.promise.d.ts +47 -0
- package/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +99 -0
- package/node_modules/typescript/lib/lib.es2020.string.d.ts +44 -0
- package/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +41 -0
- package/node_modules/typescript/lib/lib.es2021.d.ts +23 -0
- package/node_modules/typescript/lib/lib.es2021.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2021.intl.d.ts +166 -0
- package/node_modules/typescript/lib/lib.es2021.promise.d.ts +48 -0
- package/node_modules/typescript/lib/lib.es2021.string.d.ts +33 -0
- package/node_modules/typescript/lib/lib.es2021.weakref.d.ts +78 -0
- package/node_modules/typescript/lib/lib.es2022.array.d.ts +121 -0
- package/node_modules/typescript/lib/lib.es2022.d.ts +25 -0
- package/node_modules/typescript/lib/lib.es2022.error.d.ts +75 -0
- package/node_modules/typescript/lib/lib.es2022.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2022.intl.d.ts +145 -0
- package/node_modules/typescript/lib/lib.es2022.object.d.ts +26 -0
- package/node_modules/typescript/lib/lib.es2022.regexp.d.ts +39 -0
- package/node_modules/typescript/lib/lib.es2022.string.d.ts +25 -0
- package/node_modules/typescript/lib/lib.es2023.array.d.ts +924 -0
- package/node_modules/typescript/lib/lib.es2023.collection.d.ts +21 -0
- package/node_modules/typescript/lib/lib.es2023.d.ts +22 -0
- package/node_modules/typescript/lib/lib.es2023.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2023.intl.d.ts +56 -0
- package/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +65 -0
- package/node_modules/typescript/lib/lib.es2024.collection.d.ts +29 -0
- package/node_modules/typescript/lib/lib.es2024.d.ts +26 -0
- package/node_modules/typescript/lib/lib.es2024.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2024.object.d.ts +29 -0
- package/node_modules/typescript/lib/lib.es2024.promise.d.ts +35 -0
- package/node_modules/typescript/lib/lib.es2024.regexp.d.ts +25 -0
- package/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +68 -0
- package/node_modules/typescript/lib/lib.es2024.string.d.ts +29 -0
- package/node_modules/typescript/lib/lib.es5.d.ts +4601 -0
- package/node_modules/typescript/lib/lib.es6.d.ts +23 -0
- package/node_modules/typescript/lib/lib.esnext.array.d.ts +35 -0
- package/node_modules/typescript/lib/lib.esnext.collection.d.ts +96 -0
- package/node_modules/typescript/lib/lib.esnext.d.ts +29 -0
- package/node_modules/typescript/lib/lib.esnext.decorators.d.ts +28 -0
- package/node_modules/typescript/lib/lib.esnext.disposable.d.ts +193 -0
- package/node_modules/typescript/lib/lib.esnext.error.d.ts +24 -0
- package/node_modules/typescript/lib/lib.esnext.float16.d.ts +445 -0
- package/node_modules/typescript/lib/lib.esnext.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.esnext.intl.d.ts +21 -0
- package/node_modules/typescript/lib/lib.esnext.iterator.d.ts +148 -0
- package/node_modules/typescript/lib/lib.esnext.promise.d.ts +34 -0
- package/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +25 -0
- package/node_modules/typescript/lib/lib.scripthost.d.ts +322 -0
- package/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +41 -0
- package/node_modules/typescript/lib/lib.webworker.d.ts +13150 -0
- package/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +23 -0
- package/node_modules/typescript/lib/lib.webworker.iterable.d.ts +340 -0
- package/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/tsc.js +8 -0
- package/node_modules/typescript/lib/tsserver.js +8 -0
- package/node_modules/typescript/lib/tsserverlibrary.d.ts +17 -0
- package/node_modules/typescript/lib/tsserverlibrary.js +21 -0
- package/node_modules/typescript/lib/typesMap.json +497 -0
- package/node_modules/typescript/lib/typescript.d.ts +11437 -0
- package/node_modules/typescript/lib/typescript.js +200276 -0
- package/node_modules/typescript/lib/typingsInstaller.js +8 -0
- package/node_modules/typescript/lib/watchGuard.js +53 -0
- package/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/package.json +120 -0
- package/package.json +5 -3
- package/proof/CONTAINMENT-BUILD.txt +6 -6
- package/proof/R34-TASK8-SUPERVISOR-CHECKPOINT.json +29 -0
- package/proof/R34-TASK9-MCP-SURFACE-CHECKPOINT.json +28 -0
- package/scripts/capability-benchmark.mjs +27 -0
- package/scripts/deferred-slot-operation.mjs +4 -2
- package/scripts/final-closure-verify.mjs +10 -10
- package/scripts/final-closure.mjs +11 -11
- package/scripts/gate-windows.ps1 +3 -3
- package/scripts/release-parity.mjs +14 -14
- package/scripts/semantic-preflight.ps1 +73 -0
- package/scripts/tool-surface-snapshot.mjs +73 -0
- package/scripts/windows-gate-evidence.mjs +5 -5
- package/src/audit-verify.mjs +6 -2
- package/src/autonomous-action-reconcile.mjs +142 -0
- package/src/autonomous-context-engine.mjs +255 -0
- package/src/autonomous-live-state.mjs +17 -0
- package/src/autonomous-local-supervisor.mjs +249 -0
- package/src/autonomous-loop-state.mjs +304 -0
- package/src/autonomous-output-contracts.mjs +22 -3
- package/src/autonomous-plan.mjs +181 -0
- package/src/autonomous-planner-contracts.mjs +44 -0
- package/src/autonomous-planner.mjs +91 -6
- package/src/autonomous-policy.mjs +15 -2
- package/src/autonomous-progress.mjs +127 -0
- package/src/autonomous-runtime.mjs +601 -48
- package/src/autonomous-supervisor-host.mjs +70 -0
- package/src/autonomous-supervisor.mjs +31 -8
- package/src/capability-benchmark-runner.mjs +108 -0
- package/src/capability-benchmark.mjs +50 -0
- package/src/coding-mcp-tools.mjs +46 -3
- package/src/coding-output-contracts.mjs +45 -0
- package/src/context-provenance.mjs +86 -0
- package/src/deadbyte-cli.mjs +136 -30
- package/src/document-adapter.mjs +43 -0
- package/src/lsp-stdio-client.mjs +112 -0
- package/src/machine-fs-smoke-client.mjs +2 -1
- package/src/mcp-server.mjs +17 -3
- package/src/observation-smoke-client.mjs +3 -2
- package/src/operator-surface.mjs +37 -0
- package/src/provider-circuit.mjs +125 -0
- package/src/release-generation.mjs +44 -5
- package/src/remote-mcp-autonomous-smoke-client.mjs +53 -14
- package/src/remote-mcp-coding-smoke-client.mjs +5 -4
- package/src/remote-mcp-r24-disarmed-smoke-client.mjs +4 -2
- package/src/remote-mcp-r33-parity-client.mjs +1 -1
- package/src/remote-mcp-r34-parity-client.mjs +177 -0
- package/src/remote-mcp-smoke-client.mjs +2 -1
- package/src/remote-result-journal.mjs +114 -0
- package/src/runtime-update.mjs +58 -8
- package/src/semantic-backend-registry.mjs +39 -0
- package/src/semantic-code.mjs +179 -0
- package/src/semantic-lsp-backend.mjs +183 -0
- package/src/semantic-lsp-config.mjs +112 -0
- package/src/tool-surface-ledger.mjs +92 -0
- package/src/version.mjs +1 -1
- package/test/audit-verify.test.mjs +1 -1
- package/test/autonomous-action-reconcile.test.mjs +106 -0
- package/test/autonomous-adversarial.test.mjs +149 -6
- package/test/autonomous-context-engine.test.mjs +181 -0
- package/test/autonomous-live-state.test.mjs +27 -0
- package/test/autonomous-local-supervisor.test.mjs +403 -0
- package/test/autonomous-loop-state.test.mjs +126 -0
- package/test/autonomous-loop-v2.test.mjs +105 -0
- package/test/autonomous-loop.test.mjs +79 -1
- package/test/autonomous-output-contract.test.mjs +54 -0
- package/test/autonomous-plan.test.mjs +101 -0
- package/test/autonomous-progress.test.mjs +106 -0
- package/test/autonomous-r34-e2e.test.mjs +338 -0
- package/test/autonomous-runtime.test.mjs +3 -3
- package/test/autonomous-supervisor-integration.test.mjs +48 -3
- package/test/capability-benchmark-runner.test.mjs +49 -0
- package/test/capability-benchmark.test.mjs +47 -0
- package/test/cli-entrypoint.test.mjs +12 -0
- package/test/coding-catalog-consistency.test.mjs +24 -0
- package/test/coding-plane.test.mjs +3 -3
- package/test/context-provenance.test.mjs +61 -0
- package/test/controller-r27.test.mjs +4 -3
- package/test/controller.test.mjs +52 -0
- package/test/core.test.mjs +1 -1
- package/test/deferred-slot-operation-behavior.test.mjs +5 -1
- package/test/deferred-slot-operation.test.mjs +2 -1
- package/test/document-adapter.test.mjs +23 -0
- package/test/fixtures/lsp-framed-server.mjs +33 -0
- package/test/fixtures/semantic/cpp/compile_commands.json +4 -0
- package/test/fixtures/semantic/cpp/lib.cpp +2 -0
- package/test/fixtures/semantic/cpp/lib.hpp +2 -0
- package/test/fixtures/semantic/cpp/main.cpp +2 -0
- package/test/fixtures/semantic/python/lib.py +2 -0
- package/test/fixtures/semantic/python/main.py +2 -0
- package/test/fixtures/semantic/rust/Cargo.lock +7 -0
- package/test/fixtures/semantic/rust/Cargo.toml +8 -0
- package/test/fixtures/semantic/rust/src/lib.rs +3 -0
- package/test/fixtures/semantic/rust/src/main.rs +5 -0
- package/test/fixtures/semantic/rust/src/math.rs +3 -0
- package/test/fixtures/semantic/rust/target/.rustc_info.json +1 -0
- package/test/fixtures/semantic/rust/target/CACHEDIR.TAG +3 -0
- package/test/fixtures/semantic/rust/target/debug/.cargo-lock +0 -0
- package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-4c168fa33c79d09c/dep-test-lib-semantic_rust +0 -0
- package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-4c168fa33c79d09c/invoked.timestamp +1 -0
- package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-4c168fa33c79d09c/test-lib-semantic_rust +1 -0
- package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-4c168fa33c79d09c/test-lib-semantic_rust.json +1 -0
- package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-5dcd474439c54a26/dep-test-bin-semantic_rust_bin +0 -0
- package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-5dcd474439c54a26/invoked.timestamp +1 -0
- package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-5dcd474439c54a26/test-bin-semantic_rust_bin +1 -0
- package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-5dcd474439c54a26/test-bin-semantic_rust_bin.json +1 -0
- package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-6212ccd976aa3808/dep-lib-semantic_rust +0 -0
- package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-6212ccd976aa3808/invoked.timestamp +1 -0
- package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-6212ccd976aa3808/lib-semantic_rust +1 -0
- package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-6212ccd976aa3808/lib-semantic_rust.json +1 -0
- package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-d741378dccdef61c/bin-semantic_rust_bin +1 -0
- package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-d741378dccdef61c/bin-semantic_rust_bin.json +1 -0
- package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-d741378dccdef61c/dep-bin-semantic_rust_bin +0 -0
- package/test/fixtures/semantic/rust/target/debug/.fingerprint/semantic_rust-d741378dccdef61c/invoked.timestamp +1 -0
- package/test/fixtures/semantic/rust/target/debug/deps/libsemantic_rust-4c168fa33c79d09c.rmeta +0 -0
- package/test/fixtures/semantic/rust/target/debug/deps/libsemantic_rust-6212ccd976aa3808.rmeta +0 -0
- package/test/fixtures/semantic/rust/target/debug/deps/libsemantic_rust_bin-5dcd474439c54a26.rmeta +0 -0
- package/test/fixtures/semantic/rust/target/debug/deps/libsemantic_rust_bin-d741378dccdef61c.rmeta +0 -0
- package/test/fixtures/semantic/rust/target/debug/deps/semantic_rust-4c168fa33c79d09c.d +5 -0
- package/test/fixtures/semantic/rust/target/debug/deps/semantic_rust-6212ccd976aa3808.d +5 -0
- package/test/fixtures/semantic/rust/target/debug/deps/semantic_rust_bin-5dcd474439c54a26.d +6 -0
- package/test/fixtures/semantic/rust/target/debug/deps/semantic_rust_bin-d741378dccdef61c.d +6 -0
- package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust-1nzlugxi6lq16/s-hmdgo8b6hg-1n6glhc-1qb77z00k06rqw4jdkj92spax/dep-graph.bin +0 -0
- package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust-1nzlugxi6lq16/s-hmdgo8b6hg-1n6glhc-1qb77z00k06rqw4jdkj92spax/query-cache.bin +0 -0
- package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust-1nzlugxi6lq16/s-hmdgo8b6hg-1n6glhc-1qb77z00k06rqw4jdkj92spax/work-products.bin +0 -0
- package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust-1nzlugxi6lq16/s-hmdgo8b6hg-1n6glhc.lock +0 -0
- package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust-3s436v7g6f5xm/s-hmdgo8b58k-1ekj4lq-9twkpivsqnjon278x20bddozq/dep-graph.bin +0 -0
- package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust-3s436v7g6f5xm/s-hmdgo8b58k-1ekj4lq-9twkpivsqnjon278x20bddozq/metadata.rmeta +0 -0
- package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust-3s436v7g6f5xm/s-hmdgo8b58k-1ekj4lq-9twkpivsqnjon278x20bddozq/query-cache.bin +0 -0
- package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust-3s436v7g6f5xm/s-hmdgo8b58k-1ekj4lq-9twkpivsqnjon278x20bddozq/work-products.bin +0 -0
- package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust-3s436v7g6f5xm/s-hmdgo8b58k-1ekj4lq.lock +0 -0
- package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust_bin-1jxcbdeehal7q/s-hmdgo8bxlf-1qr24o3-cmu3jai030no72y8u9eurrnjj/dep-graph.bin +0 -0
- package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust_bin-1jxcbdeehal7q/s-hmdgo8bxlf-1qr24o3-cmu3jai030no72y8u9eurrnjj/query-cache.bin +0 -0
- package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust_bin-1jxcbdeehal7q/s-hmdgo8bxlf-1qr24o3-cmu3jai030no72y8u9eurrnjj/work-products.bin +0 -0
- package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust_bin-1jxcbdeehal7q/s-hmdgo8bxlf-1qr24o3.lock +0 -0
- package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust_bin-2ocx55p60ni6b/s-hmdgo8bxj8-0ir41qt-diy9mqvc2eoiblmhjs3stcgi3/dep-graph.bin +0 -0
- package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust_bin-2ocx55p60ni6b/s-hmdgo8bxj8-0ir41qt-diy9mqvc2eoiblmhjs3stcgi3/query-cache.bin +0 -0
- package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust_bin-2ocx55p60ni6b/s-hmdgo8bxj8-0ir41qt-diy9mqvc2eoiblmhjs3stcgi3/work-products.bin +0 -0
- package/test/fixtures/semantic/rust/target/debug/incremental/semantic_rust_bin-2ocx55p60ni6b/s-hmdgo8bxj8-0ir41qt.lock +0 -0
- package/test/fixtures/semantic/rust/target/flycheck0/stderr +1 -0
- package/test/fixtures/semantic/rust/target/flycheck0/stdout +5 -0
- package/test/fixtures/semantic/typescript/lib.ts +3 -0
- package/test/fixtures/semantic/typescript/main.ts +2 -0
- package/test/fixtures/tool-surface-stdio-server.mjs +14 -0
- package/test/helpers/autonomous-r34-fixture.mjs +120 -0
- package/test/lsp-stdio-client.test.mjs +72 -0
- package/test/multi-file-read.test.mjs +41 -0
- package/test/observation-integration.test.mjs +3 -3
- package/test/production-docs.test.mjs +48 -0
- package/test/prompts-resources.test.mjs +35 -0
- package/test/provider-circuit.test.mjs +93 -0
- package/test/public-autonomous-ingress-budget.test.mjs +28 -0
- package/test/r33-closeout-regression.test.mjs +3 -3
- package/test/r33-finalization.test.mjs +19 -16
- package/test/release-generation.test.mjs +23 -2
- package/test/release-version.test.mjs +24 -17
- package/test/remote-r24-catalog.test.mjs +5 -4
- package/test/remote-result-journal.test.mjs +58 -0
- package/test/remote-session-cli.test.mjs +150 -15
- package/test/runtime-self-update.test.mjs +63 -0
- package/test/semantic-backend-registry.test.mjs +29 -0
- package/test/semantic-code.test.mjs +66 -0
- package/test/semantic-lsp-backend.test.mjs +99 -0
- package/test/semantic-lsp-config.test.mjs +81 -0
- package/test/semantic-lsp-readiness.test.mjs +34 -0
- package/test/semantic-lsp-transient-empty.test.mjs +32 -0
- package/test/semantic-lsp-transient-null.test.mjs +31 -0
- package/test/semantic-multilang.test.mjs +72 -0
- package/test/semantic-runtime-routing.test.mjs +32 -0
- package/test/semantic-server-config-integration.test.mjs +66 -0
- package/test/tool-surface-ledger.test.mjs +59 -0
- package/test/tool-surface-snapshot.test.mjs +17 -0
- package/test/tracer-bullet.test.mjs +77 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { createHash, randomBytes } from 'node:crypto';
|
|
2
|
+
import { mkdtemp, mkdir, readFile, rm, writeFile } from 'node:fs/promises';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { generateTrustKeypair } from '../../src/trust.mjs';
|
|
6
|
+
import { createCodingRuntime, loadCodingPolicy } from '../../src/coding-plane.mjs';
|
|
7
|
+
import { loadAutonomousPolicy } from '../../src/autonomous-policy.mjs';
|
|
8
|
+
import { createNativeDiffRuntime } from '../../src/native-diff.mjs';
|
|
9
|
+
import { createAutonomousRuntime } from '../../src/autonomous-runtime.mjs';
|
|
10
|
+
|
|
11
|
+
const sha = bytes => createHash('sha256').update(bytes).digest('hex');
|
|
12
|
+
const nonce = () => randomBytes(32).toString('hex');
|
|
13
|
+
|
|
14
|
+
export async function createR34Fixture({authority='armed',withFailingProfile=false,withStatefulProfile=false,codingRuntimeFactory=null,nativeDiffRuntimeFactory=null}={}) {
|
|
15
|
+
const root = await mkdtemp(path.join(os.tmpdir(),'deadbyte-r34-e2e-'));
|
|
16
|
+
const project = path.join(root,'project');
|
|
17
|
+
const trust = path.join(root,'trust');
|
|
18
|
+
await mkdir(project); await mkdir(trust);
|
|
19
|
+
const target = path.join(project,'x.txt');
|
|
20
|
+
await writeFile(target,'x\n');
|
|
21
|
+
let codingCommands = {};
|
|
22
|
+
let autonomousProfiles = {};
|
|
23
|
+
if (withFailingProfile || withStatefulProfile) {
|
|
24
|
+
const failScript = path.join(project,withStatefulProfile?'stateful-check.mjs':'fail.mjs');
|
|
25
|
+
const profileSource = withStatefulProfile
|
|
26
|
+
? "import { readFileSync } from 'node:fs'; const text=readFileSync(new URL('./x.txt',import.meta.url),'utf8'); if(text!=='y\\n') throw new Error('VERIFY_FAIL'); console.log('VERIFY_PASS');\n"
|
|
27
|
+
: "throw new Error('VERIFY_FAIL');\n";
|
|
28
|
+
await writeFile(failScript,profileSource);
|
|
29
|
+
const nodeHash = sha(await readFile(process.execPath));
|
|
30
|
+
const failHash = sha(await readFile(failScript));
|
|
31
|
+
codingCommands = { node_script:{ kind:'script', executable:process.execPath, executable_sha256:nodeHash,
|
|
32
|
+
root_ids:['project'], prefix_args:[], extensions:['.mjs'], timeout_ms:120000, max_output_bytes:1048576 } };
|
|
33
|
+
autonomousProfiles = { check:{ kind:'command', root_id:'project', command_id:'node_script', script_path:path.basename(failScript),
|
|
34
|
+
script_sha256:failHash, args:[], cwd:'.', required_for_release:withStatefulProfile, run_after_mutation:withStatefulProfile,
|
|
35
|
+
description:withStatefulProfile?'stateful verification requires x.txt=y':'intentional verification failure' } };
|
|
36
|
+
}
|
|
37
|
+
const keys = await generateTrustKeypair({
|
|
38
|
+
privateKeyPath:path.join(trust,'private.pem'),publicKeyPath:path.join(trust,'public.pem')
|
|
39
|
+
});
|
|
40
|
+
const codingPath = path.join(root,'coding-policy.json');
|
|
41
|
+
await writeFile(codingPath,JSON.stringify({
|
|
42
|
+
schema:'deadbyte.coding-policy.v1',enabled:true,
|
|
43
|
+
lease_file:path.join(root,'coding-lease.json'),evidence_dir:path.join(root,'coding-evidence'),
|
|
44
|
+
roots:{project:{path:project,read:true,write:true,exec:withFailingProfile||withStatefulProfile,deny_paths:[]}},commands:codingCommands
|
|
45
|
+
},null,2));
|
|
46
|
+
const codingPolicy = await loadCodingPolicy(codingPath);
|
|
47
|
+
const autonomousPath = path.join(root,'autonomous-policy.json');
|
|
48
|
+
await writeFile(autonomousPath,JSON.stringify({
|
|
49
|
+
schema:'deadbyte.autonomous-policy.v1',enabled:true,
|
|
50
|
+
lease_file:path.join(root,'autonomous-lease.json'),evidence_dir:path.join(root,'autonomous-evidence'),
|
|
51
|
+
root_ids:['project'],coding_policy_sha256:codingPolicy.policy_sha256,
|
|
52
|
+
planner:{backend:'client_sampling',max_tokens:4096},profiles:autonomousProfiles,
|
|
53
|
+
limits:{max_iterations:16,max_mutations:8,max_wall_ms:600000,max_context_bytes:262144,
|
|
54
|
+
max_diff_bytes:262144,max_files_per_diff:4,max_stalled_cycles:2,max_post_replan_stalls:2,max_replans:8}
|
|
55
|
+
},null,2));
|
|
56
|
+
const policy = await loadAutonomousPolicy(autonomousPath,codingPolicy);
|
|
57
|
+
async function arm() {
|
|
58
|
+
await writeFile(codingPolicy.lease_file,JSON.stringify({schema:'deadbyte.coding-lease.v1',
|
|
59
|
+
policy_sha256:codingPolicy.policy_sha256,instance_nonce:nonce(),root_ids:['project'],
|
|
60
|
+
armed_at_utc:new Date().toISOString(),expires_at_utc:new Date(Date.now()+3600000).toISOString()}));
|
|
61
|
+
await writeFile(policy.lease_file,JSON.stringify({schema:'deadbyte.autonomous-lease.v1',
|
|
62
|
+
policy_sha256:policy.policy_sha256,instance_nonce:nonce(),root_ids:['project'],
|
|
63
|
+
armed_at_utc:new Date().toISOString(),expires_at_utc:new Date(Date.now()+3600000).toISOString()}));
|
|
64
|
+
}
|
|
65
|
+
async function disarm() {
|
|
66
|
+
await rm(codingPolicy.lease_file,{force:true});
|
|
67
|
+
await rm(policy.lease_file,{force:true});
|
|
68
|
+
}
|
|
69
|
+
if(authority==='armed') await arm();
|
|
70
|
+
const baseCodingRuntime = createCodingRuntime({policy:codingPolicy,signingKeyPath:keys.privateKeyPath,verifyKeyPath:keys.publicKeyPath});
|
|
71
|
+
const codingRuntime = codingRuntimeFactory ? codingRuntimeFactory(baseCodingRuntime) : baseCodingRuntime;
|
|
72
|
+
const baseNativeDiffRuntime = createNativeDiffRuntime({policy,codingRuntime,signingKeyPath:keys.privateKeyPath,verifyKeyPath:keys.publicKeyPath});
|
|
73
|
+
const nativeDiffRuntime = nativeDiffRuntimeFactory ? nativeDiffRuntimeFactory(baseNativeDiffRuntime) : baseNativeDiffRuntime;
|
|
74
|
+
const createRuntime = ({codingRuntimeOverride=codingRuntime,nativeDiffRuntimeOverride=nativeDiffRuntime}={}) => createAutonomousRuntime({policy,codingRuntime:codingRuntimeOverride,nativeDiffRuntime:nativeDiffRuntimeOverride,
|
|
75
|
+
signingKeyPath:keys.privateKeyPath,verifyKeyPath:keys.publicKeyPath});
|
|
76
|
+
return {
|
|
77
|
+
root,project,target,keys,codingPolicy,policy,baseCodingRuntime,codingRuntime,nativeDiffRuntime,createRuntime,runtime:createRuntime(),
|
|
78
|
+
initial_sha256:sha(await readFile(target)),arm,disarm,
|
|
79
|
+
cleanup:()=>rm(root,{recursive:true,force:true})
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export async function sendPlannerDecision(runtime,goalId,result,decision,{maxCycles=4}={}) {
|
|
84
|
+
if(result.status!=='input_required') throw new Error(`planner response requires input_required, got ${result.status}`);
|
|
85
|
+
return runtime.run({goalId,maxCycles,plannerResponse:{request_id:result.planner_request.request_id,
|
|
86
|
+
model:'deadbyte-r34-test',raw_text:JSON.stringify(decision)}});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function planCreateDecision() {
|
|
90
|
+
return {schema:'deadbyte.autonomous-decision.v2',kind:'plan_create',title:'Repair x.txt',
|
|
91
|
+
reason:'goal requires verified source repair',steps:[{step_id:'repair',intent:'Inspect, repair, and verify x.txt'}]};
|
|
92
|
+
}
|
|
93
|
+
export function inspectDecision() {
|
|
94
|
+
return {schema:'deadbyte.autonomous-decision.v2',kind:'inspect',reads:[{path:'x.txt',max_bytes:4096}]};
|
|
95
|
+
}
|
|
96
|
+
export function patchDecision(expectedSha) {
|
|
97
|
+
return {schema:'deadbyte.autonomous-decision.v2',kind:'act',action:{kind:'patch',operations:[{
|
|
98
|
+
kind:'replace',path:'x.txt',expected_sha256:expectedSha,old_string:'x',new_string:'y',expected_replacements:1
|
|
99
|
+
}]}};
|
|
100
|
+
}
|
|
101
|
+
export function stepCompleteDecision(evidence) {
|
|
102
|
+
return {schema:'deadbyte.autonomous-decision.v2',kind:'step_complete',step_id:'repair',evidence};
|
|
103
|
+
}
|
|
104
|
+
export function finishDecision() {
|
|
105
|
+
return {schema:'deadbyte.autonomous-decision.v2',kind:'finish',summary:'plan and release evidence complete'};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export async function localSupervisorFixture({ownerPid,ownerIdentity}) {
|
|
109
|
+
const root=await mkdtemp(path.join(os.tmpdir(),'deadbyte-r34-supervisor-'));
|
|
110
|
+
const markerPath=path.join(root,'supervisor-owner.json');
|
|
111
|
+
if(ownerIdentity) {
|
|
112
|
+
await writeFile(markerPath,JSON.stringify({
|
|
113
|
+
schema:'deadbyte.autonomous-supervisor-owner.v1',pid:ownerPid,
|
|
114
|
+
creation_time_utc:ownerIdentity.creation_time_utc,image_path:ownerIdentity.image_path,
|
|
115
|
+
image_sha256:ownerIdentity.image_sha256,instance_nonce:'a'.repeat(64),
|
|
116
|
+
started_at_utc:'2026-09-16T00:00:00.000Z'
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
119
|
+
return {options:{markerPath},markerPath,cleanup:()=>rm(root,{recursive:true,force:true})};
|
|
120
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { createHash } from 'node:crypto';
|
|
4
|
+
import { readFile } from 'node:fs/promises';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
import { createLspStdioClient } from '../src/lsp-stdio-client.mjs';
|
|
8
|
+
|
|
9
|
+
const here=path.dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const fixture=path.join(here,'fixtures','lsp-framed-server.mjs');
|
|
11
|
+
const sha256=bytes=>createHash('sha256').update(bytes).digest('hex');
|
|
12
|
+
const nodeSha=sha256(await readFile(process.execPath));
|
|
13
|
+
const make=(overrides={})=>createLspStdioClient({executablePath:process.execPath,expectedSha256:nodeSha,args:[fixture],cwd:here,env:{},requestTimeoutMs:1000,maxMessageBytes:32768,...overrides});
|
|
14
|
+
|
|
15
|
+
test('LSP stdio parses split frames and correlates out-of-order responses',async()=>{
|
|
16
|
+
const client=make();
|
|
17
|
+
try{
|
|
18
|
+
const init=await client.initialize({processId:null,rootUri:null,capabilities:{}});
|
|
19
|
+
assert.equal(init.serverInfo.name,'fixture');
|
|
20
|
+
const [a,b]=await Promise.all([
|
|
21
|
+
client.request('queue',{value:'a'}),
|
|
22
|
+
client.request('queue',{value:'b'})
|
|
23
|
+
]);
|
|
24
|
+
assert.deepEqual(a,{value:'a'});
|
|
25
|
+
assert.deepEqual(b,{value:'b'});
|
|
26
|
+
const echo=await client.request('echo',{value:'split'});
|
|
27
|
+
assert.deepEqual(echo,{value:'split'});
|
|
28
|
+
} finally { await client.shutdown().catch(()=>{}); }
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test('LSP stdio times out one request without retrying it',async()=>{
|
|
32
|
+
const client=make({requestTimeoutMs:300});
|
|
33
|
+
try{
|
|
34
|
+
await client.initialize({processId:null,rootUri:null,capabilities:{}});
|
|
35
|
+
await assert.rejects(client.request('never',{}),/LSP request timeout.*never/i);
|
|
36
|
+
} finally { await client.shutdown().catch(()=>{}); }
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('LSP stdio rejects oversized inbound messages',async()=>{
|
|
40
|
+
const client=make({maxMessageBytes:2048});
|
|
41
|
+
try{
|
|
42
|
+
await client.initialize({processId:null,rootUri:null,capabilities:{}});
|
|
43
|
+
await assert.rejects(client.request('oversize',{}),/exceeds.*2048/i);
|
|
44
|
+
} finally { await client.shutdown().catch(()=>{}); }
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test('LSP stdio rejects outstanding requests when server exits unexpectedly',async()=>{
|
|
48
|
+
const client=make();
|
|
49
|
+
await client.initialize({processId:null,rootUri:null,capabilities:{}});
|
|
50
|
+
await assert.rejects(client.request('crash',{}),/LSP process exited.*9/i);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test('LSP stdio verifies executable identity before spawn',async()=>{
|
|
54
|
+
assert.throws(()=>createLspStdioClient({executablePath:process.execPath,expectedSha256:'0'.repeat(64),args:[fixture],cwd:here,env:{},requestTimeoutMs:100,maxMessageBytes:2048}),/executable SHA-256 mismatch/i);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test('LSP stdio verifies pinned dependency identities before spawn',async()=>{
|
|
58
|
+
const fixtureSha=sha256(await readFile(fixture));
|
|
59
|
+
const client=make({dependencies:[{path:fixture,expectedSha256:fixtureSha}]});
|
|
60
|
+
try{
|
|
61
|
+
const init=await client.initialize({processId:null,rootUri:null,capabilities:{}});
|
|
62
|
+
assert.equal(init.serverInfo.name,'fixture');
|
|
63
|
+
} finally { await client.shutdown().catch(()=>{}); }
|
|
64
|
+
assert.throws(()=>make({dependencies:[{path:fixture,expectedSha256:'0'.repeat(64)}]}),/LSP dependency SHA-256 mismatch/i);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
test('LSP stdio graceful shutdown is idempotent',async()=>{
|
|
68
|
+
const client=make();
|
|
69
|
+
await client.initialize({processId:null,rootUri:null,capabilities:{}});
|
|
70
|
+
await client.shutdown();
|
|
71
|
+
await client.shutdown();
|
|
72
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { createHash } from 'node:crypto';
|
|
4
|
+
import { mkdtemp, mkdir, readFile, rm, writeFile } from 'node:fs/promises';
|
|
5
|
+
import os from 'node:os';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
import { Client } from '@modelcontextprotocol/client';
|
|
9
|
+
import { StdioClientTransport, getDefaultEnvironment } from '@modelcontextprotocol/client/stdio';
|
|
10
|
+
import { generateTrustKeypair } from '../src/trust.mjs';
|
|
11
|
+
import { loadCodingPolicy } from '../src/coding-plane.mjs';
|
|
12
|
+
|
|
13
|
+
const here=path.dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
const repoRoot=path.resolve(here,'..');
|
|
15
|
+
const serverPath=path.join(repoRoot,'src','mcp-server.mjs');
|
|
16
|
+
const sha256=bytes=>createHash('sha256').update(bytes).digest('hex');
|
|
17
|
+
const sha256File=async file=>sha256(await readFile(file));
|
|
18
|
+
async function fixture(){
|
|
19
|
+
const root=await mkdtemp(path.join(os.tmpdir(),'deadbyte-multi-read-')); const project=path.join(root,'project'); const trust=path.join(root,'trust');
|
|
20
|
+
await mkdir(project); await mkdir(trust); await mkdir(path.join(project,'.git'));
|
|
21
|
+
await writeFile(path.join(project,'a.txt'),'alpha\n'); await writeFile(path.join(project,'b.txt'),'beta\n'); await writeFile(path.join(project,'c.bin'),Buffer.from([0,1,2,255])); await writeFile(path.join(project,'.git','secret'),'no');
|
|
22
|
+
const keys=await generateTrustKeypair({privateKeyPath:path.join(trust,'private.pem'),publicKeyPath:path.join(trust,'public.pem')});
|
|
23
|
+
const policyPath=path.join(root,'coding-policy.json'); const leasePath=path.join(root,'coding-lease.json');
|
|
24
|
+
await writeFile(policyPath,JSON.stringify({schema:'deadbyte.coding-policy.v1',enabled:true,lease_file:leasePath,evidence_dir:path.join(root,'evidence'),roots:{project:{path:project,read:true,write:true,exec:true,deny_paths:['.git','node_modules']}},commands:{node_script:{kind:'script',executable:process.execPath,executable_sha256:await sha256File(process.execPath),root_ids:['project'],prefix_args:[],extensions:['.mjs','.js'],timeout_ms:30000,max_output_bytes:262144}},max_read_bytes:524288,max_write_bytes:2097152},null,2));
|
|
25
|
+
const policy=await loadCodingPolicy(policyPath);
|
|
26
|
+
await writeFile(leasePath,JSON.stringify({schema:'deadbyte.coding-lease.v1',policy_sha256:policy.policy_sha256,instance_nonce:'d'.repeat(64),root_ids:['project'],armed_at_utc:new Date().toISOString(),expires_at_utc:new Date(Date.now()+3600000).toISOString()}));
|
|
27
|
+
const client=new Client({name:'deadbyte-multi-read-test',version:'0.8.11'},{versionNegotiation:{mode:{pin:'2026-07-28'}}});
|
|
28
|
+
const transport=new StdioClientTransport({command:process.execPath,args:[serverPath],cwd:repoRoot,env:{...getDefaultEnvironment(),DEADBYTE_SIGNING_KEY:keys.privateKeyPath,DEADBYTE_VERIFY_KEY:keys.publicKeyPath,DEADBYTE_CODING_RUNTIME:'1',DEADBYTE_CODING_POLICY:policyPath},stderr:'pipe'});
|
|
29
|
+
return {root,client,transport};
|
|
30
|
+
}
|
|
31
|
+
function structured(value){if(value.isError)throw new Error(JSON.stringify(value.structuredContent??value.content));return value.structuredContent;}
|
|
32
|
+
test('coding_files_read reads bounded mixed encodings in one MCP call and fails closed on denied input',async()=>{
|
|
33
|
+
const f=await fixture(); try{
|
|
34
|
+
await f.client.connect(f.transport);
|
|
35
|
+
assert.ok((await f.client.listTools()).tools.some(t=>t.name==='coding_files_read'));
|
|
36
|
+
const result=structured(await f.client.callTool({name:'coding_files_read',arguments:{root_id:'project',files:[{path:'a.txt',encoding:'utf8'},{path:'b.txt',encoding:'utf8'},{path:'c.bin',encoding:'base64'}],max_total_bytes:64}}));
|
|
37
|
+
assert.equal(result.status,'ok'); assert.equal(result.files.length,3); assert.equal(result.total_bytes,15); assert.equal(result.files[0].content,'alpha\n'); assert.equal(result.files[2].content,Buffer.from([0,1,2,255]).toString('base64'));
|
|
38
|
+
const denied=await f.client.callTool({name:'coding_files_read',arguments:{root_id:'project',files:[{path:'a.txt',encoding:'utf8'},{path:'.git/secret',encoding:'utf8'}],max_total_bytes:64}});
|
|
39
|
+
assert.equal(denied.isError,true); assert.equal(denied.structuredContent.status,'failed'); assert.match(denied.structuredContent.error,/denied by policy/);
|
|
40
|
+
} finally {await f.client.close().catch(()=>{}); await rm(f.root,{recursive:true,force:true}).catch(()=>{});}
|
|
41
|
+
});
|
|
@@ -35,7 +35,7 @@ test('R32 updater exposes explicit observation enable and threads it into the ca
|
|
|
35
35
|
assert.match(source, /enableObservation:args\.enableObservation/);
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
test('
|
|
38
|
+
test('R34 exact remote catalog keeps observation and disarmed gate bound to the canonical 73-tool surface', async () => {
|
|
39
39
|
const source = await read('../src/remote-mcp-smoke-client.mjs');
|
|
40
40
|
const disarmed = await read('../src/remote-mcp-r24-disarmed-smoke-client.mjs');
|
|
41
41
|
assert.match(source, /const observationTools = \[/);
|
|
@@ -43,8 +43,8 @@ test('R32 exact remote catalog adds six observation tools and disarmed gate requ
|
|
|
43
43
|
assert.match(source, new RegExp(`'${name}'`));
|
|
44
44
|
}
|
|
45
45
|
assert.match(source, /observation_runtime: observationRuntime/);
|
|
46
|
-
assert.match(disarmed, /
|
|
47
|
-
assert.match(disarmed, /tool_count:
|
|
46
|
+
assert.match(disarmed, /R34_EXPECTED_TOOLS/);
|
|
47
|
+
assert.match(disarmed, /tool_count:R34_EXPECTED_TOOLS\.length/);
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
test('R32 package and Windows gate include observation live smoke before final manifest verify', async () => {
|
|
@@ -0,0 +1,48 @@
|
|
|
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 readme=()=>readFile(path.join(root,'README.txt'),'utf8');
|
|
9
|
+
|
|
10
|
+
test('production README documents one-command stdio configs for major MCP clients',async()=>{
|
|
11
|
+
const text=await readme();
|
|
12
|
+
assert.match(text,/npx -y deadbyte-mcp@0\.9\.0 mcp/);
|
|
13
|
+
assert.match(text,/CLAUDE DESKTOP/);
|
|
14
|
+
assert.match(text,/"mcpServers"[\s\S]*?"command"\s*:\s*"npx"[\s\S]*?"-y"[\s\S]*?"deadbyte-mcp@0\.9\.0"[\s\S]*?"mcp"/);
|
|
15
|
+
assert.match(text,/CURSOR/);
|
|
16
|
+
assert.match(text,/\.cursor\/mcp\.json/);
|
|
17
|
+
assert.match(text,/VS CODE/);
|
|
18
|
+
assert.match(text,/\.vscode\/mcp\.json/);
|
|
19
|
+
assert.match(text,/"servers"[\s\S]*?"type"\s*:\s*"stdio"/);
|
|
20
|
+
assert.match(text,/CODEX/);
|
|
21
|
+
assert.match(text,/\[mcp_servers\.deadbyte\]/);
|
|
22
|
+
assert.match(text,/command\s*=\s*"npx"/);
|
|
23
|
+
assert.match(text,/args\s*=\s*\["-y",\s*"deadbyte-mcp@0\.9\.0",\s*"mcp"\]/);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test('production README records tracer bullet, semantic scope, remote UX, safety and document extension',async()=>{
|
|
27
|
+
const text=await readme();
|
|
28
|
+
for(const token of ['coding_file_read','coding_text_replace','coding_command_run','coding_receipt_verify']) assert.match(text,new RegExp(token));
|
|
29
|
+
for(const token of ['coding_files_read','coding_symbol_outline','coding_symbol_definition','coding_symbol_references','coding_symbol_replace']) assert.match(text,new RegExp(token));
|
|
30
|
+
assert.match(text,/JavaScript\/TypeScript|JS\/TS/);
|
|
31
|
+
assert.match(text,/does not claim|not claim|limited to/i);
|
|
32
|
+
assert.match(text,/remote --verbose/);
|
|
33
|
+
assert.match(text,/compact/i);
|
|
34
|
+
assert.match(text,/workspace allowlist|coding-policy root/i);
|
|
35
|
+
assert.match(text,/destructive|standing grant|authority plane/i);
|
|
36
|
+
assert.match(text,/document adapter/i);
|
|
37
|
+
assert.match(text,/markdown_to_pdf/);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test('production README contains an evidence-based competitor comparison without pretending semantic breadth parity',async()=>{
|
|
41
|
+
const text=await readme();
|
|
42
|
+
assert.match(text,/Desktop Commander/i);
|
|
43
|
+
assert.match(text,/Serena/i);
|
|
44
|
+
assert.match(text,/comparison/i);
|
|
45
|
+
assert.match(text,/signed receipt|Ed25519/i);
|
|
46
|
+
assert.match(text,/rollback/i);
|
|
47
|
+
assert.match(text,/semantic breadth|language breadth|broader language/i);
|
|
48
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { Client } from '@modelcontextprotocol/client';
|
|
4
|
+
import { StdioClientTransport, getDefaultEnvironment } from '@modelcontextprotocol/client/stdio';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
|
|
8
|
+
const here=path.dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const repoRoot=path.resolve(here,'..');
|
|
10
|
+
const serverPath=path.join(repoRoot,'src','mcp-server.mjs');
|
|
11
|
+
|
|
12
|
+
test('MCP exposes compact workflow prompts and source-of-truth context resources',async()=>{
|
|
13
|
+
const client=new Client({name:'deadbyte-prompt-resource-test',version:'0.8.11'},{versionNegotiation:{mode:{pin:'2026-07-28'}}});
|
|
14
|
+
const transport=new StdioClientTransport({command:process.execPath,args:[serverPath],cwd:repoRoot,env:{...getDefaultEnvironment()},stderr:'pipe'});
|
|
15
|
+
try{
|
|
16
|
+
await client.connect(transport);
|
|
17
|
+
const prompts=await client.listPrompts();
|
|
18
|
+
const promptNames=prompts.prompts.map(p=>p.name).sort();
|
|
19
|
+
assert.deepEqual(promptNames,['deadbyte.diagnose','deadbyte.patch','deadbyte.review','deadbyte.run-tests']);
|
|
20
|
+
const patch=await client.getPrompt({name:'deadbyte.patch',arguments:{goal:'fix the failing parser test'}});
|
|
21
|
+
const patchText=patch.messages.map(m=>m.content?.text??'').join('\n');
|
|
22
|
+
assert.match(patchText,/inspect/i); assert.match(patchText,/surgical/i); assert.match(patchText,/verify/i); assert.match(patchText,/fix the failing parser test/);
|
|
23
|
+
assert.ok(patchText.length<1400,'prompt must remain compact');
|
|
24
|
+
|
|
25
|
+
const resources=await client.listResources();
|
|
26
|
+
const uris=resources.resources.map(r=>r.uri).sort();
|
|
27
|
+
assert.deepEqual(uris,['deadbyte://architecture','deadbyte://context']);
|
|
28
|
+
const context=await client.readResource({uri:'deadbyte://context'});
|
|
29
|
+
const contextText=context.contents.map(c=>'text' in c?c.text:'').join('\n');
|
|
30
|
+
assert.match(contextText,/Machine truth/i); assert.match(contextText,/Authority plane/i); assert.match(contextText,/Loop Supervisor/i);
|
|
31
|
+
const architecture=await client.readResource({uri:'deadbyte://architecture'});
|
|
32
|
+
const architectureText=architecture.contents.map(c=>'text' in c?c.text:'').join('\n');
|
|
33
|
+
assert.match(architectureText,/protocol/i); assert.match(architectureText,/semantic/i); assert.match(architectureText,/telemetry/i);
|
|
34
|
+
} finally { await client.close().catch(()=>{}); }
|
|
35
|
+
});
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import {
|
|
4
|
+
PROVIDER_CIRCUIT_STATES,
|
|
5
|
+
classifyProviderFailure,
|
|
6
|
+
deriveCircuit,
|
|
7
|
+
providerCallDisposition
|
|
8
|
+
} from '../src/provider-circuit.mjs';
|
|
9
|
+
|
|
10
|
+
const providerId='openai-compatible:gpt-test';
|
|
11
|
+
const policy=Object.freeze({failure_threshold:3,open_ms:1000,half_open_probe_limit:1});
|
|
12
|
+
const event=(type,created_at_utc,payload={})=>({
|
|
13
|
+
schema:'deadbyte.autonomous-event.v1',
|
|
14
|
+
event_sha256:'a'.repeat(64),
|
|
15
|
+
type,
|
|
16
|
+
created_at_utc,
|
|
17
|
+
payload:{provider_id:providerId,...payload}
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test('provider circuit state enum is exact and failure classifier is bounded',()=>{
|
|
21
|
+
assert.deepEqual(PROVIDER_CIRCUIT_STATES,['CLOSED','OPEN','HALF_OPEN','UNAVAILABLE']);
|
|
22
|
+
assert.equal(classifyProviderFailure(new Error('request timed out')),'timeout');
|
|
23
|
+
assert.equal(classifyProviderFailure(new Error('fetch failed ECONNRESET')),'transport');
|
|
24
|
+
assert.equal(classifyProviderFailure(new Error('planner HTTP 429: rate limit')),'rate_limit');
|
|
25
|
+
assert.equal(classifyProviderFailure(new Error('planner HTTP 401: unauthorized')),'auth');
|
|
26
|
+
assert.equal(classifyProviderFailure(new Error('planner HTTP response is not JSON')),'invalid_response');
|
|
27
|
+
assert.equal(classifyProviderFailure(new Error('weird')),'other');
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('CLOSED opens exactly at threshold and OPEN suppresses provider invocation',()=>{
|
|
31
|
+
const events=[
|
|
32
|
+
event('provider_call_failed','2026-09-17T00:00:00.000Z',{failure_class:'transport'}),
|
|
33
|
+
event('provider_call_failed','2026-09-17T00:00:01.000Z',{failure_class:'timeout'}),
|
|
34
|
+
event('provider_call_failed','2026-09-17T00:00:02.000Z',{failure_class:'rate_limit'})
|
|
35
|
+
];
|
|
36
|
+
const circuit=deriveCircuit(events,providerId,policy,'2026-09-17T00:00:02.500Z');
|
|
37
|
+
assert.equal(circuit.state,'OPEN');
|
|
38
|
+
assert.equal(circuit.failure_count,3);
|
|
39
|
+
assert.equal(circuit.opened_at_utc,'2026-09-17T00:00:02.000Z');
|
|
40
|
+
assert.equal(circuit.next_probe_at_utc,'2026-09-17T00:00:03.000Z');
|
|
41
|
+
assert.deepEqual(providerCallDisposition(circuit),{allowed:false,probe:false,reason:'circuit_open'});
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
test('OPEN becomes HALF_OPEN only at boundary and permits one bounded probe',()=>{
|
|
45
|
+
const events=[
|
|
46
|
+
event('provider_call_failed','2026-09-17T00:00:00.000Z',{failure_class:'transport'}),
|
|
47
|
+
event('provider_call_failed','2026-09-17T00:00:01.000Z',{failure_class:'transport'}),
|
|
48
|
+
event('provider_call_failed','2026-09-17T00:00:02.000Z',{failure_class:'transport'})
|
|
49
|
+
];
|
|
50
|
+
const before=deriveCircuit(events,providerId,policy,'2026-09-17T00:00:02.999Z');
|
|
51
|
+
assert.equal(before.state,'OPEN');
|
|
52
|
+
const half=deriveCircuit(events,providerId,policy,'2026-09-17T00:00:03.000Z');
|
|
53
|
+
assert.equal(half.state,'HALF_OPEN');
|
|
54
|
+
assert.deepEqual(providerCallDisposition(half),{allowed:true,probe:true,reason:'half_open_probe'});
|
|
55
|
+
const consumed=deriveCircuit([...events,event('provider_probe_started','2026-09-17T00:00:03.000Z')],providerId,policy,'2026-09-17T00:00:03.100Z');
|
|
56
|
+
assert.deepEqual(providerCallDisposition(consumed),{allowed:false,probe:false,reason:'half_open_probe_limit'});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test('HALF_OPEN success closes circuit and failure reopens it from failure time',()=>{
|
|
60
|
+
const base=[
|
|
61
|
+
event('provider_call_failed','2026-09-17T00:00:00.000Z',{failure_class:'transport'}),
|
|
62
|
+
event('provider_call_failed','2026-09-17T00:00:01.000Z',{failure_class:'transport'}),
|
|
63
|
+
event('provider_call_failed','2026-09-17T00:00:02.000Z',{failure_class:'transport'}),
|
|
64
|
+
event('provider_probe_started','2026-09-17T00:00:03.000Z')
|
|
65
|
+
];
|
|
66
|
+
const closed=deriveCircuit([...base,event('provider_call_succeeded','2026-09-17T00:00:03.100Z')],providerId,policy,'2026-09-17T00:00:03.100Z');
|
|
67
|
+
assert.equal(closed.state,'CLOSED');
|
|
68
|
+
assert.equal(closed.failure_count,0);
|
|
69
|
+
assert.equal(closed.last_success_at_utc,'2026-09-17T00:00:03.100Z');
|
|
70
|
+
const reopened=deriveCircuit([...base,event('provider_call_failed','2026-09-17T00:00:03.100Z',{failure_class:'timeout'})],providerId,policy,'2026-09-17T00:00:03.100Z');
|
|
71
|
+
assert.equal(reopened.state,'OPEN');
|
|
72
|
+
assert.equal(reopened.opened_at_utc,'2026-09-17T00:00:03.100Z');
|
|
73
|
+
assert.equal(reopened.next_probe_at_utc,'2026-09-17T00:00:04.100Z');
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
test('replay is deterministic and malformed authenticated evidence becomes unavailable',()=>{
|
|
77
|
+
const events=[event('provider_call_failed','2026-09-17T00:00:00.000Z',{failure_class:'timeout'})];
|
|
78
|
+
const first=deriveCircuit(events,providerId,policy,'2026-09-17T00:00:00.500Z');
|
|
79
|
+
const replay=deriveCircuit(structuredClone(events),providerId,policy,'2026-09-17T00:00:00.500Z');
|
|
80
|
+
assert.deepEqual(replay,first);
|
|
81
|
+
const corrupt=[{...events[0],event_sha256:'bad'}];
|
|
82
|
+
const unavailable=deriveCircuit(corrupt,providerId,policy,'2026-09-17T00:00:00.500Z');
|
|
83
|
+
assert.equal(unavailable.state,'UNAVAILABLE');
|
|
84
|
+
assert.equal(providerCallDisposition(unavailable).allowed,false);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
test('events for other providers never affect this provider circuit',()=>{
|
|
88
|
+
const other=event('provider_call_failed','2026-09-17T00:00:00.000Z',{failure_class:'timeout'});
|
|
89
|
+
other.payload.provider_id='openai-compatible:other-model';
|
|
90
|
+
const circuit=deriveCircuit([other],providerId,policy,'2026-09-17T00:00:05.000Z');
|
|
91
|
+
assert.equal(circuit.state,'CLOSED');
|
|
92
|
+
assert.equal(circuit.failure_count,0);
|
|
93
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { readFile } from 'node:fs/promises';
|
|
4
|
+
|
|
5
|
+
const sourceUrl = new URL('../src/remote-mcp-autonomous-smoke-client.mjs', import.meta.url);
|
|
6
|
+
|
|
7
|
+
test('public autonomous smoke chunks resumable goal runs below the 120 second proxy ceiling', async () => {
|
|
8
|
+
const source = await readFile(sourceUrl, 'utf8');
|
|
9
|
+
const cycles = /const AUTONOMOUS_RUN_MAX_CYCLES_PER_REQUEST = (\d+);/.exec(source);
|
|
10
|
+
const timeout = /const AUTONOMOUS_RUN_REQUEST_TIMEOUT_MS = (\d+);/.exec(source);
|
|
11
|
+
|
|
12
|
+
assert.ok(cycles, 'smoke client must declare a per-request autonomous cycle budget');
|
|
13
|
+
assert.ok(timeout, 'smoke client must declare a per-request HTTP timeout budget');
|
|
14
|
+
assert.equal(Number(cycles[1]), 1, 'one autonomous cycle per public request keeps progress resumable');
|
|
15
|
+
assert.ok(Number(timeout[1]) > 0 && Number(timeout[1]) < 120000,
|
|
16
|
+
'public autonomous request timeout must stay below the Cloudflare 120 second read timeout');
|
|
17
|
+
assert.doesNotMatch(source, /max_cycles\s*:\s*32/,
|
|
18
|
+
'public smoke must not batch all autonomous cycles into one proxy request');
|
|
19
|
+
assert.match(source, /max_cycles\s*:\s*AUTONOMOUS_RUN_MAX_CYCLES_PER_REQUEST/);
|
|
20
|
+
assert.match(source, /ran\.status === 'yielded'/,
|
|
21
|
+
'public smoke must explicitly resume yielded autonomous state');
|
|
22
|
+
assert.match(source, /REQUEST_TIMEOUT/,
|
|
23
|
+
'public smoke must recognize a bounded client timeout without treating durable server work as lost');
|
|
24
|
+
assert.match(source, /autonomous_goal_status/,
|
|
25
|
+
'timeout recovery must poll authenticated durable goal state instead of replaying the mutation');
|
|
26
|
+
assert.match(source, /recoverTimedOutGoal/,
|
|
27
|
+
'public smoke must use one explicit timeout-recovery path');
|
|
28
|
+
});
|
|
@@ -86,7 +86,7 @@ test('audit restart reconciles an orphan request with an explicit interrupted re
|
|
|
86
86
|
}finally{await rm(stateRoot,{recursive:true,force:true});}
|
|
87
87
|
});
|
|
88
88
|
|
|
89
|
-
test('Windows
|
|
89
|
+
test('Windows R35 gate emits manifest-bound machine-readable evidence outside the candidate tree', async()=>{
|
|
90
90
|
const stateRoot=await temp('deadbyte-r33-windows-evidence-');
|
|
91
91
|
try{
|
|
92
92
|
const gate=await readFile(path.join(root,'scripts','gate-windows.ps1'),'utf8');
|
|
@@ -99,11 +99,11 @@ test('Windows R33 gate emits manifest-bound machine-readable evidence outside th
|
|
|
99
99
|
assert.equal(summary.status,'written');
|
|
100
100
|
const evidence=JSON.parse(await readFile(summary.path,'utf8'));
|
|
101
101
|
const manifestSha=sha256(await readFile(path.join(root,'MANIFEST.SHA256')));
|
|
102
|
-
assert.equal(evidence.schema,'deadbyte.
|
|
102
|
+
assert.equal(evidence.schema,'deadbyte.r35-windows-gate.v1');
|
|
103
103
|
assert.equal(evidence.status,'passed');
|
|
104
104
|
assert.equal(evidence.exit_code,0);
|
|
105
105
|
assert.equal(evidence.manifest_sha256,manifestSha);
|
|
106
|
-
assert.equal(evidence.marker,'DEADBYTE V0.
|
|
106
|
+
assert.equal(evidence.marker,'DEADBYTE V0.9.0 / R35 WINDOWS BATCH GATE: PASS');
|
|
107
107
|
assert.ok(summary.path.startsWith(path.join(stateRoot,'evidence','release')));
|
|
108
108
|
}finally{await rm(stateRoot,{recursive:true,force:true});}
|
|
109
109
|
});
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import test from 'node:test';
|
|
2
2
|
import assert from 'node:assert/strict';
|
|
3
3
|
import { readFile } from 'node:fs/promises';
|
|
4
|
-
import {
|
|
4
|
+
import { R34_EXPECTED_TOOLS } from '../src/remote-mcp-r34-parity-client.mjs';
|
|
5
5
|
import { validateParityEvidence } from '../scripts/release-parity.mjs';
|
|
6
6
|
import { verifyFinalClosureObject } from '../scripts/final-closure-verify.mjs';
|
|
7
7
|
|
|
8
8
|
const root = new URL('../', import.meta.url);
|
|
9
9
|
const text = rel => readFile(new URL(rel, root), 'utf8');
|
|
10
10
|
|
|
11
|
-
test('
|
|
12
|
-
assert.equal(
|
|
13
|
-
assert.equal(new Set(
|
|
14
|
-
assert.deepEqual([...
|
|
11
|
+
test('R34 public parity catalog is exact, unique, and includes production coding ergonomics', () => {
|
|
12
|
+
assert.equal(R34_EXPECTED_TOOLS.length, 73);
|
|
13
|
+
assert.equal(new Set(R34_EXPECTED_TOOLS).size, 73);
|
|
14
|
+
assert.deepEqual([...R34_EXPECTED_TOOLS].sort(), R34_EXPECTED_TOOLS);
|
|
15
|
+
for (const name of ['coding_files_read','coding_symbol_outline','coding_symbol_definition','coding_symbol_references','coding_symbol_replace']) {
|
|
16
|
+
assert.ok(R34_EXPECTED_TOOLS.includes(name),`missing ${name}`);
|
|
17
|
+
}
|
|
15
18
|
});
|
|
16
19
|
|
|
17
20
|
test('release parity and final verifier are package entry points', async () => {
|
|
@@ -29,10 +32,10 @@ test('final closure verifier is implementation-independent from production helpe
|
|
|
29
32
|
assert.doesNotMatch(verifier, /from ['"]\.\.\/src\//);
|
|
30
33
|
assert.match(verifier, /DEADBYTE-R27-SLOT-UPDATE-V1/);
|
|
31
34
|
assert.match(verifier, /DEADBYTE-MACHINE-PING-V1/);
|
|
32
|
-
assert.match(verifier, /DEADBYTE-
|
|
33
|
-
assert.match(writer, /pointer\.version==='0\.
|
|
34
|
-
assert.match(verifier, /envelope\.body\.version==='0\.
|
|
35
|
-
assert.match(verifier, /release_label==='
|
|
35
|
+
assert.match(verifier, /DEADBYTE-R35-FINAL-CLOSURE-V1/);
|
|
36
|
+
assert.match(writer, /pointer\.version==='0\.9\.0'/);
|
|
37
|
+
assert.match(verifier, /envelope\.body\.version==='0\.9\.0'/);
|
|
38
|
+
assert.match(verifier, /release_label==='R35 FINAL MACHINE BASELINE'/);
|
|
36
39
|
});
|
|
37
40
|
|
|
38
41
|
test('final closure verifier canonicalizes traversal order before exact-tree comparison', async () => {
|
|
@@ -41,15 +44,15 @@ test('final closure verifier canonicalizes traversal order before exact-tree com
|
|
|
41
44
|
assert.match(verifier, /const expected=\[\.\.\.entries\.keys\(\)\]\.sort\(\(a,b\)=>a\.localeCompare\(b,'en'\)\);/);
|
|
42
45
|
});
|
|
43
46
|
|
|
44
|
-
test('autonomous live gate reuses the canonical
|
|
47
|
+
test('autonomous live gate reuses the canonical R34 73-tool catalog', async () => {
|
|
45
48
|
const autonomous = await text('src/remote-mcp-autonomous-smoke-client.mjs');
|
|
46
|
-
assert.match(autonomous, /import \{
|
|
49
|
+
assert.match(autonomous, /import \{ R34_EXPECTED_TOOLS \} from '\.\/remote-mcp-r34-parity-client\.mjs';/);
|
|
47
50
|
assert.doesNotMatch(autonomous, /const expectedTools\s*=\s*\[/);
|
|
48
|
-
assert.match(autonomous, /JSON\.stringify\(names\) !== JSON\.stringify\(
|
|
51
|
+
assert.match(autonomous, /JSON\.stringify\(names\) !== JSON\.stringify\(R34_EXPECTED_TOOLS\)/);
|
|
49
52
|
});
|
|
50
53
|
|
|
51
|
-
test('
|
|
52
|
-
const parity = await text('src/remote-mcp-
|
|
54
|
+
test('R34 parity proves coding package tests before package-visible scratch mutation', async () => {
|
|
55
|
+
const parity = await text('src/remote-mcp-r34-parity-client.mjs');
|
|
53
56
|
const codingTests = parity.indexOf('const tests = structured(');
|
|
54
57
|
const scratchWrite = parity.indexOf('const write = structured(');
|
|
55
58
|
assert.notEqual(codingTests, -1);
|
|
@@ -57,8 +60,8 @@ test('R33 parity proves coding package tests before package-visible scratch muta
|
|
|
57
60
|
assert.ok(codingTests < scratchWrite, 'coding tests must complete before machine-FS scratch mutation');
|
|
58
61
|
});
|
|
59
62
|
|
|
60
|
-
test('
|
|
61
|
-
const parity = await text('src/remote-mcp-
|
|
63
|
+
test('R34 parity isolates scratch mutation and search from the core release tree', async () => {
|
|
64
|
+
const parity = await text('src/remote-mcp-r34-parity-client.mjs');
|
|
62
65
|
assert.match(parity, /const scratchRoot = 'parity_scratch';/);
|
|
63
66
|
assert.match(parity, /machine_fs_write[\s\S]*?root_id:scratchRoot/);
|
|
64
67
|
assert.match(parity, /machine_search_start[\s\S]*?root_id:scratchRoot/);
|
|
@@ -19,7 +19,11 @@ test('R27 generation bundle rebinds authority and mutable state outside the rele
|
|
|
19
19
|
await mkdir(path.join(release,'scripts'),{recursive:true}); await mkdir(path.join(release,'bin'),{recursive:true}); await mkdir(workspace,{recursive:true});
|
|
20
20
|
await writeFile(path.join(release,'scripts','gate.ps1'),'Write-Output gate\n');
|
|
21
21
|
await writeFile(path.join(release,'bin','deadbyte-process-host.exe'),'process-host-bytes\n');
|
|
22
|
-
const
|
|
22
|
+
const semanticConfigPath=path.join(base,'semantic-lsp.json');
|
|
23
|
+
const semanticConfigBytes=Buffer.from(JSON.stringify({schema:'deadbyte.semantic-lsp-config.v1',servers:[]})+'\n','utf8');
|
|
24
|
+
await writeFile(semanticConfigPath,semanticConfigBytes);
|
|
25
|
+
const currentConfig={AgentRuntimeEnabled:true,ProcessRuntimeEnabled:true,CodingRuntimeEnabled:true,MachineFsRuntimeEnabled:true,ObservationRuntimeEnabled:true,AutonomousRuntimeEnabled:true,AutonomousSupervisorEnabled:true,SemanticLspConfigFile:semanticConfigPath,SemanticLspConfigSha256:sha(semanticConfigBytes),
|
|
26
|
+
Supervisor:{FilePath:'C:/node.exe',FileSha256:EXE,Arguments:'src\\autonomous-supervisor-host.mjs',WorkingDirectory:'C:/release',ScriptPath:'C:/release/src/autonomous-supervisor-host.mjs',ScriptSha256:'2'.repeat(64)},
|
|
23
27
|
Bridge:{FilePath:'C:/node.exe',FileSha256:EXE,Arguments:'bridge.mjs',WorkingDirectory:'C:/bridge',ScriptPath:'C:/bridge/bridge.mjs',ScriptSha256:EXE},
|
|
24
28
|
Cloud:{FilePath:'C:/deadbyte-tunnel-host.exe',FileSha256:EXE,Arguments:'"C:/cloudflared.exe" "C:/secret/tunnel-token.txt" "C:/bridge"',WorkingDirectory:'C:/release',Transport:'deadbyte.named-tunnel.v2',Dependencies:[
|
|
25
29
|
{Name:'cloudflared',Path:'C:/cloudflared.exe',Sha256:EXE},{Name:'tunnel-token',Path:'C:/secret/tunnel-token.txt',Sha256:EXE}
|
|
@@ -38,7 +42,7 @@ test('R27 generation bundle rebinds authority and mutable state outside the rele
|
|
|
38
42
|
const development=path.join(base,'development'); await mkdir(development,{recursive:true}); await mkdir(path.join(development,'scripts'),{recursive:true}); await writeFile(path.join(development,'scripts','gate.ps1'),'Write-Output gate\n');
|
|
39
43
|
const result=await createGenerationBundle({stateRoot:state,releaseRoot:release,developmentRoot:development,workspaceRoot:workspace,releaseId:'v0.8.3-aaaaaaaaaaaaaaaa',currentConfig,codingPolicy:coding,autonomousPolicy:autonomous,hostPolicy:host,processPolicy});
|
|
40
44
|
const verified=await verifyGenerationBundle(result.generation_root,result.generation_manifest_sha256);
|
|
41
|
-
assert.equal(verified.files,
|
|
45
|
+
assert.equal(verified.files,6);
|
|
42
46
|
const generatedProcess=JSON.parse(await readFile(result.process_policy_path,'utf8'));
|
|
43
47
|
assert.equal(generatedProcess.grant_file,path.join(path.resolve(state),'runtime','process-grant.json'));
|
|
44
48
|
assert.equal(generatedProcess.state_dir,path.join(path.resolve(state),'evidence','process'));
|
|
@@ -62,8 +66,11 @@ test('R27 generation bundle rebinds authority and mutable state outside the rele
|
|
|
62
66
|
assert.equal(generatedHost.roots.core.path,path.resolve(development));
|
|
63
67
|
assert.notEqual(generatedHost.roots.core.path,path.resolve(release));
|
|
64
68
|
assert.equal(generatedHost.arm_file,path.join(path.resolve(state),'runtime','host-grant.json'));
|
|
69
|
+
assert.equal(await readFile(result.semantic_config_path,'utf8'),semanticConfigBytes.toString('utf8'));
|
|
65
70
|
const config=await readFile(result.config_path,'utf8');
|
|
66
71
|
assert.match(config,new RegExp(`CoreRoot = '${release.replaceAll('\\','\\\\')}`));
|
|
72
|
+
assert.match(config,/SemanticLspConfigFile = '/);
|
|
73
|
+
assert.match(config,new RegExp(`SemanticLspConfigSha256 = '${sha(semanticConfigBytes)}'`));
|
|
67
74
|
assert.doesNotMatch(config,/CoreRoot = ''/);
|
|
68
75
|
assert.match(config,new RegExp(`WorkspaceRoot = '${workspace.replaceAll('\\','\\\\')}`));
|
|
69
76
|
assert.match(config,/MachineRuntimeEnabled = \$true/);
|
|
@@ -74,6 +81,10 @@ test('R27 generation bundle rebinds authority and mutable state outside the rele
|
|
|
74
81
|
assert.match(config,/ObservationRuntimeEnabled = \$true/);
|
|
75
82
|
assert.match(config,/CodingPolicyFile = '/);
|
|
76
83
|
assert.match(config,/AutonomousPolicyFile = '/);
|
|
84
|
+
assert.match(config,/AutonomousSupervisorEnabled = \$true/);
|
|
85
|
+
assert.match(config,/Supervisor = @\{/);
|
|
86
|
+
assert.match(config,/ScriptPath = 'C:\/release\/src\/autonomous-supervisor-host\.mjs'/);
|
|
87
|
+
assert.match(config,/ScriptSha256 = '2{64}'/);
|
|
77
88
|
assert.match(config,/HostPolicyFile = '/);
|
|
78
89
|
assert.match(config,/Transport = 'deadbyte\.named-tunnel\.v2'/);
|
|
79
90
|
assert.match(config,/McpUrlFile = 'C:\/mcp-url\.txt'/);
|
|
@@ -107,10 +118,20 @@ test('R27 generation bundle rebinds authority and mutable state outside the rele
|
|
|
107
118
|
const sixth=await createGenerationBundle({stateRoot:state,releaseRoot:release,developmentRoot:development,workspaceRoot:workspace,releaseId:'v0.8.3-aaaaaaaaaaaaaaaa',currentConfig:observationDisabled,codingPolicy:coding,autonomousPolicy:autonomous,hostPolicy:host,processPolicy});
|
|
108
119
|
assert.notEqual(sixth.generation_root,result.generation_root);
|
|
109
120
|
assert.notEqual(sixth.generation_seed_sha256,result.generation_seed_sha256);
|
|
121
|
+
const semanticConfig2Path=path.join(base,'semantic-lsp-v2.json');
|
|
122
|
+
const semanticConfig2Bytes=Buffer.from(JSON.stringify({schema:'deadbyte.semantic-lsp-config.v1',servers:[{id:'changed'}]})+'\n','utf8');
|
|
123
|
+
await writeFile(semanticConfig2Path,semanticConfig2Bytes);
|
|
124
|
+
const semanticChanged=structuredClone(currentConfig);
|
|
125
|
+
semanticChanged.SemanticLspConfigFile=semanticConfig2Path;
|
|
126
|
+
semanticChanged.SemanticLspConfigSha256=sha(semanticConfig2Bytes);
|
|
127
|
+
const seventh=await createGenerationBundle({stateRoot:state,releaseRoot:release,developmentRoot:development,workspaceRoot:workspace,releaseId:'v0.8.3-aaaaaaaaaaaaaaaa',currentConfig:semanticChanged,codingPolicy:coding,autonomousPolicy:autonomous,hostPolicy:host,processPolicy});
|
|
128
|
+
assert.notEqual(seventh.generation_root,result.generation_root);
|
|
129
|
+
assert.notEqual(seventh.generation_seed_sha256,result.generation_seed_sha256);
|
|
110
130
|
await verifyGenerationBundle(result.generation_root,result.generation_manifest_sha256);
|
|
111
131
|
await verifyGenerationBundle(second.generation_root,second.generation_manifest_sha256);
|
|
112
132
|
await verifyGenerationBundle(third.generation_root,third.generation_manifest_sha256);
|
|
113
133
|
await verifyGenerationBundle(fourth.generation_root,fourth.generation_manifest_sha256);
|
|
114
134
|
await verifyGenerationBundle(fifth.generation_root,fifth.generation_manifest_sha256);
|
|
115
135
|
await verifyGenerationBundle(sixth.generation_root,sixth.generation_manifest_sha256);
|
|
136
|
+
await verifyGenerationBundle(seventh.generation_root,seventh.generation_manifest_sha256);
|
|
116
137
|
});
|