deadbyte-mcp 0.15.69 → 0.15.71

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 (50) hide show
  1. package/MANIFEST.SHA256 +49 -26
  2. package/PROVENANCE.json +62 -9
  3. package/README.txt +31 -23
  4. package/RELEASE.json +70 -9
  5. package/SBOM.cdx.json +2 -2
  6. package/TEST-MATRIX.json +63 -2
  7. package/bridge/package.json +1 -1
  8. package/controller/deadbyte-process-policy.json +4 -4
  9. package/docs/R184-package-lock.json +109 -16
  10. package/package.json +1 -1
  11. package/scripts/deploy-r48.mjs +17 -4
  12. package/scripts/r191-acceptance-readonly.mjs +7 -0
  13. package/scripts/r191-existing-regression.mjs +5 -0
  14. package/scripts/r191-existing-stage-audit.mjs +21 -0
  15. package/scripts/r191-extended-security-gate.mjs +14 -0
  16. package/scripts/r191-focused-tests.mjs +3 -0
  17. package/scripts/r191-full-runner.mjs +18 -0
  18. package/scripts/r191-historical-release-regression.mjs +9 -0
  19. package/scripts/r191-live-claim-inspect.mjs +15 -0
  20. package/scripts/r191-npm-registry-readonly.mjs +14 -0
  21. package/scripts/r191-old-version-audit.mjs +12 -0
  22. package/scripts/r191-privilege-readonly.mjs +6 -0
  23. package/scripts/r191-process-policy-focused.mjs +1 -0
  24. package/scripts/r191-protected-failure-gate.mjs +3 -0
  25. package/scripts/r191-release-contract-runner.mjs +1 -0
  26. package/scripts/r191-unreached-focused.mjs +29 -0
  27. package/src/activation-lock-r65.mjs +9 -1
  28. package/src/deadbyte-cli.mjs +62 -0
  29. package/src/foreground-owner-recovery-r190.mjs +117 -0
  30. package/src/runtime-update.mjs +2 -2
  31. package/src/trusted-epoch-bootstrap-r158.mjs +8 -0
  32. package/src/version.mjs +1 -1
  33. package/test/process-policy-refresh.test.mjs +11 -1
  34. package/test/r130-release-security-contract.test.mjs +8 -8
  35. package/test/r132-release-identity.test.mjs +8 -8
  36. package/test/r153-prepublish-identity.test.mjs +1 -1
  37. package/test/r163-isolated-slot-rollback-restore.test.mjs +4 -4
  38. package/test/r165-live-cli-skew.test.mjs +1 -1
  39. package/test/r167-release-contract.test.mjs +8 -8
  40. package/test/r172-release-contract.test.mjs +6 -6
  41. package/test/r173-release-contract.test.mjs +15 -15
  42. package/test/r179-release-contract.test.mjs +11 -11
  43. package/test/r190-foreground-cli.test.mjs +51 -0
  44. package/test/r190-foreground-owner-recovery.test.mjs +61 -0
  45. package/test/r190-release-contract.test.mjs +33 -0
  46. package/test/r191-epoch-root-selection.test.mjs +24 -0
  47. package/test/r191-epoch-source-claim.test.mjs +88 -0
  48. package/test/r191-inherited-epoch-preflight.test.mjs +65 -0
  49. package/test/r191-release-contract.test.mjs +31 -0
  50. package/test/r59-tool-surface-compat.test.mjs +1 -1
package/TEST-MATRIX.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schema": "deadbyte.test-matrix.v1",
3
- "version": "0.15.69",
4
- "train": "R179",
3
+ "version": "0.15.71",
4
+ "train": "R191",
5
5
  "primary_platform": "win32-x64",
6
6
  "reference": {
7
7
  "package": "@wonderwhy-er/desktop-commander",
@@ -10,6 +10,21 @@
10
10
  "schemas_sha256": "f342345e34e48769dabaefe1b932f09d41e2e207b422f7794a15ee50ffa8f140"
11
11
  },
12
12
  "required": [
13
+ {
14
+ "id": "r191-trusted-successor-epoch-root",
15
+ "command": "run R191 protected 0.15.71 ACL and full Windows regression",
16
+ "expected": "R89 ACL verifies successor exact manifest and native epoch tests pass; no dev-root bypass"
17
+ },
18
+ {
19
+ "id": "r191-signed-initial-precondition-reconciliation",
20
+ "command": "node --test test/r191-epoch-source-claim.test.mjs test/r153-r65-signed-precondition-recovery.test.mjs",
21
+ "expected": "R65 claim reconciles only with signed initial R27 rejection, correct predecessor and untampered receipt"
22
+ },
23
+ {
24
+ "id": "r190-explicit-foreground-recovery",
25
+ "command": "node --test --test-concurrency=1 test/r190-foreground-owner-recovery.test.mjs test/r190-foreground-cli.test.mjs",
26
+ "expected": "Exact legacy marker hash, PID-reuse proof, pointer and authority vector are bound; native CAS deletion is marker-only and crash-resumable"
27
+ },
13
28
  {
14
29
  "id": "r160-receipt-startup-identity",
15
30
  "command": "node --test test/r153-marker-reconcile-receipt.test.mjs test/r159-legacy-marker-evidence.test.mjs test/r160-marker-proof.test.mjs test/r160-package-decision-manifest.test.mjs",
@@ -668,5 +683,51 @@
668
683
  "package_verify_only": "PASS_2552_MANIFEST_ENTRIES",
669
684
  "registry_publish": "NOT_RUN",
670
685
  "production_activation": "NOT_RUN"
686
+ },
687
+ "r190": {
688
+ "status": "PREPUBLISH_VERIFIED_BEFORE_FINAL_METADATA_SEAL",
689
+ "targeted_source": "PASS_14_OF_14",
690
+ "targeted_protected": "PASS_14_OF_14",
691
+ "full_protected": "PASS_2090_OF_2141_51_CLASSIFIED_SKIP_0_FAIL",
692
+ "full_protected_transcript_sha256": "85bbd8088ee25fabd37bd062cf1ec0ad83c43e04abeee81881fc009755a9dd32",
693
+ "npm_verify_only": "PASS_PRE_FINAL_METADATA_SEAL",
694
+ "live_marker_reconciliations": 2,
695
+ "live_foreground_mcp": "PASS_23_CALLS_22_OK_1_EXPECTED_DENIED_0_UNKNOWN_0_MUTATIONS",
696
+ "active_runtime_after_test": "v0.15.68-ff29dbb2fbb89862_ONLINE",
697
+ "authority_after_test": "ALL_FIVE_PLANES_DISARMED",
698
+ "publication": "NOT_RUN",
699
+ "production_activation": "NOT_RUN"
700
+ },
701
+ "r191": {
702
+ "release_version": "0.15.71",
703
+ "protected_full": "NOT_VERIFIED",
704
+ "production_activation": "NOT_RUN",
705
+ "npm_publish": "NOT_RUN",
706
+ "test_status": "SOURCE_FOCUSED_PASS_FULL_PENDING",
707
+ "focused_security": "PASS_47_FAIL_0_SKIP_0",
708
+ "historical_release_regression": "PASS_25_FAIL_0_SKIP_1",
709
+ "r191_claim_inspect": "RECONCILABLE_SIGNED_READ_ONLY",
710
+ "protected_first_attempt": "FAIL_263_PASS_2_FAIL_3_SKIP_IN_BATCH_1_OF_8",
711
+ "protected_first_log_sha256": "a417aa51f82d93463e69df4d8b90ec8498817fa5ac84e2b7d7fe6b30c7118b30",
712
+ "corrective_focused_tests": "PASS_10_FAIL_0_SKIP_0",
713
+ "corrective_security_regression": "PASS_47_FAIL_0_SKIP_0",
714
+ "protected_retest": "PENDING_FRESH_EXACT_BYTES_TEST_B",
715
+ "protected_second_attempt": "FAIL_BATCH_2_273_PASS_1_FAIL_7_SKIP_AFTER_BATCH_1_266_PASS_0_FAIL_3_SKIP",
716
+ "protected_second_log_sha256": "eb32db586a6a1e09d2404eb5088b7783a0f9261d991583be097f13fda8ef8db3",
717
+ "process_policy_source_rebound": "R191_EXACT_DEV_ROOT",
718
+ "process_policy_contract": "PASS_5_FAIL_0",
719
+ "protected_third_attempt": "FAIL_BATCH_3_255_PASS_7_FAIL_5_SKIP_AFTER_1_263_PASS_0_FAIL_3_SKIP_AND_2_266_PASS_0_FAIL_7_SKIP",
720
+ "protected_third_log_sha256": "b29bf870512b99c26cbee07f17cb5896bfaa09369fea33510a40ca6c8530062c",
721
+ "protected_unreached_batch4": "249_PASS_1_FAIL_6_SKIP",
722
+ "protected_unreached_batch5": "284_PASS_1_FAIL_4_SKIP",
723
+ "protected_unreached_batch6": "234_PASS_0_FAIL_4_SKIP",
724
+ "protected_unreached_batch7": "274_PASS_2_FAIL_10_SKIP",
725
+ "protected_unreached_batch8": "264_PASS_0_FAIL_9_SKIP",
726
+ "corrected_fixture_suite": "15_PASS_0_FAIL",
727
+ "r67_cross_volume_protected_c": "6_PASS_0_FAIL_WITH_EXPLICIT_D_SCRATCH",
728
+ "r43_historical_signed_public_key": "2_PASS_0_FAIL_READ_ONLY",
729
+ "preflight_acl_behavior": "ASSERT_TRUSTED_AND_UNTRUSTED_PATHS_BY_ACTUAL_R89",
730
+ "release_contract_changes": "R132_R59_README_EXACT_01571",
731
+ "full_protected_regression": "PENDING_FRESH_PROTECTED_CANDIDATE_D"
671
732
  }
672
733
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deadbyte-chatgpt-bridge",
3
- "version": "0.15.69",
3
+ "version": "0.15.71",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "engines": {
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "schema": "deadbyte.process-policy.v1",
3
3
  "enabled": true,
4
- "grant_file": "D:\\Projects\\deadbyte-mcp\\development\\deadbyte-mcp-0.15.69-r186-owner-consent\\controller\\runtime\\process-grant.json",
5
- "state_dir": "D:\\Projects\\deadbyte-mcp\\development\\deadbyte-mcp-0.15.69-r186-owner-consent\\controller\\runtime\\process-state",
4
+ "grant_file": "D:\\Projects\\deadbyte-mcp\\development\\deadbyte-mcp-0.15.71-r191-activation-precondition-repair\\controller\\runtime\\process-grant.json",
5
+ "state_dir": "D:\\Projects\\deadbyte-mcp\\development\\deadbyte-mcp-0.15.71-r191-activation-precondition-repair\\controller\\runtime\\process-state",
6
6
  "native_host": {
7
- "path": "D:\\Projects\\deadbyte-mcp\\development\\deadbyte-mcp-0.15.69-r186-owner-consent\\bin\\deadbyte-process-host.exe",
7
+ "path": "D:\\Projects\\deadbyte-mcp\\development\\deadbyte-mcp-0.15.71-r191-activation-precondition-repair\\bin\\deadbyte-process-host.exe",
8
8
  "sha256": "daf9cfb371bee88cafbf5597eaa507fec504dbe0b0ddd40d0c3c2e02817f49e4"
9
9
  },
10
10
  "roots": {
11
11
  "core": {
12
- "path": "D:\\Projects\\deadbyte-mcp\\development\\deadbyte-mcp-0.15.69-r186-owner-consent",
12
+ "path": "D:\\Projects\\deadbyte-mcp\\development\\deadbyte-mcp-0.15.71-r191-activation-precondition-repair",
13
13
  "deny_paths": [
14
14
  "node_modules",
15
15
  "controller/runtime",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "deadbyte-mcp",
3
- "version": "0.15.69",
3
+ "version": "0.15.71",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "deadbyte-mcp",
9
- "version": "0.15.69",
9
+ "version": "0.15.71",
10
10
  "bundleDependencies": [
11
11
  "@modelcontextprotocol/server",
12
12
  "@modelcontextprotocol/client",
@@ -76,22 +76,115 @@
76
76
  "version": "7.0.6",
77
77
  "inBundle": true,
78
78
  "license": "MIT",
79
- "dependencies": {"path-key":"^3.1.0","shebang-command":"^2.0.0","which":"^2.0.1"},
80
- "engines": {"node":">= 8"}
79
+ "dependencies": {
80
+ "path-key": "^3.1.0",
81
+ "shebang-command": "^2.0.0",
82
+ "which": "^2.0.1"
83
+ },
84
+ "engines": {
85
+ "node": ">= 8"
86
+ }
81
87
  },
82
88
  "node_modules/eventsource": {
83
- "version":"3.0.7","inBundle":true,"license":"MIT",
84
- "dependencies":{"eventsource-parser":"^3.0.1"},"engines":{"node":">=18.0.0"}
89
+ "version": "3.0.7",
90
+ "inBundle": true,
91
+ "license": "MIT",
92
+ "dependencies": {
93
+ "eventsource-parser": "^3.0.1"
94
+ },
95
+ "engines": {
96
+ "node": ">=18.0.0"
97
+ }
98
+ },
99
+ "node_modules/eventsource-parser": {
100
+ "version": "3.1.1",
101
+ "inBundle": true,
102
+ "license": "MIT",
103
+ "engines": {
104
+ "node": ">=18.0.0"
105
+ }
106
+ },
107
+ "node_modules/isexe": {
108
+ "version": "2.0.0",
109
+ "inBundle": true,
110
+ "license": "ISC"
111
+ },
112
+ "node_modules/jose": {
113
+ "version": "6.2.10",
114
+ "inBundle": true,
115
+ "license": "MIT",
116
+ "funding": {
117
+ "url": "https://github.com/sponsors/panva"
118
+ }
119
+ },
120
+ "node_modules/path-key": {
121
+ "version": "3.1.1",
122
+ "inBundle": true,
123
+ "license": "MIT",
124
+ "engines": {
125
+ "node": ">=8"
126
+ }
127
+ },
128
+ "node_modules/pkce-challenge": {
129
+ "version": "5.0.1",
130
+ "inBundle": true,
131
+ "license": "MIT",
132
+ "engines": {
133
+ "node": ">=16.20.0"
134
+ }
85
135
  },
86
- "node_modules/eventsource-parser": {"version":"3.1.1","inBundle":true,"license":"MIT","engines":{"node":">=18.0.0"}},
87
- "node_modules/isexe": {"version":"2.0.0","inBundle":true,"license":"ISC"},
88
- "node_modules/jose": {"version":"6.2.10","inBundle":true,"license":"MIT","funding":{"url":"https://github.com/sponsors/panva"}},
89
- "node_modules/path-key": {"version":"3.1.1","inBundle":true,"license":"MIT","engines":{"node":">=8"}},
90
- "node_modules/pkce-challenge": {"version":"5.0.1","inBundle":true,"license":"MIT","engines":{"node":">=16.20.0"}},
91
- "node_modules/shebang-command": {"version":"2.0.0","inBundle":true,"license":"MIT","dependencies":{"shebang-regex":"^3.0.0"},"engines":{"node":">=8"}},
92
- "node_modules/shebang-regex": {"version":"3.0.0","inBundle":true,"license":"MIT","engines":{"node":">=8"}},
93
- "node_modules/typescript": {"version":"5.9.3","inBundle":true,"license":"Apache-2.0","bin":{"tsc":"bin/tsc","tsserver":"bin/tsserver"},"engines":{"node":">=14.17"}},
94
- "node_modules/which": {"version":"2.0.2","inBundle":true,"license":"ISC","dependencies":{"isexe":"^2.0.0"},"bin":{"node-which":"bin/node-which"},"engines":{"node":">= 8"}},
95
- "node_modules/zod": {"version":"4.4.3","inBundle":true,"license":"MIT","funding":{"url":"https://github.com/sponsors/colinhacks"}}
136
+ "node_modules/shebang-command": {
137
+ "version": "2.0.0",
138
+ "inBundle": true,
139
+ "license": "MIT",
140
+ "dependencies": {
141
+ "shebang-regex": "^3.0.0"
142
+ },
143
+ "engines": {
144
+ "node": ">=8"
145
+ }
146
+ },
147
+ "node_modules/shebang-regex": {
148
+ "version": "3.0.0",
149
+ "inBundle": true,
150
+ "license": "MIT",
151
+ "engines": {
152
+ "node": ">=8"
153
+ }
154
+ },
155
+ "node_modules/typescript": {
156
+ "version": "5.9.3",
157
+ "inBundle": true,
158
+ "license": "Apache-2.0",
159
+ "bin": {
160
+ "tsc": "bin/tsc",
161
+ "tsserver": "bin/tsserver"
162
+ },
163
+ "engines": {
164
+ "node": ">=14.17"
165
+ }
166
+ },
167
+ "node_modules/which": {
168
+ "version": "2.0.2",
169
+ "inBundle": true,
170
+ "license": "ISC",
171
+ "dependencies": {
172
+ "isexe": "^2.0.0"
173
+ },
174
+ "bin": {
175
+ "node-which": "bin/node-which"
176
+ },
177
+ "engines": {
178
+ "node": ">= 8"
179
+ }
180
+ },
181
+ "node_modules/zod": {
182
+ "version": "4.4.3",
183
+ "inBundle": true,
184
+ "license": "MIT",
185
+ "funding": {
186
+ "url": "https://github.com/sponsors/colinhacks"
187
+ }
188
+ }
96
189
  }
97
190
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deadbyte-mcp",
3
- "version": "0.15.69",
3
+ "version": "0.15.71",
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.",
@@ -14,7 +14,7 @@ import {observeAuthorityEvidence} from '../src/activation-authority-proof-r75.mj
14
14
  import {proveLegacyOfflineScopeRepair} from '../src/legacy-offline-policy-proof-r146.mjs';
15
15
  import {claimWithOneTimeMigration,verifyNarrowedPolicyGeneration} from '../src/clean-activation-recovery-r153.mjs';
16
16
  import {verifyUacApproval,uacPointerSha256,protectedUacReceiptPath,requireTrustedUacInstallation} from '../src/uac-approval-contract-r153.mjs';
17
- import {inspectTrustedInstallation} from '../src/privileged-install-trust-r89.mjs';
17
+ import {inspectTrustedInstallation,privilegedEpochInstallFiles} from '../src/privileged-install-trust-r89.mjs';
18
18
  import {normalizeHostCommandPins,hostCommandPinArgs} from '../src/host-command-pins-r154.mjs';
19
19
  import {parseActivationPathFlags,assertTrustedActivationEntrypoint,appendActivationPathArgs} from '../src/activation-path-r167.mjs';
20
20
 
@@ -310,7 +310,7 @@ if(deployArgs.uacLegacyMigration){
310
310
  expiresAt:deployArgs.migrationExpiresAt
311
311
  });
312
312
  }
313
- let activationPaths=null,activationPathError=null;
313
+ let activationPaths=null,activationPathError=null,stageEpochRebind=false;
314
314
  if(preflight.authority_continuity==='EPOCH_NATIVE'){
315
315
  try{
316
316
  // Validate exact path identity before the ACL probe so an unrelated protected
@@ -329,12 +329,25 @@ if(preflight.authority_continuity==='EPOCH_NATIVE'){
329
329
  activationPathError=new Error('--authority-epoch-root is valid only for EPOCH_NATIVE activation');
330
330
  }else{
331
331
  activationPaths={authorityEpochRoot:null,developmentRoot:deployArgs.developmentRoot??root};
332
+ if(preflight.authority_continuity==='NOT_APPLICABLE'){
333
+ try{
334
+ const installed=await loadPowerShellDataFile(pointer.config_path);
335
+ if(installed.AuthorityEpochRoot){
336
+ stageEpochRebind=true;
337
+ // The successor stage itself must be OS ACL-protected. An inherited
338
+ // predecessor epoch root cannot attest different successor bytes.
339
+ await inspectTrustedInstallation(privilegedEpochInstallFiles(root,process.execPath));
340
+ }
341
+ }catch(error){activationPathError=error;}
342
+ }
332
343
  }
333
344
 
334
345
  if(deployArgs.preflight){
346
+ const protectedEntrypoint=preflight.authority_continuity==='EPOCH_NATIVE'||stageEpochRebind;
335
347
  console.log(JSON.stringify({...preflight,
336
- activation_entrypoint_state:activationPathError?'REJECTED':preflight.authority_continuity==='EPOCH_NATIVE'?'TRUSTED_READY':'NOT_APPLICABLE',
337
- protected_activation_entrypoint:preflight.authority_continuity==='EPOCH_NATIVE'?!activationPathError:null,
348
+ safe_to_activate:preflight.safe_to_activate&&!activationPathError,
349
+ activation_entrypoint_state:activationPathError?'REJECTED':protectedEntrypoint?'TRUSTED_READY':'NOT_APPLICABLE',
350
+ protected_activation_entrypoint:protectedEntrypoint?!activationPathError:null,
338
351
  activation_entrypoint_reason:activationPathError?String(activationPathError?.message??activationPathError).slice(0,256):null}));
339
352
  process.exit(0);
340
353
  }
@@ -0,0 +1,7 @@
1
+ import '../test/r191-epoch-source-claim.test.mjs';
2
+ import '../test/r191-epoch-root-selection.test.mjs';
3
+ import '../test/r191-inherited-epoch-preflight.test.mjs';
4
+ import '../test/r65-activation-lock-recovery.test.mjs';
5
+ import '../test/r65-activation-orchestration.test.mjs';
6
+ import '../test/r158-epoch-bootstrap.test.mjs';
7
+ import '../test/r167-activation-path.test.mjs';
@@ -0,0 +1,5 @@
1
+ import '../test/r65-activation-lock-recovery.test.mjs';
2
+ import '../test/r65-activation-orchestration.test.mjs';
3
+ import '../test/r158-epoch-bootstrap.test.mjs';
4
+ import '../test/r167-activation-path.test.mjs';
5
+ import '../test/r172-activation-recovery.test.mjs';
@@ -0,0 +1,21 @@
1
+ import {readFile,lstat} from 'node:fs/promises';
2
+ import {createHash} from 'node:crypto';
3
+ import path from 'node:path';
4
+ import {inspectTrustedInstallation,privilegedEpochInstallFiles} from '../src/privileged-install-trust-r89.mjs';
5
+ const stage='C:\\Program Files\\DEADBYTE-01570-REGISTRY-df15db35c7dd';
6
+ const expected='df15db35c7ddddd769650f5c86557159d10d99e9eef4dd232cae67faeb8ad6e3';
7
+ const sha=b=>createHash('sha256').update(b).digest('hex');
8
+ const info=await lstat(stage);if(!info.isDirectory()||info.isSymbolicLink())throw new Error('STAGE_DIRECTORY_INVALID');
9
+ const manifest=sha(await readFile(path.join(stage,'MANIFEST.SHA256')));
10
+ if(manifest!==expected)throw new Error('STAGE_HASH_DRIFT '+manifest);
11
+ console.log('R191_EXISTING_EXACT_STAGE_MANIFEST='+manifest);
12
+ try{
13
+ const trust=await inspectTrustedInstallation([...privilegedEpochInstallFiles(stage,process.execPath),
14
+ path.join(stage,'MANIFEST.SHA256'),path.join(stage,'scripts','deploy-r48.mjs'),
15
+ path.join(stage,'src','runtime-update.mjs'),path.join(stage,'src','trusted-epoch-bootstrap-r158.mjs')]);
16
+ if(!trust.trusted)throw new Error('R89_ACL_UNTRUSTED');
17
+ console.log('R191_EXACT_STAGE_R89_ACL=PASS');
18
+ }catch(e){
19
+ console.error('R191_EXACT_STAGE_R89_ACL=BLOCKED '+e.message);
20
+ process.exitCode=3;
21
+ }
@@ -0,0 +1,14 @@
1
+ import '../test/r65-activation-lock-recovery.test.mjs';
2
+ import '../test/r65-activation-preflight.test.mjs';
3
+ import '../test/r65-activation-orchestration.test.mjs';
4
+ import '../test/r65-deploy-preflight.test.mjs';
5
+ import '../test/r65-transaction-precondition.test.mjs';
6
+ import '../test/r153-r65-signed-precondition-recovery.test.mjs';
7
+ import '../test/r153-staging-leaf-acl.test.mjs';
8
+ import '../test/r153-uac-installed-manifest-contract.test.mjs';
9
+ import '../test/r167-activation-path.test.mjs';
10
+ import '../test/r168-protected-entrypoint.test.mjs';
11
+ import '../test/r190-foreground-owner-recovery.test.mjs';
12
+ import '../test/r191-epoch-root-selection.test.mjs';
13
+ import '../test/r191-epoch-source-claim.test.mjs';
14
+ import '../test/r191-inherited-epoch-preflight.test.mjs';
@@ -0,0 +1,3 @@
1
+ import '../test/r191-epoch-source-claim.test.mjs';
2
+ import '../test/r191-epoch-root-selection.test.mjs';
3
+ import '../test/r191-inherited-epoch-preflight.test.mjs';
@@ -0,0 +1,18 @@
1
+ import {readdir,mkdir,writeFile} from 'node:fs/promises';
2
+ import {spawnSync} from 'node:child_process';
3
+ import path from 'node:path';
4
+ import {fileURLToPath} from 'node:url';
5
+ const root=path.resolve(fileURLToPath(new URL('..',import.meta.url)));
6
+ const list=(await readdir(path.join(root,'test'))).filter(x=>x.endsWith('.test.mjs')&&!new Set(['full-max-catalog-r44.test.mjs','full-max-catalog-r45.test.mjs','full-max-catalog-r46.test.mjs']).has(x));
7
+ const output='D:\\Projects\\deadbyte-mcp\\testing\\r191\\R191-SOURCE-FULL-REGRESSION.txt';
8
+ await mkdir(path.dirname(output),{recursive:true});
9
+ console.log('FULL_SOURCE_REGRESSION_FILES='+list.length);
10
+ const started=Date.now();
11
+ const p=spawnSync(process.execPath,['--test','--test-concurrency=4',...list.map(x=>'test/'+x)],{cwd:root,shell:false,encoding:'utf8',windowsHide:true,maxBuffer:20*1024*1024,timeout:300000});
12
+ const stdout=p.stdout||'',stderr=p.stderr||'';
13
+ await writeFile(output,stdout+'\n===== STDERR =====\n'+stderr,'utf8');
14
+ const summary=stdout.split(/\r?\n/).filter(x=>/^(?:ℹ (?:tests|pass|fail|skipped|duration_ms)|✖ |﹣ |✔ R191)/.test(x));
15
+ console.log('RESULT_EXIT='+p.status+' SIGNAL='+p.signal+' ELAPSED_MS='+(Date.now()-started)+' ERROR='+(p.error?.message||'none'));
16
+ console.log('SUMMARY='+JSON.stringify(summary.slice(-100)));
17
+ console.log('TRANSCRIPT='+output);
18
+ if(p.status!==0)process.exitCode=1;
@@ -0,0 +1,9 @@
1
+ import '../test/r130-release-security-contract.test.mjs';
2
+ import '../test/r153-prepublish-identity.test.mjs';
3
+ import '../test/r165-live-cli-skew.test.mjs';
4
+ import '../test/r167-release-contract.test.mjs';
5
+ import '../test/r172-release-contract.test.mjs';
6
+ import '../test/r173-release-contract.test.mjs';
7
+ import '../test/r179-release-contract.test.mjs';
8
+ import '../test/r190-release-contract.test.mjs';
9
+ import '../test/release-version.test.mjs';
@@ -0,0 +1,15 @@
1
+ import os from 'node:os';
2
+ import path from 'node:path';
3
+ import {readFile} from 'node:fs/promises';
4
+ import {createActivationClaimManager} from '../src/activation-lock-r65.mjs';
5
+ const state=path.join(os.homedir(),'.deadbyte-mcp');
6
+ const pointer=JSON.parse(await readFile(path.join(state,'active-release.json'),'utf8'));
7
+ const manager=createActivationClaimManager({stateRoot:state});
8
+ const result=await manager.inspect();
9
+ console.log(JSON.stringify({state:'READ_ONLY_INSPECTION',active_release_id:pointer.release_id,
10
+ manifest_sha256:pointer.manifest_sha256,
11
+ claim_status:result.status,claim_operation_id:result.operation_id??null,
12
+ subject_sha256:result.subject_sha256??null,matched:result.matched??null,
13
+ foreign:result.foreign??null,unknown:result.unknown??null}));
14
+ if(pointer.release_id!=='v0.15.68-ff29dbb2fbb89862')process.exitCode=5;
15
+ if(result.status!=='RECONCILABLE')process.exitCode=6;
@@ -0,0 +1,14 @@
1
+ import https from 'node:https';
2
+ const read=url=>new Promise((resolve,reject)=>{
3
+ const req=https.get(url,{timeout:10000,headers:{'User-Agent':'deadbyte-r191-readonly-version-check'}},res=>{
4
+ let s='';res.on('data',b=>{if(s.length<40000)s+=b;});res.on('end',()=>resolve({status:res.statusCode,body:s}));});
5
+ req.on('timeout',()=>req.destroy(new Error('timeout')));req.on('error',reject);
6
+ });
7
+ for(const suffix of ['0.15.71','dist-tags']){
8
+ try{
9
+ const r=await read('https://registry.npmjs.org/deadbyte-mcp/'+suffix);
10
+ let v={status:r.status};
11
+ if(r.status===200){const p=JSON.parse(r.body);v=suffix==='dist-tags'?p:{name:p.name,version:p.version,tarball:p.dist?.tarball,integrity_present:Boolean(p.dist?.integrity)};}
12
+ console.log(JSON.stringify({target:suffix,...v}));
13
+ }catch(e){console.log(JSON.stringify({target:suffix,status:'NETWORK_UNVERIFIED',error:e.message}));}
14
+ }
@@ -0,0 +1,12 @@
1
+ import {readdir,readFile} from 'node:fs/promises';
2
+ import path from 'node:path';
3
+ import {fileURLToPath} from 'node:url';
4
+ const root=path.resolve(fileURLToPath(new URL('..',import.meta.url)));
5
+ const paths=await readdir(path.join(root,'test'));
6
+ let hits=0;
7
+ for(const f of paths.filter(x=>x.endsWith('.test.mjs'))){
8
+ const s=await readFile(path.join(root,'test',f),'utf8');
9
+ const n=s.split('0.15.70').length-1;
10
+ if(n){hits++;const a=s.split(String.fromCharCode(10)).filter(l=>l.includes('0.15.70'));console.log(f+': '+n+' occurrences; '+a.slice(0,3).map(x=>x.trim().slice(0,150)).join(' | '));}
11
+ }
12
+ console.log('MATCHED_FILES='+hits);
@@ -0,0 +1,6 @@
1
+ import {access,constants,stat} from 'node:fs/promises';
2
+ import os from 'node:os';
3
+ const programFiles='C:\\Program Files';
4
+ try{await access(programFiles,constants.W_OK);console.log('PROGRAM_FILES_WRITE_PROBE=ACCESS_ALLOWED')}catch(e){console.log('PROGRAM_FILES_WRITE_PROBE='+e.code);}
5
+ console.log('HOME='+os.homedir());
6
+ console.log('PROCESS_PLATFORM='+process.platform);
@@ -0,0 +1 @@
1
+ import '../test/process-policy-refresh.test.mjs';
@@ -0,0 +1,3 @@
1
+ import '../test/r166-hotfix-contract.test.mjs';
2
+ import '../test/r190-foreground-cli.test.mjs';
3
+ import '../test/r191-epoch-source-claim.test.mjs';
@@ -0,0 +1 @@
1
+ import '../test/r191-release-contract.test.mjs';
@@ -0,0 +1,29 @@
1
+ import {spawnSync} from 'node:child_process';
2
+ import {mkdtemp,mkdir,readFile} from 'node:fs/promises';
3
+ import {createPublicKey} from 'node:crypto';
4
+ import {fileURLToPath} from 'node:url';
5
+ import path from 'node:path';
6
+ import os from 'node:os';
7
+ const root=path.resolve(fileURLToPath(new URL('..',import.meta.url)));
8
+ const parentPublicKey=path.join(os.homedir(),'.deadbyte-mcp','trust','ed25519-public.pem');
9
+ const pubKey=createPublicKey(await readFile(parentPublicKey));
10
+ if(pubKey.asymmetricKeyType!=='ed25519')throw new Error('R43_PARENT_PUBLIC_KEY_NOT_ED25519');
11
+ const isolated=await mkdtemp(path.join(os.tmpdir(),'deadbyte-r191-unreached-'));
12
+ const scratch='D:\\Projects\\deadbyte-mcp\\testing\\r191\\cross-volume-focused';
13
+ if(path.parse(scratch).root.toLowerCase()===path.parse(os.tmpdir()).root.toLowerCase())throw new Error('R67_CROSS_VOLUME_NOT_DISTINCT');
14
+ await mkdir(scratch,{recursive:true});
15
+ const tests=[
16
+ 'test/r132-release-identity.test.mjs',
17
+ 'test/r59-tool-surface-compat.test.mjs',
18
+ 'test/production-docs.test.mjs',
19
+ 'test/r191-inherited-epoch-preflight.test.mjs',
20
+ 'test/r67-npm-cross-volume.test.mjs',
21
+ 'test/r43-parent.test.mjs'
22
+ ];
23
+ const r=spawnSync(process.execPath,['--test','--test-concurrency=1',...tests],{
24
+ cwd:root,env:{...process.env,DEADBYTE_STATE_ROOT:isolated,DEADBYTE_PARENT_VERIFY_KEY:parentPublicKey,DEADBYTE_TEST_CROSS_VOLUME_ROOT:scratch},
25
+ windowsHide:true,shell:false,encoding:'utf8',timeout:160000,maxBuffer:2000000});
26
+ console.log('FOCUSED_EXIT='+r.status+' ERROR='+(r.error?.message??'none'));
27
+ console.log((r.stdout??'').slice(-19000));
28
+ if(r.stderr)console.error(r.stderr.slice(-1400));
29
+ if(r.error||r.status!==0)process.exitCode=1;
@@ -115,7 +115,7 @@ async function isSafeSignedPreconditionReject(outcome,lock,stateRoot){
115
115
  body.result!=='PRECONDITION_REJECTED'||body.phase!=='initial'||
116
116
  body.attempted_pointer!==null||body.rollback?.attempted!==false||
117
117
  !Array.isArray(body.rollback?.errors)||body.rollback.errors.length!==0||
118
- !(/^(?:host command 'powershell_script' executable pin drift detected;|windows release gate package script invalid$)/.test(String(body.error?.message??'')))||
118
+ !(/^(?:host command 'powershell_script' executable pin drift detected;.*$|windows release gate package script invalid$|authority epoch exact release source hash mismatch: manifest\.sha256$)/.test(String(body.error?.message??'')))||
119
119
  !Number.isFinite(failedTime)||failedTime<lockTime||failedTime>observedTime||
120
120
  !samePointerIdentity(body.prior_pointer,current))return false;
121
121
  return true;
@@ -162,6 +162,14 @@ export function createActivationClaimManager({stateRoot}={}){
162
162
  }
163
163
 
164
164
  return Object.freeze({
165
+ async inspect(){
166
+ const claim=await readLock(lockPath);
167
+ if(!claim)return Object.freeze({status:'NO_CLAIM'});
168
+ const evidence=await findTerminalOutcome(updatesDir,claim,state);
169
+ const safe=evidence.matched&&!evidence.foreign&&!evidence.unknown;
170
+ return Object.freeze({status:safe?'RECONCILABLE':'UNRESOLVED',operation_id:claim.operation_id,
171
+ subject_sha256:claim.subject_sha256,matched:evidence.matched,foreign:evidence.foreign,unknown:evidence.unknown});
172
+ },
165
173
  async claim(subjectSha256){
166
174
  if(!HEX64.test(String(subjectSha256??'')))throw new Error('activation claim subject invalid');
167
175
  await mkdir(updatesDir,{recursive:true});
@@ -33,6 +33,8 @@ import {reconcileStaleMarker,resumeMarkerReconciliation,recoverPublishedMarkerTe
33
33
  import {selectLegacyMarkerEvidence,verifyLocatedLegacyMarkerReceipt} from './legacy-marker-evidence-r159.mjs';
34
34
  import {normalizeHostCommandPins,encodeHostCommandPins} from './host-command-pins-r154.mjs';
35
35
  import {verifyPackageDecisionManifest} from './package-identity-r160.mjs';
36
+ import {inspectTrustedInstallation} from './privileged-install-trust-r89.mjs';
37
+ import {recoverLegacyForegroundOwnership} from './foreground-owner-recovery-r190.mjs';
36
38
 
37
39
  const REMOTE_COMMANDS=new Set([
38
40
  'menu','start','resume','park','stop','restart','status','url','test','fulltest','toggle','clean','machinetest',
@@ -70,6 +72,7 @@ function printHelp(){
70
72
  ` npx -y ${exact} remote --trace # show trace/span identity without payload detail`,
71
73
 
72
74
  ` npx -y ${exact} remote --filter <expr> # presentation filter: tool/category/status/trace`,
75
+ ` npx -y ${exact} remote reconcileforeground --confirm-marker-sha256 <sha256> # protected marker-only recovery`,
73
76
  ` npx -y ${exact} remote status`,
74
77
  ` npx -y ${exact} remote restart`,
75
78
  ` npx -y ${exact} supervisor status`,
@@ -934,8 +937,56 @@ async function runRemoteSession({resumeCursor=null,verbose=false,trace=false,fil
934
937
  }
935
938
  }
936
939
  }
940
+ async function readR190Evidence(file){
941
+ try{
942
+ const info=await lstat(file);
943
+ if(!info.isFile()||info.isSymbolicLink()||info.size<1||info.size>64*1024)
944
+ throw new Error(`R190 recovery evidence is unsafe: ${path.basename(file)}`);
945
+ return JSON.parse((await readFile(file,'utf8')).replace(/^\uFEFF/,''));
946
+ }catch(error){if(error?.code==='ENOENT')return null;throw error;}
947
+ }
948
+ async function runRemoteForegroundRecovery(expectedMarkerSha256){
949
+ // Reject writable/untrusted CLI bytes before reading controller state.
950
+ const thisFile=fileURLToPath(import.meta.url);
951
+ const protectedFiles=[process.execPath,thisFile,path.join(CURRENT_PACKAGE_ROOT,'MANIFEST.SHA256'),
952
+ path.join(CURRENT_PACKAGE_ROOT,'src','foreground-owner-recovery-r190.mjs'),
953
+ path.join(CURRENT_PACKAGE_ROOT,'src','foreground-marker-cas-win32.mjs'),
954
+ path.join(CURRENT_PACKAGE_ROOT,'src','foreground-process-identity.mjs'),
955
+ path.join(CURRENT_PACKAGE_ROOT,'src','foreground-session-lock.mjs'),
956
+ path.join(CURRENT_PACKAGE_ROOT,'src','privileged-install-trust-r89.mjs'),
957
+ path.join(CURRENT_PACKAGE_ROOT,'src','canonical-json.mjs'),
958
+ path.join(CURRENT_PACKAGE_ROOT,'bin','deadbyte-epoch-lock-r85.node')];
959
+ let installation;
960
+ try{installation=await inspectTrustedInstallation(protectedFiles);}
961
+ catch(error){throw new Error(`R190_PROTECTED_RECOVERY_REQUIRED: ${boundedSingleLine(error?.message||error,512)}`);}
962
+ if(!installation.trusted)throw new Error('R190_PROTECTED_RECOVERY_REQUIRED: package ACL is not R89-trusted');
963
+ await verifyPackageDecisionManifest({root:CURRENT_PACKAGE_ROOT,expectedVersion:DEADBYTE_VERSION});
964
+ const ctx=await remoteContext();
965
+ const evidenceDir=path.join(ctx.root,'evidence','foreground-recovery-r190');
966
+ const intentPath=path.join(evidenceDir,`${expectedMarkerSha256}.intent.json`);
967
+ const terminalPath=path.join(evidenceDir,`${expectedMarkerSha256}.terminal.json`);
968
+ const startupLock=await acquireForegroundSessionLock({root:ctx.root,powershell:ctx.powershell});
969
+ try{
970
+ startupLock.assertHeld();
971
+ const result=await recoverLegacyForegroundOwnership({
972
+ expectedMarkerSha256,
973
+ readMarkerSnapshot:()=>readRemoteMarkerSnapshot(remoteSessionMarker(ctx.root)),
974
+ deleteMarkerIfHash:expected=>deletePinnedRemoteMarker(remoteSessionMarker(ctx.root),expected),
975
+ readActivePointer:()=>readActiveRuntimeBinding(ctx.root),
976
+ readAuthority:()=>observedAuthority(ctx),
977
+ queryIdentity:identity=>queryForegroundIdentity(identity.pid),
978
+ loadIntent:()=>readR190Evidence(intentPath),loadTerminal:()=>readR190Evidence(terminalPath),
979
+ publishIntent:value=>publishExclusiveJson(intentPath,value),
980
+ publishTerminal:value=>publishExclusiveJson(terminalPath,value)
981
+ });
982
+ startupLock.assertHeld();
983
+ process.stdout.write(`${JSON.stringify({...result,intent_path:intentPath,terminal_path:terminalPath,
984
+ authority_mutated:false,runtime_mutated:false})}\n`);
985
+ }finally{await startupLock.release();}
986
+ }
937
987
  async function runRemote(args){
938
988
  let verbose=false,trace=false,filterExpression='',resumeCursor=null,mode='default';
989
+ let recoveryMarkerSha256=null;
939
990
  const hostCommandPinValues=[];
940
991
  const positional=[];
941
992
  for(let index=0;index<args.length;index++){
@@ -960,12 +1011,23 @@ async function runRemote(args){
960
1011
  if(index+1>=args.length) throw new Error('remote --resume requires a cursor');
961
1012
  resumeCursor=args[++index];continue;
962
1013
  }
1014
+ if(arg==='--confirm-marker-sha256'){
1015
+ if(recoveryMarkerSha256!==null) throw new Error('remote --confirm-marker-sha256 may be specified once');
1016
+ recoveryMarkerSha256=String(args[++index]??'');continue;
1017
+ }
963
1018
  positional.push(arg);
964
1019
  }
965
1020
  let hostCommandPins;
966
1021
  try{hostCommandPins=normalizeHostCommandPins(hostCommandPinValues);}
967
1022
  catch(error){throw new Error(`remote --host-command-pin ${error.message}`);}
968
1023
  const presentation=verbose||trace||Boolean(filterExpression)||resumeCursor!==null||mode!=='default'||hostCommandPins.length>0;
1024
+ if(positional.length===1&&positional[0]==='reconcileforeground'){
1025
+ if(presentation)throw new Error('remote reconcileforeground does not accept presentation or authority flags');
1026
+ if(!/^[0-9a-f]{64}$/.test(String(recoveryMarkerSha256??'')))
1027
+ throw new Error('remote reconcileforeground requires --confirm-marker-sha256 with the exact current marker hash');
1028
+ await runRemoteForegroundRecovery(recoveryMarkerSha256);return;
1029
+ }
1030
+ if(recoveryMarkerSha256!==null)throw new Error('remote --confirm-marker-sha256 is valid only with reconcileforeground');
969
1031
  if(positional.length===0){await runRemoteSession({resumeCursor,verbose,trace,filterExpression,mode,hostCommandPins});return;}
970
1032
  if(presentation) throw new Error('remote presentation flags are valid only for foreground session');
971
1033
  if(positional.length>1) throw new Error('remote accepts one controller command');