deadbyte-mcp 0.15.32 → 0.15.34
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 +19 -11
- package/PROVENANCE.json +27 -22
- package/README.txt +22 -14
- package/RELEASE.json +29 -22
- package/SBOM.cdx.json +3 -3
- package/TEST-MATRIX.json +61 -33
- package/controller/deadbyte-process-policy.json +4 -4
- package/package.json +5 -3
- package/scripts/gate-windows-r56.ps1 +27 -0
- package/scripts/gate-windows-r57.ps1 +27 -0
- package/scripts/windows-gate-evidence-r56.mjs +81 -0
- package/scripts/windows-gate-evidence-r57.mjs +81 -0
- package/src/runtime-update.mjs +100 -9
- package/src/version.mjs +1 -1
- package/test/r49-windows-gate.test.mjs +19 -16
- package/test/r55-release-contract.test.mjs +5 -3
- package/test/r56-release-contract.test.mjs +65 -0
- package/test/r56-rollback-launcher-restore.test.mjs +103 -0
- package/test/r57-core-startup-race.test.mjs +85 -0
- package/test/r57-release-contract.test.mjs +65 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { readFile } from 'node:fs/promises';
|
|
4
|
+
import { pathToFileURL } from 'node:url';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
|
|
7
|
+
const target=process.env.R57_RUNTIME_UPDATE_PATH
|
|
8
|
+
? path.resolve(process.env.R57_RUNTIME_UPDATE_PATH)
|
|
9
|
+
: path.resolve(new URL('../src/runtime-update.mjs',import.meta.url).pathname.replace(/^\/(?:[A-Za-z]:)/,m=>m.slice(1)));
|
|
10
|
+
const runtimeUpdate=await import(pathToFileURL(target).href+'?r57='+Date.now());
|
|
11
|
+
const coreRoot='C:\\slot\\core';
|
|
12
|
+
const bridge={pid:20396,component:'bridge',script_path:'C:\\slot\\bridge\\src\\bridge.mjs',script_sha256:'a'.repeat(64)};
|
|
13
|
+
|
|
14
|
+
function core(pid=13456,parentPid=bridge.pid){
|
|
15
|
+
return {
|
|
16
|
+
ProcessId:pid,
|
|
17
|
+
ParentProcessId:parentPid,
|
|
18
|
+
CreationDate:'20261001011147.227000+000',
|
|
19
|
+
ExecutablePath:'C:\\Program Files\\nodejs\\node.exe',
|
|
20
|
+
CommandLine:`"C:\\Program Files\\nodejs\\node.exe" ${coreRoot}\\src\\mcp-server.mjs`
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
test('R57 exports bounded downstream core discovery',()=>{
|
|
25
|
+
assert.equal(typeof runtimeUpdate.waitForCoreProcess,'function');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test('R57 tolerates the observed ONLINE-to-core visibility race and returns the later exact child',async()=>{
|
|
29
|
+
const snapshots=[[],[],[core()]];
|
|
30
|
+
let calls=0;
|
|
31
|
+
let clock=0;
|
|
32
|
+
const found=await runtimeUpdate.waitForCoreProcess(coreRoot,bridge,{
|
|
33
|
+
timeoutMs:1000,
|
|
34
|
+
pollMs:100,
|
|
35
|
+
processProvider:()=>{ calls++; return snapshots.shift()??[core()]; },
|
|
36
|
+
sleepFn:async ms=>{ clock+=ms; },
|
|
37
|
+
nowFn:()=>clock
|
|
38
|
+
});
|
|
39
|
+
assert.equal(found.pid,13456);
|
|
40
|
+
assert.equal(found.parent_pid,bridge.pid);
|
|
41
|
+
assert.equal(found.identity_basis,'command_line');
|
|
42
|
+
assert.equal(calls,3);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test('R57 times out fail-closed when the core never appears',async()=>{
|
|
46
|
+
let calls=0;
|
|
47
|
+
let clock=0;
|
|
48
|
+
await assert.rejects(
|
|
49
|
+
runtimeUpdate.waitForCoreProcess(coreRoot,bridge,{
|
|
50
|
+
timeoutMs:250,
|
|
51
|
+
pollMs:100,
|
|
52
|
+
processProvider:()=>{ calls++; return []; },
|
|
53
|
+
sleepFn:async ms=>{ clock+=ms; },
|
|
54
|
+
nowFn:()=>clock
|
|
55
|
+
}),
|
|
56
|
+
/downstream core did not appear.*bridge 20396.*250ms/i
|
|
57
|
+
);
|
|
58
|
+
assert.ok(calls>=3);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test('R57 does not retry an ambiguous downstream core topology',async()=>{
|
|
62
|
+
let calls=0;
|
|
63
|
+
let clock=0;
|
|
64
|
+
await assert.rejects(
|
|
65
|
+
runtimeUpdate.waitForCoreProcess(coreRoot,bridge,{
|
|
66
|
+
timeoutMs:1000,
|
|
67
|
+
pollMs:100,
|
|
68
|
+
processProvider:()=>{ calls++; return [core(14001),core(14002)]; },
|
|
69
|
+
sleepFn:async ms=>{ clock+=ms; },
|
|
70
|
+
nowFn:()=>clock
|
|
71
|
+
}),
|
|
72
|
+
/expected one unambiguous downstream core.*children=2.*visible_matches=2/i
|
|
73
|
+
);
|
|
74
|
+
assert.equal(calls,1);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
test('R57 startAndVerify uses bounded core discovery after the ONLINE gate',async()=>{
|
|
78
|
+
const source=await readFile(target,'utf8');
|
|
79
|
+
const start=source.indexOf('async function startAndVerify');
|
|
80
|
+
const end=source.indexOf('async function stabilizeRuntime',start);
|
|
81
|
+
assert.ok(start>=0&&end>start);
|
|
82
|
+
const body=source.slice(start,end);
|
|
83
|
+
assert.match(body,/const core=await waitForCoreProcess\(ctx\.core_root,bridge\)/);
|
|
84
|
+
assert.doesNotMatch(body,/const core=coreProcess\(ctx\.core_root,bridge\)/);
|
|
85
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { readFile } from 'node:fs/promises';
|
|
4
|
+
|
|
5
|
+
const root=new URL('../',import.meta.url);
|
|
6
|
+
const read=rel=>readFile(new URL(rel,root),'utf8');
|
|
7
|
+
const json=rel=>read(rel).then(JSON.parse);
|
|
8
|
+
|
|
9
|
+
test('R57 release identity is coherent across package lock source metadata SBOM and gate',async()=>{
|
|
10
|
+
const [pkg,lock,release,provenance,matrix,sbom,versionSource]=await Promise.all([
|
|
11
|
+
json('package.json'),json('package-lock.json'),json('RELEASE.json'),json('PROVENANCE.json'),json('TEST-MATRIX.json'),json('SBOM.cdx.json'),read('src/version.mjs')
|
|
12
|
+
]);
|
|
13
|
+
assert.equal(pkg.version,'0.15.34');
|
|
14
|
+
assert.equal(lock.version,pkg.version);
|
|
15
|
+
assert.equal(lock.packages[''].version,pkg.version);
|
|
16
|
+
assert.match(versionSource,/DEADBYTE_VERSION = '0\.15\.34'/);
|
|
17
|
+
assert.equal(release.version,pkg.version);
|
|
18
|
+
assert.equal(release.train,'R57');
|
|
19
|
+
assert.equal(provenance.version,pkg.version);
|
|
20
|
+
assert.equal(matrix.version,pkg.version);
|
|
21
|
+
assert.equal(matrix.train,'R57');
|
|
22
|
+
assert.equal(sbom.metadata.component.version,pkg.version);
|
|
23
|
+
assert.equal(sbom.serialNumber,'urn:cdx:deadbyte-mcp:r57:0.15.34');
|
|
24
|
+
assert.match(pkg.scripts['gate:windows'],/gate-windows-r57\.ps1/);
|
|
25
|
+
assert.match(pkg.scripts['r57:focused:test'],/r57-core-startup-race\.test\.mjs/);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test('R57 source and runtime predecessor are exact active published 0.15.33',async()=>{
|
|
29
|
+
const [release,provenance]=await Promise.all([json('RELEASE.json'),json('PROVENANCE.json')]);
|
|
30
|
+
assert.equal(release.parent.version,'0.15.33');
|
|
31
|
+
assert.equal(release.parent.release_id,'v0.15.33-776a51cb916e28dd');
|
|
32
|
+
assert.equal(release.parent.manifest_sha256,'776a51cb916e28ddc3cbb2ecd3857151a0e73e0aaf83d4e6308e6674125dd01c');
|
|
33
|
+
assert.equal(release.parent.generation_manifest_sha256,'20ccc5e4bbf8470b61e0a6d2ad181dad5e8533da980ceba7749e1d6f48d9dbd3');
|
|
34
|
+
assert.equal(release.parent.tarball_sha256,'d84a6df0a972a43c50d5e31242d9217f59858b2d73c4284af296da76d2048e5f');
|
|
35
|
+
assert.equal(release.parent.activation_status,'ACTIVATED_ROLLBACK_CORE_DISCOVERY_RACE_OBSERVED');
|
|
36
|
+
assert.equal(release.source_predecessor.version,'0.15.33');
|
|
37
|
+
assert.deepEqual(release.runtime_predecessor,{
|
|
38
|
+
release_id:'v0.15.33-776a51cb916e28dd',
|
|
39
|
+
manifest_sha256:'776a51cb916e28ddc3cbb2ecd3857151a0e73e0aaf83d4e6308e6674125dd01c',
|
|
40
|
+
generation_manifest_sha256:'20ccc5e4bbf8470b61e0a6d2ad181dad5e8533da980ceba7749e1d6f48d9dbd3'
|
|
41
|
+
});
|
|
42
|
+
assert.equal(provenance.parent_manifest_sha256,release.parent.manifest_sha256);
|
|
43
|
+
assert.equal(provenance.parent_generation_manifest_sha256,release.parent.generation_manifest_sha256);
|
|
44
|
+
assert.deepEqual(provenance.runtime_predecessor,release.runtime_predecessor);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test('R57 records bounded zero-child retry RED to GREEN and preserves fail-closed controls',async()=>{
|
|
48
|
+
const [release,provenance,matrix]=await Promise.all([json('RELEASE.json'),json('PROVENANCE.json'),json('TEST-MATRIX.json')]);
|
|
49
|
+
assert.equal(release.hotfix.bounded_core_discovery_after_online,true);
|
|
50
|
+
assert.equal(release.hotfix.retry_only_missing_core,true);
|
|
51
|
+
assert.equal(release.hotfix.ambiguous_core_fail_closed,true);
|
|
52
|
+
assert.equal(release.hotfix.timeout_fail_closed,true);
|
|
53
|
+
assert.equal(release.hotfix.parent_rollback_reached_exact_0_15_32,true);
|
|
54
|
+
assert.equal(release.hotfix.parent_recovery_restored_exact_0_15_33,true);
|
|
55
|
+
assert.equal(release.hotfix.exact_parent_activation_receipt_sha256,'5da29c0c6e7858d518f1ece5e3509ac9ac9e2079f4117a83827a0d432018a4d0');
|
|
56
|
+
assert.equal(release.hotfix.observed_parent_rollback_state_sha256,'e4ffcdb92a997bb49f936dfc338701b81601ad0ded97284f5d615f4276786608');
|
|
57
|
+
assert.equal(release.hotfix.red_parent_0_15_33,'FAIL_5_OF_5');
|
|
58
|
+
assert.equal(release.hotfix.green_r57_candidate,'PASS_5_OF_5');
|
|
59
|
+
assert.equal(matrix.observed_pre_release_evidence.red_parent_0_15_33.receipt_sha256,'f12a8ea7593aa0754da45c074e613d7d3c530e8e95d83a9e8b669cfbc61d0306');
|
|
60
|
+
assert.equal(matrix.observed_pre_release_evidence.green_r57_candidate.receipt_sha256,'9b62291a4312df128e88749f1a0c88d3884d82fb651d7d389db4e14556a5f39f');
|
|
61
|
+
assert.equal(provenance.operator_override.four_hour_soak,'NOT_COMPLETED');
|
|
62
|
+
assert.equal(release.hotfix.stable_final_claim,false);
|
|
63
|
+
assert.equal(provenance.operator_override.stable_final_claim,false);
|
|
64
|
+
assert.equal(matrix.operator_override.stable_final_claim,false);
|
|
65
|
+
});
|