deadbyte-mcp 0.11.1 → 0.11.3
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/MANIFEST.SHA256 +36 -20
- package/README.txt +7 -7
- package/controller/README.TXT +1 -1
- package/controller/deadbyte-controller.ps1 +4 -4
- package/docs/ARCHITECTURE.md +1 -1
- package/package.json +6 -6
- package/scripts/deferred-slot-operation-r38.mjs +124 -0
- package/scripts/deferred-slot-operation-r39.mjs +124 -0
- package/scripts/final-closure-r38.mjs +113 -0
- package/scripts/final-closure-r39.mjs +113 -0
- package/scripts/final-closure-verify-r38.mjs +208 -0
- package/scripts/final-closure-verify-r39.mjs +208 -0
- package/scripts/gate-windows-r38.ps1 +42 -0
- package/scripts/gate-windows-r39.ps1 +42 -0
- package/scripts/release-parity-r38.mjs +200 -0
- package/scripts/release-parity-r39.mjs +200 -0
- package/scripts/release-parity-tests-r38.ps1 +9 -0
- package/scripts/release-parity-tests-r39.ps1 +9 -0
- package/scripts/windows-gate-evidence-r38.mjs +52 -0
- package/scripts/windows-gate-evidence-r39.mjs +52 -0
- package/src/deadbyte-cli.mjs +7 -3
- package/src/release-generation.mjs +18 -1
- package/src/remote-live-log.mjs +9 -2
- package/src/version.mjs +1 -1
- package/test/cli-entrypoint.test.mjs +1 -1
- package/test/controller.test.mjs +11 -0
- package/test/core.test.mjs +1 -1
- package/test/production-docs.test.mjs +3 -3
- package/test/r33-closeout-regression.test.mjs +8 -8
- package/test/r33-finalization.test.mjs +14 -14
- package/test/r37-remote-tool-call-timeline.test.mjs +2 -2
- package/test/r38-finalization.test.mjs +74 -0
- package/test/r39-finalization.test.mjs +74 -0
- package/test/release-generation.test.mjs +13 -3
- package/test/release-version.test.mjs +47 -25
- package/test/remote-live-log-r37.test.mjs +1 -1
- package/test/remote-session-cli.test.mjs +46 -12
package/MANIFEST.SHA256
CHANGED
|
@@ -30,19 +30,19 @@ f0ce7acb1e41325cef8b6789f95bd78b6a6107423773eace57a12b49faa55095 bin/WORKER-REG
|
|
|
30
30
|
e74d45bd9facf03c9a2a0ff52600252924deb804a87e4b5503f48662a2b45a3b conpty-input-observer.obj
|
|
31
31
|
8c1c45dd47e07b05eb2b43a6060ac23ecb9f7d0dd8aecfdfc29d42a6f824e507 CONTEXT.md
|
|
32
32
|
e19ff4253eb57ea6befd5df8b807c1c95fda83bfebd0ba871ceae7c5412d4c27 controller/deadbyte-controller.config.psd1.example
|
|
33
|
-
|
|
33
|
+
2ca38a9f869cfd1ef1c69268a2d8372e6b2a4767b07e17cc56aaaa7aa1045fea controller/deadbyte-controller.ps1
|
|
34
34
|
5e8ef223b0dbc52173aaf044a075837eef8964ff0e7e16f83a595e0d17695625 controller/deadbyte-host-policy.json.example
|
|
35
35
|
6f0cc469f51444dd18211fa3346c826abeea4d2ec7a8945f0200dc5c622031ef controller/DEADBYTE-MCP.cmd
|
|
36
36
|
e5f8d8b23a31ff6f0ea3c30711fe28031db04156c54ae95840f12e41e0259710 controller/deadbyte-process-policy.json
|
|
37
37
|
d274b099a298c1033fea8f1e8849751693bbc0448778d619400acb82d4f53a3b controller/deadbyte-semantic-lsp-config.json
|
|
38
|
-
|
|
38
|
+
adb4bbc160312694084ff0ecc3c29422da985b2bf5961a39bc27383a4738ad72 controller/README.TXT
|
|
39
39
|
101e613518c73c6aa31c725fe1b5f9a24c995dc9876b7b28e1f3e97ac9f8d362 DEADBYTE-MCP-R27-FINAL/R27-ADMIN-CLOSURE.json
|
|
40
40
|
e9baf9abf4410ff8bd0f68e6b957dbbf9790fc88d9126311c5c135e943424952 DEADBYTE-MCP-R27-FINAL/R27-CLEANUP-FINAL-RECEIPT.json
|
|
41
41
|
39cb483c0897af5027bf1790a35a4c3b9a8cd5f6e3a2e0440787615f69cd14b2 DEADBYTE-MCP-R27-FINAL/R27-FINAL-CLOSURE.json
|
|
42
42
|
9aaf6d07e7511a1f0046ee8cc731d4b9660bbbf47dcea785a9c6b6cec95640bc DEADBYTE-MCP-R27-FINAL/R27-SLOT-UPDATE-RECEIPT.json
|
|
43
43
|
70dfccba12797ce5fea60668c97026cf71e7942cb4d886cac5853e05b362b6c1 DEADBYTE-MCP.cmd
|
|
44
44
|
7994082e4340b5f43272e8cb111ce54043af64dc3a04d5279e251f3dae16f654 docs/ADR-0001-PRODUCTION-BASELINE-SEAMS.md
|
|
45
|
-
|
|
45
|
+
25a260c088bbb207cc6c0ef996f7e5829476dda6d51f0f4673cfb6cf3ba4e6c2 docs/ARCHITECTURE.md
|
|
46
46
|
3f455f407933d8e044682f3415bdb51e68d7c4b508411dda7d8ed65b6e1d7e79 docs/AUTHORITY.md
|
|
47
47
|
3be291331862ac5bd892345e84d6ce8d9b6d835855235d7c5f28d5cd4b04afdb docs/CHILD-CONTROL.md
|
|
48
48
|
a9cbd1e2def00aae93569835f2ee17aa5cfd181e5770d7c1185c9c62deb0769e docs/CONSTRUCTION-LADDER.md
|
|
@@ -1303,7 +1303,7 @@ db605a698f917c4006462596e6526fe6a9c6eff9b8409e8472fe545d4b70027c node_modules/z
|
|
|
1303
1303
|
f67a25ded944912bd4621b68df17c7c70a52aae117278c076c0aabbc32a3abba node_modules/zod/v4/mini/schemas.d.ts
|
|
1304
1304
|
51b3a7869df2d3a1bd98acb9d5b6a61bbccc7653d7a3d8fca7f0e0db7e84e284 node_modules/zod/v4/mini/schemas.js
|
|
1305
1305
|
3e3125b5a537a24c3632c1c5c09640ce7bcb3935901b127ad8ae3c37a27f133f node_modules/zod/v4/package.json
|
|
1306
|
-
|
|
1306
|
+
285b71e772676dca14d7c6da199cc9f2f6c5b0a373edcad9c14d0f37f1caa10e package.json
|
|
1307
1307
|
5a2722b8b5b16a2b5af9851638851c82c8f795bf4685f1090745ebbe61498c91 proof/CONTAINMENT-BUILD.txt
|
|
1308
1308
|
a8efa13e44ff50902aee64cfca542d19605a1ae23db95280ad2d44b324f3eae7 proof/MCP-SMOKE-STATUS.txt
|
|
1309
1309
|
7c115069cc4a343ca21b0ebdee74bd8f544b02d4aa906ffa13308725825d891a proof/NODE-SYNTAX.txt
|
|
@@ -1364,7 +1364,7 @@ bd0773a9e02e8ab11475c9cc5a7db29a8313233b7eab7f837922737e75ec5938 proof/VERIFY.t
|
|
|
1364
1364
|
2c821808d4596965c577f40191daee224d3aea81989778c4af97f53a83b487db proof/WINDOWS-CONTAINED-STATUS.txt
|
|
1365
1365
|
f8bc839c7b4fcb0ea7b7e7ad9448847c3beae6f95f2eb4d407d1b284aaa4ff68 proof/WINDOWS-CONTAINMENT-STATUS.txt
|
|
1366
1366
|
27ca0f3c9ee3a1b6374a9c8dd98008decdd0c7659c7a569c70ad7b9734c74655 R34-BASELINE.json
|
|
1367
|
-
|
|
1367
|
+
ce3997d49fbca531fad424d1e5820508dd311457ceaedb2fd4bbaf388d5c74f3 README.txt
|
|
1368
1368
|
1d4e9dee6f0669bd825334a6a72e13ee85ee29ab430dcef21d893ffd744774b5 scripts/autonomous-benchmark.mjs
|
|
1369
1369
|
06447dea18be1fa0a5e5a1167a6e3dcbd10ddfd28dd18d7bfd17383cf5bfc080 scripts/autonomous-build.ps1
|
|
1370
1370
|
6ae23099102eb0f0be4969598ba76600d19b00abf534a039d48e63bc7d7fffe3 scripts/autonomous-tests.ps1
|
|
@@ -1372,21 +1372,33 @@ f8bc839c7b4fcb0ea7b7e7ad9448847c3beae6f95f2eb4d407d1b284aaa4ff68 proof/WINDOWS-
|
|
|
1372
1372
|
1077e2f4baf2aae1c0d3e2416d00bd49a54e9e39a5939872c73143ca9e546633 scripts/capability-benchmark.mjs
|
|
1373
1373
|
7d3c741de2b1c29f82efa96ab81fc819d8520f97413ce5ab0d4a1b1efd0e8b42 scripts/coding-live-smoke.mjs
|
|
1374
1374
|
254872f5f1f2fa662b1061aad4c3da59b21d882e45f7f0ceefff2f688ea493a1 scripts/deferred-slot-operation-r37-0110.mjs
|
|
1375
|
+
98b27366379a63ffad8cc6ac3c33dff6f0f6810eb4f1a75835aa8477afba8ad6 scripts/deferred-slot-operation-r38.mjs
|
|
1376
|
+
66a6d4ea03b9a7d5aa9f0fafbd7b5fc1568aaa7de1c3ce15f213e6fced11c9ba scripts/deferred-slot-operation-r39.mjs
|
|
1375
1377
|
34116370895aeff9a424475558f4aca3b05460146455d9bb0bafcacd1a270910 scripts/deferred-slot-operation.mjs
|
|
1376
1378
|
69e3beb55573b5fc3ba30a220fabf9e3585e7757430fb3264caf27e41254b789 scripts/final-closure-r36.mjs
|
|
1377
1379
|
4b7dce462db12237e9f3bb8637e703689140c16e5ddd8bf08b41f8a4b35de95d scripts/final-closure-r37-0110.mjs
|
|
1380
|
+
551e7aa855d1618f29b243413a3cb888f67b0f33eb436f25401902d528c6171a scripts/final-closure-r38.mjs
|
|
1381
|
+
9e3c4f4294a5b73916bc542fafdada82b6c085ac6b57592e6abc0f714a0f54bb scripts/final-closure-r39.mjs
|
|
1378
1382
|
4b895f85e2bf7009def5ecb0a96dad38832c6fac3b2a0633a6b71d9ac9a868be scripts/final-closure-verify-r36.mjs
|
|
1379
1383
|
c6cbbfe7ea3e4c257c419535425a9f75e4d58f2d5cb18f2f408b871f1c7c20a8 scripts/final-closure-verify-r37-0110.mjs
|
|
1384
|
+
228268406b0fd7bcb585fe87ce720bec7548ce172ee22f7f1be02638c2d7af18 scripts/final-closure-verify-r38.mjs
|
|
1385
|
+
d39ce4e31509b9a3417f24b401e930b989e312d029ab7e7f21ce194d056c3299 scripts/final-closure-verify-r39.mjs
|
|
1380
1386
|
c1a16ed8b9e3bde9622d288e7274d7677eec7fa1783cbb090fb8df96db3d6e2a scripts/final-closure-verify.mjs
|
|
1381
1387
|
14b7fee5246589819ee0a5e89a0e386b932d89275660305d98324efc6a3f0902 scripts/final-closure.mjs
|
|
1382
1388
|
feaecfaf78ebf20a42b17974a81777185b74344bc4717f00fde69b5e66ac3257 scripts/gate-windows-r36.ps1
|
|
1383
1389
|
75931dbb30e7d5b07bf781481849c7a583c7fe7250ac2e5d43a83e9c4764569b scripts/gate-windows-r37-0110.ps1
|
|
1390
|
+
96c407135841b88ed713ed4984a678acfe5b19285673e0d2c35168d9bedde68c scripts/gate-windows-r38.ps1
|
|
1391
|
+
28de53c80e967a1d2a0b52450deb2805caf6eb6d4f8ba6f052f6175200480992 scripts/gate-windows-r39.ps1
|
|
1384
1392
|
9a085b34b9e54023eb0efadcea1e74a1bef44b984105d064768d66910999173e scripts/gate-windows.ps1
|
|
1385
1393
|
a64ab9a70c26495ac5d94c024a8813d8bd2bc8a708f236b672cb18556396c262 scripts/init-host-policy.ps1
|
|
1386
1394
|
b655f2f9c63c7e4b651e7182c6461f9ec63d0991f770f24fe5d44b209ad6bdfb scripts/refresh-process-policy.mjs
|
|
1387
1395
|
c92b518b7232849d945f0fcd9c428a2366758e5c9410be68104ed50ef869a33e scripts/release-manifest.mjs
|
|
1388
1396
|
2272ceab04fba9030fe3dad5ccb14b8313f7dea963873ca64a86945608b6e7fb scripts/release-parity-r36.mjs
|
|
1389
1397
|
bb03b8645718c52f7e195703d88caf284c6bdb4459e35bc2ff67ed7dcc7ebcfb scripts/release-parity-r37-0110.mjs
|
|
1398
|
+
64779ec84d473fb15efe6908a8e9d9b25fcec42806393083586a4d088cedb69c scripts/release-parity-r38.mjs
|
|
1399
|
+
4fcb522511ebe3901da68f531022a7b1fc77ddd2b00da893eebfbd0521cc4c6e scripts/release-parity-r39.mjs
|
|
1400
|
+
6b5ea3ae9b3468bc82df8f371f7e2120c5f4265916cf312beae045f481b8abbb scripts/release-parity-tests-r38.ps1
|
|
1401
|
+
7b47e96d78437d65d492e3982efb6d440bb0220681a3b1f133c743c26bc3464a scripts/release-parity-tests-r39.ps1
|
|
1390
1402
|
4c8ff3df2d3c5bb06984be8887381f29d87c468c6a0c87db7ba623717907e79a scripts/release-parity-tests.ps1
|
|
1391
1403
|
1b83f49d9798188533c8cfca0030a98af34560fe181b3e593db790319e1b7bc5 scripts/release-parity.mjs
|
|
1392
1404
|
caac2867971dfdf56456528b816ff56282a11cbba81510c13e1723accffac678 scripts/runtime-self-update.mjs
|
|
@@ -1394,6 +1406,8 @@ b0cc75c38e0163dbcf7fb1b0d21f2dc34c71f2d0e2a156a53e570ff84afc64e6 scripts/semant
|
|
|
1394
1406
|
0a115aa9829576c86cc247f754cae69ae09ba146b637d3a1c9fbc16420d20a5d scripts/tool-surface-snapshot.mjs
|
|
1395
1407
|
eb59d412712270bedc33bcdabd65fe9c31994339858a4947d0dc4bac371256fc scripts/windows-gate-evidence-r36.mjs
|
|
1396
1408
|
ea68d948b9e3bf155b7782b5745d75d98c142a199785ba52840aff7d2272ea17 scripts/windows-gate-evidence-r37-0110.mjs
|
|
1409
|
+
3d7c5092b080cae079607e5f741edd5c106117b962b0ebdc2c647431517a2282 scripts/windows-gate-evidence-r38.mjs
|
|
1410
|
+
c1e5b8afa71f438c2a6c554df37ce1e1abf763870bb4255841ebf2fbf891c9ac scripts/windows-gate-evidence-r39.mjs
|
|
1397
1411
|
2255b8eb78ca61267df54448560a671357f04893b6bb1df27b8b9fc8a944d255 scripts/windows-gate-evidence.mjs
|
|
1398
1412
|
5f4a73a1c3dc178c4b5de193b6cfc4774cfc46d5ad95ef0b786d4d386d82323b src/agent-mcp-tools.mjs
|
|
1399
1413
|
22d32373fdaceb7debae300ec4db2f3b1677072e946a203acff6f5e4dc458946 src/agent-memory-plane.mjs
|
|
@@ -1438,7 +1452,7 @@ dcd4c9784e88e253e91ddad3c24b38cb0b36906ed737f6d7bee7712360f66f7a src/containmen
|
|
|
1438
1452
|
fe1761b98738e1aea1d25ddf3a0ba56ccad95a43d45104a89b8665197c7c9e18 src/containment-result.mjs
|
|
1439
1453
|
705a89cb12fedb993d55dfed32a5870d33e10db26422c944d1e52223566c096c src/containment-smoke.mjs
|
|
1440
1454
|
63a1d4d6a53f9eb7e02197b4e42158b867da8c042c2e61848d8a36cd398b8bd8 src/context-provenance.mjs
|
|
1441
|
-
|
|
1455
|
+
17f9b02c201f4dcc94f99b91019d858fa382d3d59fe6fba505aff10656db0eed src/deadbyte-cli.mjs
|
|
1442
1456
|
f57fe200ad916a03480c804ca57ab12b603822cbfb8d45ba7bce4376ec3d712a src/document-adapter.mjs
|
|
1443
1457
|
7786e7c102cd69ebaefff7696e9e420e28cf9c40c2af5c5227d26bba6fe4f824 src/effect-ledger.mjs
|
|
1444
1458
|
f5fafd46052b09f71a528594eb230edc5766ee0d006432d744590ec97c9c580d src/executor.mjs
|
|
@@ -1480,9 +1494,9 @@ be4a4f7f16e473ac842559a5a18eccb59e3693bded59a1abc71e75ff448cc755 src/proof-work
|
|
|
1480
1494
|
9105c86adc4f5a11ccc076cd17c9effe4d4d3e7bce42e00420a987deb315ec92 src/r36-compact-disarmed-probe.mjs
|
|
1481
1495
|
57f6f90baff83eb7a6e0cb4a02b62e10c3de39d10befbf426578eb187d626ad7 src/r36-full-surface-probe.mjs
|
|
1482
1496
|
afc638b797d81b16c620ca2226eacc4cb1a36562a402219cdac3376867170610 src/receipt.mjs
|
|
1483
|
-
|
|
1497
|
+
4d9acc7d201d135ac3fc70632fb2fb39ee977bc608f0ed575d475b0a04070d34 src/release-generation.mjs
|
|
1484
1498
|
a7a63ea58291e0676c7199633ae234030f46285840cdfc519c879c279ae8bb14 src/release-slot.mjs
|
|
1485
|
-
|
|
1499
|
+
09fe812d1e9c38ad263c3686ad7d89062cbf36c8616dd2b4591bd9c91d992f50 src/remote-live-log.mjs
|
|
1486
1500
|
589c7f348ef24ce61206ea6b6d5e6962e7828c4c12eb23c9bfda7d6103dd710a src/remote-mcp-autonomous-smoke-client.mjs
|
|
1487
1501
|
ebff2982142263632a40b9f144e802b9cb0c86c798bb6c591de7f175ba50b660 src/remote-mcp-coding-smoke-client.mjs
|
|
1488
1502
|
efd3f7ae0a3a614485933942ab5e27e874175feb81eb3e5130913c1e6837e7ca src/remote-mcp-host-smoke-client.mjs
|
|
@@ -1511,7 +1525,7 @@ a765372ee27cf34b3f42ca77e43b839a306a4ca7d8b1c5e2fdd4367ab0c95769 src/tunnel-std
|
|
|
1511
1525
|
16df134040e3ff1e73df722b568d3e8ac0a6923b097696cead7580da75aa8d2a src/tunnel-stdio-compat.mjs
|
|
1512
1526
|
642cb67d1854850e336ee73fbd71b329056bdcbdab35cea19c1a995a155ff5d9 src/verifier-cli.mjs
|
|
1513
1527
|
8f818a4852ce3be3a380cd4736c3073a7a3e0e45cd7c7ca90588a6b843d3d022 src/verifier.mjs
|
|
1514
|
-
|
|
1528
|
+
5c2fe126465b1322b66eade4166fe7bb1719c13b7010917f03901c586a80e246 src/version.mjs
|
|
1515
1529
|
7e09c57a97289360aabfaf3d531208e54872efbfb3182f3c18203d2cb88c46b5 src/worker-registry.mjs
|
|
1516
1530
|
76361d5ae9a710273cf64a7525082197b692236bf23689875e5fd1ef4aa96d2b src/worker-scheduler.mjs
|
|
1517
1531
|
2a78c818058b25efdc143a3a97c832da231ccd6ff9d90c7796d681a0251b85c4 test/agent-crash-child.mjs
|
|
@@ -1545,7 +1559,7 @@ bad448d7bfd0c66b8d0dc0fa601fc22d69ccc3f447140ed0f77b68957984daea test/capabilit
|
|
|
1545
1559
|
c343906ca0878e13c576cd9f615802b1139c693bf6769a780dfb052637cf0d83 test/capability-benchmark.test.mjs
|
|
1546
1560
|
b9a8faa4b86683ac5aea891fe6bc95f8e425fb31635176aa4603f9d582b52a79 test/capability-claims-r36.test.mjs
|
|
1547
1561
|
6fb8640b5488b6c2f1e16bb5c7c0e17b0a7a485b149e2a7cc203fceb812ed824 test/capability-ledger-r36.test.mjs
|
|
1548
|
-
|
|
1562
|
+
1b1eaf646b8367d47197062c8d1e4f557eafb868d225d0c49d894fa270f1a667 test/cli-entrypoint.test.mjs
|
|
1549
1563
|
350e151dbd8cc2723b141c5cf5f90bdf11289577c9b9347330e3ad815d948e98 test/coding-catalog-consistency.test.mjs
|
|
1550
1564
|
604605e1992ea62e1eca6880d7b0bae36d43b16d17573a663cd9b3ff089575c7 test/coding-crash.test.mjs
|
|
1551
1565
|
0fad3c669e48d60bbae7f4b847472677bf3bf8bcc9db0c798d76814b8f907e17 test/coding-observation.test.mjs
|
|
@@ -1566,8 +1580,8 @@ a972bd20fa927427e6d8e4181699a27e792e916b02dcf8a1ac3e2b44afd238c1 test/controlle
|
|
|
1566
1580
|
41959e534e2283bf55ced245a58b6ea8d4d0d91d79820d87a3325adc2051560a test/controller-r27.test.mjs
|
|
1567
1581
|
ceba7d1a09ccdcb20f33fe4e6de7667ffe0f0170d1bc9fefadfdba4d7f228090 test/controller-r29.test.mjs
|
|
1568
1582
|
4d0dc810d9af13907f31c834a13acfb7e01ffbbe65575b69649fe52741e42175 test/controller-r30.test.mjs
|
|
1569
|
-
|
|
1570
|
-
|
|
1583
|
+
275e7d4c0301cbb1fe5ee44f6d6cd7085ea3b9547e639c121b9c6a112abc2505 test/controller.test.mjs
|
|
1584
|
+
b666a96c0613d0d1a1405df89417085de64b31bf21b7300c6bf5d5a0f8109048 test/core.test.mjs
|
|
1571
1585
|
7ba4b06a1c4141ba87b5b371157fb59940d15a1016b4c599a13753d63ad0d3d3 test/DEADBYTE-MCP-WRITE-PROBE.txt
|
|
1572
1586
|
c526724a6d10648fdd5152af917ba2fe51836dc5877daaac554bbd9e52fcd47e test/deferred-slot-operation-behavior.test.mjs
|
|
1573
1587
|
69a515b1a36f0620cae4057ea8dc5302751058e290aedaf2f0b637eb3288aba8 test/deferred-slot-operation.test.mjs
|
|
@@ -1660,30 +1674,32 @@ b84622d07d2ecfe27b55e45f7e89949f29a2d14184d8c6f6f82ed7f1e5fa59be test/process-n
|
|
|
1660
1674
|
510f51a6288a1030387cf372951499aea6dba2a35362ad89510bf7480e2f8004 test/process-release-gate.test.mjs
|
|
1661
1675
|
e19a477abb83c63a1fb7ab5d5d1e9925113cded95d57084186b6ecd6161780e0 test/process-runtime.test.mjs
|
|
1662
1676
|
34afc8a01e0c21501ec2647b7b0198b73570bce89eaaa983bd50c5709bb83fb8 test/process-supervision.test.mjs
|
|
1663
|
-
|
|
1677
|
+
c90c34c692214ba890fd699c1af586edd843c203034bbebf04016e76ec00fa1e test/production-docs.test.mjs
|
|
1664
1678
|
a20273128f4e6dcf2163c0b3fb7fe6ed9bf4d698fb0a5a0c4638396331d961cf test/prompts-resources.test.mjs
|
|
1665
1679
|
fcb70992870cd2f84674d578b0aaee554f958969c629a9d522d1efd230fe8288 test/provider-circuit.test.mjs
|
|
1666
1680
|
0286df49beb2c2dcf46e384d87687d8d7a1618dd86f068517e36ae80dceb489b test/public-autonomous-ingress-budget.test.mjs
|
|
1667
|
-
|
|
1668
|
-
|
|
1681
|
+
27819a28833f906b327f0cfafbabe1fb1c5d9e22d3c33fa5450e4eff60c4d214 test/r33-closeout-regression.test.mjs
|
|
1682
|
+
b1dc922a41a582c6989103a83f2fa0902a748722ffd1a875d78f719cf5227a59 test/r33-finalization.test.mjs
|
|
1669
1683
|
7e419d3c1caf79bfc7407207f50e5645298f9b19d91a7d6f595af185b92cd55e test/r36-finalization.test.mjs
|
|
1670
1684
|
139b0e11e5aac97649af0ab5efa78e8da06b4ee4da7372cc6c26d415ced53084 test/r36-release-identity.test.mjs
|
|
1671
1685
|
54d13ac29dd59aeca54f132d782a859cacba98ba0e5bac03d07ddeb042e8030b test/r37-0110-history.test.mjs
|
|
1672
1686
|
6dfb1b2b74b9e1cc74998d3fe7ce3c69bbad6b6751dabc81a65b6ec810872820 test/r37-agent-fabric.test.mjs
|
|
1673
1687
|
72bc1863a2e113f7815903595d010b9c15513e05243d4eef3bef584aea18757b test/r37-autonomous-timeout-recovery.test.mjs
|
|
1674
1688
|
291d01d18840b543bd6c5790dc6a8a7c167244611168015377ce6b837a1ec038 test/r37-finalization.test.mjs
|
|
1675
|
-
|
|
1676
|
-
|
|
1689
|
+
25e4acd08a38dc1d4430c5ce96a6e93fce29349729a4b30dbf0fd677c8ceba52 test/r37-remote-tool-call-timeline.test.mjs
|
|
1690
|
+
82bd5e708736ec59837218301964e01e3fe6a757905e5f395699e499c65f64fb test/r38-finalization.test.mjs
|
|
1691
|
+
82a8d3e80c20f87c16948209c275c316a88bd23d423438bd1c0502bece447d6a test/r39-finalization.test.mjs
|
|
1692
|
+
984d153419c3273e896fd280c9347480802c8854742b7832eec113c63f538f4b test/release-generation.test.mjs
|
|
1677
1693
|
bb58887a2c393cd5aac3fa3bb3a04de2704bd2a30dd2083ea638543485fa7e60 test/release-manifest-windows.test.mjs
|
|
1678
1694
|
7cc69e786bfd9e4a7e70888c4c1b5f756a264bc1a991139c468b63af23f24c38 test/release-slot.test.mjs
|
|
1679
1695
|
0109c76b480cc600f6ed42be4519df3fa6835012bb9e4ba4ae6be6635468c4a8 test/release-smoke-isolation.test.mjs
|
|
1680
|
-
|
|
1696
|
+
e09d5cbedbb3f151488677b36664b655bab299ffb3e8119854362fde6a0f76dd test/release-version.test.mjs
|
|
1681
1697
|
3d26a0550a22c69990567d998c28e4ba0978c71429741c10c7c47f261653fbe2 test/remote-live-log-r36.test.mjs
|
|
1682
|
-
|
|
1698
|
+
b3fa419651ee067ba24021e75fc5cd53f8acc789b6227b4aa483f799ddd9d070 test/remote-live-log-r37.test.mjs
|
|
1683
1699
|
02ad827dc46e3dacf1ef2cfd861f583a44c471b1411cc674f4d61cd421418ad3 test/remote-live-log-recovery-r36.test.mjs
|
|
1684
1700
|
cda93f7e2453916855a338de63360eb9c9e0b7c513391d344d01c32f500b188e test/remote-r24-catalog.test.mjs
|
|
1685
1701
|
7fb0196c15dc0c98a86d330ece3c752db5d2285289cb7b264a04871ba2fbd3d8 test/remote-result-journal.test.mjs
|
|
1686
|
-
|
|
1702
|
+
4ee929451cc0ce56023452487468cd1a7439644f74b8b487698dcb887381a2fb test/remote-session-cli.test.mjs
|
|
1687
1703
|
6faccee09e78210ee580f364ce5d56254c0bc8c38351a3a37642a0c60a3291d0 test/runtime-self-update.test.mjs
|
|
1688
1704
|
b131611ec56e83d5db05d40b9be9b029396a177bca1ddacac9bf13086d370897 test/semantic-backend-registry.test.mjs
|
|
1689
1705
|
a939ffa93544602d713749bc315fb970bd1a0d59b0d1570f2b8d4c26b4ec6e35 test/semantic-code.test.mjs
|
package/README.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
DEADBYTE MCP V0.11.
|
|
1
|
+
DEADBYTE MCP V0.11.3 / R39 HOTFIX BASELINE
|
|
2
2
|
=========================
|
|
3
3
|
|
|
4
4
|
AUTHENTICATED MACHINE TRUTH + DURABLE AGENT + CODING + AUTONOMOUS PRODUCTION ENGINE
|
|
@@ -7,7 +7,7 @@ NPX PRIMARY OPERATOR UX
|
|
|
7
7
|
------------------------
|
|
8
8
|
Use the npm CLI entry point instead of the legacy CMD convenience wrapper:
|
|
9
9
|
|
|
10
|
-
npx -y deadbyte-mcp@0.11.
|
|
10
|
+
npx -y deadbyte-mcp@0.11.3 mcp
|
|
11
11
|
npx deadbyte-mcp@latest remote
|
|
12
12
|
npx deadbyte-mcp@latest remote status
|
|
13
13
|
npx deadbyte-mcp@latest remote restart
|
|
@@ -273,7 +273,7 @@ MCP CLIENT CONFIGURATION
|
|
|
273
273
|
------------------------
|
|
274
274
|
The local stdio entry point is quiet and suitable for MCP hosts:
|
|
275
275
|
|
|
276
|
-
npx -y deadbyte-mcp@0.11.
|
|
276
|
+
npx -y deadbyte-mcp@0.11.3 mcp
|
|
277
277
|
|
|
278
278
|
CLAUDE DESKTOP
|
|
279
279
|
Use the standard local-server entry in claude_desktop_config.json:
|
|
@@ -282,7 +282,7 @@ Use the standard local-server entry in claude_desktop_config.json:
|
|
|
282
282
|
"mcpServers": {
|
|
283
283
|
"deadbyte": {
|
|
284
284
|
"command": "npx",
|
|
285
|
-
"args": ["-y", "deadbyte-mcp@0.11.
|
|
285
|
+
"args": ["-y", "deadbyte-mcp@0.11.3", "mcp"]
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
}
|
|
@@ -295,7 +295,7 @@ Create .cursor/mcp.json:
|
|
|
295
295
|
"deadbyte": {
|
|
296
296
|
"type": "stdio",
|
|
297
297
|
"command": "npx",
|
|
298
|
-
"args": ["-y", "deadbyte-mcp@0.11.
|
|
298
|
+
"args": ["-y", "deadbyte-mcp@0.11.3", "mcp"]
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
}
|
|
@@ -308,7 +308,7 @@ Create .vscode/mcp.json:
|
|
|
308
308
|
"deadbyte": {
|
|
309
309
|
"type": "stdio",
|
|
310
310
|
"command": "npx",
|
|
311
|
-
"args": ["-y", "deadbyte-mcp@0.11.
|
|
311
|
+
"args": ["-y", "deadbyte-mcp@0.11.3", "mcp"]
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
}
|
|
@@ -318,7 +318,7 @@ Add this to ~/.codex/config.toml:
|
|
|
318
318
|
|
|
319
319
|
[mcp_servers.deadbyte]
|
|
320
320
|
command = "npx"
|
|
321
|
-
args = ["-y", "deadbyte-mcp@0.11.
|
|
321
|
+
args = ["-y", "deadbyte-mcp@0.11.3", "mcp"]
|
|
322
322
|
|
|
323
323
|
The remote device path remains `npx deadbyte-mcp@latest remote`. Remote public MCP uses the
|
|
324
324
|
verified HTTPS named-tunnel URL selected by the active generation; do not commit a private device
|
package/controller/README.TXT
CHANGED
|
@@ -1032,11 +1032,11 @@ function Recover-AutonomousSupervisor($Cfg) {
|
|
|
1032
1032
|
$process = Get-ProcessGrantStatus $Cfg
|
|
1033
1033
|
$coding = Get-CodingLeaseStatus $Cfg
|
|
1034
1034
|
$autonomous = Get-AutonomousLeaseStatus $Cfg
|
|
1035
|
-
$
|
|
1036
|
-
if ($process.Armed -or $coding.Armed -or $autonomous.Armed -or $
|
|
1035
|
+
$hostStatus = Get-HostArmStatus $Cfg
|
|
1036
|
+
if ($process.Armed -or $coding.Armed -or $autonomous.Armed -or $hostStatus.Armed) { Fail 'supervisor recovery final authority is not fully disarmed' }
|
|
1037
1037
|
$supervisor = Start-AutonomousSupervisor $Cfg
|
|
1038
1038
|
Write-Host 'AUTONOMOUS SUPERVISOR RECOVERY PASS: runtime ONLINE; privileged planes DISARMED.'
|
|
1039
|
-
return [pscustomobject]@{ Runtime=$runtime; Supervisor=$supervisor; Process=$process; Coding=$coding; Autonomous=$autonomous; Host=$
|
|
1039
|
+
return [pscustomobject]@{ Runtime=$runtime; Supervisor=$supervisor; Process=$process; Coding=$coding; Autonomous=$autonomous; Host=$hostStatus }
|
|
1040
1040
|
}
|
|
1041
1041
|
|
|
1042
1042
|
function Show-State($Cfg) {
|
|
@@ -1197,7 +1197,7 @@ while ($true) {
|
|
|
1197
1197
|
Clear-Host
|
|
1198
1198
|
$cfg = Get-Config
|
|
1199
1199
|
Assert-ControllerRootBound $cfg
|
|
1200
|
-
Write-Host 'DEADBYTE MCP ON-DEMAND CONTROLLER V0.11.
|
|
1200
|
+
Write-Host 'DEADBYTE MCP ON-DEMAND CONTROLLER V0.11.3 / R39'
|
|
1201
1201
|
Write-Host '======================================'
|
|
1202
1202
|
Show-State $cfg | Out-Null
|
|
1203
1203
|
Write-Host ''
|
package/docs/ARCHITECTURE.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "deadbyte-mcp",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Authenticated MCP machine-truth runtime with signed audit chain, immutable release slots, contained execution, coding/autonomous production authority, and npx-first remote control.",
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"manifest:write": "node scripts/release-manifest.mjs write",
|
|
13
13
|
"manifest:verify": "node scripts/release-manifest.mjs verify",
|
|
14
14
|
"self-update:runtime": "node scripts/runtime-self-update.mjs",
|
|
15
|
-
"self-update:deferred": "node scripts/deferred-slot-operation.mjs",
|
|
16
|
-
"release:parity": "node scripts/release-parity.mjs",
|
|
17
|
-
"release:final:write": "node scripts/final-closure.mjs",
|
|
18
|
-
"release:final:verify": "node scripts/final-closure-verify.mjs",
|
|
15
|
+
"self-update:deferred": "node scripts/deferred-slot-operation-r39.mjs",
|
|
16
|
+
"release:parity": "node scripts/release-parity-r39.mjs",
|
|
17
|
+
"release:final:write": "node scripts/final-closure-r39.mjs",
|
|
18
|
+
"release:final:verify": "node scripts/final-closure-verify-r39.mjs",
|
|
19
19
|
"proof": "node src/proof-cli.mjs workspaces/demo input.txt",
|
|
20
20
|
"verify": "node src/verifier-cli.mjs workspaces/demo evidence/latest.json",
|
|
21
21
|
"trust:init": "node src/trust-init.mjs",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"contained:run": "node src/contained-cli.mjs workspaces/demo input.txt",
|
|
39
39
|
"contained:smoke": "node src/contained-smoke.mjs",
|
|
40
40
|
"mcp:contained:smoke": "node src/mcp-contained-smoke-client.mjs",
|
|
41
|
-
"gate:windows": "powershell -NoProfile -ExecutionPolicy Bypass -File scripts/gate-windows.ps1",
|
|
41
|
+
"gate:windows": "powershell -NoProfile -ExecutionPolicy Bypass -File scripts/gate-windows-r39.ps1",
|
|
42
42
|
"authority:smoke": "node src/authority-smoke.mjs",
|
|
43
43
|
"mcp:remote:smoke": "node src/remote-mcp-smoke-client.mjs",
|
|
44
44
|
"mcp:host:smoke": "node src/mcp-host-smoke-client.mjs",
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { createHash, createPublicKey, randomBytes } from 'node:crypto';
|
|
2
|
+
import { spawn } from 'node:child_process';
|
|
3
|
+
import { mkdir, readFile, realpath, writeFile } from 'node:fs/promises';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
import { parseActivePointer } from '../src/release-slot.mjs';
|
|
8
|
+
import { loadPowerShellDataFile, runSlotUpdateCli, verifySlotUpdateEnvelope } from '../src/runtime-update.mjs';
|
|
9
|
+
|
|
10
|
+
const HEX64=/^[0-9a-f]{64}$/;
|
|
11
|
+
const RECEIPT_ID=/^r27-[A-Za-z0-9-]+$/;
|
|
12
|
+
const here=path.dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const packageRoot=path.resolve(here,'..');
|
|
14
|
+
const stateRoot=path.resolve(process.env.DEADBYTE_STATE_ROOT||path.join(os.homedir(),'.deadbyte-mcp'));
|
|
15
|
+
const evidenceRoot=path.join(stateRoot,'evidence','deferred-slot-operations');
|
|
16
|
+
const sha256=bytes=>createHash('sha256').update(bytes).digest('hex');
|
|
17
|
+
const atomicJson=async(file,value)=>{
|
|
18
|
+
await mkdir(path.dirname(file),{recursive:true});
|
|
19
|
+
const temp=`${file}.${process.pid}.${randomBytes(4).toString('hex')}.tmp`;
|
|
20
|
+
await writeFile(temp,`${JSON.stringify(value,null,2)}\n`,{flag:'wx'});
|
|
21
|
+
await import('node:fs/promises').then(fs=>fs.rename(temp,file));
|
|
22
|
+
};
|
|
23
|
+
function activationArgs(manifestSha){
|
|
24
|
+
if(!HEX64.test(manifestSha??'')) throw new Error('activate requires one lowercase manifest SHA-256');
|
|
25
|
+
return ['--stage',packageRoot,'--development-root',packageRoot,'--expected-version','0.11.2',
|
|
26
|
+
'--expected-manifest',manifestSha,'--process-policy',path.join(packageRoot,'controller','deadbyte-process-policy.json'),
|
|
27
|
+
'--process-policy-sha256',null,'--semantic-lsp-config',path.join(packageRoot,'controller','deadbyte-semantic-lsp-config.json'),
|
|
28
|
+
'--semantic-lsp-config-sha256',null,'--enable-machine-fs','--enable-observation','--enable-autonomous-supervisor'];
|
|
29
|
+
}
|
|
30
|
+
async function bridgeBootstrapArgs(explicitBridgeRoot=null,explicitBridgeSha256=null){
|
|
31
|
+
const hasRoot=typeof explicitBridgeRoot==='string'&&explicitBridgeRoot.length>0;
|
|
32
|
+
const hasSha=typeof explicitBridgeSha256==='string'&&explicitBridgeSha256.length>0;
|
|
33
|
+
if(hasRoot!==hasSha) throw new Error('bridge override requires exact root + SHA pair');
|
|
34
|
+
let bridgeRootRaw,expectedSha256=null;
|
|
35
|
+
if(hasRoot){
|
|
36
|
+
if(!path.isAbsolute(explicitBridgeRoot)||!HEX64.test(explicitBridgeSha256)) throw new Error('bridge override requires exact root + SHA pair');
|
|
37
|
+
bridgeRootRaw=explicitBridgeRoot;expectedSha256=explicitBridgeSha256;
|
|
38
|
+
}else{
|
|
39
|
+
const pointer=parseActivePointer(await readFile(path.join(stateRoot,'active-release.json'),'utf8'));
|
|
40
|
+
const config=await loadPowerShellDataFile(pointer.config_path);
|
|
41
|
+
bridgeRootRaw=config?.Bridge?.WorkingDirectory;
|
|
42
|
+
if(typeof bridgeRootRaw!=='string'||!path.isAbsolute(bridgeRootRaw)) throw new Error('active controller Bridge.WorkingDirectory must be absolute');
|
|
43
|
+
}
|
|
44
|
+
const bridgeRoot=await realpath(path.resolve(bridgeRootRaw));
|
|
45
|
+
const packageFile=path.join(bridgeRoot,'package.json');
|
|
46
|
+
const bridgeScript=path.join(bridgeRoot,'src','bridge.mjs');
|
|
47
|
+
const pkg=JSON.parse(await readFile(packageFile,'utf8'));
|
|
48
|
+
if(pkg?.name!=='deadbyte-chatgpt-bridge') throw new Error('active Bridge package identity mismatch');
|
|
49
|
+
const scriptSha256=sha256(await readFile(bridgeScript));
|
|
50
|
+
if(expectedSha256&&scriptSha256!==expectedSha256) throw new Error('bridge override SHA-256 mismatch');
|
|
51
|
+
return ['--bridge-root',bridgeRoot,'--bridge-script-sha256',scriptSha256];
|
|
52
|
+
}
|
|
53
|
+
async function rollbackArgs(receiptPath){
|
|
54
|
+
const resolved=await realpath(path.resolve(receiptPath));
|
|
55
|
+
const allowed=path.join(stateRoot,'evidence','updates')+path.sep;
|
|
56
|
+
if(!resolved.startsWith(allowed)||path.basename(resolved).toLowerCase()!=='receipt.json'||!RECEIPT_ID.test(path.basename(path.dirname(resolved)))) {
|
|
57
|
+
throw new Error('rollback receipt must be one signed activation receipt under the update evidence store');
|
|
58
|
+
}
|
|
59
|
+
const envelope=JSON.parse(await readFile(resolved,'utf8'));
|
|
60
|
+
const publicKey=createPublicKey(await readFile(path.join(stateRoot,'trust','ed25519-public.pem')));
|
|
61
|
+
if(!verifySlotUpdateEnvelope(envelope,publicKey)||envelope.body?.rollback_performed!==false) throw new Error('rollback activation receipt verification failed');
|
|
62
|
+
const pointer=parseActivePointer(await readFile(path.join(stateRoot,'active-release.json'),'utf8'));
|
|
63
|
+
if(pointer.release_id!==envelope.body?.active_pointer?.release_id||pointer.generation_root!==envelope.body?.active_pointer?.generation_root) {
|
|
64
|
+
throw new Error('rollback receipt does not identify the active release generation');
|
|
65
|
+
}
|
|
66
|
+
return ['--rollback-receipt',resolved];
|
|
67
|
+
}
|
|
68
|
+
async function normalizedArgs(mode,value,{explicitBridgeRoot=null,explicitBridgeSha256=null}={}){
|
|
69
|
+
if(mode==='activate'){
|
|
70
|
+
const args=activationArgs(value);
|
|
71
|
+
args[args.indexOf('--process-policy-sha256')+1]=sha256(await readFile(path.join(packageRoot,'controller','deadbyte-process-policy.json')));
|
|
72
|
+
args[args.indexOf('--semantic-lsp-config-sha256')+1]=sha256(await readFile(path.join(packageRoot,'controller','deadbyte-semantic-lsp-config.json')));
|
|
73
|
+
args.push(...await bridgeBootstrapArgs(explicitBridgeRoot,explicitBridgeSha256));
|
|
74
|
+
return args;
|
|
75
|
+
}
|
|
76
|
+
if(mode==='rollback'){
|
|
77
|
+
if(explicitBridgeRoot||explicitBridgeSha256) throw new Error('rollback does not accept bridge override');
|
|
78
|
+
return rollbackArgs(value);
|
|
79
|
+
}
|
|
80
|
+
throw new Error("operation must be exactly 'activate' or 'rollback'");
|
|
81
|
+
}
|
|
82
|
+
const rawArgs=process.argv.slice(2);
|
|
83
|
+
const mode=rawArgs[0],value=rawArgs[1];
|
|
84
|
+
if(!value||!['activate','rollback'].includes(mode)) throw new Error('usage: deferred-slot-operation.mjs <activate manifest_sha256|rollback activation_receipt> [--bridge-root ABS --bridge-script-sha256 HEX64]');
|
|
85
|
+
let cursor=2,explicitBridgeRoot=null,explicitBridgeSha256=null;
|
|
86
|
+
if(rawArgs[cursor]==='--bridge-root'){
|
|
87
|
+
explicitBridgeRoot=rawArgs[cursor+1]??null;
|
|
88
|
+
if(rawArgs[cursor+2]!=='--bridge-script-sha256') throw new Error('bridge override requires exact root + SHA pair');
|
|
89
|
+
explicitBridgeSha256=rawArgs[cursor+3]??null;cursor+=4;
|
|
90
|
+
}
|
|
91
|
+
let workerFlag=null,operationIdArg=null;
|
|
92
|
+
if(rawArgs[cursor]==='--worker'){workerFlag='--worker';operationIdArg=rawArgs[cursor+1]??null;cursor+=2;}
|
|
93
|
+
if(cursor!==rawArgs.length) throw new Error('deferred slot operation arguments invalid');
|
|
94
|
+
if((explicitBridgeRoot===null)!==(explicitBridgeSha256===null)) throw new Error('bridge override requires exact root + SHA pair');
|
|
95
|
+
if(mode==='rollback'&&(explicitBridgeRoot||explicitBridgeSha256)) throw new Error('rollback does not accept bridge override');
|
|
96
|
+
if(workerFlag==='--worker'){
|
|
97
|
+
if(!/^[0-9a-f]{32}$/.test(operationIdArg??'')) throw new Error('deferred worker operation id invalid');
|
|
98
|
+
const statePath=path.join(evidenceRoot,`${operationIdArg}.json`);
|
|
99
|
+
await new Promise(resolve=>setTimeout(resolve,4000));
|
|
100
|
+
await atomicJson(statePath,{schema:'deadbyte.deferred-slot-operation.v1',operation_id:operationIdArg,mode,state:'running',started_at_utc:new Date().toISOString(),bridge_root:explicitBridgeRoot,bridge_script_sha256:explicitBridgeSha256});
|
|
101
|
+
try{
|
|
102
|
+
const args=await normalizedArgs(mode,value,{explicitBridgeRoot,explicitBridgeSha256});
|
|
103
|
+
const result=await runSlotUpdateCli(args,{stateRoot});
|
|
104
|
+
await atomicJson(statePath,{schema:'deadbyte.deferred-slot-operation.v1',operation_id:operationIdArg,mode,state:'completed',
|
|
105
|
+
completed_at_utc:new Date().toISOString(),receipt_path:result.receipt_path,receipt_sha256:result.receipt_sha256,
|
|
106
|
+
active_release:result.pointer.release_id,generation_root:result.pointer.generation_root,bridge_root:explicitBridgeRoot,bridge_script_sha256:explicitBridgeSha256});
|
|
107
|
+
}catch(error){
|
|
108
|
+
await atomicJson(statePath,{schema:'deadbyte.deferred-slot-operation.v1',operation_id:operationIdArg,mode,state:'failed',
|
|
109
|
+
completed_at_utc:new Date().toISOString(),error:String(error?.message??error),bridge_root:explicitBridgeRoot,bridge_script_sha256:explicitBridgeSha256});
|
|
110
|
+
process.exitCode=1;
|
|
111
|
+
}
|
|
112
|
+
}else{
|
|
113
|
+
const operationId=randomBytes(16).toString('hex');
|
|
114
|
+
const statePath=path.join(evidenceRoot,`${operationId}.json`);
|
|
115
|
+
await atomicJson(statePath,{schema:'deadbyte.deferred-slot-operation.v1',operation_id:operationId,mode,state:'scheduled',scheduled_at_utc:new Date().toISOString(),bridge_root:explicitBridgeRoot,bridge_script_sha256:explicitBridgeSha256});
|
|
116
|
+
const workerArgs=[fileURLToPath(import.meta.url),mode,value];
|
|
117
|
+
if(explicitBridgeRoot) workerArgs.push('--bridge-root',explicitBridgeRoot,'--bridge-script-sha256',explicitBridgeSha256);
|
|
118
|
+
workerArgs.push('--worker',operationId);
|
|
119
|
+
const child=spawn(process.execPath,workerArgs,{
|
|
120
|
+
cwd:packageRoot,detached:true,stdio:'ignore',windowsHide:true,env:{...process.env,DEADBYTE_STATE_ROOT:stateRoot}
|
|
121
|
+
});
|
|
122
|
+
child.unref();
|
|
123
|
+
console.log(JSON.stringify({status:'scheduled',operation_id:operationId,mode,state_path:statePath,execution_provider:'deadbyte_mcp',rdc_operation_count:0,bridge_root:explicitBridgeRoot,bridge_script_sha256:explicitBridgeSha256}));
|
|
124
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { createHash, createPublicKey, randomBytes } from 'node:crypto';
|
|
2
|
+
import { spawn } from 'node:child_process';
|
|
3
|
+
import { mkdir, readFile, realpath, writeFile } from 'node:fs/promises';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
import { parseActivePointer } from '../src/release-slot.mjs';
|
|
8
|
+
import { loadPowerShellDataFile, runSlotUpdateCli, verifySlotUpdateEnvelope } from '../src/runtime-update.mjs';
|
|
9
|
+
|
|
10
|
+
const HEX64=/^[0-9a-f]{64}$/;
|
|
11
|
+
const RECEIPT_ID=/^r27-[A-Za-z0-9-]+$/;
|
|
12
|
+
const here=path.dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const packageRoot=path.resolve(here,'..');
|
|
14
|
+
const stateRoot=path.resolve(process.env.DEADBYTE_STATE_ROOT||path.join(os.homedir(),'.deadbyte-mcp'));
|
|
15
|
+
const evidenceRoot=path.join(stateRoot,'evidence','deferred-slot-operations');
|
|
16
|
+
const sha256=bytes=>createHash('sha256').update(bytes).digest('hex');
|
|
17
|
+
const atomicJson=async(file,value)=>{
|
|
18
|
+
await mkdir(path.dirname(file),{recursive:true});
|
|
19
|
+
const temp=`${file}.${process.pid}.${randomBytes(4).toString('hex')}.tmp`;
|
|
20
|
+
await writeFile(temp,`${JSON.stringify(value,null,2)}\n`,{flag:'wx'});
|
|
21
|
+
await import('node:fs/promises').then(fs=>fs.rename(temp,file));
|
|
22
|
+
};
|
|
23
|
+
function activationArgs(manifestSha){
|
|
24
|
+
if(!HEX64.test(manifestSha??'')) throw new Error('activate requires one lowercase manifest SHA-256');
|
|
25
|
+
return ['--stage',packageRoot,'--development-root',packageRoot,'--expected-version','0.11.3',
|
|
26
|
+
'--expected-manifest',manifestSha,'--process-policy',path.join(packageRoot,'controller','deadbyte-process-policy.json'),
|
|
27
|
+
'--process-policy-sha256',null,'--semantic-lsp-config',path.join(packageRoot,'controller','deadbyte-semantic-lsp-config.json'),
|
|
28
|
+
'--semantic-lsp-config-sha256',null,'--enable-machine-fs','--enable-observation','--enable-autonomous-supervisor'];
|
|
29
|
+
}
|
|
30
|
+
async function bridgeBootstrapArgs(explicitBridgeRoot=null,explicitBridgeSha256=null){
|
|
31
|
+
const hasRoot=typeof explicitBridgeRoot==='string'&&explicitBridgeRoot.length>0;
|
|
32
|
+
const hasSha=typeof explicitBridgeSha256==='string'&&explicitBridgeSha256.length>0;
|
|
33
|
+
if(hasRoot!==hasSha) throw new Error('bridge override requires exact root + SHA pair');
|
|
34
|
+
let bridgeRootRaw,expectedSha256=null;
|
|
35
|
+
if(hasRoot){
|
|
36
|
+
if(!path.isAbsolute(explicitBridgeRoot)||!HEX64.test(explicitBridgeSha256)) throw new Error('bridge override requires exact root + SHA pair');
|
|
37
|
+
bridgeRootRaw=explicitBridgeRoot;expectedSha256=explicitBridgeSha256;
|
|
38
|
+
}else{
|
|
39
|
+
const pointer=parseActivePointer(await readFile(path.join(stateRoot,'active-release.json'),'utf8'));
|
|
40
|
+
const config=await loadPowerShellDataFile(pointer.config_path);
|
|
41
|
+
bridgeRootRaw=config?.Bridge?.WorkingDirectory;
|
|
42
|
+
if(typeof bridgeRootRaw!=='string'||!path.isAbsolute(bridgeRootRaw)) throw new Error('active controller Bridge.WorkingDirectory must be absolute');
|
|
43
|
+
}
|
|
44
|
+
const bridgeRoot=await realpath(path.resolve(bridgeRootRaw));
|
|
45
|
+
const packageFile=path.join(bridgeRoot,'package.json');
|
|
46
|
+
const bridgeScript=path.join(bridgeRoot,'src','bridge.mjs');
|
|
47
|
+
const pkg=JSON.parse(await readFile(packageFile,'utf8'));
|
|
48
|
+
if(pkg?.name!=='deadbyte-chatgpt-bridge') throw new Error('active Bridge package identity mismatch');
|
|
49
|
+
const scriptSha256=sha256(await readFile(bridgeScript));
|
|
50
|
+
if(expectedSha256&&scriptSha256!==expectedSha256) throw new Error('bridge override SHA-256 mismatch');
|
|
51
|
+
return ['--bridge-root',bridgeRoot,'--bridge-script-sha256',scriptSha256];
|
|
52
|
+
}
|
|
53
|
+
async function rollbackArgs(receiptPath){
|
|
54
|
+
const resolved=await realpath(path.resolve(receiptPath));
|
|
55
|
+
const allowed=path.join(stateRoot,'evidence','updates')+path.sep;
|
|
56
|
+
if(!resolved.startsWith(allowed)||path.basename(resolved).toLowerCase()!=='receipt.json'||!RECEIPT_ID.test(path.basename(path.dirname(resolved)))) {
|
|
57
|
+
throw new Error('rollback receipt must be one signed activation receipt under the update evidence store');
|
|
58
|
+
}
|
|
59
|
+
const envelope=JSON.parse(await readFile(resolved,'utf8'));
|
|
60
|
+
const publicKey=createPublicKey(await readFile(path.join(stateRoot,'trust','ed25519-public.pem')));
|
|
61
|
+
if(!verifySlotUpdateEnvelope(envelope,publicKey)||envelope.body?.rollback_performed!==false) throw new Error('rollback activation receipt verification failed');
|
|
62
|
+
const pointer=parseActivePointer(await readFile(path.join(stateRoot,'active-release.json'),'utf8'));
|
|
63
|
+
if(pointer.release_id!==envelope.body?.active_pointer?.release_id||pointer.generation_root!==envelope.body?.active_pointer?.generation_root) {
|
|
64
|
+
throw new Error('rollback receipt does not identify the active release generation');
|
|
65
|
+
}
|
|
66
|
+
return ['--rollback-receipt',resolved];
|
|
67
|
+
}
|
|
68
|
+
async function normalizedArgs(mode,value,{explicitBridgeRoot=null,explicitBridgeSha256=null}={}){
|
|
69
|
+
if(mode==='activate'){
|
|
70
|
+
const args=activationArgs(value);
|
|
71
|
+
args[args.indexOf('--process-policy-sha256')+1]=sha256(await readFile(path.join(packageRoot,'controller','deadbyte-process-policy.json')));
|
|
72
|
+
args[args.indexOf('--semantic-lsp-config-sha256')+1]=sha256(await readFile(path.join(packageRoot,'controller','deadbyte-semantic-lsp-config.json')));
|
|
73
|
+
args.push(...await bridgeBootstrapArgs(explicitBridgeRoot,explicitBridgeSha256));
|
|
74
|
+
return args;
|
|
75
|
+
}
|
|
76
|
+
if(mode==='rollback'){
|
|
77
|
+
if(explicitBridgeRoot||explicitBridgeSha256) throw new Error('rollback does not accept bridge override');
|
|
78
|
+
return rollbackArgs(value);
|
|
79
|
+
}
|
|
80
|
+
throw new Error("operation must be exactly 'activate' or 'rollback'");
|
|
81
|
+
}
|
|
82
|
+
const rawArgs=process.argv.slice(2);
|
|
83
|
+
const mode=rawArgs[0],value=rawArgs[1];
|
|
84
|
+
if(!value||!['activate','rollback'].includes(mode)) throw new Error('usage: deferred-slot-operation.mjs <activate manifest_sha256|rollback activation_receipt> [--bridge-root ABS --bridge-script-sha256 HEX64]');
|
|
85
|
+
let cursor=2,explicitBridgeRoot=null,explicitBridgeSha256=null;
|
|
86
|
+
if(rawArgs[cursor]==='--bridge-root'){
|
|
87
|
+
explicitBridgeRoot=rawArgs[cursor+1]??null;
|
|
88
|
+
if(rawArgs[cursor+2]!=='--bridge-script-sha256') throw new Error('bridge override requires exact root + SHA pair');
|
|
89
|
+
explicitBridgeSha256=rawArgs[cursor+3]??null;cursor+=4;
|
|
90
|
+
}
|
|
91
|
+
let workerFlag=null,operationIdArg=null;
|
|
92
|
+
if(rawArgs[cursor]==='--worker'){workerFlag='--worker';operationIdArg=rawArgs[cursor+1]??null;cursor+=2;}
|
|
93
|
+
if(cursor!==rawArgs.length) throw new Error('deferred slot operation arguments invalid');
|
|
94
|
+
if((explicitBridgeRoot===null)!==(explicitBridgeSha256===null)) throw new Error('bridge override requires exact root + SHA pair');
|
|
95
|
+
if(mode==='rollback'&&(explicitBridgeRoot||explicitBridgeSha256)) throw new Error('rollback does not accept bridge override');
|
|
96
|
+
if(workerFlag==='--worker'){
|
|
97
|
+
if(!/^[0-9a-f]{32}$/.test(operationIdArg??'')) throw new Error('deferred worker operation id invalid');
|
|
98
|
+
const statePath=path.join(evidenceRoot,`${operationIdArg}.json`);
|
|
99
|
+
await new Promise(resolve=>setTimeout(resolve,4000));
|
|
100
|
+
await atomicJson(statePath,{schema:'deadbyte.deferred-slot-operation.v1',operation_id:operationIdArg,mode,state:'running',started_at_utc:new Date().toISOString(),bridge_root:explicitBridgeRoot,bridge_script_sha256:explicitBridgeSha256});
|
|
101
|
+
try{
|
|
102
|
+
const args=await normalizedArgs(mode,value,{explicitBridgeRoot,explicitBridgeSha256});
|
|
103
|
+
const result=await runSlotUpdateCli(args,{stateRoot});
|
|
104
|
+
await atomicJson(statePath,{schema:'deadbyte.deferred-slot-operation.v1',operation_id:operationIdArg,mode,state:'completed',
|
|
105
|
+
completed_at_utc:new Date().toISOString(),receipt_path:result.receipt_path,receipt_sha256:result.receipt_sha256,
|
|
106
|
+
active_release:result.pointer.release_id,generation_root:result.pointer.generation_root,bridge_root:explicitBridgeRoot,bridge_script_sha256:explicitBridgeSha256});
|
|
107
|
+
}catch(error){
|
|
108
|
+
await atomicJson(statePath,{schema:'deadbyte.deferred-slot-operation.v1',operation_id:operationIdArg,mode,state:'failed',
|
|
109
|
+
completed_at_utc:new Date().toISOString(),error:String(error?.message??error),bridge_root:explicitBridgeRoot,bridge_script_sha256:explicitBridgeSha256});
|
|
110
|
+
process.exitCode=1;
|
|
111
|
+
}
|
|
112
|
+
}else{
|
|
113
|
+
const operationId=randomBytes(16).toString('hex');
|
|
114
|
+
const statePath=path.join(evidenceRoot,`${operationId}.json`);
|
|
115
|
+
await atomicJson(statePath,{schema:'deadbyte.deferred-slot-operation.v1',operation_id:operationId,mode,state:'scheduled',scheduled_at_utc:new Date().toISOString(),bridge_root:explicitBridgeRoot,bridge_script_sha256:explicitBridgeSha256});
|
|
116
|
+
const workerArgs=[fileURLToPath(import.meta.url),mode,value];
|
|
117
|
+
if(explicitBridgeRoot) workerArgs.push('--bridge-root',explicitBridgeRoot,'--bridge-script-sha256',explicitBridgeSha256);
|
|
118
|
+
workerArgs.push('--worker',operationId);
|
|
119
|
+
const child=spawn(process.execPath,workerArgs,{
|
|
120
|
+
cwd:packageRoot,detached:true,stdio:'ignore',windowsHide:true,env:{...process.env,DEADBYTE_STATE_ROOT:stateRoot}
|
|
121
|
+
});
|
|
122
|
+
child.unref();
|
|
123
|
+
console.log(JSON.stringify({status:'scheduled',operation_id:operationId,mode,state_path:statePath,execution_provider:'deadbyte_mcp',rdc_operation_count:0,bridge_root:explicitBridgeRoot,bridge_script_sha256:explicitBridgeSha256}));
|
|
124
|
+
}
|