deadbyte-mcp 0.15.22 → 0.15.24

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 (59) hide show
  1. package/MANIFEST.SHA256 +58 -36
  2. package/PROVENANCE.json +11 -10
  3. package/README.txt +18 -7
  4. package/RELEASE.json +26 -39
  5. package/SBOM.cdx.json +3 -3
  6. package/TEST-MATRIX.json +32 -86
  7. package/package.json +4 -3
  8. package/proof/commander-closure-20260928/DIFFERENTIAL-CHECKPOINT.json +111 -0
  9. package/scripts/activate-skill-creator-1.1.1.mjs +46 -0
  10. package/scripts/build-advanced-pcb-skill.mjs +208 -0
  11. package/scripts/commander-real-performance-benchmark-r47.mjs +12 -3
  12. package/scripts/diagnose-skill-tree.mjs +8 -0
  13. package/scripts/npm-release-r48.mjs +252 -0
  14. package/scripts/pcb-skill-src-SKILL.md.txt +67 -0
  15. package/scripts/pcb-skill-src-bringup-evidence.md.txt +22 -0
  16. package/scripts/pcb-skill-src-constraint-model.md.txt +17 -0
  17. package/scripts/pcb-skill-src-emc-mechanical-dfm.md.txt +17 -0
  18. package/scripts/pcb-skill-src-high-speed-layout.md.txt +27 -0
  19. package/scripts/pcb-skill-src-kicad-native.md.txt +30 -0
  20. package/scripts/pcb-skill-src-kicad_pcb_probe.py.txt +159 -0
  21. package/scripts/pcb-skill-src-pcb_constraint_gate.py.txt +76 -0
  22. package/scripts/pcb-skill-src-power-integrity.md.txt +15 -0
  23. package/scripts/prepare-skill-creator-1.1.1.mjs +113 -0
  24. package/scripts/test-skill-creator-semver-matrix.mjs +30 -0
  25. package/scripts/test-skill-creator-semver.mjs +22 -0
  26. package/src/atomic-mutation.mjs +12 -4
  27. package/src/coding-mcp-tools.mjs +15 -1
  28. package/src/coding-output-contracts.mjs +9 -3
  29. package/src/commander-office-reader-r48.mjs +36 -3
  30. package/src/commander-pdf-r48.mjs +36 -1
  31. package/src/commander-wire-adapter-r47.mjs +56 -2
  32. package/src/deadbyte-cli.mjs +70 -15
  33. package/src/host-plane.mjs +10 -31
  34. package/src/machine-fs-mcp-tools.mjs +7 -1
  35. package/src/machine-fs-output-contracts.mjs +6 -0
  36. package/src/mcp-server.mjs +14 -2
  37. package/src/output-contracts.mjs +6 -4
  38. package/src/remote-live-log.mjs +189 -35
  39. package/src/stdio-protocol-guard.mjs +71 -0
  40. package/src/tool-audit.mjs +1 -1
  41. package/src/version.mjs +1 -1
  42. package/test/atomic-mutation.test.mjs +61 -0
  43. package/test/coding-mcp-unknown-effect.test.mjs +42 -0
  44. package/test/commander-biff-reference-r48.test.mjs +38 -0
  45. package/test/commander-core-bridge-r47.test.mjs +19 -0
  46. package/test/commander-office-reader-r48.test.mjs +18 -2
  47. package/test/commander-pdf-r48.test.mjs +35 -0
  48. package/test/commander-protocol-adversarial-r48.test.mjs +166 -0
  49. package/test/commander-real-parity-r47.test.mjs +37 -3
  50. package/test/commander-schema-differential-r48.test.mjs +1 -1
  51. package/test/commander-wire-contract-r47.test.mjs +32 -0
  52. package/test/full-max-catalog-r48.test.mjs +1 -1
  53. package/test/machine-fs-mcp-tools.test.mjs +12 -0
  54. package/test/output-schema.test.mjs +20 -1
  55. package/test/r48-release-contract.test.mjs +27 -21
  56. package/test/remote-live-log-r37.test.mjs +106 -7
  57. package/test/remote-session-cli.test.mjs +40 -0
  58. package/test/tool-audit.test.mjs +17 -0
  59. package/test/tunnel-stdio-compat.test.mjs +3 -1
package/TEST-MATRIX.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schema": "deadbyte.test-matrix.v1",
3
- "version": "0.15.22",
3
+ "version": "0.15.24",
4
4
  "train": "R48",
5
5
  "primary_platform": "win32-x64",
6
6
  "reference": {
@@ -10,94 +10,40 @@
10
10
  "schemas_sha256": "f342345e34e48769dabaefe1b932f09d41e2e207b422f7794a15ee50ffa8f140"
11
11
  },
12
12
  "required": [
13
- {
14
- "id": "capability-authority-truth",
15
- "command": "node --test test/capability-resolver.test.mjs",
16
- "expected": "PASS across disarmed Coding/Process/Autonomous/Desktop/Host plus armed Host positive control"
17
- },
18
- {
19
- "id": "compact-authority-truth",
20
- "command": "node --test test/compact-max-catalog-r45.test.mjs",
21
- "expected": "PASS real compact stdio authority-state manifest truth"
22
- },
23
- {
24
- "id": "coding-durable-event-envelope",
25
- "command": "node --test test/coding-runtime.test.mjs",
26
- "expected": "PASS with signed durable event envelope fields"
27
- },
28
- {
29
- "id": "native-windows-observation",
30
- "command": "powershell -NoProfile -ExecutionPolicy Bypass -File scripts/build-hardware-r45.ps1",
31
- "expected": "PASS native registry/services/drivers/sockets/volumes/usb/wsl queries with /W4 /WX"
32
- },
33
- {
34
- "id": "machine-fs-entry-isolation",
35
- "command": "node --test test/machine-fs-runtime.test.mjs",
36
- "expected": "PASS unreadable EINVAL child isolation without page failure"
37
- },
38
- {
39
- "id": "r48-catalog",
40
- "command": "npm run r48:catalog:test",
41
- "expected": "PASS 116-tool full catalog with machine_windows_query; compact remains 43"
42
- },
43
- {
44
- "id": "commander-hardening",
45
- "command": "npm run r47:hardening:test",
46
- "expected": "PASS"
47
- },
48
- {
49
- "id": "r48-release",
50
- "command": "npm run r48:release:test",
51
- "expected": "PASS"
52
- },
53
- {
54
- "id": "full-regression",
55
- "command": "npm run r48:full:test",
56
- "expected": "PASS"
57
- },
58
- {
59
- "id": "package-boundary",
60
- "command": "node --test test/package-boundary.test.mjs",
61
- "expected": "PASS"
62
- },
63
- {
64
- "id": "release-smoke",
65
- "command": "node --test test/release-smoke-isolation.test.mjs",
66
- "expected": "PASS"
67
- },
68
- {
69
- "id": "runtime-update",
70
- "command": "node --test test/runtime-self-update.test.mjs",
71
- "expected": "PASS"
72
- },
73
- {
74
- "id": "audit",
75
- "command": "npm audit --omit=dev",
76
- "expected": "0 vulnerabilities"
77
- },
78
- {
79
- "id": "activation",
80
- "command": "npx -y deadbyte-mcp@0.15.22 remote status",
81
- "expected": "active runtime 0.15.22 with no VERSION SKEW"
82
- },
83
- {
84
- "id": "machine-truth",
85
- "command": "signed machine_ping",
86
- "expected": "release_id and manifests bind activated 0.15.22 generation"
87
- },
88
- {
89
- "id": "live-capability-truth",
90
- "command": "capability_manifest after activation",
91
- "expected": "DENIED mutating/bound reads follow disarmed authority; authority-independent reads remain AVAILABLE"
92
- }
13
+ {"id":"capability-authority-truth","command":"node --test test/capability-resolver.test.mjs","expected":"PASS authority-state manifest truth"},
14
+ {"id":"compact-authority-truth","command":"node --test test/compact-max-catalog-r45.test.mjs","expected":"PASS real compact stdio authority-state manifest truth"},
15
+ {"id":"native-windows-observation","command":"powershell -NoProfile -ExecutionPolicy Bypass -File scripts/build-hardware-r45.ps1","expected":"PASS native Windows observation build/query gate"},
16
+ {"id":"r48-catalog","command":"npm run r48:catalog:test","expected":"PASS 116-tool full catalog; compact remains 43"},
17
+ {"id":"commander-hardening","command":"npm run r47:hardening:test","expected":"PASS"},
18
+ {"id":"commander-protocol-adversarial","command":"node --test test/commander-protocol-adversarial-r48.test.mjs","expected":"PASS malformed JSON, invalid request, unknown method/tool, duplicate IDs and concurrent correlation"},
19
+ {"id":"r48-release","command":"npm run r48:release:test","expected":"PASS"},
20
+ {"id":"full-regression","command":"npm run r48:full:test","expected":"PASS"},
21
+ {"id":"package-boundary","command":"node --test test/package-boundary.test.mjs","expected":"PASS"},
22
+ {"id":"release-smoke","command":"node --test test/release-smoke-isolation.test.mjs","expected":"PASS"},
23
+ {"id":"runtime-update","command":"node --test test/runtime-self-update.test.mjs","expected":"PASS"},
24
+ {"id":"audit","command":"npm audit --omit=dev","expected":"0 vulnerabilities"},
25
+ {"id":"activation","command":"npx -y deadbyte-mcp@0.15.24 remote status","expected":"active runtime 0.15.24 with no VERSION SKEW"},
26
+ {"id":"machine-truth","command":"signed machine_ping","expected":"release_id and manifests bind activated 0.15.24 generation"},
27
+ {"id":"rollback-restore","command":"immutable slot rollback/restore","expected":"0.15.24 -> exact 0.15.23 -> exact 0.15.24"}
93
28
  ],
29
+ "focused_proof": {
30
+ "raw_mcp_protocol": {"tests":3,"pass":3,"fail":0},
31
+ "commander_hardening": {"tests":101,"pass":101,"fail":0,"skip":0},
32
+ "npm_audit_production_vulnerabilities": 0
33
+ },
94
34
  "full_regression_partition_proof": {
95
- "files": 207,
35
+ "files": 211,
96
36
  "batches": 8,
97
- "tests": 1023,
98
- "pass": 1014,
99
- "skip": 9,
100
- "fail": 0
37
+ "fail": 0,
38
+ "elapsed_ms": 196997.218,
39
+ "coding_task_id": "a1a10fff1520b37ac674f1861cd9e53e64e350d5a0766639036aefe5e096e235",
40
+ "task_receipt_sha256": "7711039e4807f6c2af02bbda897d0032b067e0a6631f789fd3bf801258160d3f",
41
+ "action_receipt_sha256": "095c5eb4d959b9105a769649aa196a1d33f5097b899031dd16997e5ba1b352e6"
42
+ },
43
+ "performance": {
44
+ "fresh_cross_reference_status": "BLOCKED_REFERENCE_RUNTIME_DEPS",
45
+ "reason": "Pinned Desktop Commander reference lacks package-lock.json and its staged node_modules is missing cross-fetch; no floating dependency install was used.",
46
+ "historical_sample_only": true
101
47
  },
102
48
  "non_win32": {
103
49
  "portable_tests": "supported where platform-independent",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deadbyte-mcp",
3
- "version": "0.15.22",
3
+ "version": "0.15.24",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Authenticated MCP agentic runtime with signed skills, persistent model backends, identity-bound remote devices, durable job supervision, immutable release slots, and separately revocable machine authority.",
@@ -70,8 +70,9 @@
70
70
  "r47:catalog:test": "node --test --test-concurrency=1 test/full-max-catalog-r47.test.mjs",
71
71
  "r47:hardening:test": "node scripts/commander-hardening-gate-r47.mjs",
72
72
  "r48:full:test": "node scripts/full-regression-r48.mjs",
73
- "r48:release:test": "node --test --test-concurrency=1 test/r48-release-contract.test.mjs test/commander-reference-contract-r48.test.mjs test/commander-extended-wire-r48.test.mjs test/commander-external-process-r48.test.mjs test/commander-office-reader-r48.test.mjs test/commander-pdf-r48.test.mjs test/commander-url-reader-r48.test.mjs test/commander-wire-contract-r47.test.mjs",
74
- "r48:catalog:test": "node --test --test-concurrency=1 test/full-max-catalog-r48.test.mjs"
73
+ "r48:release:test": "node --test --test-concurrency=1 test/r48-release-contract.test.mjs test/commander-reference-contract-r48.test.mjs test/commander-extended-wire-r48.test.mjs test/commander-external-process-r48.test.mjs test/commander-office-reader-r48.test.mjs test/commander-pdf-r48.test.mjs test/commander-url-reader-r48.test.mjs test/commander-wire-contract-r47.test.mjs test/commander-protocol-adversarial-r48.test.mjs",
74
+ "r48:catalog:test": "node --test --test-concurrency=1 test/full-max-catalog-r48.test.mjs",
75
+ "release:npm": "node scripts/npm-release-r48.mjs"
75
76
  },
76
77
  "bundleDependencies": [
77
78
  "@modelcontextprotocol/server",
@@ -0,0 +1,111 @@
1
+ {
2
+ "schema": "deadbyte.commander-differential-checkpoint.v1",
3
+ "status": "INCOMPLETE",
4
+ "observed_at_utc": "2026-09-28T15:19:36.8198652Z",
5
+ "source": {
6
+ "requested_path": "D:\\Projects\\deadbyte-mcp-r36-dev",
7
+ "requested_path_version": "0.12.0",
8
+ "actual_successor_workspace": "D:\\Projects\\deadbyte-mcp\\development\\deadbyte-mcp-r42-agentic-dev",
9
+ "version": "0.15.24",
10
+ "git_head": "f9037d4847a7204ce4e1f808758ee3f0e9e7a738",
11
+ "path_drift_classification": "requested source path is a historical snapshot and cannot produce a successor of active 0.15.23"
12
+ },
13
+ "reference": {
14
+ "path": "D:\\Projects\\desktop-commander-stage-20260922\\desktop-commander",
15
+ "package": "@wonderwhy-er/desktop-commander",
16
+ "version": "0.2.51",
17
+ "server_sha256": "dfc303bb7dd2e8d01debac50fc43bb8644d00089bffdf2887e149497cff8b305",
18
+ "schemas_sha256": "f342345e34e48769dabaefe1b932f09d41e2e207b422f7794a15ee50ffa8f140"
19
+ },
20
+ "live": {
21
+ "release_id": "v0.15.23-c97e3d21e792420e",
22
+ "release_manifest_sha256": "c97e3d21e792420ea90dada3c1360cd56e4c1f221daa86596d611b0d1ac351ec",
23
+ "generation_manifest_sha256": "4d2d3a4dc103576c39171c52db3436366e62d8b872bcafa4c55f2adb6d3a1126",
24
+ "bridge_pid": 2804,
25
+ "cloud_pid": 13704,
26
+ "state": "ONLINE",
27
+ "authority": "Process/Coding/Autonomous/Desktop/Host ARMED standing-grant"
28
+ },
29
+ "findings": [
30
+ {
31
+ "id": "reference-biff8",
32
+ "classification": "REFERENCE_DEFECT",
33
+ "red": "real OLE/BIFF8 fixture is rejected by the reference ExcelJS xlsx reader",
34
+ "green": "independent BIFF8 fixture test proves reference read rejection and OOXML bytes emitted under .xls",
35
+ "fixture_sha256": "096168376d0abf282546749fdf6765309f895d12fe81d45c52a2c54bb6c0d139"
36
+ },
37
+ {
38
+ "id": "incremental-pdf-revisions",
39
+ "classification": "REAL_DEADBYTE_DEFECT_FIXED_IN_SOURCE",
40
+ "red": "valid independent-oracle-readable incremental PDF failed with PDF duplicate object 3 0",
41
+ "green": "latest revision accepted only when both revisions are bound by a validated classic xref Prev chain; PDF suite 10/10 PASS"
42
+ },
43
+ {
44
+ "id": "powershell-command-byte-preservation",
45
+ "classification": "OBSERVED_PASS",
46
+ "green": "real policy-bound PowerShell REPL preserved variables, quotes, pipe and Unicode and returned more than 1 MiB through bounded chunk reads"
47
+ },
48
+ {
49
+ "id": "atomic-mutation-post-effect-observation",
50
+ "classification": "REAL_DEADBYTE_DEFECT_FIXED_IN_SOURCE",
51
+ "red": "machine filesystem, coding, and Host public boundaries collapsed a post-rename observation failure into a generic denied/failed response without uncertainty identity",
52
+ "green": "shared atomic mutation marks FAILED_AFTER_UNKNOWN_EFFECT with unknown side-effect state and expected-after SHA-256; machine filesystem, coding, and Host structured outputs preserve it"
53
+ },
54
+ {
55
+ "id": "read-file-directory-and-binary-semantics",
56
+ "classification": "REAL_DEADBYTE_DEFECT_FIXED_IN_SOURCE",
57
+ "red": "reference returns a bounded recursive listing for read_file(directory) and explicit binary guidance, while DEADBYTE attempted a file read or lossy UTF-8 decoding",
58
+ "green": "compatibility read_file uses policy-bound stat plus paged listing for directories and deterministic binary classification without replacement-character data loss"
59
+ },
60
+ {
61
+ "id": "docx-outline-and-content-search",
62
+ "classification": "REAL_DEADBYTE_DEFECT_FIXED_IN_SOURCE",
63
+ "red": "reference exposes drawing markers, header/footer text, and literal DOCX part search while DEADBYTE omitted those document parts and searched ZIP bytes",
64
+ "green": "native bounded DOCX parsing now exposes drawing/header/footer evidence and searches document/header/footer w:t parts through deterministic compatibility sessions"
65
+ }
66
+ ],
67
+ "focused_evidence": [
68
+ {"scope": "schema-search", "tests": 21, "pass": 21, "fail": 0, "skip": 0},
69
+ {"scope": "documents-wire-url", "tests": 49, "pass": 49, "fail": 0, "skip": 0},
70
+ {"scope": "biff-reference", "tests": 1, "pass": 1, "fail": 0, "skip": 0},
71
+ {"scope": "process-adjacent", "tests": 55, "pass": 55, "fail": 0, "skip": 0},
72
+ {"scope": "mcp-protocol", "tests": 9, "pass": 9, "fail": 0, "skip": 0},
73
+ {"scope": "mcp-protocol-adversarial", "tests": 3, "pass": 3, "fail": 0, "skip": 0},
74
+ {"scope": "atomic-mutation-public-boundaries", "tests": 15, "pass": 14, "fail": 0, "skip": 1},
75
+ {"scope": "full-regression-r48", "files": 211, "batches": 8, "fail": 0, "task_receipt_sha256": "7711039e4807f6c2af02bbda897d0032b067e0a6631f789fd3bf801258160d3f"},
76
+ {"scope": "npm-audit-production", "vulnerabilities": 0},
77
+ {"scope": "real-performance-sample", "iterations_per_workload": 50, "reference_byte_pins_verified": true, "status": "HISTORICAL_ONLY_FRESH_RUN_BLOCKED_REFERENCE_RUNTIME_DEPS",
78
+ "results": {"read_file": {"reference_ops_per_sec": 55, "deadbyte_ops_per_sec": 1058}, "list_directory": {"reference_ops_per_sec": 3818, "deadbyte_ops_per_sec": 1959}, "get_file_info": {"reference_ops_per_sec": 1805, "deadbyte_ops_per_sec": 2231}, "read_multiple_files": {"reference_ops_per_sec": 30, "deadbyte_ops_per_sec": 562}}}
79
+ ,{"scope": "filesystem-document-search-adjacent", "tests": 54, "pass": 54, "fail": 0, "skip": 0}
80
+ ],
81
+ "changed_file_sha256": {
82
+ "src/commander-pdf-r48.mjs": "23cda18e86daa4163003fb5a80e0069bc19541d454f32a9a38b1d901ee39f26b",
83
+ "src/coding-search.mjs": "7f15b59bc240d896beddc2057354f8c72f296fe189db30c200d2c84a67d65773",
84
+ "src/commander-wire-adapter-r47.mjs": "2ac8421b3dcdd52431001ac16ee1be8cc54a5483d6aab9700b118172ce0d44bd",
85
+ "src/commander-office-reader-r48.mjs": "7379825118da8fae16d63fe7c4d89b0ddb03e7649f3754adae58a4480f8b317f",
86
+ "test/commander-pdf-r48.test.mjs": "bfc2e6d7e1aa5332c1c81687001cdb5f923a45c5ce64925097fe11fd850e9214",
87
+ "test/commander-biff-reference-r48.test.mjs": "8e8b20604062a0398214e159729b10bedff334cb44bddfa4b4046b1ae396520f",
88
+ "test/commander-schema-differential-r48.test.mjs": "fb82a21e8752ccb82cbd6b631f3366bfe5af9a4c5a433db5a128c0a1fe703c66",
89
+ "test/commander-real-parity-r47.test.mjs": "cad9a9fc42c50e450a3b019e9ed066e7313631015179be7edbbdd094fea00a81"
90
+ ,"test/commander-wire-contract-r47.test.mjs": "d8e884e241c705b12797f911fb967a4a33b1ec6f3e15b433735882b3de4a34e5"
91
+ ,"test/commander-office-reader-r48.test.mjs": "abf1eb0977a064101420a0e908a4c2adbf9d606e9873433709910efafa2b4453"
92
+ ,"test/commander-core-bridge-r47.test.mjs": "16092ed097420b9da99573c1e84f62d011fcb5db069242d70ffd1649c704fd35"
93
+ ,"src/atomic-mutation.mjs": "622ee1d3c34c50a6343788cc7312e47cb43a87bdace78fb37ca7f51d453b19ad"
94
+ ,"src/machine-fs-mcp-tools.mjs": "5413fea537f9d72f73e89137b4c750530fbca41598b16bd9ede0e1c272111488"
95
+ ,"src/machine-fs-output-contracts.mjs": "d94e4478b7e465fa559065e508f65b9ef3eff815a8f2d7b2481bf2a0b05224c9"
96
+ ,"src/coding-mcp-tools.mjs": "c4e07aa6818cd989c43ce8d027dc7d467e05c8e2fe96b5548eea291285d3bbb1"
97
+ ,"src/coding-output-contracts.mjs": "059b4bef2ae6a6c2d7a706c463bea6e49d364faeb619372a429ba36c53004ab7"
98
+ ,"src/host-plane.mjs": "0ff88bce7ee34b22f48a1494efb16586b68c74bd46c608116eb9d9daa65fdc43"
99
+ ,"src/output-contracts.mjs": "6cbe72d14af097dde78e989bc7b28b48b9cb8990c989d0d40783633f3a7be465"
100
+ ,"src/mcp-server.mjs": "16e2250e20710b358b304a0bc41bb416ecb9a586c50d5933f6a4eb2230569b21"
101
+ ,"test/atomic-mutation.test.mjs": "98de1fc43092c27e0fa85f391607494b11e6cc0d53eaf47b6db1ab457c6d6a4b"
102
+ ,"test/coding-mcp-unknown-effect.test.mjs": "f37e260c2def4c48434b3f251a4cb756a1852843784c08cf6c39dba9045dfb69"
103
+ ,"scripts/commander-real-performance-benchmark-r47.mjs": "d7806aa408dc7ca74f05feec535ad6cc545f8c61892c51f0fe388bb13d975290"
104
+ },
105
+ "release_created": true,
106
+ "candidate_version": "0.15.24",
107
+ "publish_attempt": {"status":"BLOCKED_NPM_AUTH","npm_whoami":"E401 Unauthorized","registry_maintainer":"deadbytes <termay10000@gmail.com>","publish_error":"E404 package not found or no permission"},
108
+ "published": false,
109
+ "activated": false,
110
+ "remaining_scope": "restore npm authentication, registry round-trip, successor activation, exact 0.15.23 rollback, exact successor restore and independent final closure"
111
+ }
@@ -0,0 +1,46 @@
1
+ import { readFile, rename, rm, mkdir } from "node:fs/promises";
2
+ import path from "node:path";
3
+ import os from "node:os";
4
+ import { createSkillPlane } from "../src/skill-plane-r44.mjs";
5
+
6
+ const stateDir=path.join(os.homedir(),".deadbyte-mcp");
7
+ const skillsRoot=path.join(stateDir,"skills");
8
+ const active=path.join(skillsRoot,"skill-creator");
9
+ const stageParent=path.join(stateDir,"skill-staging","skill-creator-1.1.1");
10
+ const candidate=path.join(stageParent,"skill-creator");
11
+ const expectedOld="f34b3953db176c8ae9a5e08e7702b39f12b60b013edcd2f4d63a6268af9ba432";
12
+ const expectedNew="e39960cab9eab44512fa38703fc8255b8be8e8b4f6565b4255b94604eded5359";
13
+
14
+ const oldEnv=JSON.parse(await readFile(path.join(active,"skill.json"),"utf8"));
15
+ const newEnv=JSON.parse(await readFile(path.join(candidate,"skill.json"),"utf8"));
16
+ if(oldEnv.manifest_sha256!==expectedOld||oldEnv.body.version!=="1.1.0") throw new Error("active precondition failed");
17
+ if(newEnv.manifest_sha256!==expectedNew||newEnv.body.version!=="1.1.1") throw new Error("candidate precondition failed");
18
+
19
+ const stagePlane=await createSkillPlane({root:stageParent,verifyKeyPath:path.join(stateDir,"trust","ed25519-public.pem")});
20
+ const staged=await stagePlane.load({name:"skill-creator"});
21
+ if(!staged.verified||staged.version!=="1.1.1") throw new Error("candidate signature verification failed");
22
+
23
+ const swapRoot=path.join(stateDir,"skill-staging","swap");
24
+ await mkdir(swapRoot,{recursive:true});
25
+ const oldSwap=path.join(swapRoot,"skill-creator-1.1.0-"+expectedOld);
26
+ await rm(oldSwap,{recursive:true,force:true});
27
+
28
+ let movedOld=false,movedNew=false;
29
+ try{
30
+ await rename(active,oldSwap); movedOld=true;
31
+ await rename(candidate,active); movedNew=true;
32
+ const livePlane=await createSkillPlane({root:skillsRoot,verifyKeyPath:path.join(stateDir,"trust","ed25519-public.pem")});
33
+ const live=await livePlane.load({name:"skill-creator"});
34
+ if(!live.verified||live.version!=="1.1.1"||live.manifest_sha256!==expectedNew) throw new Error("live verification failed after swap");
35
+ await rm(oldSwap,{recursive:true,force:true});
36
+ await rm(stageParent,{recursive:true,force:true});
37
+ console.log(JSON.stringify({status:"ACTIVATED",version:live.version,manifest_sha256:live.manifest_sha256,verified:live.verified},null,2));
38
+ }catch(e){
39
+ try{
40
+ if(movedNew) await rename(active,candidate);
41
+ if(movedOld) await rename(oldSwap,active);
42
+ }catch(rollbackError){
43
+ e.message += "; rollback_failed="+rollbackError.message;
44
+ }
45
+ throw e;
46
+ }
@@ -0,0 +1,208 @@
1
+ import { readFile, writeFile, mkdir, rm, mkdtemp } from "node:fs/promises";
2
+ import path from "node:path";
3
+ import os from "node:os";
4
+ import { fileURLToPath } from "node:url";
5
+ import { promisify } from "node:util";
6
+ import { execFile } from "node:child_process";
7
+ import { createHash, createPrivateKey, createPublicKey, sign } from "node:crypto";
8
+ import { createSkillPlane } from "../src/skill-plane-r44.mjs";
9
+
10
+ const ex = promisify(execFile);
11
+ const here = path.dirname(fileURLToPath(import.meta.url));
12
+ const home = os.homedir();
13
+ const stateDir = path.join(home, ".deadbyte-mcp");
14
+ const skillsRoot = path.join(stateDir, "skills");
15
+ const creatorDir = path.join(skillsRoot, "skill-creator");
16
+ const name = "deadbyte-advanced-pcb-engineering";
17
+ const version = "1.0.0";
18
+ const out = path.join(skillsRoot, name);
19
+ const description = "Evidence-driven advanced PCB engineering workflow for schematic review, constraint capture, stackup-aware placement and routing, power and signal integrity, EMC, DFM/DFT, KiCad verification, manufacturing release, and hardware bring-up.";
20
+ const creatorManifest = "e39960cab9eab44512fa38703fc8255b8be8e8b4f6565b4255b94604eded5359";
21
+
22
+ const sha = b => createHash("sha256").update(b).digest("hex");
23
+ const canonical = v => Array.isArray(v) ? v.map(canonical) : v && typeof v === "object"
24
+ ? Object.fromEntries(Object.keys(v).sort((a,b)=>a.localeCompare(b,"en")).map(k=>[k,canonical(v[k])]))
25
+ : v;
26
+
27
+ const sources = [
28
+ ["SKILL.md", "pcb-skill-src-SKILL.md.txt", "skill"],
29
+ ["references/bringup-evidence.md", "pcb-skill-src-bringup-evidence.md.txt", "reference"],
30
+ ["references/constraint-model.md", "pcb-skill-src-constraint-model.md.txt", "reference"],
31
+ ["references/emc-mechanical-dfm.md", "pcb-skill-src-emc-mechanical-dfm.md.txt", "reference"],
32
+ ["references/high-speed-layout.md", "pcb-skill-src-high-speed-layout.md.txt", "reference"],
33
+ ["references/kicad-native.md", "pcb-skill-src-kicad-native.md.txt", "reference"],
34
+ ["references/power-integrity.md", "pcb-skill-src-power-integrity.md.txt", "reference"],
35
+ ["scripts/kicad_pcb_probe.py", "pcb-skill-src-kicad_pcb_probe.py.txt", "script"],
36
+ ["scripts/pcb_constraint_gate.py", "pcb-skill-src-pcb_constraint_gate.py.txt", "script"]
37
+ ];
38
+
39
+ await rm(out, { recursive: true, force: true });
40
+ const scaffold = await ex(process.execPath, [path.join(creatorDir, "scripts", "create-skill.mjs"), skillsRoot, name, version], { maxBuffer: 1024 * 1024 });
41
+
42
+ for (const [target, src] of sources) {
43
+ const data = await readFile(path.join(here, src));
44
+ const dst = path.join(out, ...target.split("/"));
45
+ await mkdir(path.dirname(dst), { recursive: true });
46
+ await writeFile(dst, data);
47
+ }
48
+
49
+ const resources = [];
50
+ for (const [target,, kind] of sources) {
51
+ if (target === "SKILL.md") continue;
52
+ const bytes = await readFile(path.join(out, ...target.split("/")));
53
+ resources.push({ path: target, sha256: sha(bytes), kind });
54
+ }
55
+ resources.sort((a,b)=>a.path.localeCompare(b.path,"en"));
56
+
57
+ const body = {
58
+ schema: "deadbyte.skill-manifest.v1",
59
+ name,
60
+ version,
61
+ description,
62
+ audience: "agent",
63
+ skill_md_sha256: sha(await readFile(path.join(out, "SKILL.md"))),
64
+ resources,
65
+ required_capabilities: [],
66
+ authority_planes: ["coding"],
67
+ provenance: {
68
+ source: "skill-creator",
69
+ origin_url: null,
70
+ source_revision: "local-draft-2026-09-27-pcb-v1"
71
+ }
72
+ };
73
+
74
+ const bodyBytes = Buffer.from(JSON.stringify(canonical(body)), "utf8");
75
+ const body_sha256 = sha(bodyBytes);
76
+ const priv = createPrivateKey(await readFile(path.join(stateDir, "trust", "ed25519-private.pem")));
77
+ const pub = createPublicKey(priv);
78
+ const keyId = sha(pub.export({ type: "spki", format: "der" }));
79
+ const attestation = {
80
+ algorithm: "ed25519",
81
+ domain: "DEADBYTE-SKILL-MANIFEST-V1",
82
+ key_id: keyId,
83
+ signature_base64: sign(null, Buffer.concat([Buffer.from("DEADBYTE-SKILL-MANIFEST-V1\0", "utf8"), bodyBytes]), priv).toString("base64")
84
+ };
85
+ const unsigned = { body, body_sha256, attestation };
86
+ const envelope = {
87
+ ...unsigned,
88
+ manifest_sha256: sha(Buffer.from(JSON.stringify(canonical(unsigned)), "utf8"))
89
+ };
90
+ await writeFile(path.join(out, "skill.json"), JSON.stringify(envelope, null, 2), "utf8");
91
+
92
+ const validator = await ex(process.execPath, [path.join(creatorDir, "scripts", "validate-skill.mjs"), out], { maxBuffer: 1024 * 1024 });
93
+
94
+ const plane = await createSkillPlane({
95
+ root: skillsRoot,
96
+ verifyKeyPath: path.join(stateDir, "trust", "ed25519-public.pem")
97
+ });
98
+ const loaded = await plane.load({ name });
99
+ if (!loaded.verified) throw new Error("skill plane returned verified=false");
100
+
101
+ let python = null;
102
+ for (const candidate of ["python", "py"]) {
103
+ try {
104
+ await ex(candidate, ["--version"], { timeout: 10000, maxBuffer: 1024 * 1024 });
105
+ python = candidate;
106
+ break;
107
+ } catch {}
108
+ }
109
+
110
+ let selfTest = { status: "SKIPPED", reason: "python_not_found" };
111
+ if (python) {
112
+ const tmp = await mkdtemp(path.join(os.tmpdir(), "deadbyte-pcb-skill-"));
113
+ try {
114
+ const fixture = [
115
+ "(kicad_pcb",
116
+ " (version 20240108)",
117
+ " (generator pcbnew)",
118
+ " (layers",
119
+ " (0 \"F.Cu\" signal)",
120
+ " (31 \"B.Cu\" signal)",
121
+ " )",
122
+ " (net 0 \"\")",
123
+ " (net 1 \"GND\")",
124
+ " (footprint \"TEST\" (layer \"F.Cu\"))",
125
+ " (segment (start 0 0) (end 1 0) (width 0.2) (layer \"F.Cu\") (net 1))",
126
+ " (via (at 1 0) (size 0.6) (drill 0.3) (layers \"F.Cu\" \"B.Cu\") (net 1))",
127
+ " (zone (net 1) (net_name \"GND\") (layer \"B.Cu\"))",
128
+ ")",
129
+ ""
130
+ ].join("\n");
131
+ const fixturePath = path.join(tmp, "fixture.kicad_pcb");
132
+ const probePath = path.join(tmp, "probe.json");
133
+ const contractPath = path.join(tmp, "contract.json");
134
+ await writeFile(fixturePath, fixture, "utf8");
135
+
136
+ const probeScript = path.join(out, "scripts", "kicad_pcb_probe.py");
137
+ const gateScript = path.join(out, "scripts", "pcb_constraint_gate.py");
138
+ const probeRun = await ex(python, [probeScript, fixturePath, "--pretty"], { timeout: 30000, maxBuffer: 1024 * 1024 });
139
+ const probe = JSON.parse(probeRun.stdout);
140
+ if (probe.copper_layer_count !== 2 || probe.counts.footprints !== 1 || probe.counts.segments !== 1 || probe.counts.vias !== 1 || probe.track_width_mm.min !== 0.2 || probe.via_drill_mm.min !== 0.3) {
141
+ throw new Error("probe self-test observation mismatch");
142
+ }
143
+ await writeFile(probePath, probeRun.stdout, "utf8");
144
+
145
+ const passContract = {
146
+ required_layers: ["F.Cu", "B.Cu"],
147
+ min_copper_layers: 2,
148
+ min_track_width_mm: 0.15,
149
+ min_via_diameter_mm: 0.45,
150
+ min_via_drill_mm: 0.20,
151
+ required_nets: ["GND"],
152
+ min_footprints: 1,
153
+ min_segments: 1,
154
+ min_vias: 1,
155
+ min_zones: 1
156
+ };
157
+ await writeFile(contractPath, JSON.stringify(passContract, null, 2), "utf8");
158
+ const passRun = await ex(python, [gateScript, probePath, contractPath], { timeout: 30000, maxBuffer: 1024 * 1024 });
159
+ const passResult = JSON.parse(passRun.stdout);
160
+ if (passResult.status !== "PASS") throw new Error("positive gate self-test did not pass");
161
+
162
+ const failContract = { min_track_width_mm: 0.25 };
163
+ await writeFile(contractPath, JSON.stringify(failContract, null, 2), "utf8");
164
+ let negativeCaught = false;
165
+ try {
166
+ await ex(python, [gateScript, probePath, contractPath], { timeout: 30000, maxBuffer: 1024 * 1024 });
167
+ } catch (e) {
168
+ const parsed = e.stdout ? JSON.parse(e.stdout) : null;
169
+ if (e.code === 2 && parsed && parsed.status === "FAIL") negativeCaught = true;
170
+ }
171
+ if (!negativeCaught) throw new Error("negative gate self-test did not fail closed");
172
+
173
+ selfTest = {
174
+ status: "PASS",
175
+ python,
176
+ fixture_probe: {
177
+ copper_layers: probe.copper_layer_count,
178
+ footprints: probe.counts.footprints,
179
+ segments: probe.counts.segments,
180
+ vias: probe.counts.vias,
181
+ zones: probe.counts.zones,
182
+ min_track_width_mm: probe.track_width_mm.min,
183
+ min_via_diameter_mm: probe.via_diameter_mm.min,
184
+ min_via_drill_mm: probe.via_drill_mm.min
185
+ },
186
+ positive_gate: "PASS",
187
+ negative_gate: "FAIL_EXIT_2"
188
+ };
189
+ } finally {
190
+ await rm(tmp, { recursive: true, force: true });
191
+ }
192
+ }
193
+
194
+ console.log(JSON.stringify({
195
+ status: "built",
196
+ name,
197
+ version,
198
+ out,
199
+ creator_manifest: creatorManifest,
200
+ scaffold_stdout: scaffold.stdout.trim(),
201
+ manifest_sha256: envelope.manifest_sha256,
202
+ body_sha256,
203
+ resource_count: resources.length,
204
+ verify_key_id: keyId,
205
+ validator_stdout: validator.stdout.trim(),
206
+ skill_plane_verified: loaded.verified,
207
+ self_test: selfTest
208
+ }, null, 2));
@@ -1,5 +1,5 @@
1
1
  import { performance } from 'node:perf_hooks';
2
- import { mkdtemp, writeFile, rm } from 'node:fs/promises';
2
+ import { mkdtemp, writeFile, readFile, rm } from 'node:fs/promises';
3
3
  import os from 'node:os';
4
4
  import path from 'node:path';
5
5
  import { createHash } from 'node:crypto';
@@ -9,7 +9,16 @@ import { loadCodingPolicy } from '../src/coding-plane.mjs';
9
9
  import { createMachineFsRuntime } from '../src/machine-fs.mjs';
10
10
 
11
11
  const N=50;
12
- const commanderFs=await import(pathToFileURL('D:/Projects/desktop-commander-stage-20260922/desktop-commander/dist/tools/filesystem.js').href);
12
+ const referenceRoot=path.resolve(process.env.DEADBYTE_COMMANDER_REFERENCE_RUNTIME??'D:/Projects/desktop-commander-stage-20260922/desktop-commander');
13
+ const expectedReferenceHashes={
14
+ 'dist/server.js':'dfc303bb7dd2e8d01debac50fc43bb8644d00089bffdf2887e149497cff8b305',
15
+ 'dist/tools/schemas.js':'f342345e34e48769dabaefe1b932f09d41e2e207b422f7794a15ee50ffa8f140'
16
+ };
17
+ for(const [relative,expected] of Object.entries(expectedReferenceHashes)){
18
+ const actual=createHash('sha256').update(await readFile(path.join(referenceRoot,relative))).digest('hex');
19
+ if(actual!==expected)throw new Error(`reference byte pin mismatch: ${relative}`);
20
+ }
21
+ const commanderFs=await import(pathToFileURL(path.join(referenceRoot,'dist','tools','filesystem.js')).href);
13
22
  const { readFileFromDisk, readMultipleFiles, listDirectory, getFileInfo }=commanderFs;
14
23
  const sha=b=>createHash('sha256').update(b).digest('hex');
15
24
  const root=await mkdtemp(path.join(os.tmpdir(),'deadbyte-commander-bench-'));
@@ -37,5 +46,5 @@ rows.push(await t('Commander get_file_info',()=>getFileInfo(commanderFile)));
37
46
  rows.push(await t('DEADBYTE get_file_info',()=>db.stat({rootId:'bench',relativePath:'a.txt',hash:true})));
38
47
  rows.push(await t('Commander read_multiple_files',()=>readMultipleFiles([path.join(commanderDir,'a.txt'),path.join(commanderDir,'b.txt')])));
39
48
  rows.push(await t('DEADBYTE read_multiple_files', async()=>{ await db.read({rootId:'bench',relativePath:'a.txt',offset:0,maxBytes:4096}); await db.read({rootId:'bench',relativePath:'b.txt',offset:0,maxBytes:4096}); }));
40
- console.log(JSON.stringify({schema:'deadbyte.commander-real-performance-benchmark.v1',reference:'@wonderwhy-er/desktop-commander dist local stage',iterations:N,rows},null,2));
49
+ console.log(JSON.stringify({schema:'deadbyte.commander-real-performance-benchmark.v1',reference:'@wonderwhy-er/desktop-commander@0.2.51',reference_hashes:expectedReferenceHashes,iterations:N,rows},null,2));
41
50
  await rm(root,{recursive:true,force:true});
@@ -0,0 +1,8 @@
1
+ import { readFile, readdir } from "node:fs/promises";
2
+ import path from "node:path";
3
+ const root=process.argv[2];
4
+ async function walk(d,r=""){let out=[];for(const e of (await readdir(d,{withFileTypes:true})).sort((a,b)=>a.name.localeCompare(b.name,"en"))){const p=path.join(d,e.name),q=r?r+"/"+e.name:e.name;if(e.isDirectory())out.push(...await walk(p,q));else if(e.isFile())out.push(q)}return out}
5
+ const env=JSON.parse(await readFile(path.join(root,"skill.json"),"utf8"));
6
+ const actual=(await walk(root)).sort((a,b)=>a.localeCompare(b,"en"));
7
+ const expected=["SKILL.md","skill.json",...env.body.resources.map(x=>x.path)].sort((a,b)=>a.localeCompare(b,"en"));
8
+ console.log(JSON.stringify({actual,expected,extra:actual.filter(x=>!expected.includes(x)),missing:expected.filter(x=>!actual.includes(x))},null,2));