deadbyte-mcp 0.15.21 → 0.15.22
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 +31 -22
- package/PROVENANCE.json +10 -10
- package/README.txt +7 -7
- package/RELEASE.json +45 -16
- package/SBOM.cdx.json +33 -7
- package/TEST-MATRIX.json +85 -18
- package/bin/deadbyte-hardware-observer-r45.exe +0 -0
- package/bin/deadbyte-hardware-observer-r45.obj +0 -0
- package/docs/R48-FULL-TOOL-CATALOG.json +124 -0
- package/native/deadbyte-hardware-observer.cpp +535 -12
- package/package.json +94 -93
- package/scripts/build-hardware-r45.ps1 +19 -0
- package/scripts/full-regression-r48-batch.mjs +27 -0
- package/scripts/promote-local-c-generation.ps1 +217 -0
- package/scripts/promote-local-d-generation.ps1 +217 -0
- package/scripts/test-r48-post-bump.ps1 +8 -0
- package/scripts/test-r48-windows-observation.ps1 +8 -0
- package/src/capability-ledger.mjs +7 -0
- package/src/capability-resolver.mjs +7 -0
- package/src/compact-gateway-mcp-tools.mjs +16 -2
- package/src/machine-fs.mjs +16 -3
- package/src/observation-mcp-tools.mjs +13 -1
- package/src/observation-output-contracts.mjs +8 -0
- package/src/observation-runtime.mjs +54 -2
- package/src/version.mjs +1 -1
- package/test/full-max-catalog-r47.test.mjs +1 -1
- package/test/full-max-catalog-r48.test.mjs +78 -0
- package/test/machine-fs-runtime.test.mjs +28 -3
- package/test/observation-mcp-tools.test.mjs +4 -3
- package/test/r48-release-contract.test.mjs +18 -14
- package/test/windows-observation-r48.test.mjs +63 -0
- package/test/windows-observation-surface-r48.test.mjs +70 -0
|
@@ -6,29 +6,33 @@ import { DEADBYTE_VERSION } from '../src/version.mjs';
|
|
|
6
6
|
const root=new URL('../',import.meta.url);
|
|
7
7
|
const read=rel=>readFile(new URL(rel,root),'utf8');
|
|
8
8
|
|
|
9
|
-
test('R48 successor
|
|
9
|
+
test('R48 0.15.22 successor binds active 0.15.21 parent and native Windows observation release evidence',async()=>{
|
|
10
10
|
const [pkg,lock,release,provenance]=await Promise.all([
|
|
11
11
|
read('package.json').then(JSON.parse),
|
|
12
12
|
read('package-lock.json').then(JSON.parse),
|
|
13
13
|
read('RELEASE.json').then(JSON.parse),
|
|
14
14
|
read('PROVENANCE.json').then(JSON.parse)
|
|
15
15
|
]);
|
|
16
|
-
assert.equal(pkg.version,'0.15.
|
|
17
|
-
assert.equal(lock.version,'0.15.
|
|
18
|
-
assert.equal(lock.packages[''].version,'0.15.
|
|
19
|
-
assert.equal(DEADBYTE_VERSION,'0.15.
|
|
20
|
-
assert.equal(release.version,'0.15.
|
|
21
|
-
assert.equal(provenance.version,'0.15.
|
|
16
|
+
assert.equal(pkg.version,'0.15.22');
|
|
17
|
+
assert.equal(lock.version,'0.15.22');
|
|
18
|
+
assert.equal(lock.packages[''].version,'0.15.22');
|
|
19
|
+
assert.equal(DEADBYTE_VERSION,'0.15.22');
|
|
20
|
+
assert.equal(release.version,'0.15.22');
|
|
21
|
+
assert.equal(provenance.version,'0.15.22');
|
|
22
22
|
assert.equal(release.train,'R48');
|
|
23
|
-
assert.equal(release.label,'
|
|
24
|
-
assert.equal(release.parent.release_id,'v0.15.
|
|
25
|
-
assert.equal(release.parent.manifest_sha256,'
|
|
26
|
-
assert.equal(release.parent.generation_manifest_sha256,'
|
|
27
|
-
assert.equal(release.source_predecessor.version,'0.15.
|
|
28
|
-
assert.equal(release.source_predecessor.tarball_sha256,'
|
|
29
|
-
assert.equal(release.source_predecessor.manifest_file_sha256,'
|
|
23
|
+
assert.equal(release.label,'NATIVE WINDOWS OBSERVATION + MACHINE FS RESILIENCE');
|
|
24
|
+
assert.equal(release.parent.release_id,'v0.15.21-7c2735e0b1c6cc8d');
|
|
25
|
+
assert.equal(release.parent.manifest_sha256,'7c2735e0b1c6cc8dac6581c47b6b557d8d0157a324b67efd4df058e67cdb289f');
|
|
26
|
+
assert.equal(release.parent.generation_manifest_sha256,'b376e7fc450f44edddb0d0e1d596014c463f603e4917c56a68906b7f66f99dc7');
|
|
27
|
+
assert.equal(release.source_predecessor.version,'0.15.21');
|
|
28
|
+
assert.equal(release.source_predecessor.tarball_sha256,'3439f5f4435632e4cde385a6937e3e3d2ffcfb777295dd56aafbf3b036be7493');
|
|
29
|
+
assert.equal(release.source_predecessor.manifest_file_sha256,'7c2735e0b1c6cc8dac6581c47b6b557d8d0157a324b67efd4df058e67cdb289f');
|
|
30
30
|
assert.equal(release.source_predecessor.reference_server_sha256,'dfc303bb7dd2e8d01debac50fc43bb8644d00089bffdf2887e149497cff8b305');
|
|
31
31
|
assert.equal(release.source_predecessor.reference_schemas_sha256,'f342345e34e48769dabaefe1b932f09d41e2e207b422f7794a15ee50ffa8f140');
|
|
32
|
+
assert.equal(release.capabilities.full_tool_count,116);
|
|
33
|
+
assert.equal(release.capabilities.full_tool_catalog.path,'docs/R48-FULL-TOOL-CATALOG.json');
|
|
34
|
+
assert.deepEqual(release.capabilities.windows_queries,['registry','services','drivers','sockets','volumes','usb','wsl']);
|
|
35
|
+
assert.equal(release.capabilities.machine_fs_list_entry_fault_isolation,true);
|
|
32
36
|
assert.equal(release.capabilities.capability_manifest_authority_truth,true);
|
|
33
37
|
assert.equal(release.capabilities.capability_manifest_host_grant_truth,true);
|
|
34
38
|
assert.equal(provenance.parent_release_id,release.parent.release_id);
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { mkdtemp, mkdir, writeFile } from 'node:fs/promises';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { generateTrustKeypair } from '../src/trust.mjs';
|
|
7
|
+
import { loadCodingPolicy } from '../src/coding-plane.mjs';
|
|
8
|
+
import { createObservationRuntime, verifyObservationReceiptFile } from '../src/observation-runtime.mjs';
|
|
9
|
+
|
|
10
|
+
async function fixture(){
|
|
11
|
+
const root=await mkdtemp(path.join(os.tmpdir(),'deadbyte-windows-query-r48-'));
|
|
12
|
+
const project=path.join(root,'project');await mkdir(project);
|
|
13
|
+
const policyPath=path.join(root,'coding-policy.json');
|
|
14
|
+
await writeFile(policyPath,JSON.stringify({schema:'deadbyte.coding-policy.v1',enabled:true,
|
|
15
|
+
lease_file:path.join(root,'coding-grant.json'),evidence_dir:path.join(root,'evidence'),
|
|
16
|
+
roots:{project:{path:project,read:true,write:false,exec:false,deny_paths:[]}},commands:{},
|
|
17
|
+
max_read_bytes:65536,max_write_bytes:65536}));
|
|
18
|
+
const policy=await loadCodingPolicy(policyPath);
|
|
19
|
+
const keys=await generateTrustKeypair({privateKeyPath:path.join(root,'private.pem'),publicKeyPath:path.join(root,'public.pem')});
|
|
20
|
+
const calls=[];
|
|
21
|
+
const windowsSnapshotProvider=async args=>{
|
|
22
|
+
calls.push(args);
|
|
23
|
+
return {schema:'deadbyte.windows-query.v1',query:args.query,data:{query:args.query,fixture:true},observer_sha256:'e'.repeat(64)};
|
|
24
|
+
};
|
|
25
|
+
const runtime=createObservationRuntime({policy,signingKeyPath:keys.privateKeyPath,verifyKeyPath:keys.publicKeyPath,
|
|
26
|
+
stateRoot:root,processSnapshotProvider:async()=>[],systemSnapshotProvider:async()=>({hostname:'x',platform:'win32',architecture:'x64',
|
|
27
|
+
uptime_seconds:1,total_memory_bytes:1,free_memory_bytes:1,cpu_count:1,load_average:[0,0,0]}),
|
|
28
|
+
ownedRuntimePidProvider:async()=>new Set(),hardwareSnapshotProvider:async query=>({schema:'deadbyte.hardware-query.v1',query,data:{fixture:true}}),
|
|
29
|
+
windowsSnapshotProvider});
|
|
30
|
+
return {root,policy,keys,runtime,calls};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
test('R48 typed Windows queries are read-only signed native observations',async()=>{
|
|
34
|
+
const f=await fixture();
|
|
35
|
+
assert.equal(typeof f.runtime.windowsQuery,'function','windowsQuery runtime method missing');
|
|
36
|
+
const requests=[
|
|
37
|
+
{query:'registry',hive:'HKLM',key:'SYSTEM\\CurrentControlSet\\Control',value:null},
|
|
38
|
+
{query:'services'},{query:'drivers'},{query:'sockets'},{query:'volumes'},{query:'usb'},{query:'wsl'}
|
|
39
|
+
];
|
|
40
|
+
for(const request of requests){
|
|
41
|
+
const out=await f.runtime.windowsQuery(request);
|
|
42
|
+
assert.equal(out.status,'ok');
|
|
43
|
+
assert.equal(out.query,request.query);
|
|
44
|
+
assert.equal(out.data.query,request.query);
|
|
45
|
+
assert.match(out.observer_sha256,/^[0-9a-f]{64}$/);
|
|
46
|
+
assert.match(out.request_sha256,/^[0-9a-f]{64}$/);
|
|
47
|
+
assert.match(out.result_head_sha256,/^[0-9a-f]{64}$/);
|
|
48
|
+
assert.match(out.receipt_id,/^[0-9a-f]{24}$/);
|
|
49
|
+
const verified=await verifyObservationReceiptFile({policy:f.policy,verifyKeyPath:f.keys.publicKeyPath,receiptId:out.receipt_id});
|
|
50
|
+
assert.equal(verified.ok,true);
|
|
51
|
+
assert.equal(verified.kind,'machine_windows_query');
|
|
52
|
+
}
|
|
53
|
+
assert.deepEqual(f.calls,requests);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test('R48 Windows query validation rejects arbitrary commands and malformed registry selectors before dispatch',async()=>{
|
|
57
|
+
const f=await fixture();
|
|
58
|
+
assert.equal(typeof f.runtime.windowsQuery,'function','windowsQuery runtime method missing');
|
|
59
|
+
await assert.rejects(()=>f.runtime.windowsQuery({query:'powershell',command:'Get-Service'}),/windows query/i);
|
|
60
|
+
await assert.rejects(()=>f.runtime.windowsQuery({query:'registry',hive:'HKCR',key:'x'}),/registry hive/i);
|
|
61
|
+
await assert.rejects(()=>f.runtime.windowsQuery({query:'registry',hive:'HKLM',key:''}),/registry key/i);
|
|
62
|
+
assert.deepEqual(f.calls,[]);
|
|
63
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { machineObserveInputSchema, registerCompactGatewayTools } from '../src/compact-gateway-mcp-tools.mjs';
|
|
4
|
+
import { registerObservationTools } from '../src/observation-mcp-tools.mjs';
|
|
5
|
+
import { R36_CAPABILITY_LEDGER } from '../src/capability-ledger.mjs';
|
|
6
|
+
|
|
7
|
+
const fakeServer=()=>{
|
|
8
|
+
const tools=new Map();
|
|
9
|
+
return {tools,registerTool(name,spec,handler){if(tools.has(name))throw new Error('duplicate '+name);tools.set(name,{spec,handler});}};
|
|
10
|
+
};
|
|
11
|
+
const ledger={schema:'deadbyte.capability-ledger.v1',entries:[],ledger_sha256:'0'.repeat(64)};
|
|
12
|
+
const evidence=query=>({status:'ok',observed_at_utc:new Date(0).toISOString(),query,data:{query},observer_sha256:'e'.repeat(64),
|
|
13
|
+
request_sha256:'b'.repeat(64),result_head_sha256:'c'.repeat(64),receipt_id:'a'.repeat(24),receipt_sha256:'d'.repeat(64)});
|
|
14
|
+
|
|
15
|
+
test('R48 compact machine_observe exposes seven strict Windows native operations without generic command dispatch',()=>{
|
|
16
|
+
const valid=[
|
|
17
|
+
{op:'registry_query',hive:'HKLM',key:'SYSTEM\\CurrentControlSet\\Control',value:null},
|
|
18
|
+
{op:'service_list'},{op:'driver_list'},{op:'socket_list'},{op:'volume_list'},{op:'usb_list'},{op:'wsl_list'}
|
|
19
|
+
];
|
|
20
|
+
for(const input of valid) assert.equal(machineObserveInputSchema.safeParse(input).success,true,JSON.stringify(input));
|
|
21
|
+
assert.equal(machineObserveInputSchema.safeParse({op:'registry_query',hive:'HKCR',key:'x',value:null}).success,false);
|
|
22
|
+
assert.equal(machineObserveInputSchema.safeParse({op:'service_list',command:'sc.exe query'}).success,false);
|
|
23
|
+
assert.equal(machineObserveInputSchema.safeParse({op:'socket_list',powershell:'Get-NetTCPConnection'}).success,false);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test('R48 compact machine_observe routes all Windows operations to one typed runtime method',async()=>{
|
|
27
|
+
const calls=[];
|
|
28
|
+
const observationRuntime={windowsQuery:async args=>{calls.push(args);return evidence(args.query);}};
|
|
29
|
+
const server=fakeServer();
|
|
30
|
+
registerCompactGatewayTools(server,{profile:'compact',ledger,codingRuntime:null,semanticRuntime:null,machineFsRuntime:null,processRuntime:null,
|
|
31
|
+
observationRuntime,machineRuntime:null,desktopRuntime:null,skillRuntime:null,autonomousRuntime:null,hostPolicy:null,
|
|
32
|
+
catalogProvider:()=>[...server.tools.keys()]});
|
|
33
|
+
const tool=server.tools.get('machine_observe');
|
|
34
|
+
const inputs=[
|
|
35
|
+
{op:'registry_query',hive:'HKCU',key:'Software\\Microsoft',value:'Test'},
|
|
36
|
+
{op:'service_list'},{op:'driver_list'},{op:'socket_list'},{op:'volume_list'},{op:'usb_list'},{op:'wsl_list'}
|
|
37
|
+
];
|
|
38
|
+
for(const input of inputs){
|
|
39
|
+
const out=await tool.handler(input);
|
|
40
|
+
assert.equal(out.isError,false);
|
|
41
|
+
}
|
|
42
|
+
assert.deepEqual(calls,[
|
|
43
|
+
{query:'registry',hive:'HKCU',key:'Software\\Microsoft',value:'Test'},
|
|
44
|
+
{query:'services'},{query:'drivers'},{query:'sockets'},{query:'volumes'},{query:'usb'},{query:'wsl'}
|
|
45
|
+
]);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test('R48 full observation surface exposes one typed machine_windows_query tool',()=>{
|
|
49
|
+
const server=fakeServer();
|
|
50
|
+
registerObservationTools(server,{runtime:{windowsQuery:async args=>evidence(args.query),
|
|
51
|
+
searchStart:async()=>{},searchPage:async()=>{},searchStatus:async()=>{},searchCancel:async()=>{},processList:async()=>{},systemStatus:async()=>{},hardwareQuery:async()=>{}}});
|
|
52
|
+
assert.equal(server.tools.has('machine_windows_query'),true);
|
|
53
|
+
const schema=server.tools.get('machine_windows_query').spec.inputSchema;
|
|
54
|
+
assert.equal(schema.safeParse({query:'registry',hive:'HKLM',key:'SOFTWARE',value:null}).success,true);
|
|
55
|
+
assert.equal(schema.safeParse({query:'services'}).success,true);
|
|
56
|
+
assert.equal(schema.safeParse({query:'services',command:'sc query'}).success,false);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test('R48 capability ledger declares every Windows observation through compact machine_observe',()=>{
|
|
60
|
+
const expected=['registry_query','service_list','driver_list','socket_list','volume_list','usb_list','wsl_list'];
|
|
61
|
+
for(const op of expected){
|
|
62
|
+
const cap=R36_CAPABILITY_LEDGER.entries.find(x=>x.id===`observation.${op}`);
|
|
63
|
+
assert.ok(cap,`missing observation.${op}`);
|
|
64
|
+
assert.equal(cap.full_tool,'machine_windows_query');
|
|
65
|
+
assert.equal(cap.compact_tool,'machine_observe');
|
|
66
|
+
assert.equal(cap.compact_op,op);
|
|
67
|
+
assert.equal(cap.authority,'none');
|
|
68
|
+
assert.equal(cap.mutating,false);
|
|
69
|
+
}
|
|
70
|
+
});
|