deadbyte-mcp 0.15.3 → 0.15.5

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.
@@ -0,0 +1,54 @@
1
+ import test from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { createHash } from 'node:crypto';
4
+ import { fuzzyIndexOf } from '../src/fuzzy-search-core.mjs';
5
+ import { runFuzzySearchInWorker } from '../src/fuzzy-search.mjs';
6
+ import { createCodingSearch } from '../src/coding-search.mjs';
7
+
8
+ const sha = text => createHash('sha256').update(text,'utf8').digest('hex');
9
+ const files = new Map([
10
+ ['src/a.mjs','const deadbyte_machine_identity = true;'],
11
+ ['src/b.mjs','const unrelated = false;']
12
+ ]);
13
+
14
+ function cursorCodec(){
15
+ return {
16
+ async encode(value){ return Buffer.from(JSON.stringify(value)).toString('base64url'); },
17
+ async decode(value){ return JSON.parse(Buffer.from(value,'base64url').toString('utf8')); }
18
+ };
19
+ }
20
+
21
+ test('R46 fuzzy core and worker agree under a hard timeout boundary', async () => {
22
+ const text='AAAA deadbyte_machine_identity SHA256 CATALOG';
23
+ const direct=fuzzyIndexOf(text,'deadbyte_machine_identiti');
24
+ const worker=await runFuzzySearchInWorker(text,'deadbyte_machine_identiti',3000);
25
+ assert.equal(worker.start,direct.start);
26
+ assert.equal(worker.end,direct.end);
27
+ assert.equal(worker.distance,direct.distance);
28
+ assert.ok(worker.similarity >= 0.90);
29
+ });
30
+
31
+ test('R46 coding search fuzzy mode preserves bounded paging and file identity', async () => {
32
+ const search=createCodingSearch({
33
+ tree: async ({rootId,path,maxEntries}) => ({
34
+ status:'ok',root_id:rootId,path,
35
+ entries:[...files].map(([item])=>({path:item,type:'file',bytes:files.get(item).length})).slice(0,maxEntries),
36
+ truncated:false
37
+ }),
38
+ fileRead: async ({relativePath}) => {
39
+ const text=files.get(relativePath);
40
+ return {content:Buffer.from(text,'utf8').toString('base64'),bytes:Buffer.byteLength(text),sha256:sha(text)};
41
+ },
42
+ cursorCodec:cursorCodec()
43
+ });
44
+ const value=await search({
45
+ rootId:'core',path:'.',pattern:'deadbyte_machine_identiti',
46
+ target:'content',mode:'fuzzy',maxResults:10,maxFileBytes:4096,maxScanBytes:4096,pageSize:10
47
+ });
48
+ assert.equal(value.status,'ok');
49
+ assert.equal(value.matches.length,1);
50
+ assert.equal(value.matches[0].path,'src/a.mjs');
51
+ assert.equal(value.matches[0].distance,1);
52
+ assert.ok(value.matches[0].similarity >= 0.90);
53
+ assert.match(value.matches[0].file_sha256,/^[0-9a-f]{64}$/);
54
+ });
@@ -37,6 +37,8 @@ test('R31 machine filesystem schemas expose root-relative IDs/preconditions only
37
37
  registerMachineFsTools(server, { runtime: runtime() });
38
38
  const read = server.tools.get('machine_fs_read').spec.inputSchema;
39
39
  assert.equal(read.safeParse({ root_id:'core', path:'a.txt', offset:0, max_bytes:65536, hash_file:false, timeout_ms:30000 }).success, true);
40
+ assert.equal(read.safeParse({ root_id:'core', path:'a.txt', offset:-4096, max_bytes:4096, hash_file:false, timeout_ms:30000 }).success, true);
41
+ assert.equal(read.safeParse({ root_id:'core', path:'a.txt', offset:-4194305, max_bytes:4096, hash_file:false, timeout_ms:30000 }).success, false);
40
42
  assert.equal(read.safeParse({ root_id:'core', path:'a.txt', timeout_ms:99 }).success, false);
41
43
  const write = server.tools.get('machine_fs_write').spec.inputSchema;
42
44
  const move = server.tools.get('machine_fs_move').spec.inputSchema;
@@ -53,6 +53,12 @@ test('R31 machine fs supports exact mkdir/write/stat/list/range-read/edit/move/d
53
53
  assert.equal(Buffer.from(read.data_base64, 'base64').toString('utf8'), 'beta');
54
54
  assert.equal(read.next_offset, 10);
55
55
  assert.equal(read.timeout_ms, 30000);
56
+ const tail = await f.runtime.read({ rootId: 'project', relativePath: 'dir/a.txt', offset: -5, maxBytes: 8 });
57
+ assert.equal(Buffer.from(tail.data_base64, 'base64').toString('utf8'), 'gamma');
58
+ assert.equal(tail.offset, 11);
59
+ assert.equal(tail.requested_offset, -5);
60
+ assert.equal(tail.next_offset, 16);
61
+ assert.equal(tail.eof, true);
56
62
  const edited = await f.runtime.editExact({
57
63
  rootId: 'project', relativePath: 'dir/a.txt', expectedSha256: written.sha256,
58
64
  oldString: 'beta', newString: 'BETA', expectedReplacements: 1
@@ -9,9 +9,9 @@ const readme=()=>readFile(path.join(root,'README.txt'),'utf8');
9
9
 
10
10
  test('production README documents one-command stdio configs for major MCP clients',async()=>{
11
11
  const text=await readme();
12
- assert.match(text,/npx -y deadbyte-mcp@0\.15\.2 mcp/);
12
+ assert.match(text,/npx -y deadbyte-mcp@0\.15\.5 mcp/);
13
13
  assert.match(text,/CLAUDE DESKTOP/);
14
- assert.match(text,/"mcpServers"[\s\S]*?"command"\s*:\s*"npx"[\s\S]*?"-y"[\s\S]*?"deadbyte-mcp@0\.15\.2"[\s\S]*?"mcp"/);
14
+ assert.match(text,/"mcpServers"[\s\S]*?"command"\s*:\s*"npx"[\s\S]*?"-y"[\s\S]*?"deadbyte-mcp@0\.15\.5"[\s\S]*?"mcp"/);
15
15
  assert.match(text,/CURSOR/);
16
16
  assert.match(text,/\.cursor\/mcp\.json/);
17
17
  assert.match(text,/VS CODE/);
@@ -20,7 +20,7 @@ test('production README documents one-command stdio configs for major MCP client
20
20
  assert.match(text,/CODEX/);
21
21
  assert.match(text,/\[mcp_servers\.deadbyte\]/);
22
22
  assert.match(text,/command\s*=\s*"npx"/);
23
- assert.match(text,/args\s*=\s*\["-y",\s*"deadbyte-mcp@0\.15\.2",\s*"mcp"\]/);
23
+ assert.match(text,/args\s*=\s*\["-y",\s*"deadbyte-mcp@0\.15\.5",\s*"mcp"\]/);
24
24
  });
25
25
 
26
26
  test('production README records tracer bullet, semantic scope, remote UX, safety and document extension',async()=>{
@@ -5,11 +5,11 @@ import { createHash } from 'node:crypto';
5
5
 
6
6
  const root=new URL('../',import.meta.url);
7
7
  const text=rel=>readFile(new URL(rel,root),'utf8');
8
- const PARENT_RELEASE='v0.15.1-d55f00b5144dc31a';
9
- const PARENT_MANIFEST='d55f00b5144dc31a7fe39e4dc60d640a94780da6aaeca0918e87636b816d7854';
8
+ const PARENT_RELEASE='v0.15.2-0fb46542f6a4345f';
9
+ const PARENT_MANIFEST='0fb46542f6a4345f1c527565d06bf6e9b8e283260e47bf684fb70a60308fcf34';
10
10
  const PARENT_GENERATION='00cde7bf540cc2804d679a39040d5b07193c5f8a0d49cac3b882402f8f4e6ad8';
11
11
 
12
- test('R46 current authority agrees on V0.15.2 and preserves exact R45 parent identity',async()=>{
12
+ test('R46 current authority agrees on V0.15.5 and preserves exact V0.15.2 parent identity',async()=>{
13
13
  const pkg=JSON.parse(await text('package.json'));
14
14
  const release=JSON.parse(await text('RELEASE.json'));
15
15
  const [version,controller,gate,readme,architecture,controllerReadme,deferred,parity,closure,closureVerify,windowsGate,processPolicy]=await Promise.all([
@@ -27,7 +27,7 @@ test('R46 current authority agrees on V0.15.2 and preserves exact R45 parent ide
27
27
  text('controller/deadbyte-process-policy.json')
28
28
  ]);
29
29
 
30
- assert.equal(pkg.version,'0.15.2');
30
+ assert.equal(pkg.version,'0.15.5');
31
31
  assert.equal(pkg.scripts['gate:windows'],'powershell -NoProfile -ExecutionPolicy Bypass -File scripts/gate-windows-r46.ps1');
32
32
  assert.equal(pkg.scripts['self-update:deferred'],'node scripts/deferred-slot-operation-r46.mjs');
33
33
  assert.equal(pkg.scripts['release:parity'],'node scripts/release-parity-r46.mjs');
@@ -36,14 +36,14 @@ test('R46 current authority agrees on V0.15.2 and preserves exact R45 parent ide
36
36
  assert.equal(pkg.scripts['r46:fileless:test'],"node --test --test-concurrency=1 test/process-policy.test.mjs test/process-policy-refresh.test.mjs test/release-generation.test.mjs test/process-runtime.test.mjs test/process-mcp-tools.test.mjs test/compact-gateway-r36.test.mjs test/capability-ledger-r36.test.mjs test/remote-device-r44.test.mjs test/observation-runtime.test.mjs test/observation-mcp-tools.test.mjs");
37
37
  assert.equal(pkg.scripts['r46:full:test'],'node scripts/full-regression-r46.mjs');
38
38
 
39
- assert.match(version,/DEADBYTE_VERSION = '0\.15\.2'/);
40
- assert.match(controller,/CONTROLLER V0\.15\.2 \/ R46/);
41
- assert.match(gate,/DEADBYTE V0\.15\.2 \/ R46 FILELESS POWERSHELL WINDOWS BATCH GATE: PASS/);
42
- assert.match(readme,/^DEADBYTE MCP V0\.15\.2 \/ R46 FILELESS POWERSHELL PRODUCT BASELINE$/m);
39
+ assert.match(version,/DEADBYTE_VERSION = '0\.15\.5'/);
40
+ assert.match(controller,/CONTROLLER V0\.15\.5 \/ R46/);
41
+ assert.match(gate,/DEADBYTE V0\.15\.5 \/ R46 FILELESS POWERSHELL WINDOWS BATCH GATE: PASS/);
42
+ assert.match(readme,/^DEADBYTE MCP V0\.15\.5 \/ R46 FILELESS POWERSHELL PRODUCT BASELINE$/m);
43
43
  assert.match(readme,/powershell\.exe -Command <source>/);
44
- assert.match(architecture,/^# DEADBYTE MCP V0\.15\.2 \/ R46 ARCHITECTURE$/m);
45
- assert.match(controllerReadme,/^DEADBYTE MCP V0\.15\.2 \/ R46 CONTROLLER$/m);
46
- assert.match(deferred,/--expected-version','0\.15\.2'/);
44
+ assert.match(architecture,/^# DEADBYTE MCP V0\.15\.5 \/ R46 ARCHITECTURE$/m);
45
+ assert.match(controllerReadme,/^DEADBYTE MCP V0\.15\.5 \/ R46 CONTROLLER$/m);
46
+ assert.match(deferred,/--expected-version','0\.15\.5'/);
47
47
  assert.match(parity,/deadbyte\.r46-parity\.v1/);
48
48
  assert.match(parity,/DB_R46_FILELESS_PARITY/);
49
49
  assert.match(parity,/target_repin_verified:true/);
@@ -59,7 +59,7 @@ test('R46 current authority agrees on V0.15.2 and preserves exact R45 parent ide
59
59
  assert.match(closureVerify,/DEADBYTE-R46-FINAL-CLOSURE-V1/);
60
60
  assert.match(windowsGate,/deadbyte\.r46-windows-gate\.v1/);
61
61
 
62
- assert.equal(release.version,'0.15.2');
62
+ assert.equal(release.version,'0.15.5');
63
63
  assert.equal(release.train,'R46');
64
64
  assert.equal(release.label,'FILELESS POWERSHELL PRODUCT BASELINE');
65
65
  assert.equal(release.parent.release_id,PARENT_RELEASE);
@@ -382,7 +382,7 @@ test('R31 slot-update CLI binds process-policy bootstrap and machine-FS enable e
382
382
  });
383
383
 
384
384
  test('R46 slot-update CLI binds coding policy bootstrap as one exact pair', () => {
385
- const base=['--stage','stage','--development-root','dev','--expected-version','0.15.2','--expected-manifest',hex('a')];
385
+ const base=['--stage','stage','--development-root','dev','--expected-version','0.15.5','--expected-manifest',hex('a')];
386
386
  assert.throws(()=>parseUpdateArgs([...base,'--coding-policy','C:/candidate/coding.json']),/coding policy.*pair/i);
387
387
  assert.throws(()=>parseUpdateArgs([...base,'--coding-policy-sha256',hex('b')]),/coding policy.*pair/i);
388
388
  const parsed=parseUpdateArgs([...base,'--coding-policy','C:/candidate/coding.json','--coding-policy-sha256',hex('b')]);