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
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
|
|
3
|
+
const SURFACE_SCHEMA='deadbyte.tool-surface.v1';
|
|
4
|
+
|
|
5
|
+
function canonicalValue(value,seen=new Set()){
|
|
6
|
+
if(value===null||typeof value==='string'||typeof value==='boolean') return value;
|
|
7
|
+
if(typeof value==='number'){
|
|
8
|
+
if(!Number.isFinite(value)) throw new Error('schema contains unsupported non-finite JSON number');
|
|
9
|
+
return Object.is(value,-0)?0:value;
|
|
10
|
+
}
|
|
11
|
+
if(typeof value==='undefined') throw new Error('schema contains unsupported undefined JSON value');
|
|
12
|
+
if(typeof value==='function') throw new Error('schema contains unsupported function JSON value');
|
|
13
|
+
if(typeof value==='symbol') throw new Error('schema contains unsupported symbol JSON value');
|
|
14
|
+
if(typeof value==='bigint') throw new Error('schema contains unsupported bigint JSON value');
|
|
15
|
+
if(typeof value!=='object') throw new Error(`schema contains unsupported JSON value type: ${typeof value}`);
|
|
16
|
+
if(seen.has(value)) throw new Error('schema contains circular JSON value');
|
|
17
|
+
seen.add(value);
|
|
18
|
+
try{
|
|
19
|
+
if(Array.isArray(value)){
|
|
20
|
+
const out=[];
|
|
21
|
+
for(let index=0;index<value.length;index+=1){
|
|
22
|
+
if(!Object.prototype.hasOwnProperty.call(value,index)) throw new Error('schema contains sparse JSON array');
|
|
23
|
+
out.push(canonicalValue(value[index],seen));
|
|
24
|
+
}
|
|
25
|
+
return out;
|
|
26
|
+
}
|
|
27
|
+
const proto=Object.getPrototypeOf(value);
|
|
28
|
+
if(proto!==Object.prototype&&proto!==null) throw new Error('schema contains unsupported non-plain JSON object');
|
|
29
|
+
const out={};
|
|
30
|
+
for(const key of Object.keys(value).sort((a,b)=>a.localeCompare(b,'en'))){
|
|
31
|
+
out[key]=canonicalValue(value[key],seen);
|
|
32
|
+
}
|
|
33
|
+
return out;
|
|
34
|
+
} finally {
|
|
35
|
+
seen.delete(value);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function canonicalJson(value){return JSON.stringify(canonicalValue(value));}
|
|
40
|
+
function sha256(value){return createHash('sha256').update(value,'utf8').digest('hex');}
|
|
41
|
+
|
|
42
|
+
export function canonicalSchemaHash(schema){return sha256(canonicalJson(schema));}
|
|
43
|
+
|
|
44
|
+
export function snapshotToolSurface(toolDescriptors){
|
|
45
|
+
if(!Array.isArray(toolDescriptors)) throw new Error('tool descriptors must be an array');
|
|
46
|
+
const names=new Set();
|
|
47
|
+
const tools=toolDescriptors.map(descriptor=>{
|
|
48
|
+
if(!descriptor||typeof descriptor!=='object'||Array.isArray(descriptor)) throw new Error('tool descriptor must be an object');
|
|
49
|
+
const name=descriptor.name;
|
|
50
|
+
if(typeof name!=='string'||name.length<1) throw new Error('tool descriptor name must be non-empty');
|
|
51
|
+
if(names.has(name)) throw new Error(`duplicate tool: ${name}`);
|
|
52
|
+
names.add(name);
|
|
53
|
+
return {
|
|
54
|
+
name,
|
|
55
|
+
input_sha256:canonicalSchemaHash(descriptor.inputSchema),
|
|
56
|
+
output_sha256:canonicalSchemaHash(descriptor.outputSchema)
|
|
57
|
+
};
|
|
58
|
+
}).sort((a,b)=>a.name.localeCompare(b.name,'en'));
|
|
59
|
+
const body={schema:SURFACE_SCHEMA,tools};
|
|
60
|
+
return {...body,surface_sha256:sha256(canonicalJson(body))};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function snapshotToolsListResult(result){
|
|
64
|
+
if(!result||typeof result!=='object'||!Array.isArray(result.tools)) throw new Error('MCP tools/list result tools must be an array');
|
|
65
|
+
return snapshotToolSurface(result.tools.map(tool=>{
|
|
66
|
+
if(!tool||typeof tool!=='object'||Array.isArray(tool)) throw new Error('MCP tools/list tool must be an object');
|
|
67
|
+
if(!tool.inputSchema||typeof tool.inputSchema!=='object'||Array.isArray(tool.inputSchema)) throw new Error(`tool ${tool.name??'<unknown>'} missing inputSchema`);
|
|
68
|
+
if(!tool.outputSchema||typeof tool.outputSchema!=='object'||Array.isArray(tool.outputSchema)) throw new Error(`tool ${tool.name??'<unknown>'} missing outputSchema`);
|
|
69
|
+
return {name:tool.name,inputSchema:tool.inputSchema,outputSchema:tool.outputSchema};
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function assertSnapshot(snapshot,label){
|
|
74
|
+
if(!snapshot||snapshot.schema!==SURFACE_SCHEMA||!Array.isArray(snapshot.tools)) throw new Error(`${label} tool surface snapshot invalid`);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function diffToolSurface(baseline,current){
|
|
78
|
+
assertSnapshot(baseline,'baseline'); assertSnapshot(current,'current');
|
|
79
|
+
const before=new Map(baseline.tools.map(tool=>[tool.name,tool]));
|
|
80
|
+
const after=new Map(current.tools.map(tool=>[tool.name,tool]));
|
|
81
|
+
const unchanged=[]; const added=[]; const removed=[]; const schemaChanged=[];
|
|
82
|
+
for(const name of [...new Set([...before.keys(),...after.keys()])].sort((a,b)=>a.localeCompare(b,'en'))){
|
|
83
|
+
const left=before.get(name); const right=after.get(name);
|
|
84
|
+
if(!left){added.push(name);continue;}
|
|
85
|
+
if(!right){removed.push(name);continue;}
|
|
86
|
+
if(left.input_sha256===right.input_sha256&&left.output_sha256===right.output_sha256) unchanged.push(name);
|
|
87
|
+
else schemaChanged.push(name);
|
|
88
|
+
}
|
|
89
|
+
return {unchanged,added,removed,schema_changed:schemaChanged};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export const TOOL_SURFACE_SCHEMA=SURFACE_SCHEMA;
|
package/src/version.mjs
CHANGED
|
@@ -19,7 +19,7 @@ async function fixture(){
|
|
|
19
19
|
}
|
|
20
20
|
async function lines(file){return (await readFile(file,'utf8')).trim().split(/\r?\n/);}
|
|
21
21
|
|
|
22
|
-
test('independent verifier accepts a clean signed multi-segment audit chain',async()=>{const f=await fixture();try{const result=await verifyAuditChain({stateRoot:f.root,verifyKeyPath:f.key.publicKeyPath});assert.equal(result.ok,true);assert.equal(result.event_count,4);assert.equal(result.request_count,2);assert.equal(result.result_count,2);assert.equal(result.segment_count,2);assert.equal(result.checkpoint_count,2);assert.equal(result.last_seq,4);assert.match(result.head_sha256,/^[0-9a-f]{64}$/);}finally{await rm(f.root,{recursive:true,force:true});}});
|
|
22
|
+
test('independent verifier accepts a clean signed multi-segment audit chain',async()=>{const f=await fixture();try{const result=await verifyAuditChain({stateRoot:f.root,verifyKeyPath:f.key.publicKeyPath});assert.equal(result.ok,true);assert.equal(result.event_count,4);assert.equal(result.request_count,2);assert.equal(result.result_count,2);assert.equal(result.segment_count,2);assert.equal(result.checkpoint_count,2);assert.equal(result.last_seq,4);assert.match(result.head_sha256,/^[0-9a-f]{64}$/);assert.deepEqual(result.tool_usage,[{tool:'one',requests:1,results:1,errors:0},{tool:'two',requests:1,results:1,errors:0}]);}finally{await rm(f.root,{recursive:true,force:true});}});
|
|
23
23
|
|
|
24
24
|
test('verifier detects an edited event line',async()=>{const f=await fixture();try{const file=path.join(f.root,'audit','segment-00000001.jsonl');const row=await lines(file);const first=JSON.parse(row[0]);first.tool='tampered';row[0]=JSON.stringify(first);await writeFile(file,row.join('\n')+'\n');const result=await verifyAuditChain({stateRoot:f.root,verifyKeyPath:f.key.publicKeyPath});assert.equal(result.ok,false);assert.match(result.reason,/event hash mismatch/i);}finally{await rm(f.root,{recursive:true,force:true});}});
|
|
25
25
|
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { actionIdentity, reconcileStartedAction } from '../src/autonomous-action-reconcile.mjs';
|
|
4
|
+
|
|
5
|
+
const H = c => c.repeat(64);
|
|
6
|
+
|
|
7
|
+
const identityInput = {
|
|
8
|
+
goalId:H('1'),
|
|
9
|
+
planId:H('2'),
|
|
10
|
+
planVersion:3,
|
|
11
|
+
stepId:'fix',
|
|
12
|
+
mutationEpoch:4,
|
|
13
|
+
decisionEventSha:H('5'),
|
|
14
|
+
action:{kind:'patch',operations:[{kind:'replace',path:'x.txt',expected_sha256:H('6'),old_string:'x',new_string:'y',expected_replacements:1}]}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
test('action identity is deterministic and changes when plan version changes', () => {
|
|
18
|
+
const a = actionIdentity(identityInput);
|
|
19
|
+
const b = actionIdentity(structuredClone(identityInput));
|
|
20
|
+
assert.deepEqual(a,b);
|
|
21
|
+
assert.match(a.action_id,/^[0-9a-f]{64}$/);
|
|
22
|
+
assert.match(a.request_sha256,/^[0-9a-f]{64}$/);
|
|
23
|
+
const changed = actionIdentity({...identityInput,planVersion:4});
|
|
24
|
+
assert.notEqual(changed.action_id,a.action_id);
|
|
25
|
+
assert.notEqual(changed.request_sha256,a.request_sha256);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
function patchStarted() {
|
|
29
|
+
return {
|
|
30
|
+
type:'action_started',event_sha256:H('7'),payload:{
|
|
31
|
+
action_id:H('8'),request_sha256:H('9'),
|
|
32
|
+
action:{kind:'patch',diff_id:H('a')}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
test('verified mutation receipt classifies as executed without replay', async () => {
|
|
38
|
+
const result = await reconcileStartedAction({
|
|
39
|
+
startedEvent:patchStarted(),journal:[],
|
|
40
|
+
runtimes:{nativeDiffRuntime:{async verify({diffId}){
|
|
41
|
+
assert.equal(diffId,H('a'));
|
|
42
|
+
return {ok:true,current_state_matches:true,receipt_sha256:H('b'),journal_head_sha256:H('c')};
|
|
43
|
+
}}}
|
|
44
|
+
});
|
|
45
|
+
assert.equal(result.classification,'executed_verified');
|
|
46
|
+
assert.equal(result.replay_allowed,false);
|
|
47
|
+
assert.equal(result.evidence.receipt_sha256,H('b'));
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
test('missing mutation evidence is not executed and may retry with the same identity', async () => {
|
|
51
|
+
const result = await reconcileStartedAction({
|
|
52
|
+
startedEvent:patchStarted(),journal:[],
|
|
53
|
+
runtimes:{nativeDiffRuntime:{async verify(){return {ok:false,reason:'native diff receipt missing'};}}}
|
|
54
|
+
});
|
|
55
|
+
assert.equal(result.classification,'not_executed');
|
|
56
|
+
assert.equal(result.replay_allowed,true);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test('conflicting or unverifiable mutation evidence is ambiguous and never replayed', async () => {
|
|
60
|
+
const badSignature = await reconcileStartedAction({
|
|
61
|
+
startedEvent:patchStarted(),journal:[],
|
|
62
|
+
runtimes:{nativeDiffRuntime:{async verify(){return {ok:false,reason:'receipt signature mismatch'};}}}
|
|
63
|
+
});
|
|
64
|
+
assert.equal(badSignature.classification,'ambiguous');
|
|
65
|
+
assert.equal(badSignature.replay_allowed,false);
|
|
66
|
+
|
|
67
|
+
const staleState = await reconcileStartedAction({
|
|
68
|
+
startedEvent:patchStarted(),journal:[],
|
|
69
|
+
runtimes:{nativeDiffRuntime:{async verify(){return {ok:true,current_state_matches:false,receipt_sha256:H('b')};}}}
|
|
70
|
+
});
|
|
71
|
+
assert.equal(staleState.classification,'ambiguous');
|
|
72
|
+
assert.equal(staleState.replay_allowed,false);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
test('verified profile failure is recovered as executed_failed_verified', async () => {
|
|
76
|
+
const started = {type:'action_started',event_sha256:H('1'),payload:{
|
|
77
|
+
action_id:H('2'),request_sha256:H('3'),
|
|
78
|
+
action:{kind:'profile',receipt_id:'a'.repeat(24),expect_exit_code:0}
|
|
79
|
+
}};
|
|
80
|
+
const result = await reconcileStartedAction({
|
|
81
|
+
startedEvent:started,journal:[],
|
|
82
|
+
runtimes:{codingRuntime:{async verifyReceiptDetailed(receiptId){
|
|
83
|
+
assert.equal(receiptId,'a'.repeat(24));
|
|
84
|
+
return {ok:true,request_sha256:H('3'),receipt_sha256:H('4'),receipt:{receipt_id:receiptId,operation:'coding_command_run',exit_code:1,timed_out:false}};
|
|
85
|
+
}}}
|
|
86
|
+
});
|
|
87
|
+
assert.equal(result.classification,'executed_failed_verified');
|
|
88
|
+
assert.equal(result.replay_allowed,false);
|
|
89
|
+
assert.equal(result.evidence.receipt_sha256,H('4'));
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
test('receipt substitution or stale request identity is ambiguous', async () => {
|
|
93
|
+
const started = {type:'action_started',event_sha256:H('1'),payload:{
|
|
94
|
+
action_id:H('2'),request_sha256:H('3'),
|
|
95
|
+
action:{kind:'profile',receipt_id:'a'.repeat(24),expect_exit_code:0}
|
|
96
|
+
}};
|
|
97
|
+
const result = await reconcileStartedAction({
|
|
98
|
+
startedEvent:started,journal:[],
|
|
99
|
+
runtimes:{codingRuntime:{async verifyReceiptDetailed(){
|
|
100
|
+
return {ok:true,request_sha256:H('f'),receipt_sha256:H('4'),receipt:{receipt_id:'a'.repeat(24),operation:'coding_command_run',exit_code:0,timed_out:false}};
|
|
101
|
+
}}}
|
|
102
|
+
});
|
|
103
|
+
assert.equal(result.classification,'ambiguous');
|
|
104
|
+
assert.match(result.reason,/request/i);
|
|
105
|
+
assert.equal(result.replay_allowed,false);
|
|
106
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import test from 'node:test';
|
|
2
2
|
import assert from 'node:assert/strict';
|
|
3
|
-
import { randomBytes } from 'node:crypto';
|
|
3
|
+
import { createHash, randomBytes } from 'node:crypto';
|
|
4
4
|
import { mkdtemp, mkdir, readFile, rm, writeFile } from 'node:fs/promises';
|
|
5
5
|
import os from 'node:os';
|
|
6
6
|
import path from 'node:path';
|
|
@@ -9,7 +9,7 @@ import { createCodingRuntime, loadCodingPolicy } from '../src/coding-plane.mjs';
|
|
|
9
9
|
import { loadAutonomousPolicy } from '../src/autonomous-policy.mjs';
|
|
10
10
|
import { createNativeDiffRuntime } from '../src/native-diff.mjs';
|
|
11
11
|
import { createAutonomousRuntime } from '../src/autonomous-runtime.mjs';
|
|
12
|
-
import { buildPlannerPrompt, parsePlannerDecision } from '../src/autonomous-planner.mjs';
|
|
12
|
+
import { buildPlannerPrompt, parsePlannerDecision, parseR34PlannerDecision, requestR34ProviderDecision } from '../src/autonomous-planner.mjs';
|
|
13
13
|
|
|
14
14
|
const nonce = () => randomBytes(32).toString('hex');
|
|
15
15
|
async function fixture(delegates = {}) {
|
|
@@ -32,13 +32,17 @@ async function fixture(delegates = {}) {
|
|
|
32
32
|
await writeFile(policy.lease_file, JSON.stringify({ schema:'deadbyte.autonomous-lease.v1', policy_sha256:policy.policy_sha256,
|
|
33
33
|
instance_nonce:nonce(), root_ids:['project'], armed_at_utc:new Date().toISOString(), expires_at_utc:new Date(Date.now()+1800000).toISOString() }));
|
|
34
34
|
const codingRuntime = createCodingRuntime({ policy:codingPolicy, signingKeyPath:keys.privateKeyPath, verifyKeyPath:keys.publicKeyPath });
|
|
35
|
-
const
|
|
36
|
-
const { codingRuntimeFactory, observationRuntimeFactory, ...runtimeDelegates } = delegates;
|
|
35
|
+
const baseNativeDiffRuntime = createNativeDiffRuntime({ policy,codingRuntime,signingKeyPath:keys.privateKeyPath,verifyKeyPath:keys.publicKeyPath });
|
|
36
|
+
const { codingRuntimeFactory, nativeDiffRuntimeFactory, observationRuntimeFactory, ...runtimeDelegates } = delegates;
|
|
37
37
|
const autonomousCodingRuntime = codingRuntimeFactory ? codingRuntimeFactory(codingRuntime) : codingRuntime;
|
|
38
|
+
const autonomousNativeDiffRuntime = nativeDiffRuntimeFactory ? nativeDiffRuntimeFactory(baseNativeDiffRuntime) : baseNativeDiffRuntime;
|
|
38
39
|
if (observationRuntimeFactory) runtimeDelegates.observationRuntime = observationRuntimeFactory({ codingPolicy,keys });
|
|
39
|
-
const
|
|
40
|
+
const createRuntime = (overrides = {}) => createAutonomousRuntime({ policy,codingRuntime:autonomousCodingRuntime,
|
|
41
|
+
nativeDiffRuntime:autonomousNativeDiffRuntime,...runtimeDelegates,...overrides,
|
|
40
42
|
signingKeyPath:keys.privateKeyPath,verifyKeyPath:keys.publicKeyPath });
|
|
41
|
-
|
|
43
|
+
const runtime = createRuntime();
|
|
44
|
+
return { root,project,keys,codingPolicy,policy,codingRuntime:autonomousCodingRuntime,
|
|
45
|
+
nativeDiffRuntime:autonomousNativeDiffRuntime,baseNativeDiffRuntime,createRuntime,runtime };
|
|
42
46
|
}
|
|
43
47
|
async function submit(runtime,id='adv') {
|
|
44
48
|
return runtime.submit({ submissionId:id, rootId:'project', title:'adversarial', goal:'Inspect x.txt safely.', acceptance:'Do not claim release without evidence.' });
|
|
@@ -122,6 +126,66 @@ test('planner parser rejects malformed JSON and unknown top-level fields', async
|
|
|
122
126
|
} finally { await rm(f.root,{recursive:true,force:true}); }
|
|
123
127
|
});
|
|
124
128
|
|
|
129
|
+
test('R34 decision parser rejects prose-wrapped JSON and authority arming actions', async () => {
|
|
130
|
+
const f = await fixture();
|
|
131
|
+
try {
|
|
132
|
+
assert.throws(() => parseR34PlannerDecision('Here is JSON: {"schema":"deadbyte.autonomous-decision.v2","kind":"finish"}',f.policy),/structured|JSON|contract/i);
|
|
133
|
+
assert.throws(() => parseR34PlannerDecision(JSON.stringify({
|
|
134
|
+
schema:'deadbyte.autonomous-decision.v2',kind:'act',action:{kind:'armcoding'}
|
|
135
|
+
}),f.policy),/unsupported|authority|contract/i);
|
|
136
|
+
} finally { await rm(f.root,{recursive:true,force:true}); }
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
test('R34 replan carries only a bounded mutable suffix proposal', async () => {
|
|
140
|
+
const f = await fixture();
|
|
141
|
+
try {
|
|
142
|
+
const decision = parseR34PlannerDecision(JSON.stringify({
|
|
143
|
+
schema:'deadbyte.autonomous-decision.v2',kind:'replan',reason:'test failed',
|
|
144
|
+
steps:[
|
|
145
|
+
{step_id:'diagnose',intent:'Inspect failing evidence'},
|
|
146
|
+
{step_id:'fix',intent:'Apply corrected patch'}
|
|
147
|
+
]
|
|
148
|
+
}),f.policy);
|
|
149
|
+
assert.equal(decision.schema,'deadbyte.autonomous-decision.v2');
|
|
150
|
+
assert.equal(decision.kind,'replan');
|
|
151
|
+
assert.equal(decision.steps.length,2);
|
|
152
|
+
assert.equal(decision.steps[0].step_id,'diagnose');
|
|
153
|
+
} finally { await rm(f.root,{recursive:true,force:true}); }
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
test('R34 act accepts one bounded existing patch action with exact SHA precondition', async () => {
|
|
157
|
+
const f = await fixture();
|
|
158
|
+
try {
|
|
159
|
+
const decision = parseR34PlannerDecision(JSON.stringify({
|
|
160
|
+
schema:'deadbyte.autonomous-decision.v2',kind:'act',
|
|
161
|
+
action:{kind:'patch',operations:[{
|
|
162
|
+
kind:'replace',path:'x.txt',expected_sha256:'0'.repeat(64),old_string:'x',new_string:'y',expected_replacements:1
|
|
163
|
+
}]}
|
|
164
|
+
}),f.policy);
|
|
165
|
+
assert.equal(decision.kind,'act');
|
|
166
|
+
assert.equal(decision.action.kind,'patch');
|
|
167
|
+
assert.equal(decision.action.operations[0].expected_sha256,'0'.repeat(64));
|
|
168
|
+
} finally { await rm(f.root,{recursive:true,force:true}); }
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
test('R34 provider adapter returns only normalized decision plus raw response hash', async () => {
|
|
172
|
+
const rawDecision = JSON.stringify({schema:'deadbyte.autonomous-decision.v2',kind:'finish',summary:'verified'});
|
|
173
|
+
const policy = {
|
|
174
|
+
planner:{backend:'openai_compatible',endpoint:'https://planner.invalid/v1/chat/completions',model:'fake-r34',api_key_env:null,max_tokens:2048,timeout_ms:30000,max_response_bytes:262144},
|
|
175
|
+
limits:{max_context_bytes:262144,max_files_per_diff:4},
|
|
176
|
+
profiles:{}
|
|
177
|
+
};
|
|
178
|
+
const fakeFetch = async () => new Response(JSON.stringify({model:'fake-r34',choices:[{message:{content:rawDecision}}]}),{
|
|
179
|
+
status:200,headers:{'content-type':'application/json'}
|
|
180
|
+
});
|
|
181
|
+
const result = await requestR34ProviderDecision(policy,'PROMPT',fakeFetch);
|
|
182
|
+
assert.equal(result.backend,'openai_compatible');
|
|
183
|
+
assert.equal(result.model,'fake-r34');
|
|
184
|
+
assert.equal(result.decision.kind,'finish');
|
|
185
|
+
assert.match(result.raw_response_sha256,/^[0-9a-f]{64}$/);
|
|
186
|
+
assert.equal(Object.hasOwn(result,'raw_text'),false);
|
|
187
|
+
});
|
|
188
|
+
|
|
125
189
|
test('R33 private delegate routes bounded machine reads and records signed evidence', async () => {
|
|
126
190
|
const calls=[];
|
|
127
191
|
const f = await fixture({ machineFsRuntime:{ async stat(args){ calls.push(args); return {status:'ok',root_id:args.rootId,path:args.relativePath,kind:'file',bytes:2}; } } });
|
|
@@ -327,3 +391,82 @@ test('signed autonomous journal tamper is rejected before state is trusted', asy
|
|
|
327
391
|
await assert.rejects(f.runtime.status({ goalId:goal.goal_id }), /signature verification failed|hash-chain mismatch/);
|
|
328
392
|
} finally { await rm(f.root,{recursive:true,force:true}); }
|
|
329
393
|
});
|
|
394
|
+
|
|
395
|
+
test('R34 event deletion/reorder/signature tamper fails before state trust', async () => {
|
|
396
|
+
async function prepared(id) {
|
|
397
|
+
const f=await fixture();
|
|
398
|
+
const goal=await submit(f.runtime,id);
|
|
399
|
+
const first=await f.runtime.run({goalId:goal.goal_id,maxCycles:1});
|
|
400
|
+
assert.equal(first.status,'input_required');
|
|
401
|
+
const dir=path.join(f.policy.evidence_dir,'goals',goal.goal_id,'events');
|
|
402
|
+
return {f,goal,dir};
|
|
403
|
+
}
|
|
404
|
+
for (const mode of ['delete','reorder','signature']) {
|
|
405
|
+
const {f,goal,dir}=await prepared(`journal-${mode}`);
|
|
406
|
+
try {
|
|
407
|
+
const one=path.join(dir,'000001.json');
|
|
408
|
+
const two=path.join(dir,'000002.json');
|
|
409
|
+
if(mode==='delete') {
|
|
410
|
+
await rm(two,{force:true});
|
|
411
|
+
} else if(mode==='reorder') {
|
|
412
|
+
const a=await readFile(one); const b=await readFile(two);
|
|
413
|
+
await writeFile(one,b); await writeFile(two,a);
|
|
414
|
+
} else {
|
|
415
|
+
const event=JSON.parse(await readFile(one,'utf8'));
|
|
416
|
+
event.payload.submission_id='forged-submission';
|
|
417
|
+
await writeFile(one,JSON.stringify(event));
|
|
418
|
+
}
|
|
419
|
+
await assert.rejects(f.runtime.status({goalId:goal.goal_id}),/event gap|signature verification failed|hash-chain mismatch/);
|
|
420
|
+
} finally { await rm(f.root,{recursive:true,force:true}); }
|
|
421
|
+
}
|
|
422
|
+
});
|
|
423
|
+
|
|
424
|
+
test('R34 restart reconciles a committed Native Diff after crash without invoking apply twice', async () => {
|
|
425
|
+
let applyCalls = 0;
|
|
426
|
+
let crashOnce = true;
|
|
427
|
+
const f = await fixture({
|
|
428
|
+
nativeDiffRuntimeFactory(base) {
|
|
429
|
+
return {
|
|
430
|
+
preview: args => base.preview(args),
|
|
431
|
+
verify: args => base.verify(args),
|
|
432
|
+
async apply(args) {
|
|
433
|
+
applyCalls += 1;
|
|
434
|
+
const result = await base.apply(args);
|
|
435
|
+
if (crashOnce) {
|
|
436
|
+
crashOnce = false;
|
|
437
|
+
throw new Error('simulated crash after native diff apply');
|
|
438
|
+
}
|
|
439
|
+
return result;
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
});
|
|
444
|
+
try {
|
|
445
|
+
const goal = await submit(f.runtime,'r34-crash-after-apply');
|
|
446
|
+
const first = await f.runtime.run({goalId:goal.goal_id,maxCycles:2});
|
|
447
|
+
assert.equal(first.status,'input_required');
|
|
448
|
+
const before = await readFile(path.join(f.project,'x.txt'));
|
|
449
|
+
const beforeSha = createHash('sha256').update(before).digest('hex');
|
|
450
|
+
const patch = JSON.stringify({
|
|
451
|
+
schema:'deadbyte.autonomous-decision.v1',action:'patch',summary:'mutate once',
|
|
452
|
+
operations:[{kind:'replace',path:'x.txt',expected_sha256:beforeSha,old_string:'x',new_string:'y',expected_replacements:1}]
|
|
453
|
+
});
|
|
454
|
+
await assert.rejects(f.runtime.run({goalId:goal.goal_id,maxCycles:2,
|
|
455
|
+
plannerResponse:{request_id:first.planner_request.request_id,model:'fake',raw_text:patch}}),/simulated crash after native diff apply/);
|
|
456
|
+
assert.equal(await readFile(path.join(f.project,'x.txt'),'utf8'),'y\n');
|
|
457
|
+
assert.equal(applyCalls,1);
|
|
458
|
+
|
|
459
|
+
const restarted = f.createRuntime();
|
|
460
|
+
const resumed = await restarted.run({goalId:goal.goal_id,maxCycles:1});
|
|
461
|
+
assert.notEqual(resumed.status,'paused');
|
|
462
|
+
assert.equal(applyCalls,1,'restart must reconcile durable mutation evidence instead of invoking apply again');
|
|
463
|
+
assert.equal(await readFile(path.join(f.project,'x.txt'),'utf8'),'y\n');
|
|
464
|
+
const journal = await restarted.events({goalId:goal.goal_id,fromSeq:1,limit:200});
|
|
465
|
+
assert.equal(journal.events.filter(event=>event.type==='native_diff_committed').length,1);
|
|
466
|
+
assert.equal(journal.events.filter(event=>event.type==='action_started').length,1);
|
|
467
|
+
assert.equal(journal.events.filter(event=>event.type==='action_reconciled').length,1);
|
|
468
|
+
assert.equal(journal.events.filter(event=>event.type==='action_completed').length,1);
|
|
469
|
+
const reconciled = journal.events.find(event=>event.type==='action_reconciled');
|
|
470
|
+
assert.equal(reconciled.payload.classification,'executed_verified');
|
|
471
|
+
} finally { await rm(f.root,{recursive:true,force:true}); }
|
|
472
|
+
});
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { parseR34PlannerDecision, buildPlannerPrompt } from '../src/autonomous-planner.mjs';
|
|
4
|
+
import { judgeProgress } from '../src/autonomous-progress.mjs';
|
|
5
|
+
import { createR34Fixture, sendPlannerDecision, planCreateDecision, inspectDecision } from './helpers/autonomous-r34-fixture.mjs';
|
|
6
|
+
|
|
7
|
+
const H='a'.repeat(64);
|
|
8
|
+
const policy={
|
|
9
|
+
profiles:{},
|
|
10
|
+
limits:{max_context_bytes:262144,max_files_per_diff:32,max_stalled_cycles:2,max_post_replan_stalls:2,max_replans:8}
|
|
11
|
+
};
|
|
12
|
+
const wrap=action=>JSON.stringify({schema:'deadbyte.autonomous-decision.v2',kind:'act',action});
|
|
13
|
+
|
|
14
|
+
const typedCases=[
|
|
15
|
+
['search',{kind:'search',path:'.',target:'content',mode:'regex',pattern:'foo\\d+',case_sensitive:false,max_results:50,max_file_bytes:262144,max_scan_bytes:1048576,page_size:25,cursor:null}],
|
|
16
|
+
['stat',{kind:'stat',path:'src/a.mjs',hash:true}],
|
|
17
|
+
['multi_read',{kind:'multi_read',files:[{path:'src/a.mjs',encoding:'utf8'},{path:'src/b.mjs',encoding:'utf8'}],max_total_bytes:131072}],
|
|
18
|
+
['semantic_references',{kind:'semantic_references',path:'src/a.mjs',line:1,column:2,max_results:100}],
|
|
19
|
+
['semantic_rename_preview',{kind:'semantic_rename_preview',path:'src/a.mjs',line:1,column:2,new_name:'renamed'}],
|
|
20
|
+
['native_diff_apply',{kind:'native_diff_apply',diff_id:H,expected_operation_count:1}],
|
|
21
|
+
['native_diff_verify',{kind:'native_diff_verify',diff_id:H}],
|
|
22
|
+
['process_start',{kind:'process_start',profile_id:'test',cwd:'.',args:[]}],
|
|
23
|
+
['process_read',{kind:'process_read',session_id:H,offset:0,max_bytes:65536}],
|
|
24
|
+
['process_status',{kind:'process_status',session_id:H}],
|
|
25
|
+
['process_action',{kind:'process_action',session_id:H,action_id:'ping'}],
|
|
26
|
+
['process_terminate',{kind:'process_terminate',session_id:H}],
|
|
27
|
+
['machine_fs_stat',{kind:'machine_fs_stat',path:'src',hash:true}],
|
|
28
|
+
['machine_fs_list',{kind:'machine_fs_list',path:'.',cursor:null,limit:100,hash_files:false}],
|
|
29
|
+
['machine_fs_read',{kind:'machine_fs_read',path:'src/a.mjs',offset:0,max_bytes:65536,hash_file:true}],
|
|
30
|
+
['machine_fs_mkdir',{kind:'machine_fs_mkdir',path:'generated'}],
|
|
31
|
+
['machine_fs_move',{kind:'machine_fs_move',source_path:'a.txt',destination_path:'b.txt',expected_source_identity:H}],
|
|
32
|
+
['machine_fs_delete',{kind:'machine_fs_delete',path:'empty',expected_source_identity:H}],
|
|
33
|
+
['observation_search_start',{kind:'observation_search_start',path:'.',pattern:'FAIL',case_sensitive:false,max_results:100,max_files:1000,max_bytes:1048576,max_file_bytes:262144}],
|
|
34
|
+
['observation_search_page',{kind:'observation_search_page',search_id:H,cursor:null,limit:50}],
|
|
35
|
+
['observation_system_status',{kind:'observation_system_status'}]
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
test('R36 planner parses first-class capability actions without delegate wrapper',()=>{
|
|
39
|
+
for(const [label,action] of typedCases){
|
|
40
|
+
const parsed=parseR34PlannerDecision(wrap(action),policy);
|
|
41
|
+
assert.equal(parsed.kind,'act',label);
|
|
42
|
+
assert.equal(parsed.action.kind,action.kind,label);
|
|
43
|
+
assert.notEqual(parsed.action.kind,'delegate',label);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test('R36 legacy delegate is accepted only for a known operation and normalized into typed action',()=>{
|
|
48
|
+
const parsed=parseR34PlannerDecision(wrap({kind:'delegate',operation:{kind:'process_status',session_id:H}}),policy);
|
|
49
|
+
assert.equal(parsed.action.kind,'process_status');
|
|
50
|
+
assert.equal(parsed.action.session_id,H);
|
|
51
|
+
assert.equal('operation' in parsed.action,false);
|
|
52
|
+
assert.throws(()=>parseR34PlannerDecision(wrap({kind:'delegate',operation:{kind:'arbitrary_tool',tool_name:'host_exec',args:{}}}),policy),/contract|delegated|unsupported|authority/i);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
test('R36 planner prompt exposes configured capability manifest and never advertises Host',()=>{
|
|
56
|
+
const prompt=buildPlannerPrompt({goal:{title:'x',goal:'fix',acceptance:'tests pass'},policy,view:{mutation_epoch:0,planner_round:0,tree:[],contexts:[],observations:[],recent_decisions:[],active_plan:null,capabilities:{schema:'deadbyte.capability-manifest.v1',ledger_sha256:H,entries:[
|
|
57
|
+
{id:'coding.search',authority:'coding',mutating:false},
|
|
58
|
+
{id:'process.start',authority:'process',mutating:true}
|
|
59
|
+
]}}});
|
|
60
|
+
assert.match(prompt,/coding\.search/);
|
|
61
|
+
assert.match(prompt,/process\.start/);
|
|
62
|
+
assert.doesNotMatch(prompt,/host\.exec|host_file|host authority/i);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test('R36 progress fingerprint ignores rationale but binds capability, evidence, session and cursor identity',()=>{
|
|
66
|
+
const base={before:{mutation_epoch:2},after:{mutation_epoch:2},decision:{kind:'process_read',rationale:'first'},evidence:{capability_id:'process.read',session_id:H,cursor:10,observation_sha256:'b'.repeat(64),receipt_sha256:'c'.repeat(64)}};
|
|
67
|
+
const a=judgeProgress(base);
|
|
68
|
+
const prose=judgeProgress({...base,decision:{...base.decision,rationale:'completely different prose'}});
|
|
69
|
+
assert.equal(a.fingerprint,prose.fingerprint);
|
|
70
|
+
const cap=judgeProgress({...base,evidence:{...base.evidence,capability_id:'process.status'}});
|
|
71
|
+
const cursor=judgeProgress({...base,evidence:{...base.evidence,cursor:11}});
|
|
72
|
+
const session=judgeProgress({...base,evidence:{...base.evidence,session_id:'d'.repeat(64)}});
|
|
73
|
+
const receipt=judgeProgress({...base,evidence:{...base.evidence,receipt_sha256:'e'.repeat(64)}});
|
|
74
|
+
assert.notEqual(a.fingerprint,cap.fingerprint);
|
|
75
|
+
assert.notEqual(a.fingerprint,cursor.fingerprint);
|
|
76
|
+
assert.notEqual(a.fingerprint,session.fingerprint);
|
|
77
|
+
assert.notEqual(a.fingerprint,receipt.fingerprint);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
test('R36 typed stat executes through the autonomous loop and records capability-bound evidence',async()=>{
|
|
81
|
+
const f=await createR34Fixture();
|
|
82
|
+
try{
|
|
83
|
+
const goal=await f.runtime.submit({submissionId:'r36-typed-stat',rootId:'project',title:'typed stat',goal:'inspect x.txt identity',acceptance:'stat evidence is journaled'});
|
|
84
|
+
let result=await f.runtime.run({goalId:goal.goal_id,maxCycles:4});
|
|
85
|
+
result=await sendPlannerDecision(f.runtime,goal.goal_id,result,planCreateDecision());
|
|
86
|
+
result=await sendPlannerDecision(f.runtime,goal.goal_id,result,inspectDecision());
|
|
87
|
+
assert.equal(result.loop.phase,'ACTING');
|
|
88
|
+
result=await sendPlannerDecision(f.runtime,goal.goal_id,result,{schema:'deadbyte.autonomous-decision.v2',kind:'act',action:{kind:'stat',path:'x.txt',hash:true}});
|
|
89
|
+
assert.equal(result.status,'input_required');
|
|
90
|
+
assert.equal(result.loop.phase,'VERIFYING');
|
|
91
|
+
const journal=await f.runtime.events({goalId:goal.goal_id,fromSeq:1,limit:200});
|
|
92
|
+
const event=journal.events.find(item=>item.type==='delegated_action_completed'&&item.payload?.operation?.kind==='stat');
|
|
93
|
+
assert.ok(event);
|
|
94
|
+
assert.equal(event.payload.capability_id,'coding.stat');
|
|
95
|
+
assert.match(event.payload.result.observation_sha256,/^[0-9a-f]{64}$/);
|
|
96
|
+
} finally {await f.cleanup();}
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
test('R36 typed native_diff_apply binds expected operation count and advances mutation epoch only after verified apply',async()=>{
|
|
100
|
+
const f=await createR34Fixture();
|
|
101
|
+
try{
|
|
102
|
+
const preview=await f.nativeDiffRuntime.preview({rootId:'project',title:'typed apply',operations:[{
|
|
103
|
+
kind:'replace',path:'x.txt',expected_sha256:f.initial_sha256,old_string:'x',new_string:'y',expected_replacements:1
|
|
104
|
+
}]});
|
|
105
|
+
assert.equal(preview.operation_count,1);
|
|
106
|
+
const goal=await f.runtime.submit({submissionId:'r36-typed-apply',rootId:'project',title:'typed apply',goal:'apply the prepared native diff',acceptance:'mutation is verified and journaled'});
|
|
107
|
+
let result=await f.runtime.run({goalId:goal.goal_id,maxCycles:4});
|
|
108
|
+
result=await sendPlannerDecision(f.runtime,goal.goal_id,result,planCreateDecision());
|
|
109
|
+
result=await sendPlannerDecision(f.runtime,goal.goal_id,result,inspectDecision());
|
|
110
|
+
assert.equal(result.loop.phase,'ACTING');
|
|
111
|
+
result=await sendPlannerDecision(f.runtime,goal.goal_id,result,{schema:'deadbyte.autonomous-decision.v2',kind:'act',action:{kind:'native_diff_apply',diff_id:preview.diff_id,expected_operation_count:1}});
|
|
112
|
+
assert.equal(result.status,'input_required');
|
|
113
|
+
assert.equal(result.loop.phase,'VERIFYING');
|
|
114
|
+
const state=await f.runtime.status({goalId:goal.goal_id});
|
|
115
|
+
assert.equal(state.mutation_epoch,1);
|
|
116
|
+
assert.equal(state.mutation_count,1);
|
|
117
|
+
const read=await f.baseCodingRuntime.fileRead({rootId:'project',relativePath:'x.txt',encoding:'utf8'});
|
|
118
|
+
assert.equal(read.content,'y\n');
|
|
119
|
+
const verified=await f.nativeDiffRuntime.verify({diffId:preview.diff_id});
|
|
120
|
+
assert.equal(verified.ok,true);
|
|
121
|
+
assert.equal(verified.current_state_matches,true);
|
|
122
|
+
const journal=await f.runtime.events({goalId:goal.goal_id,fromSeq:1,limit:200});
|
|
123
|
+
const committed=journal.events.find(item=>item.type==='native_diff_committed'&&item.payload?.diff_id===preview.diff_id);
|
|
124
|
+
assert.ok(committed);
|
|
125
|
+
assert.equal(committed.payload.mutation_count,1);
|
|
126
|
+
assert.deepEqual(committed.payload.paths,['x.txt']);
|
|
127
|
+
} finally {await f.cleanup();}
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
test('R36 typed machine_fs_mkdir is promoted to Native Diff V2 and advances mutation epoch',async()=>{
|
|
131
|
+
const f=await createR34Fixture();
|
|
132
|
+
try{
|
|
133
|
+
const goal=await f.runtime.submit({submissionId:'r36-typed-mkdir',rootId:'project',title:'typed mkdir',goal:'create generated directory transactionally',acceptance:'directory creation is native-diff verified'});
|
|
134
|
+
let result=await f.runtime.run({goalId:goal.goal_id,maxCycles:4});
|
|
135
|
+
result=await sendPlannerDecision(f.runtime,goal.goal_id,result,planCreateDecision());
|
|
136
|
+
result=await sendPlannerDecision(f.runtime,goal.goal_id,result,inspectDecision());
|
|
137
|
+
result=await sendPlannerDecision(f.runtime,goal.goal_id,result,{schema:'deadbyte.autonomous-decision.v2',kind:'act',action:{kind:'machine_fs_mkdir',path:'generated'}});
|
|
138
|
+
assert.equal(result.status,'input_required');
|
|
139
|
+
assert.equal(result.loop.phase,'VERIFYING');
|
|
140
|
+
const state=await f.runtime.status({goalId:goal.goal_id});
|
|
141
|
+
assert.equal(state.mutation_epoch,1);
|
|
142
|
+
assert.equal(state.mutation_count,1);
|
|
143
|
+
const dir=await f.machineFsRuntime.state({rootId:'project',relativePath:'generated'});
|
|
144
|
+
assert.equal(dir.exists,true);
|
|
145
|
+
assert.equal(dir.kind,'directory');
|
|
146
|
+
const journal=await f.runtime.events({goalId:goal.goal_id,fromSeq:1,limit:200});
|
|
147
|
+
const committed=journal.events.find(item=>item.type==='native_diff_committed');
|
|
148
|
+
assert.ok(committed);
|
|
149
|
+
assert.deepEqual(committed.payload.paths,['generated']);
|
|
150
|
+
} finally {await f.cleanup();}
|
|
151
|
+
});
|