deadbyte-mcp 0.15.39 → 0.15.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/DEADBYTE-MCP.cmd +8 -4
  2. package/MANIFEST.SHA256 +99 -45
  3. package/PROVENANCE.json +90 -20
  4. package/README.txt +39 -18
  5. package/RELEASE.json +85 -20
  6. package/SBOM.cdx.json +2 -2
  7. package/TEST-MATRIX.json +134 -34
  8. package/bridge/package.json +1 -1
  9. package/controller/deadbyte-controller.ps1 +132 -12
  10. package/controller/deadbyte-process-policy.json +4 -4
  11. package/docs/R64-EVIDENCE.json +95 -0
  12. package/docs/R64-REFERENCE-GAP-MATRIX.json +98 -0
  13. package/docs/R64-SCOPE.json +41 -0
  14. package/docs/R65-AUTHORITY-CONTINUITY-DESIGN.json +27 -0
  15. package/docs/R65-REFERENCE-GAP-MATRIX.json +22 -0
  16. package/package.json +7 -4
  17. package/scripts/deploy-r48.mjs +123 -7
  18. package/scripts/gate-windows-r63-prepublish.ps1 +45 -0
  19. package/scripts/gate-windows-r64-prepublish.ps1 +68 -0
  20. package/scripts/gate-windows-r65-prepublish.ps1 +65 -0
  21. package/scripts/npm-publication-r65.mjs +139 -0
  22. package/scripts/npm-release-r48.mjs +62 -37
  23. package/scripts/r64-predecessor-reproducer.mjs +32 -0
  24. package/scripts/r64-read-benchmark.mjs +84 -0
  25. package/scripts/r65-canonical-full.mjs +45 -0
  26. package/scripts/r65-focused.mjs +37 -0
  27. package/scripts/verify-r65-parent-source.mjs +75 -0
  28. package/src/activation-continuity-engine-r65.mjs +225 -0
  29. package/src/activation-lock-r65.mjs +155 -0
  30. package/src/activation-preflight-r65.mjs +197 -0
  31. package/src/authority-continuity-r65.mjs +541 -0
  32. package/src/authority-epoch-cli-r65.mjs +10 -0
  33. package/src/autonomous-policy.mjs +7 -3
  34. package/src/coding-plane.mjs +12 -3
  35. package/src/compact-gateway-mcp-tools.mjs +1 -1
  36. package/src/deadbyte-cli.mjs +16 -2
  37. package/src/desktop-policy-r40.mjs +6 -3
  38. package/src/doctor-transactions-r58.mjs +1 -1
  39. package/src/host-plane.mjs +9 -3
  40. package/src/machine-fs-mcp-tools.mjs +1 -1
  41. package/src/machine-fs.mjs +7 -4
  42. package/src/process-policy.mjs +7 -4
  43. package/src/remote-authority.mjs +20 -1
  44. package/src/runtime-update.mjs +15 -5
  45. package/src/version.mjs +1 -1
  46. package/test/audit-context.test.mjs +15 -4
  47. package/test/autonomous-local-supervisor.test.mjs +7 -6
  48. package/test/autonomous-supervisor-integration.test.mjs +8 -7
  49. package/test/capability-resolver.test.mjs +11 -5
  50. package/test/codex-autonomous-r44.test.mjs +7 -6
  51. package/test/coding-observation.test.mjs +4 -3
  52. package/test/commander-real-parity-r47.test.mjs +5 -4
  53. package/test/commander-torture-r47.test.mjs +5 -4
  54. package/test/desktop-policy-r40.test.mjs +6 -4
  55. package/test/desktop-runtime-r40.test.mjs +8 -3
  56. package/test/host-inline-r45.test.mjs +4 -3
  57. package/test/machine-fs-runtime.test.mjs +4 -3
  58. package/test/process-longrun-r36.test.mjs +3 -2
  59. package/test/process-policy.test.mjs +10 -6
  60. package/test/process-runtime.test.mjs +9 -6
  61. package/test/r52-host-revocation.test.mjs +1 -0
  62. package/test/r59-tool-surface-compat.test.mjs +14 -4
  63. package/test/r62-release-contract.test.mjs +2 -1
  64. package/test/r63-one-shot-coherence.test.mjs +38 -0
  65. package/test/r63-release-contract.test.mjs +59 -0
  66. package/test/r64-machine-fs-large-read.test.mjs +136 -0
  67. package/test/r64-release-contract.test.mjs +52 -0
  68. package/test/r65-activation-lock-recovery.test.mjs +72 -0
  69. package/test/r65-activation-lock.test.mjs +59 -0
  70. package/test/r65-activation-orchestration.test.mjs +179 -0
  71. package/test/r65-activation-preflight.test.mjs +35 -0
  72. package/test/r65-authority-continuity-decision.test.mjs +58 -0
  73. package/test/r65-authority-durable-policy-binding.test.mjs +34 -0
  74. package/test/r65-authority-epoch-cli.test.mjs +125 -0
  75. package/test/r65-authority-epoch-races.test.mjs +87 -0
  76. package/test/r65-authority-epoch-recovery.test.mjs +82 -0
  77. package/test/r65-authority-epoch-store.test.mjs +94 -0
  78. package/test/r65-authority-fixture.mjs +41 -0
  79. package/test/r65-authority-grant-capture.test.mjs +37 -0
  80. package/test/r65-authority-observation-epoch.test.mjs +25 -0
  81. package/test/r65-authority-policy-envelope.test.mjs +46 -0
  82. package/test/r65-authority-restored-safe.test.mjs +75 -0
  83. package/test/r65-authority-runtime-epoch.test.mjs +115 -0
  84. package/test/r65-authority-runtime-policy-binding.test.mjs +29 -0
  85. package/test/r65-authority-test-trust.mjs +20 -0
  86. package/test/r65-cli-invocation.test.mjs +38 -0
  87. package/test/r65-controller-authority-epoch-live.test.mjs +100 -0
  88. package/test/r65-controller-authority-epoch.test.mjs +37 -0
  89. package/test/r65-deploy-preflight.test.mjs +55 -0
  90. package/test/r65-epoch-native-activation-integration.test.mjs +141 -0
  91. package/test/r65-epoch-native-continuity-engine.test.mjs +112 -0
  92. package/test/r65-epoch-native-cross-plane.test.mjs +95 -0
  93. package/test/r65-legacy-authority-migration.test.mjs +63 -0
  94. package/test/r65-legacy-auto-restore-rejection.test.mjs +17 -0
  95. package/test/r65-npm-publication.test.mjs +114 -0
  96. package/test/r65-parent-source-verifier.test.mjs +63 -0
  97. package/test/r65-release-contract.test.mjs +74 -0
  98. package/test/r65-transaction-precondition.test.mjs +36 -0
  99. package/test/remote-session-cli.test.mjs +13 -11
  100. package/test/standing-grants.test.mjs +20 -4
@@ -1,5 +1,6 @@
1
1
  import test from 'node:test';
2
2
  import assert from 'node:assert/strict';
3
+ import { createHash } from 'node:crypto';
3
4
  import { mkdtemp, mkdir, readFile, rm, writeFile } from 'node:fs/promises';
4
5
  import os from 'node:os';
5
6
  import path from 'node:path';
@@ -181,7 +182,7 @@ winTest('remote refuses READY when public signed MCP execution probe fails',asyn
181
182
  try{
182
183
  child=spawn(process.execPath,[cliPath,'remote'],{env:fx.env,stdio:['pipe','pipe','pipe'],windowsHide:true});
183
184
  const output=await collect(child);
184
- const ended=await Promise.race([output.closed,sleep(6500).then(()=>({timeout:true}))]);
185
+ const ended=await Promise.race([output.closed,sleep(12000).then(()=>({timeout:true}))]);
185
186
  assert.equal(ended.timeout,undefined,'remote did not fail closed after execution probe failure');
186
187
  assert.notEqual(ended.code,0);
187
188
  assert.doesNotMatch(output.stdout,/\[READY\]|\[OK\] ONLINE/);
@@ -200,8 +201,8 @@ winTest('remote refuses READY when controller snapshot lies about Host enforceme
200
201
  try{
201
202
  child=spawn(process.execPath,[cliPath,'remote'],{env:fx.env,stdio:['pipe','pipe','pipe'],windowsHide:true});
202
203
  const output=await collect(child);
203
- const ended=await Promise.race([output.closed,sleep(6500).then(()=>({timeout:true}))]);
204
- assert.equal(ended.timeout,undefined,'remote did not reject split authority truth');
204
+ const ended=await Promise.race([output.closed,sleep(12000).then(()=>({timeout:true}))]);
205
+ assert.equal(ended.timeout,undefined,`remote did not reject split authority truth; stdout=${output.stdout.slice(-1200)} stderr=${output.stderr.slice(-1200)} trace=${(await traceCommands(fx.trace)).join(',')}`);
205
206
  assert.notEqual(ended.code,0);
206
207
  assert.doesNotMatch(output.stdout,/\[READY\]|\[OK\] ONLINE/);
207
208
  assert.match(output.stderr,/machinetest|enforcement/i);
@@ -393,7 +394,7 @@ winTest('remote --resume replays sanitized tool-call and terminal result events
393
394
  const liveIndex=secondOutput.stdout.indexOf('[LOG] Human live timeline');
394
395
  assert.ok(callReplayIndex>=0&&resultReplayIndex>callReplayIndex&&liveIndex>resultReplayIndex,'resume ordering must be call -> result -> live tail');
395
396
  second.stdin.end();
396
- const secondEnded=await Promise.race([secondOutput.closed,sleep(6000).then(()=>({timeout:true}))]);
397
+ const secondEnded=await Promise.race([secondOutput.closed,sleep(12000).then(()=>({timeout:true}))]);
397
398
  assert.equal(secondEnded.timeout,undefined);
398
399
  assert.equal(secondEnded.code,0,secondOutput.stderr);
399
400
  }finally{
@@ -501,8 +502,8 @@ winTest('bare remote rolls back authority and parks if one plane fails to arm',a
501
502
  try{
502
503
  const child=spawn(process.execPath,[cliPath,'remote'],{env:fx.env,stdio:['ignore','pipe','pipe'],windowsHide:true});
503
504
  const output=await collect(child);
504
- const ended=await Promise.race([output.closed,sleep(6000).then(()=>({timeout:true}))]);
505
- assert.equal(ended.timeout,undefined,'failed startup did not terminate');
505
+ const ended=await Promise.race([output.closed,sleep(12000).then(()=>({timeout:true}))]);
506
+ assert.equal(ended.timeout,undefined,`failed startup did not terminate; stdout=${output.stdout.slice(-1200)} stderr=${output.stderr.slice(-1200)} trace=${(await traceCommands(fx.trace)).join(',')}`);
506
507
  assert.notEqual(ended.code,0);
507
508
  const commands=await traceCommands(fx.trace);
508
509
  assert.deepEqual(commands.slice(0,6),['status','start','status','status','armprocess','armcoding']);
@@ -645,13 +646,14 @@ winTest('explicit remote status remains a one-shot controller command',async()=>
645
646
  }finally{await rm(fx.dir,{recursive:true,force:true});}
646
647
  });
647
648
 
648
- winTest('explicit remote status reports CLI package and active runtime VERSION SKEW',async()=>{
649
+ winTest('explicit remote status keeps the coherent runtime one-shot and silent',async()=>{
649
650
  const fx=await fixture({statusOnline:true});
650
651
  try{
651
- const manifest='1'.repeat(64),generation='2'.repeat(64),launcher='3'.repeat(64);
652
+ const manifest=createHash('sha256').update(await readFile(path.join(root,'MANIFEST.SHA256'))).digest('hex');
653
+ const generation='2'.repeat(64),launcher='3'.repeat(64);
652
654
  await writeFile(path.join(fx.state,'active-release.json'),JSON.stringify({
653
- schema:'deadbyte.active-release.v1',release_id:`v0.15.16-${manifest.slice(0,16)}`,version:'0.15.16',manifest_sha256:manifest,
654
- release_root:'C:/deadbyte/releases/0.15.16',generation_root:'C:/deadbyte/generations/0.15.16',generation_manifest_sha256:generation,
655
+ schema:'deadbyte.active-release.v1',release_id:`v${DEADBYTE_VERSION}-${manifest.slice(0,16)}`,version:DEADBYTE_VERSION,manifest_sha256:manifest,
656
+ release_root:'C:/deadbyte/releases/current',generation_root:'C:/deadbyte/generations/current',generation_manifest_sha256:generation,
655
657
  launcher_sha256:launcher,config_path:'C:/deadbyte/config.psd1'
656
658
  }),'utf8');
657
659
  const child=spawn(process.execPath,[cliPath,'remote','status'],{env:fx.env,stdio:['ignore','pipe','pipe'],windowsHide:true});
@@ -659,7 +661,7 @@ winTest('explicit remote status reports CLI package and active runtime VERSION S
659
661
  const ended=await Promise.race([output.closed,sleep(6000).then(()=>({timeout:true}))]);
660
662
  assert.equal(ended.timeout,undefined);
661
663
  assert.equal(ended.code,0,output.stderr);
662
- assert.ok(output.stderr.includes(`VERSION SKEW: CLI package ${DEADBYTE_VERSION}; active runtime 0.15.16`),output.stderr);
664
+ assert.doesNotMatch(output.stderr,/VERSION SKEW/);
663
665
  assert.deepEqual(await traceCommands(fx.trace),['status']);
664
666
  }finally{await rm(fx.dir,{recursive:true,force:true});}
665
667
  });
@@ -1,23 +1,26 @@
1
1
  import test from 'node:test';
2
2
  import assert from 'node:assert/strict';
3
- import { mkdtemp, mkdir, writeFile } from 'node:fs/promises';
3
+ import { mkdtemp, mkdir, readFile, writeFile } from 'node:fs/promises';
4
4
  import os from 'node:os';
5
5
  import path from 'node:path';
6
6
  import { loadCodingPolicy, codingSessionStatus } from '../src/coding-plane.mjs';
7
7
  import { assertAutonomousArmed, loadAutonomousPolicy, autonomousSessionStatus, recheckAutonomousAuthority } from '../src/autonomous-policy.mjs';
8
8
  import { loadHostPolicy, assertHostArmed } from '../src/host-plane.mjs';
9
9
  import { createHash } from 'node:crypto';
10
+ import { createAuthorityEpochStore } from '../src/authority-continuity-r65.mjs';
11
+ import { prepareAuthorityTestTrust } from './r65-authority-test-trust.mjs';
10
12
 
11
13
  const sha = bytes => createHash('sha256').update(bytes).digest('hex');
12
14
  const farFuture = new Date('2099-01-01T00:00:00Z');
13
15
 
14
16
  async function fixture() {
15
17
  const root = await mkdtemp(path.join(os.tmpdir(), 'deadbyte-standing-'));
18
+ await prepareAuthorityTestTrust(root);
16
19
  const project = path.join(root, 'project');
17
20
  await mkdir(project);
18
21
  const codingPath = path.join(root, 'coding.json');
19
22
  await writeFile(codingPath, JSON.stringify({ schema:'deadbyte.coding-policy.v1', enabled:true,
20
- lease_file:path.join(root,'coding-grant.json'), evidence_dir:path.join(root,'coding-evidence'),
23
+ lease_file:path.join(root,'runtime','coding-grant.json'), evidence_dir:path.join(root,'coding-evidence'),
21
24
  roots:{ project:{ path:project, read:true, write:true, exec:false, deny_paths:[] } }, commands:{} }));
22
25
  const coding = await loadCodingPolicy(codingPath);
23
26
  return { root, project, coding, codingPath };
@@ -27,6 +30,10 @@ test('coding standing grant remains armed until explicit revocation', async () =
27
30
  await writeFile(coding.lease_file, JSON.stringify({ schema:'deadbyte.coding-grant.v2',
28
31
  policy_sha256:coding.policy_sha256, instance_nonce:'a'.repeat(64), root_ids:['project'],
29
32
  granted_at_utc:'2026-09-04T00:00:00Z' }));
33
+ const codingBytes=await readFile(coding.lease_file);
34
+ await createAuthorityEpochStore({runtimeDir:path.dirname(coding.lease_file),policyBytes:await readFile(coding.policy_path)}).append({
35
+ plane:'coding',action:'grant',grantBytes:codingBytes,grantInstanceNonce:'a'.repeat(64),updateId:null
36
+ });
30
37
  const status = await codingSessionStatus(coding, farFuture);
31
38
  assert.equal(status.armed, true);
32
39
  assert.equal(status.reason, 'standing-grant');
@@ -37,13 +44,17 @@ test('autonomous standing grant remains armed until explicit revocation', async
37
44
  const { root, coding } = await fixture();
38
45
  const policyPath = path.join(root, 'autonomous.json');
39
46
  await writeFile(policyPath, JSON.stringify({ schema:'deadbyte.autonomous-policy.v1', enabled:true,
40
- lease_file:path.join(root,'autonomous-grant.json'), evidence_dir:path.join(root,'autonomous-evidence'),
47
+ lease_file:path.join(root,'runtime','autonomous-grant.json'), evidence_dir:path.join(root,'autonomous-evidence'),
41
48
  coding_policy_sha256:coding.policy_sha256, root_ids:['project'], planner:{backend:'client_sampling'},
42
49
  limits:{max_iterations:4,max_mutations:4,max_wall_ms:null}, profiles:{} }));
43
50
  const policy = await loadAutonomousPolicy(policyPath, coding);
44
51
  await writeFile(policy.lease_file, JSON.stringify({ schema:'deadbyte.autonomous-grant.v2',
45
52
  policy_sha256:policy.policy_sha256, coding_policy_sha256:coding.policy_sha256,
46
53
  instance_nonce:'b'.repeat(64), root_ids:['project'], granted_at_utc:'2026-09-04T00:00:00Z' }));
54
+ const autonomousBytes=await readFile(policy.lease_file);
55
+ await createAuthorityEpochStore({runtimeDir:path.dirname(policy.lease_file),policyBytes:await readFile(policy.policy_path)}).append({
56
+ plane:'autonomous',action:'grant',grantBytes:autonomousBytes,grantInstanceNonce:'b'.repeat(64),updateId:null
57
+ });
47
58
  const status = await autonomousSessionStatus(policy, farFuture);
48
59
  assert.equal(status.armed, true);
49
60
  assert.equal(status.reason, 'standing-grant');
@@ -55,15 +66,20 @@ test('autonomous standing grant remains armed until explicit revocation', async
55
66
  });
56
67
  test('host standing grant remains armed until explicit revocation', async () => {
57
68
  const root = await mkdtemp(path.join(os.tmpdir(), 'deadbyte-host-standing-'));
69
+ await prepareAuthorityTestTrust(root);
58
70
  const project = path.join(root, 'project');
59
71
  await mkdir(project);
60
72
  const policyPath = path.join(root, 'host.json');
61
73
  await writeFile(policyPath, JSON.stringify({ schema:'deadbyte.host-policy.v1', enabled:true,
62
- arm_file:path.join(root,'host-grant.json'), roots:{ project:{path:project,read:true,write:true,exec:false} },
74
+ arm_file:path.join(root,'runtime','host-grant.json'), roots:{ project:{path:project,read:true,write:true,exec:false} },
63
75
  commands:{} }));
64
76
  const policy = await loadHostPolicy(policyPath);
65
77
  await writeFile(policy.arm_file, JSON.stringify({ schema:'deadbyte.host-grant.v2',
66
78
  policy_sha256:policy.policy_sha256, instance_nonce:'c'.repeat(64), granted_at_utc:'2026-09-04T00:00:00Z' }));
79
+ const hostBytes=await readFile(policy.arm_file);
80
+ await createAuthorityEpochStore({runtimeDir:path.dirname(policy.arm_file),policyBytes:await readFile(policy.policy_path)}).append({
81
+ plane:'host',action:'grant',grantBytes:hostBytes,grantInstanceNonce:'c'.repeat(64),updateId:null
82
+ });
67
83
  const status = await assertHostArmed(policy, farFuture);
68
84
  assert.equal(status.standing, true);
69
85
  assert.equal(status.remaining_ms, null);