deadbyte-mcp 0.8.10 → 0.10.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 +386 -94
- package/R34-BASELINE.json +9 -0
- package/README.txt +141 -10
- package/bench/fixtures/corpus.json +36 -0
- package/bench/fixtures/r36/case-map.json +8 -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 +12 -4
- package/controller/deadbyte-controller.config.psd1.example +14 -0
- package/controller/deadbyte-controller.ps1 +191 -20
- package/controller/deadbyte-process-policy.json +5 -5
- package/controller/deadbyte-semantic-lsp-config.json +95 -0
- package/docs/ADR-0001-PRODUCTION-BASELINE-SEAMS.md +29 -0
- package/docs/ARCHITECTURE.md +6 -5
- package/docs/R36-CAPABILITY-EVIDENCE.md +43 -0
- 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/plans/2026-09-18-r36-zero-loss-autonomy.md +739 -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/docs/superpowers/specs/2026-09-18-r36-zero-loss-autonomy-design.md +640 -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 +56 -16
- package/scripts/final-closure-verify.mjs +88 -39
- package/scripts/final-closure.mjs +63 -56
- package/scripts/gate-windows.ps1 +3 -3
- package/scripts/release-parity-tests.ps1 +9 -0
- package/scripts/release-parity.mjs +149 -139
- 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 +256 -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-mcp-tools.mjs +5 -1
- package/src/autonomous-output-contracts.mjs +26 -7
- package/src/autonomous-plan.mjs +181 -0
- package/src/autonomous-planner-contracts.mjs +79 -0
- package/src/autonomous-planner.mjs +113 -6
- package/src/autonomous-policy.mjs +15 -2
- package/src/autonomous-progress.mjs +127 -0
- package/src/autonomous-runtime.mjs +785 -62
- package/src/autonomous-supervisor-host.mjs +70 -0
- package/src/autonomous-supervisor.mjs +31 -8
- package/src/capability-benchmark-runner.mjs +193 -0
- package/src/capability-benchmark.mjs +95 -0
- package/src/capability-ledger.mjs +158 -0
- package/src/coding-mcp-tools.mjs +65 -8
- package/src/coding-output-contracts.mjs +91 -8
- package/src/coding-plane.mjs +45 -9
- package/src/coding-search.mjs +130 -47
- package/src/compact-gateway-mcp-tools.mjs +128 -0
- package/src/compact-gateway-output-contracts.mjs +16 -0
- package/src/context-provenance.mjs +86 -0
- package/src/deadbyte-cli.mjs +145 -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/machine-fs.mjs +51 -8
- package/src/mcp-server.mjs +46 -9
- package/src/native-diff-v2.mjs +337 -0
- package/src/native-diff.mjs +50 -2
- package/src/observation-smoke-client.mjs +3 -2
- package/src/operator-surface.mjs +43 -0
- package/src/process-runtime.mjs +98 -11
- package/src/process-smoke-client.mjs +11 -3
- package/src/provider-circuit.mjs +125 -0
- package/src/r36-compact-disarmed-probe.mjs +50 -0
- package/src/r36-full-surface-probe.mjs +56 -0
- package/src/release-generation.mjs +44 -5
- package/src/remote-live-log.mjs +76 -0
- package/src/remote-mcp-autonomous-smoke-client.mjs +58 -15
- 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-r34-parity-client.mjs +177 -0
- package/src/remote-mcp-r36-parity-client.mjs +175 -0
- package/src/remote-mcp-smoke-client.mjs +113 -56
- package/src/remote-result-journal.mjs +114 -0
- package/src/runtime-update.mjs +109 -9
- package/src/search-cursor.mjs +45 -0
- package/src/semantic-backend-registry.mjs +39 -0
- package/src/semantic-code.mjs +246 -0
- package/src/semantic-lsp-backend.mjs +219 -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-capability-r36.test.mjs +151 -0
- 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-r36.test.mjs +107 -0
- package/test/capability-benchmark-runner.test.mjs +49 -0
- package/test/capability-benchmark-semantic-r36.test.mjs +52 -0
- package/test/capability-benchmark.test.mjs +47 -0
- package/test/capability-claims-r36.test.mjs +23 -0
- package/test/capability-ledger-r36.test.mjs +102 -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/coding-runtime.test.mjs +16 -0
- package/test/coding-search-r36.test.mjs +90 -0
- package/test/compact-catalog-r36.test.mjs +37 -0
- package/test/compact-gateway-r36.test.mjs +66 -0
- package/test/contained.test.mjs +1 -1
- 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 +11 -1
- package/test/document-adapter.test.mjs +23 -0
- package/test/fixtures/lsp-framed-server.mjs +35 -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 +122 -0
- package/test/lsp-stdio-client.test.mjs +72 -0
- package/test/multi-file-read.test.mjs +44 -0
- package/test/native-diff-topology-r36.test.mjs +105 -0
- package/test/observation-integration.test.mjs +3 -3
- package/test/package-boundary.test.mjs +6 -0
- package/test/process-longrun-r36.test.mjs +82 -0
- package/test/process-release-gate.test.mjs +9 -0
- package/test/production-docs.test.mjs +48 -0
- package/test/prompts-resources.test.mjs +41 -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 +4 -3
- package/test/r33-finalization.test.mjs +26 -18
- package/test/r36-finalization.test.mjs +104 -0
- package/test/r36-release-identity.test.mjs +52 -0
- package/test/release-generation.test.mjs +23 -2
- package/test/release-version.test.mjs +27 -17
- package/test/remote-live-log-r36.test.mjs +37 -0
- package/test/remote-live-log-recovery-r36.test.mjs +41 -0
- package/test/remote-r24-catalog.test.mjs +18 -4
- package/test/remote-result-journal.test.mjs +58 -0
- package/test/remote-session-cli.test.mjs +135 -30
- package/test/runtime-self-update.test.mjs +121 -1
- package/test/semantic-backend-registry.test.mjs +29 -0
- package/test/semantic-code.test.mjs +66 -0
- package/test/semantic-lsp-backend.test.mjs +108 -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-r36-rename.test.mjs +82 -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
- package/deadbyte-mcp-0.8.9.tgz +0 -0
|
@@ -5,12 +5,22 @@ import path from 'node:path';
|
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
6
|
|
|
7
7
|
const root=path.resolve(path.dirname(fileURLToPath(import.meta.url)),'..');
|
|
8
|
-
test('
|
|
8
|
+
test('R34 deferred slot operation preserves supervisor bootstrap across rollback restore',async()=>{
|
|
9
9
|
const source=await readFile(path.join(root,'scripts','deferred-slot-operation.mjs'),'utf8');
|
|
10
10
|
assert.match(source,/mode==='activate'/);
|
|
11
11
|
assert.match(source,/mode==='rollback'/);
|
|
12
12
|
assert.match(source,/verifySlotUpdateEnvelope/);
|
|
13
13
|
assert.match(source,/runSlotUpdateCli\(args,\{stateRoot\}\)/);
|
|
14
|
+
assert.match(source,/--enable-autonomous-supervisor/);
|
|
15
|
+
assert.match(source,/loadPowerShellDataFile/);
|
|
16
|
+
assert.match(source,/active-release\.json/);
|
|
17
|
+
assert.match(source,/Bridge\.WorkingDirectory/);
|
|
18
|
+
assert.match(source,/src['"],['"]bridge\.mjs/);
|
|
19
|
+
assert.match(source,/--bridge-root/);
|
|
20
|
+
assert.match(source,/--bridge-script-sha256/);
|
|
21
|
+
assert.match(source,/explicitBridgeRoot/);
|
|
22
|
+
assert.match(source,/explicitBridgeSha256/);
|
|
23
|
+
assert.match(source,/bridge override requires exact root \+ SHA pair/i);
|
|
14
24
|
assert.match(source,/detached:true/);
|
|
15
25
|
assert.match(source,/rdc_operation_count:0/);
|
|
16
26
|
assert.doesNotMatch(source,/shell:\s*true/);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { createDocumentAdapterRegistry } from '../src/document-adapter.mjs';
|
|
4
|
+
|
|
5
|
+
test('document adapter registry is bounded, explicit and rejects ambiguous adapter contracts',async()=>{
|
|
6
|
+
const registry=createDocumentAdapterRegistry({maxInputBytes:1024*1024,maxOutputBytes:2*1024*1024});
|
|
7
|
+
registry.register({
|
|
8
|
+
id:'fixture-markdown-pdf',operation:'markdown_to_pdf',inputMime:['text/markdown'],outputMime:'application/pdf',
|
|
9
|
+
async transform({bytes}){return {bytes:Buffer.concat([Buffer.from('%PDF-fixture\n'),bytes]),metadata:{engine:'fixture'}};}
|
|
10
|
+
});
|
|
11
|
+
assert.deepEqual(registry.list(),[{id:'fixture-markdown-pdf',operation:'markdown_to_pdf',input_mime:['text/markdown'],output_mime:'application/pdf'}]);
|
|
12
|
+
const out=await registry.run({adapterId:'fixture-markdown-pdf',operation:'markdown_to_pdf',inputMime:'text/markdown',bytes:Buffer.from('# hello\n')});
|
|
13
|
+
assert.equal(out.status,'ok'); assert.equal(out.output_mime,'application/pdf'); assert.match(out.bytes.toString('utf8'),/^%PDF-fixture/); assert.equal(out.metadata.engine,'fixture');
|
|
14
|
+
assert.throws(()=>registry.register({id:'fixture-markdown-pdf',operation:'x',inputMime:['text/plain'],outputMime:'text/plain',transform:async()=>({bytes:Buffer.alloc(0)})}),/already registered/);
|
|
15
|
+
await assert.rejects(()=>registry.run({adapterId:'fixture-markdown-pdf',operation:'markdown_to_pdf',inputMime:'application/octet-stream',bytes:Buffer.from('x')}),/input MIME denied/);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test('document adapter registry enforces input and output byte budgets',async()=>{
|
|
19
|
+
const registry=createDocumentAdapterRegistry({maxInputBytes:4,maxOutputBytes:8});
|
|
20
|
+
registry.register({id:'bounded',operation:'extract_text',inputMime:['application/test'],outputMime:'text/plain',async transform({bytes}){return {bytes:Buffer.concat([bytes,bytes]),metadata:{}};}});
|
|
21
|
+
await assert.rejects(()=>registry.run({adapterId:'bounded',operation:'extract_text',inputMime:'application/test',bytes:Buffer.from('12345')}),/input exceeds/);
|
|
22
|
+
const small=await registry.run({adapterId:'bounded',operation:'extract_text',inputMime:'application/test',bytes:Buffer.from('1234')}); assert.equal(small.bytes.length,8);
|
|
23
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
let buffer=Buffer.alloc(0);
|
|
2
|
+
let queued=[];
|
|
3
|
+
let expectedLanguageId=null;
|
|
4
|
+
let requiredOpenCount=0;
|
|
5
|
+
let readyAfterMs=0;
|
|
6
|
+
let documentSymbolNullCount=0;
|
|
7
|
+
let referencesEmptyCount=0;
|
|
8
|
+
let initializedAt=0;
|
|
9
|
+
const openedUris=[];
|
|
10
|
+
const frame=value=>{const body=Buffer.from(JSON.stringify(value),'utf8');return Buffer.concat([Buffer.from(`Content-Length: ${body.length}\r\n\r\n`,'ascii'),body]);};
|
|
11
|
+
const ready=()=>Date.now()-initializedAt>=readyAfterMs;
|
|
12
|
+
function send(value,{split=false}={}){const bytes=frame(value);if(!split){process.stdout.write(bytes);return;}const cut=Math.max(1,Math.floor(bytes.length/3));process.stdout.write(bytes.subarray(0,cut));setTimeout(()=>process.stdout.write(bytes.subarray(cut)),5);}
|
|
13
|
+
function respond(msg){
|
|
14
|
+
if(msg.method==='initialize') { expectedLanguageId=msg.params?.initializationOptions?.expectedLanguageId??null; requiredOpenCount=Number(msg.params?.initializationOptions?.requiredOpenCount??0); readyAfterMs=Number(msg.params?.initializationOptions?.readyAfterMs??0); documentSymbolNullCount=Number(msg.params?.initializationOptions?.documentSymbolNullCount??0); referencesEmptyCount=Number(msg.params?.initializationOptions?.referencesEmptyCount??0); initializedAt=Date.now(); return send({jsonrpc:'2.0',id:msg.id,result:{capabilities:{},serverInfo:{name:'fixture'}}},{split:true}); }
|
|
15
|
+
if(msg.method==='textDocument/didOpen') { if(expectedLanguageId&&msg.params?.textDocument?.languageId!==expectedLanguageId) return process.exit(7); if(msg.params?.textDocument?.uri&&!openedUris.includes(msg.params.textDocument.uri))openedUris.push(msg.params.textDocument.uri); return; }
|
|
16
|
+
if(msg.method==='echo') return send({jsonrpc:'2.0',method:'fixture/note',params:{seen:msg.params?.value}},{}),send({jsonrpc:'2.0',id:msg.id,result:{value:msg.params?.value}},{split:true});
|
|
17
|
+
if(msg.method==='queue') { queued.push(msg); if(queued.length===2){const [a,b]=queued.splice(0);process.stdout.write(Buffer.concat([frame({jsonrpc:'2.0',id:b.id,result:{value:b.params?.value}}),frame({jsonrpc:'2.0',id:a.id,result:{value:a.params?.value}})]));} return; }
|
|
18
|
+
if(msg.method==='textDocument/documentSymbol') { if(documentSymbolNullCount>0){documentSymbolNullCount-=1;return send({jsonrpc:'2.0',id:msg.id,result:null});} return send({jsonrpc:'2.0',id:msg.id,result:[{name:'alpha',kind:12,range:{start:{line:0,character:0},end:{line:0,character:26}},selectionRange:{start:{line:0,character:16},end:{line:0,character:21}},children:[]}]}); }
|
|
19
|
+
if(msg.method==='textDocument/definition') { if(!Number.isInteger(msg.params?.position?.character)) return send({jsonrpc:'2.0',id:msg.id,error:{code:-32602,message:'position.character required'}}); if(!ready())return send({jsonrpc:'2.0',id:msg.id,result:null}); if(requiredOpenCount>0&&openedUris.length<requiredOpenCount)return send({jsonrpc:'2.0',id:msg.id,result:null}); const targetUri=requiredOpenCount>0?(openedUris.find(uri=>uri!==msg.params.textDocument.uri)??msg.params.textDocument.uri):msg.params.textDocument.uri; return send({jsonrpc:'2.0',id:msg.id,result:{uri:targetUri,range:{start:{line:0,character:16},end:{line:0,character:21}}}}); }
|
|
20
|
+
if(msg.method==='textDocument/references') { if(!Number.isInteger(msg.params?.position?.character)) return send({jsonrpc:'2.0',id:msg.id,error:{code:-32602,message:'position.character required'}}); if(referencesEmptyCount>0){referencesEmptyCount-=1;return send({jsonrpc:'2.0',id:msg.id,result:[]});} if(requiredOpenCount>0&&openedUris.length<requiredOpenCount)return send({jsonrpc:'2.0',id:msg.id,result:[]}); const uris=requiredOpenCount>0?openedUris:[msg.params.textDocument.uri]; return send({jsonrpc:'2.0',id:msg.id,result:uris.map(uri=>({uri,range:{start:{line:0,character:16},end:{line:0,character:21}}}))}); }
|
|
21
|
+
if(msg.method==='textDocument/implementation') { if(msg.params?.position?.character===999) return send({jsonrpc:'2.0',id:msg.id,error:{code:-32601,message:'method not found'}}); const uri=openedUris.find(x=>x!==msg.params.textDocument.uri)??msg.params.textDocument.uri; return send({jsonrpc:'2.0',id:msg.id,result:[{uri,range:{start:{line:0,character:16},end:{line:0,character:21}}}]}); }
|
|
22
|
+
if(msg.method==='textDocument/rename') { if(msg.params?.newName==='UNSUPPORTED') return send({jsonrpc:'2.0',id:msg.id,error:{code:-32601,message:'method not found'}}); const changes={}; for(const uri of (openedUris.length?openedUris:[msg.params.textDocument.uri])) changes[uri]=[{range:{start:{line:0,character:16},end:{line:0,character:21}},newText:msg.params.newName}]; return send({jsonrpc:'2.0',id:msg.id,result:{changes}}); }
|
|
23
|
+
if(msg.method==='textDocument/diagnostic') return send({jsonrpc:'2.0',id:msg.id,result:{kind:'full',items:[{range:{start:{line:0,character:0},end:{line:0,character:5}},severity:1,code:'fixture',message:'fixture diagnostic'}]}});
|
|
24
|
+
if(msg.method==='never') return;
|
|
25
|
+
if(msg.method==='oversize') return send({jsonrpc:'2.0',id:msg.id,result:{blob:'x'.repeat(65536)}});
|
|
26
|
+
if(msg.method==='crash') { setTimeout(()=>process.exit(9),5); return; }
|
|
27
|
+
if(msg.method==='shutdown') { if(Object.prototype.hasOwnProperty.call(msg,'params')) return send({jsonrpc:'2.0',id:msg.id,error:{code:-32602,message:'shutdown params must be omitted'}}); return send({jsonrpc:'2.0',id:msg.id,result:null}); }
|
|
28
|
+
if(msg.method==='exit') return process.exit(0);
|
|
29
|
+
if(msg.id!==undefined) return send({jsonrpc:'2.0',id:msg.id,error:{code:-32601,message:'method not found'}});
|
|
30
|
+
}
|
|
31
|
+
function drain(){
|
|
32
|
+
while(true){const marker=buffer.indexOf('\r\n\r\n');if(marker<0)return;const head=buffer.subarray(0,marker).toString('ascii');const match=/^Content-Length:\s*(\d+)$/mi.exec(head);if(!match)process.exit(2);const size=Number(match[1]);const start=marker+4;if(buffer.length<start+size)return;const body=buffer.subarray(start,start+size);buffer=buffer.subarray(start+size);respond(JSON.parse(body.toString('utf8')));}
|
|
33
|
+
}
|
|
34
|
+
process.stdin.on('data',chunk=>{buffer=Buffer.concat([buffer,chunk]);drain();});
|
|
35
|
+
process.stdin.on('end',()=>process.exit(0));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"rustc_fingerprint":488889025332616082,"outputs":{"7971740275564407648":{"success":true,"status":"","code":0,"stdout":"___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\nC:\\Users\\DEADBYTE\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\npacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"msvc\"\ntarget_family=\"windows\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"windows\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"pc\"\nwindows\n","stderr":""},"17747080675513052775":{"success":true,"status":"","code":0,"stdout":"rustc 1.95.0 (59807616e 2026-04-14)\nbinary: rustc\ncommit-hash: 59807616e1fa2540724bfbac14d7976d7e4a3860\ncommit-date: 2026-04-14\nhost: x86_64-pc-windows-msvc\nrelease: 1.95.0\nLLVM version: 22.1.2\n","stderr":""}},"successes":{}}
|
|
File without changes
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This file has an mtime of when this was started.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
e81bfc7c62cc4693
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"rustc":8891013984288978370,"features":"[]","declared_features":"[]","target":1767539846898895204,"profile":3316208278650011218,"path":10763286916239946207,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug\\.fingerprint\\semantic_rust-4c168fa33c79d09c\\dep-test-lib-semantic_rust","checksum":false}}],"rustflags":[],"config":8247474407144887393,"compile_kind":0}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This file has an mtime of when this was started.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
bf98c9de3da0b2d9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"rustc":8891013984288978370,"features":"[]","declared_features":"[]","target":13421206264646069821,"profile":3316208278650011218,"path":4942398508502643691,"deps":[[11869315561588691901,"semantic_rust",false,9543626721491377734]],"local":[{"CheckDepInfo":{"dep_info":"debug\\.fingerprint\\semantic_rust-5dcd474439c54a26\\dep-test-bin-semantic_rust_bin","checksum":false}}],"rustflags":[],"config":8247474407144887393,"compile_kind":0}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This file has an mtime of when this was started.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
465e6b5bf0c57184
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"rustc":8891013984288978370,"features":"[]","declared_features":"[]","target":1767539846898895204,"profile":17672942494452627365,"path":10763286916239946207,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug\\.fingerprint\\semantic_rust-6212ccd976aa3808\\dep-lib-semantic_rust","checksum":false}}],"rustflags":[],"config":8247474407144887393,"compile_kind":0}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
8730cd13a886d085
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"rustc":8891013984288978370,"features":"[]","declared_features":"[]","target":13421206264646069821,"profile":17672942494452627365,"path":4942398508502643691,"deps":[[11869315561588691901,"semantic_rust",false,9543626721491377734]],"local":[{"CheckDepInfo":{"dep_info":"debug\\.fingerprint\\semantic_rust-d741378dccdef61c\\dep-bin-semantic_rust_bin","checksum":false}}],"rustflags":[],"config":8247474407144887393,"compile_kind":0}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This file has an mtime of when this was started.
|
|
File without changes
|
|
Binary file
|
package/test/fixtures/semantic/rust/target/debug/deps/libsemantic_rust_bin-5dcd474439c54a26.rmeta
ADDED
|
File without changes
|
package/test/fixtures/semantic/rust/target/debug/deps/libsemantic_rust_bin-d741378dccdef61c.rmeta
ADDED
|
File without changes
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
D:\Projects\deadbyte-mcp-r35-release-v0.9.0\test\fixtures\semantic\rust\target\debug\deps\semantic_rust-4c168fa33c79d09c.d: src\lib.rs
|
|
2
|
+
|
|
3
|
+
D:\Projects\deadbyte-mcp-r35-release-v0.9.0\test\fixtures\semantic\rust\target\debug\deps\libsemantic_rust-4c168fa33c79d09c.rmeta: src\lib.rs
|
|
4
|
+
|
|
5
|
+
src\lib.rs:
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
D:\Projects\deadbyte-mcp-r35-release-v0.9.0\test\fixtures\semantic\rust\target\debug\deps\semantic_rust-6212ccd976aa3808.d: src\lib.rs
|
|
2
|
+
|
|
3
|
+
D:\Projects\deadbyte-mcp-r35-release-v0.9.0\test\fixtures\semantic\rust\target\debug\deps\libsemantic_rust-6212ccd976aa3808.rmeta: src\lib.rs
|
|
4
|
+
|
|
5
|
+
src\lib.rs:
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
D:\Projects\deadbyte-mcp-r35-release-v0.9.0\test\fixtures\semantic\rust\target\debug\deps\semantic_rust_bin-5dcd474439c54a26.d: src\main.rs src\math.rs
|
|
2
|
+
|
|
3
|
+
D:\Projects\deadbyte-mcp-r35-release-v0.9.0\test\fixtures\semantic\rust\target\debug\deps\libsemantic_rust_bin-5dcd474439c54a26.rmeta: src\main.rs src\math.rs
|
|
4
|
+
|
|
5
|
+
src\main.rs:
|
|
6
|
+
src\math.rs:
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
D:\Projects\deadbyte-mcp-r35-release-v0.9.0\test\fixtures\semantic\rust\target\debug\deps\semantic_rust_bin-d741378dccdef61c.d: src\main.rs src\math.rs
|
|
2
|
+
|
|
3
|
+
D:\Projects\deadbyte-mcp-r35-release-v0.9.0\test\fixtures\semantic\rust\target\debug\deps\libsemantic_rust_bin-d741378dccdef61c.rmeta: src\main.rs src\math.rs
|
|
4
|
+
|
|
5
|
+
src\main.rs:
|
|
6
|
+
src\math.rs:
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.05s
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{"reason":"compiler-artifact","package_id":"path+file:///D:/Projects/deadbyte-mcp-r35-release-v0.9.0/test/fixtures/semantic/rust#semantic_rust@0.1.0","manifest_path":"D:\\Projects\\deadbyte-mcp-r35-release-v0.9.0\\test\\fixtures\\semantic\\rust\\Cargo.toml","target":{"kind":["lib"],"crate_types":["lib"],"name":"semantic_rust","src_path":"D:\\Projects\\deadbyte-mcp-r35-release-v0.9.0\\test\\fixtures\\semantic\\rust\\src\\lib.rs","edition":"2024","doc":true,"doctest":true,"test":true},"profile":{"opt_level":"0","debuginfo":2,"debug_assertions":true,"overflow_checks":true,"test":false},"features":[],"filenames":["D:\\Projects\\deadbyte-mcp-r35-release-v0.9.0\\test\\fixtures\\semantic\\rust\\target\\debug\\deps\\libsemantic_rust-6212ccd976aa3808.rmeta"],"executable":null,"fresh":true}
|
|
2
|
+
{"reason":"compiler-artifact","package_id":"path+file:///D:/Projects/deadbyte-mcp-r35-release-v0.9.0/test/fixtures/semantic/rust#semantic_rust@0.1.0","manifest_path":"D:\\Projects\\deadbyte-mcp-r35-release-v0.9.0\\test\\fixtures\\semantic\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"semantic_rust_bin","src_path":"D:\\Projects\\deadbyte-mcp-r35-release-v0.9.0\\test\\fixtures\\semantic\\rust\\src\\main.rs","edition":"2024","doc":true,"doctest":false,"test":true},"profile":{"opt_level":"0","debuginfo":2,"debug_assertions":true,"overflow_checks":true,"test":false},"features":[],"filenames":["D:\\Projects\\deadbyte-mcp-r35-release-v0.9.0\\test\\fixtures\\semantic\\rust\\target\\debug\\deps\\libsemantic_rust_bin-d741378dccdef61c.rmeta"],"executable":null,"fresh":true}
|
|
3
|
+
{"reason":"compiler-artifact","package_id":"path+file:///D:/Projects/deadbyte-mcp-r35-release-v0.9.0/test/fixtures/semantic/rust#semantic_rust@0.1.0","manifest_path":"D:\\Projects\\deadbyte-mcp-r35-release-v0.9.0\\test\\fixtures\\semantic\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"semantic_rust_bin","src_path":"D:\\Projects\\deadbyte-mcp-r35-release-v0.9.0\\test\\fixtures\\semantic\\rust\\src\\main.rs","edition":"2024","doc":true,"doctest":false,"test":true},"profile":{"opt_level":"0","debuginfo":2,"debug_assertions":true,"overflow_checks":true,"test":true},"features":[],"filenames":["D:\\Projects\\deadbyte-mcp-r35-release-v0.9.0\\test\\fixtures\\semantic\\rust\\target\\debug\\deps\\libsemantic_rust_bin-5dcd474439c54a26.rmeta"],"executable":null,"fresh":true}
|
|
4
|
+
{"reason":"compiler-artifact","package_id":"path+file:///D:/Projects/deadbyte-mcp-r35-release-v0.9.0/test/fixtures/semantic/rust#semantic_rust@0.1.0","manifest_path":"D:\\Projects\\deadbyte-mcp-r35-release-v0.9.0\\test\\fixtures\\semantic\\rust\\Cargo.toml","target":{"kind":["lib"],"crate_types":["lib"],"name":"semantic_rust","src_path":"D:\\Projects\\deadbyte-mcp-r35-release-v0.9.0\\test\\fixtures\\semantic\\rust\\src\\lib.rs","edition":"2024","doc":true,"doctest":true,"test":true},"profile":{"opt_level":"0","debuginfo":2,"debug_assertions":true,"overflow_checks":true,"test":true},"features":[],"filenames":["D:\\Projects\\deadbyte-mcp-r35-release-v0.9.0\\test\\fixtures\\semantic\\rust\\target\\debug\\deps\\libsemantic_rust-4c168fa33c79d09c.rmeta"],"executable":null,"fresh":true}
|
|
5
|
+
{"reason":"build-finished","success":true}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/server';
|
|
2
|
+
import { serveStdio } from '@modelcontextprotocol/server/stdio';
|
|
3
|
+
import * as z from 'zod/v4';
|
|
4
|
+
|
|
5
|
+
serveStdio(()=>{
|
|
6
|
+
const server=new McpServer({name:'surface-fixture',version:'1.0.0'});
|
|
7
|
+
const outputSchema=z.strictObject({status:z.literal('ok')});
|
|
8
|
+
server.registerTool('alpha',{
|
|
9
|
+
description:'fixture',
|
|
10
|
+
inputSchema:z.strictObject({value:z.string()}),
|
|
11
|
+
outputSchema
|
|
12
|
+
},async()=>({content:[{type:'text',text:'ok'}],structuredContent:{status:'ok'}}));
|
|
13
|
+
return server;
|
|
14
|
+
},{legacy:'reject'});
|
|
@@ -0,0 +1,122 @@
|
|
|
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 { createMachineFsRuntime } from '../../src/machine-fs.mjs';
|
|
8
|
+
import { loadAutonomousPolicy } from '../../src/autonomous-policy.mjs';
|
|
9
|
+
import { createNativeDiffRuntime } from '../../src/native-diff.mjs';
|
|
10
|
+
import { createAutonomousRuntime } from '../../src/autonomous-runtime.mjs';
|
|
11
|
+
|
|
12
|
+
const sha = bytes => createHash('sha256').update(bytes).digest('hex');
|
|
13
|
+
const nonce = () => randomBytes(32).toString('hex');
|
|
14
|
+
|
|
15
|
+
export async function createR34Fixture({authority='armed',withFailingProfile=false,withStatefulProfile=false,codingRuntimeFactory=null,nativeDiffRuntimeFactory=null}={}) {
|
|
16
|
+
const root = await mkdtemp(path.join(os.tmpdir(),'deadbyte-r34-e2e-'));
|
|
17
|
+
const project = path.join(root,'project');
|
|
18
|
+
const trust = path.join(root,'trust');
|
|
19
|
+
await mkdir(project); await mkdir(trust);
|
|
20
|
+
const target = path.join(project,'x.txt');
|
|
21
|
+
await writeFile(target,'x\n');
|
|
22
|
+
let codingCommands = {};
|
|
23
|
+
let autonomousProfiles = {};
|
|
24
|
+
if (withFailingProfile || withStatefulProfile) {
|
|
25
|
+
const failScript = path.join(project,withStatefulProfile?'stateful-check.mjs':'fail.mjs');
|
|
26
|
+
const profileSource = withStatefulProfile
|
|
27
|
+
? "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"
|
|
28
|
+
: "throw new Error('VERIFY_FAIL');\n";
|
|
29
|
+
await writeFile(failScript,profileSource);
|
|
30
|
+
const nodeHash = sha(await readFile(process.execPath));
|
|
31
|
+
const failHash = sha(await readFile(failScript));
|
|
32
|
+
codingCommands = { node_script:{ kind:'script', executable:process.execPath, executable_sha256:nodeHash,
|
|
33
|
+
root_ids:['project'], prefix_args:[], extensions:['.mjs'], timeout_ms:120000, max_output_bytes:1048576 } };
|
|
34
|
+
autonomousProfiles = { check:{ kind:'command', root_id:'project', command_id:'node_script', script_path:path.basename(failScript),
|
|
35
|
+
script_sha256:failHash, args:[], cwd:'.', required_for_release:withStatefulProfile, run_after_mutation:withStatefulProfile,
|
|
36
|
+
description:withStatefulProfile?'stateful verification requires x.txt=y':'intentional verification failure' } };
|
|
37
|
+
}
|
|
38
|
+
const keys = await generateTrustKeypair({
|
|
39
|
+
privateKeyPath:path.join(trust,'private.pem'),publicKeyPath:path.join(trust,'public.pem')
|
|
40
|
+
});
|
|
41
|
+
const codingPath = path.join(root,'coding-policy.json');
|
|
42
|
+
await writeFile(codingPath,JSON.stringify({
|
|
43
|
+
schema:'deadbyte.coding-policy.v1',enabled:true,
|
|
44
|
+
lease_file:path.join(root,'coding-lease.json'),evidence_dir:path.join(root,'coding-evidence'),
|
|
45
|
+
roots:{project:{path:project,read:true,write:true,exec:withFailingProfile||withStatefulProfile,deny_paths:[]}},commands:codingCommands
|
|
46
|
+
},null,2));
|
|
47
|
+
const codingPolicy = await loadCodingPolicy(codingPath);
|
|
48
|
+
const autonomousPath = path.join(root,'autonomous-policy.json');
|
|
49
|
+
await writeFile(autonomousPath,JSON.stringify({
|
|
50
|
+
schema:'deadbyte.autonomous-policy.v1',enabled:true,
|
|
51
|
+
lease_file:path.join(root,'autonomous-lease.json'),evidence_dir:path.join(root,'autonomous-evidence'),
|
|
52
|
+
root_ids:['project'],coding_policy_sha256:codingPolicy.policy_sha256,
|
|
53
|
+
planner:{backend:'client_sampling',max_tokens:4096},profiles:autonomousProfiles,
|
|
54
|
+
limits:{max_iterations:16,max_mutations:8,max_wall_ms:600000,max_context_bytes:262144,
|
|
55
|
+
max_diff_bytes:262144,max_files_per_diff:4,max_stalled_cycles:2,max_post_replan_stalls:2,max_replans:8}
|
|
56
|
+
},null,2));
|
|
57
|
+
const policy = await loadAutonomousPolicy(autonomousPath,codingPolicy);
|
|
58
|
+
async function arm() {
|
|
59
|
+
await writeFile(codingPolicy.lease_file,JSON.stringify({schema:'deadbyte.coding-lease.v1',
|
|
60
|
+
policy_sha256:codingPolicy.policy_sha256,instance_nonce:nonce(),root_ids:['project'],
|
|
61
|
+
armed_at_utc:new Date().toISOString(),expires_at_utc:new Date(Date.now()+3600000).toISOString()}));
|
|
62
|
+
await writeFile(policy.lease_file,JSON.stringify({schema:'deadbyte.autonomous-lease.v1',
|
|
63
|
+
policy_sha256:policy.policy_sha256,instance_nonce:nonce(),root_ids:['project'],
|
|
64
|
+
armed_at_utc:new Date().toISOString(),expires_at_utc:new Date(Date.now()+3600000).toISOString()}));
|
|
65
|
+
}
|
|
66
|
+
async function disarm() {
|
|
67
|
+
await rm(codingPolicy.lease_file,{force:true});
|
|
68
|
+
await rm(policy.lease_file,{force:true});
|
|
69
|
+
}
|
|
70
|
+
if(authority==='armed') await arm();
|
|
71
|
+
const baseCodingRuntime = createCodingRuntime({policy:codingPolicy,signingKeyPath:keys.privateKeyPath,verifyKeyPath:keys.publicKeyPath});
|
|
72
|
+
const codingRuntime = codingRuntimeFactory ? codingRuntimeFactory(baseCodingRuntime) : baseCodingRuntime;
|
|
73
|
+
const machineFsRuntime = createMachineFsRuntime({policy:codingPolicy,signingKeyPath:keys.privateKeyPath,verifyKeyPath:keys.publicKeyPath});
|
|
74
|
+
const baseNativeDiffRuntime = createNativeDiffRuntime({policy,codingRuntime,machineFsRuntime,signingKeyPath:keys.privateKeyPath,verifyKeyPath:keys.publicKeyPath});
|
|
75
|
+
const nativeDiffRuntime = nativeDiffRuntimeFactory ? nativeDiffRuntimeFactory(baseNativeDiffRuntime) : baseNativeDiffRuntime;
|
|
76
|
+
const createRuntime = ({codingRuntimeOverride=codingRuntime,nativeDiffRuntimeOverride=nativeDiffRuntime}={}) => createAutonomousRuntime({policy,codingRuntime:codingRuntimeOverride,nativeDiffRuntime:nativeDiffRuntimeOverride,machineFsRuntime,
|
|
77
|
+
signingKeyPath:keys.privateKeyPath,verifyKeyPath:keys.publicKeyPath});
|
|
78
|
+
return {
|
|
79
|
+
root,project,target,keys,codingPolicy,policy,baseCodingRuntime,codingRuntime,machineFsRuntime,nativeDiffRuntime,createRuntime,runtime:createRuntime(),
|
|
80
|
+
initial_sha256:sha(await readFile(target)),arm,disarm,
|
|
81
|
+
cleanup:()=>rm(root,{recursive:true,force:true})
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export async function sendPlannerDecision(runtime,goalId,result,decision,{maxCycles=4}={}) {
|
|
86
|
+
if(result.status!=='input_required') throw new Error(`planner response requires input_required, got ${result.status}`);
|
|
87
|
+
return runtime.run({goalId,maxCycles,plannerResponse:{request_id:result.planner_request.request_id,
|
|
88
|
+
model:'deadbyte-r34-test',raw_text:JSON.stringify(decision)}});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function planCreateDecision() {
|
|
92
|
+
return {schema:'deadbyte.autonomous-decision.v2',kind:'plan_create',title:'Repair x.txt',
|
|
93
|
+
reason:'goal requires verified source repair',steps:[{step_id:'repair',intent:'Inspect, repair, and verify x.txt'}]};
|
|
94
|
+
}
|
|
95
|
+
export function inspectDecision() {
|
|
96
|
+
return {schema:'deadbyte.autonomous-decision.v2',kind:'inspect',reads:[{path:'x.txt',max_bytes:4096}]};
|
|
97
|
+
}
|
|
98
|
+
export function patchDecision(expectedSha) {
|
|
99
|
+
return {schema:'deadbyte.autonomous-decision.v2',kind:'act',action:{kind:'patch',operations:[{
|
|
100
|
+
kind:'replace',path:'x.txt',expected_sha256:expectedSha,old_string:'x',new_string:'y',expected_replacements:1
|
|
101
|
+
}]}};
|
|
102
|
+
}
|
|
103
|
+
export function stepCompleteDecision(evidence) {
|
|
104
|
+
return {schema:'deadbyte.autonomous-decision.v2',kind:'step_complete',step_id:'repair',evidence};
|
|
105
|
+
}
|
|
106
|
+
export function finishDecision() {
|
|
107
|
+
return {schema:'deadbyte.autonomous-decision.v2',kind:'finish',summary:'plan and release evidence complete'};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export async function localSupervisorFixture({ownerPid,ownerIdentity}) {
|
|
111
|
+
const root=await mkdtemp(path.join(os.tmpdir(),'deadbyte-r34-supervisor-'));
|
|
112
|
+
const markerPath=path.join(root,'supervisor-owner.json');
|
|
113
|
+
if(ownerIdentity) {
|
|
114
|
+
await writeFile(markerPath,JSON.stringify({
|
|
115
|
+
schema:'deadbyte.autonomous-supervisor-owner.v1',pid:ownerPid,
|
|
116
|
+
creation_time_utc:ownerIdentity.creation_time_utc,image_path:ownerIdentity.image_path,
|
|
117
|
+
image_sha256:ownerIdentity.image_sha256,instance_nonce:'a'.repeat(64),
|
|
118
|
+
started_at_utc:'2026-09-16T00:00:00.000Z'
|
|
119
|
+
}));
|
|
120
|
+
}
|
|
121
|
+
return {options:{markerPath},markerPath,cleanup:()=>rm(root,{recursive:true,force:true})};
|
|
122
|
+
}
|
|
@@ -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,44 @@
|
|
|
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
|
+
assert.match(result.observation_sha256,/^[0-9a-f]{64}$/);
|
|
39
|
+
const repeat=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}}));
|
|
40
|
+
assert.equal(repeat.observation_sha256,result.observation_sha256);
|
|
41
|
+
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}});
|
|
42
|
+
assert.equal(denied.isError,true); assert.equal(denied.structuredContent.status,'failed'); assert.match(denied.structuredContent.error,/denied by policy/);
|
|
43
|
+
} finally {await f.client.close().catch(()=>{}); await rm(f.root,{recursive:true,force:true}).catch(()=>{});}
|
|
44
|
+
});
|