deadbyte-mcp 0.14.0 → 0.15.1

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 (157) hide show
  1. package/AGENTS.md +11 -18
  2. package/CONTEXT.md +3 -3
  3. package/MANIFEST.SHA256 +156 -70
  4. package/PROVENANCE.json +10 -0
  5. package/R43-PARENT.json +20 -0
  6. package/R44-DONORS.json +99 -0
  7. package/R44-PARENT.json +18 -0
  8. package/R45-PARENT.json +18 -0
  9. package/README.txt +19 -14
  10. package/RELEASE.json +37 -0
  11. package/SBOM.cdx.json +46 -0
  12. package/TEST-MATRIX.json +31 -0
  13. package/bin/deadbyte-hardware-observer-r45.exe +0 -0
  14. package/bin/deadbyte-hardware-observer-r45.obj +0 -0
  15. package/controller/README.TXT +5 -6
  16. package/controller/deadbyte-controller.ps1 +2 -2
  17. package/docs/ARCHITECTURE.md +8 -1
  18. package/docs/R44-ARCHITECTURE.md +37 -0
  19. package/native/deadbyte-hardware-observer.cpp +308 -0
  20. package/package.json +18 -8
  21. package/scripts/autonomous-tests.ps1 +2 -2
  22. package/scripts/build-hardware-r45.ps1 +71 -0
  23. package/scripts/deferred-slot-operation-r43.mjs +126 -0
  24. package/scripts/deferred-slot-operation-r44.mjs +126 -0
  25. package/scripts/deferred-slot-operation-r45.mjs +126 -0
  26. package/scripts/derive-r45-parent.mjs +24 -0
  27. package/scripts/derive-r45-release.mjs +72 -0
  28. package/scripts/derive-r45-tests.mjs +20 -0
  29. package/scripts/final-closure-r43.mjs +115 -0
  30. package/scripts/final-closure-r44.mjs +121 -0
  31. package/scripts/final-closure-r45.mjs +121 -0
  32. package/scripts/final-closure-verify-r43.mjs +213 -0
  33. package/scripts/final-closure-verify-r44.mjs +220 -0
  34. package/scripts/final-closure-verify-r45.mjs +220 -0
  35. package/scripts/finalize-r43.mjs +217 -0
  36. package/scripts/finalize-r44.mjs +217 -0
  37. package/scripts/finalize-r45.mjs +219 -0
  38. package/scripts/full-regression-r43.mjs +20 -0
  39. package/scripts/full-regression-r44.mjs +20 -0
  40. package/scripts/full-regression-r45.mjs +20 -0
  41. package/scripts/full-regression-summary-r45.mjs +14 -0
  42. package/scripts/gate-windows-r43.ps1 +36 -0
  43. package/scripts/gate-windows-r44.ps1 +36 -0
  44. package/scripts/gate-windows-r45.ps1 +44 -0
  45. package/scripts/init-host-policy.ps1 +39 -1
  46. package/scripts/inspect-active-release-r45.mjs +20 -0
  47. package/scripts/release-manifest.mjs +3 -1
  48. package/scripts/release-parity-r43.mjs +218 -0
  49. package/scripts/release-parity-r44.mjs +242 -0
  50. package/scripts/release-parity-r45.mjs +253 -0
  51. package/scripts/release-parity-tests-r43.ps1 +8 -0
  52. package/scripts/release-parity-tests-r44.ps1 +8 -0
  53. package/scripts/release-parity-tests-r45.ps1 +8 -0
  54. package/scripts/verify-r43-parent.mjs +126 -0
  55. package/scripts/verify-r44-parent.mjs +142 -0
  56. package/scripts/verify-r45-parent.mjs +142 -0
  57. package/scripts/windows-gate-evidence-r43.mjs +55 -0
  58. package/scripts/windows-gate-evidence-r44.mjs +55 -0
  59. package/scripts/windows-gate-evidence-r45.mjs +60 -0
  60. package/src/agent-backend-r44.mjs +254 -0
  61. package/src/autonomous-output-contracts.mjs +1 -1
  62. package/src/autonomous-policy.mjs +41 -4
  63. package/src/autonomous-runtime.mjs +37 -19
  64. package/src/autonomous-supervisor-host.mjs +12 -2
  65. package/src/capability-ledger.mjs +3 -1
  66. package/src/codex-app-server-r44.mjs +154 -0
  67. package/src/coding-plane.mjs +66 -19
  68. package/src/compact-gateway-mcp-tools.mjs +4 -2
  69. package/src/deadbyte-cli.mjs +17 -9
  70. package/src/doctor-r45.mjs +65 -0
  71. package/src/durable-job-r44.mjs +145 -0
  72. package/src/external-job-provider-r44.mjs +126 -0
  73. package/src/host-plane.mjs +156 -87
  74. package/src/job-supervisor-host-r44.mjs +112 -0
  75. package/src/machine-fs-smoke-client.mjs +1 -1
  76. package/src/machine-fs.mjs +21 -10
  77. package/src/mcp-host-smoke-client.mjs +1 -1
  78. package/src/mcp-server.mjs +84 -26
  79. package/src/mcp-smoke-client.mjs +1 -1
  80. package/src/native-diff-v2.mjs +12 -7
  81. package/src/native-diff.mjs +32 -9
  82. package/src/observation-mcp-tools.mjs +5 -1
  83. package/src/observation-output-contracts.mjs +8 -0
  84. package/src/observation-runtime.mjs +33 -2
  85. package/src/observation-smoke-client.mjs +7 -3
  86. package/src/operator-surface.mjs +2 -2
  87. package/src/output-contracts.mjs +27 -11
  88. package/src/process-policy.mjs +19 -0
  89. package/src/process-runtime.mjs +5 -2
  90. package/src/process-smoke-client.mjs +2 -2
  91. package/src/provider-circuit.mjs +8 -2
  92. package/src/r44-compact-disarmed-probe.mjs +74 -0
  93. package/src/r44-full-surface-probe.mjs +34 -0
  94. package/src/r45-compact-disarmed-probe.mjs +74 -0
  95. package/src/r45-full-surface-probe.mjs +34 -0
  96. package/src/release-generation.mjs +1 -0
  97. package/src/remote-device-r44.mjs +205 -0
  98. package/src/remote-mcp-autonomous-smoke-client.mjs +4 -4
  99. package/src/remote-mcp-r44-parity-client.mjs +203 -0
  100. package/src/remote-mcp-r45-parity-client.mjs +206 -0
  101. package/src/remote-mcp-smoke-client.mjs +7 -4
  102. package/src/runtime-update.mjs +100 -39
  103. package/src/skill-mcp-tools-r44.mjs +37 -0
  104. package/src/skill-plane-r44.mjs +203 -0
  105. package/src/tunnel-stdio-compat-smoke.mjs +1 -1
  106. package/src/version.mjs +1 -1
  107. package/test/agent-backend-r44.test.mjs +115 -0
  108. package/test/agent-runtime.test.mjs +4 -3
  109. package/test/autonomous-loop.test.mjs +121 -11
  110. package/test/autonomous-runtime.test.mjs +3 -2
  111. package/test/capability-ledger-r36.test.mjs +3 -3
  112. package/test/cli-entrypoint.test.mjs +4 -4
  113. package/test/codex-app-server-r44.test.mjs +115 -0
  114. package/test/codex-autonomous-r44.test.mjs +87 -0
  115. package/test/coding-plane.test.mjs +3 -2
  116. package/test/coding-runtime.test.mjs +36 -1
  117. package/test/compact-catalog-r36.test.mjs +3 -3
  118. package/test/compact-max-catalog-r40.test.mjs +4 -2
  119. package/test/compact-max-catalog-r44.test.mjs +97 -0
  120. package/test/compact-max-catalog-r45.test.mjs +99 -0
  121. package/test/contained.test.mjs +23 -11
  122. package/test/controller.test.mjs +5 -1
  123. package/test/core.test.mjs +1 -1
  124. package/test/durable-job-r44.test.mjs +75 -0
  125. package/test/external-job-provider-r44.test.mjs +46 -0
  126. package/test/full-max-catalog-r40.test.mjs +5 -3
  127. package/test/full-max-catalog-r44.test.mjs +91 -0
  128. package/test/full-max-catalog-r45.test.mjs +91 -0
  129. package/test/hardware-observation-r45.test.mjs +44 -0
  130. package/test/host-inline-r45.test.mjs +67 -0
  131. package/test/host-plane.test.mjs +15 -1
  132. package/test/machine-mcp-integration.test.mjs +1 -0
  133. package/test/native-diff.test.mjs +28 -0
  134. package/test/observation-mcp-tools.test.mjs +4 -3
  135. package/test/output-schema.test.mjs +3 -2
  136. package/test/package-boundary.test.mjs +1 -1
  137. package/test/process-policy.test.mjs +22 -1
  138. package/test/production-docs.test.mjs +3 -3
  139. package/test/prompts-resources.test.mjs +1 -1
  140. package/test/r33-closeout-regression.test.mjs +20 -36
  141. package/test/r33-finalization.test.mjs +7 -7
  142. package/test/r43-finalization.test.mjs +31 -0
  143. package/test/r43-finalizer.test.mjs +34 -0
  144. package/test/r43-parent.test.mjs +29 -0
  145. package/test/r44-finalization.test.mjs +58 -0
  146. package/test/r44-finalizer.test.mjs +48 -0
  147. package/test/r44-parent.test.mjs +25 -0
  148. package/test/r45-autonomous-quick-test.test.mjs +10 -0
  149. package/test/r45-finalization.test.mjs +84 -0
  150. package/test/release-generation.test.mjs +1 -0
  151. package/test/release-version.test.mjs +65 -20
  152. package/test/remote-device-r44.test.mjs +104 -0
  153. package/test/runtime-host-bootstrap-r45.test.mjs +46 -0
  154. package/test/runtime-self-update.test.mjs +42 -0
  155. package/test/skill-mcp-r44.test.mjs +38 -0
  156. package/test/skill-plane-r44.test.mjs +93 -0
  157. package/test/standing-grants.test.mjs +5 -1
@@ -0,0 +1,217 @@
1
+ import { createHash, randomBytes } from 'node:crypto';
2
+ import { spawn, spawnSync } from 'node:child_process';
3
+ import { lstat, mkdir, readFile, realpath, rename, writeFile } from 'node:fs/promises';
4
+ import os from 'node:os';
5
+ import path from 'node:path';
6
+ import { fileURLToPath } from 'node:url';
7
+ import { parseActivePointer } from '../src/release-slot.mjs';
8
+ import { loadPowerShellDataFile, parseControllerStatus, runSlotUpdateCli, windowsPowerShellEnvironment } from '../src/runtime-update.mjs';
9
+ import { verifyR44Parent } from './verify-r44-parent.mjs';
10
+ import { runReleaseParity } from './release-parity-r44.mjs';
11
+ import { writeFinalClosure } from './final-closure-r44.mjs';
12
+ import { verifyFinalClosureObject } from './final-closure-verify-r44.mjs';
13
+
14
+ const HEX64=/^[0-9a-f]{64}$/;
15
+ const EXPECTED_VERSION='0.15.0';
16
+ const PARENT_RELEASE_ID='v0.14.1-0a5a833892593283';
17
+ const PARENT_MANIFEST='0a5a8338925932830986421dda60ec5643f62f600404de4992fda2a5e79d09a9';
18
+ const PARENT_FINAL_CLOSURE='2f29e94dd726638c23b2e520a608dcf2a6919e43348855be3940599d557f920b';
19
+ const here=path.dirname(fileURLToPath(import.meta.url));
20
+ const packageRoot=path.resolve(here,'..');
21
+ const stateRoot=path.resolve(process.env.DEADBYTE_STATE_ROOT||path.join(os.homedir(),'.deadbyte-mcp'));
22
+ const evidenceRoot=path.join(stateRoot,'evidence','release','r44-finalization');
23
+ const launcher=path.join(stateRoot,'bin','DEADBYTE-MCP.ps1');
24
+ const ps=path.join(process.env.SystemRoot||'C:\\Windows','System32','WindowsPowerShell','v1.0','powershell.exe');
25
+ const sha256=bytes=>createHash('sha256').update(bytes).digest('hex');
26
+ const sleep=ms=>new Promise(resolve=>setTimeout(resolve,ms));
27
+ const insist=(ok,message)=>{if(!ok)throw new Error(message);};
28
+
29
+ async function atomicJson(file,value){
30
+ await mkdir(path.dirname(file),{recursive:true});
31
+ const bytes=Buffer.from(`${JSON.stringify(value,null,2)}\n`,'utf8');
32
+ const temp=`${file}.${process.pid}.${randomBytes(4).toString('hex')}.tmp`;
33
+ await writeFile(temp,bytes,{flag:'wx'});
34
+ await rename(temp,file);
35
+ return {path:file,sha256:sha256(bytes)};
36
+ }
37
+ async function activePointer(){
38
+ return parseActivePointer(await readFile(path.join(stateRoot,'active-release.json'),'utf8'));
39
+ }
40
+ async function bridgeArgs(){
41
+ const pointer=await activePointer();
42
+ const config=await loadPowerShellDataFile(pointer.config_path);
43
+ const raw=config?.Bridge?.WorkingDirectory;
44
+ insist(typeof raw==='string'&&path.isAbsolute(raw),'active Bridge.WorkingDirectory must be absolute');
45
+ const root=await realpath(path.resolve(raw));
46
+ const pkg=JSON.parse(await readFile(path.join(root,'package.json'),'utf8'));
47
+ insist(pkg?.name==='deadbyte-chatgpt-bridge','active Bridge package identity mismatch');
48
+ const script=path.join(root,'src','bridge.mjs');
49
+ return ['--bridge-root',root,'--bridge-script-sha256',sha256(await readFile(script))];
50
+ }
51
+ async function activationArgs(manifestSha256){
52
+ insist(HEX64.test(manifestSha256??''),'R44 finalizer manifest must be lowercase SHA-256');
53
+ const processPolicy=path.join(packageRoot,'controller','deadbyte-process-policy.json');
54
+ const desktopPolicy=path.join(packageRoot,'controller','deadbyte-desktop-policy.json');
55
+ const semantic=path.join(packageRoot,'controller','deadbyte-semantic-lsp-config.json');
56
+ return [
57
+ '--stage',packageRoot,'--development-root',packageRoot,'--expected-version',EXPECTED_VERSION,
58
+ '--expected-manifest',manifestSha256,
59
+ '--process-policy',processPolicy,'--process-policy-sha256',sha256(await readFile(processPolicy)),
60
+ '--desktop-policy',desktopPolicy,'--desktop-policy-sha256',sha256(await readFile(desktopPolicy)),
61
+ '--semantic-lsp-config',semantic,'--semantic-lsp-config-sha256',sha256(await readFile(semantic)),
62
+ '--enable-machine-fs','--enable-observation','--enable-desktop','--enable-autonomous-supervisor',
63
+ '--restore-standing-grants',
64
+ ...await bridgeArgs()
65
+ ];
66
+ }
67
+ export function validateFinalizerAuthorityStatus(status){
68
+ insist(status?.process_armed===true,'R44 finalizer requires Process standing grant');
69
+ insist(status?.coding_armed===true,'R44 finalizer requires Coding standing grant');
70
+ insist(status?.autonomous_armed===true,'R44 finalizer requires Autonomous standing grant');
71
+ insist(status?.desktop_armed===false,'R44 finalizer requires Desktop DISARMED');
72
+ insist(status?.host_armed===false,'R44 finalizer requires Host DISARMED');
73
+ return true;
74
+ }
75
+ function currentAuthorityStatus(){
76
+ const result=spawnSync(ps,['-NoLogo','-NoProfile','-ExecutionPolicy','Bypass','-File',launcher,'status'],
77
+ {encoding:'utf8',windowsHide:true,timeout:20000,env:windowsPowerShellEnvironment()});
78
+ if(result.error) throw result.error;
79
+ if(result.status!==0) throw new Error(`R44 finalizer controller status failed: ${result.stderr||result.stdout}`);
80
+ return parseControllerStatus(result.stdout??'');
81
+ }
82
+ export function validateWindowsGateEvidence(value,manifestSha256,parent){
83
+ insist(value?.schema==='deadbyte.r44-windows-gate.v1'&&value.status==='passed'&&value.exit_code===0,'R44 Windows gate evidence invalid');
84
+ insist(value.version===EXPECTED_VERSION&&value.manifest_sha256===manifestSha256,'R44 Windows gate candidate mismatch');
85
+ insist(value.marker==='DEADBYTE V0.15.0 / R44 REMOTE AGENT SKILL WINDOWS BATCH GATE: PASS','R44 Windows gate marker mismatch');
86
+ insist(value.parent?.release_id===parent.release_id&&value.parent?.manifest_sha256===parent.manifest_sha256,'R44 Windows gate parent mismatch');
87
+ insist(value.parent?.generation_manifest_sha256===parent.generation_manifest_sha256,'R44 Windows gate parent generation mismatch');
88
+ insist(value.parent?.final_closure_sha256===PARENT_FINAL_CLOSURE&&value.parent?.final_closure_sha256===parent.closure_sha256,'R44 Windows gate parent final closure mismatch');
89
+ for(const key of ['skill_integrity','agent_backend_persistence','codex_protocol_contract','remote_device_identity','durable_job_supervisor','real_external_supervisor_smoke','full_regression_required']) {
90
+ insist(value.features?.[key]===true,`R44 Windows gate feature contract missing ${key}`);
91
+ }
92
+ return true;
93
+ }
94
+ function disarmFailClosed(){
95
+ const results=[];
96
+ for(const command of ['disarmdesktop','disarmautonomous','disarmcoding','disarmprocess','disarmhost']){
97
+ const result=spawnSync(ps,['-NoLogo','-NoProfile','-ExecutionPolicy','Bypass','-File',launcher,command],
98
+ {encoding:'utf8',windowsHide:true,timeout:20000,env:windowsPowerShellEnvironment()});
99
+ results.push({command,status:result.status,signal:result.signal??null});
100
+ }
101
+ return results;
102
+ }
103
+ async function mirrorRoot(){
104
+ const pointer=await activePointer();
105
+ const policy=JSON.parse(await readFile(path.join(pointer.generation_root,'coding-policy.json'),'utf8'));
106
+ const raw=policy?.roots?.parity_scratch?.path??policy?.roots?.parity_scratch?.real_path;
107
+ if(typeof raw!=='string'||!path.isAbsolute(raw)) throw new Error('active generation parity_scratch root unavailable');
108
+ const stat=await lstat(raw);
109
+ if(!stat.isDirectory()||stat.isSymbolicLink()) throw new Error('parity_scratch root must be a real directory');
110
+ return raw;
111
+ }
112
+ async function writeMirror(manifestSha256,value){
113
+ const root=await mirrorRoot();
114
+ const file=path.join(root,`r44-final-${manifestSha256.slice(0,16)}.json`);
115
+ return atomicJson(file,value);
116
+ }
117
+ async function verifyInputs(manifestSha256){
118
+ insist(HEX64.test(manifestSha256??''),'R44 finalizer manifest invalid');
119
+ const manifestBytes=await readFile(path.join(packageRoot,'MANIFEST.SHA256'));
120
+ insist(sha256(manifestBytes)===manifestSha256,'R44 finalizer manifest drift');
121
+ const pkg=JSON.parse(await readFile(path.join(packageRoot,'package.json'),'utf8'));
122
+ insist(pkg?.name==='deadbyte-mcp'&&pkg?.version===EXPECTED_VERSION,'R44 finalizer package identity mismatch');
123
+ const parent=await verifyR44Parent(path.join(packageRoot,'R44-PARENT.json'));
124
+ const authorityStatus=currentAuthorityStatus();
125
+ validateFinalizerAuthorityStatus(authorityStatus);
126
+ const before=await activePointer();
127
+ insist(before.release_id===PARENT_RELEASE_ID&&before.manifest_sha256===PARENT_MANIFEST,'R44 finalizer must start from exact sealed R43 parent');
128
+ const windowsGatePath=path.join(stateRoot,'evidence','release',`r44-windows-gate-${manifestSha256.slice(0,16)}.json`);
129
+ const windowsGateBytes=await readFile(windowsGatePath);
130
+ const windowsGate=JSON.parse(windowsGateBytes.toString('utf8').replace(/^\uFEFF/,''));
131
+ validateWindowsGateEvidence(windowsGate,manifestSha256,parent);
132
+ return {parent,before,authorityStatus,windowsGatePath,windowsGateFileSha256:sha256(windowsGateBytes)};
133
+ }
134
+ async function runWorker(manifestSha256,operationId){
135
+ const statePath=path.join(evidenceRoot,`${operationId}.json`);
136
+ let activation=null;
137
+ let parity=null;
138
+ try{
139
+ await atomicJson(statePath,{schema:'deadbyte.r44-finalization-state.v1',operation_id:operationId,status:'running',
140
+ manifest_sha256:manifestSha256,started_at_utc:new Date().toISOString()});
141
+ const inputs=await verifyInputs(manifestSha256);
142
+ activation=await runSlotUpdateCli(await activationArgs(manifestSha256),{stateRoot});
143
+ insist(activation?.pointer?.version===EXPECTED_VERSION&&activation.pointer.manifest_sha256===manifestSha256,'R44 activation result mismatch');
144
+ insist(activation?.final_authority?.process_armed===true&&activation?.final_authority?.coding_armed===true&&activation?.final_authority?.autonomous_armed===true,
145
+ 'R44 activation must restore prior Process+Coding+Autonomous standing grants for detached parity');
146
+ insist(activation?.final_authority?.desktop_armed===false&&activation?.final_authority?.host_armed===false,
147
+ 'R44 activation must keep Desktop+Host disarmed');
148
+
149
+ parity=await runReleaseParity(activation.receipt_path);
150
+ insist(parity?.evidence?.status==='passed'&&parity.evidence?.candidate?.manifest_sha256===manifestSha256,'R44 parity result mismatch');
151
+
152
+ const closure=await writeFinalClosure({parityPath:parity.evidence_path,activationPath:activation.receipt_path,
153
+ windowsGatePath:inputs.windowsGatePath});
154
+ const envelope=JSON.parse(await readFile(closure.path,'utf8'));
155
+ const verified=await verifyFinalClosureObject(envelope,{stateRoot});
156
+ insist(verified?.ok===true&&verified.status==='passed'&&verified.manifest_sha256===manifestSha256,'R44 independent final closure verification failed');
157
+
158
+ const pointer=await activePointer();
159
+ const result={schema:'deadbyte.r44-finalization-result.v1',status:'passed',verified:true,
160
+ completed_at_utc:new Date().toISOString(),release_id:pointer.release_id,version:pointer.version,
161
+ manifest_sha256:pointer.manifest_sha256,generation_manifest_sha256:pointer.generation_manifest_sha256,
162
+ activation_receipt_sha256:activation.receipt_sha256,
163
+ parity_sha256:parity.evidence_sha256,windows_gate_sha256:inputs.windowsGateFileSha256,
164
+ closure_file_sha256:closure.sha256,closure_sha256:closure.closure_sha256,
165
+ full_tool_count:verified.full_tool_count,compact_tool_count:verified.compact_tool_count,
166
+ parent_release_id:inputs.parent.release_id,parent_manifest_sha256:inputs.parent.manifest_sha256};
167
+ const mirror=await writeMirror(manifestSha256,result);
168
+ await atomicJson(statePath,{...result,operation_id:operationId,mirror_path:mirror.path,mirror_sha256:mirror.sha256,
169
+ activation_receipt_path:activation.receipt_path,parity_path:parity.evidence_path,closure_path:closure.path});
170
+ return result;
171
+ }catch(error){
172
+ let rollback=null;
173
+ try{
174
+ if(activation?.receipt_path){
175
+ const pointer=await activePointer().catch(()=>null);
176
+ if(pointer?.version===EXPECTED_VERSION&&pointer?.manifest_sha256===manifestSha256){
177
+ rollback=await runSlotUpdateCli(['--rollback-receipt',activation.receipt_path],{stateRoot});
178
+ }
179
+ }
180
+ }catch(rollbackError){rollback={error:String(rollbackError?.message??rollbackError)};}
181
+ const disarm=disarmFailClosed();
182
+ const failed={schema:'deadbyte.r44-finalization-result.v1',status:'failed',verified:false,
183
+ completed_at_utc:new Date().toISOString(),manifest_sha256:manifestSha256,
184
+ error:String(error?.message??error),rollback:rollback?{ok:rollback?.ok===true,error:rollback?.error??null}:null,disarm};
185
+ await atomicJson(statePath,{...failed,operation_id:operationId}).catch(()=>{});
186
+ await writeMirror(manifestSha256,failed).catch(()=>{});
187
+ throw error;
188
+ }
189
+ }
190
+ export async function scheduleFinalization(manifestSha256){
191
+ insist(HEX64.test(manifestSha256??''),'R44 finalizer manifest invalid');
192
+ const operationId=`r44-${manifestSha256.slice(0,16)}-${randomBytes(8).toString('hex')}`;
193
+ const statePath=path.join(evidenceRoot,`${operationId}.json`);
194
+ await atomicJson(statePath,{schema:'deadbyte.r44-finalization-state.v1',operation_id:operationId,status:'scheduled',
195
+ manifest_sha256:manifestSha256,scheduled_at_utc:new Date().toISOString()});
196
+ const child=spawn(process.execPath,[fileURLToPath(import.meta.url),manifestSha256,'--worker',operationId],{
197
+ cwd:packageRoot,detached:true,stdio:'ignore',windowsHide:true,env:{...process.env,DEADBYTE_STATE_ROOT:stateRoot}
198
+ });
199
+ child.unref();
200
+ return {status:'scheduled',operation_id:operationId,state_path:statePath,manifest_sha256:manifestSha256,
201
+ execution_provider:'deadbyte_mcp',rdc_operation_count:0};
202
+ }
203
+
204
+ const invoked=process.argv[1]&&path.resolve(process.argv[1])===fileURLToPath(import.meta.url);
205
+ if(invoked){
206
+ const [manifestSha256,flag,operationId]=process.argv.slice(2);
207
+ try{
208
+ if(flag==='--worker'){
209
+ insist(/^r44-[0-9a-f]{16}-[0-9a-f]{16}$/.test(operationId??''),'R44 finalizer worker operation id invalid');
210
+ await sleep(4000);
211
+ await runWorker(manifestSha256,operationId);
212
+ }else{
213
+ insist(flag===undefined&&operationId===undefined,'usage: node scripts/finalize-r44.mjs <manifest_sha256>');
214
+ console.log(JSON.stringify(await scheduleFinalization(manifestSha256)));
215
+ }
216
+ }catch(error){console.error(error instanceof Error?error.stack:String(error));process.exitCode=1;}
217
+ }
@@ -0,0 +1,219 @@
1
+ import { createHash, randomBytes } from 'node:crypto';
2
+ import { spawn, spawnSync } from 'node:child_process';
3
+ import { lstat, mkdir, readFile, realpath, rename, writeFile } from 'node:fs/promises';
4
+ import os from 'node:os';
5
+ import path from 'node:path';
6
+ import { fileURLToPath } from 'node:url';
7
+ import { parseActivePointer } from '../src/release-slot.mjs';
8
+ import { loadPowerShellDataFile, parseControllerStatus, runSlotUpdateCli, windowsPowerShellEnvironment } from '../src/runtime-update.mjs';
9
+ import { verifyR45Parent } from './verify-r45-parent.mjs';
10
+ import { runReleaseParity } from './release-parity-r45.mjs';
11
+ import { writeFinalClosure } from './final-closure-r45.mjs';
12
+ import { verifyFinalClosureObject } from './final-closure-verify-r45.mjs';
13
+
14
+ const HEX64=/^[0-9a-f]{64}$/;
15
+ const EXPECTED_VERSION='0.15.1';
16
+ const PARENT_RELEASE_ID='v0.15.0-c15fa41719be61b3';
17
+ const PARENT_MANIFEST='c15fa41719be61b3186e49b2367a5f4c057365cfb465102dbefb7d7355f45483';
18
+ const PARENT_FINAL_CLOSURE='533b7e0ff9ded04086dd90ed34e3b87bc427acc3c55c25bb9f4ec66cb448e667';
19
+ const here=path.dirname(fileURLToPath(import.meta.url));
20
+ const packageRoot=path.resolve(here,'..');
21
+ const stateRoot=path.resolve(process.env.DEADBYTE_STATE_ROOT||path.join(os.homedir(),'.deadbyte-mcp'));
22
+ const evidenceRoot=path.join(stateRoot,'evidence','release','r45-finalization');
23
+ const launcher=path.join(stateRoot,'bin','DEADBYTE-MCP.ps1');
24
+ const ps=path.join(process.env.SystemRoot||'C:\\Windows','System32','WindowsPowerShell','v1.0','powershell.exe');
25
+ const sha256=bytes=>createHash('sha256').update(bytes).digest('hex');
26
+ const sleep=ms=>new Promise(resolve=>setTimeout(resolve,ms));
27
+ const insist=(ok,message)=>{if(!ok)throw new Error(message);};
28
+
29
+ async function atomicJson(file,value){
30
+ await mkdir(path.dirname(file),{recursive:true});
31
+ const bytes=Buffer.from(`${JSON.stringify(value,null,2)}\n`,'utf8');
32
+ const temp=`${file}.${process.pid}.${randomBytes(4).toString('hex')}.tmp`;
33
+ await writeFile(temp,bytes,{flag:'wx'});
34
+ await rename(temp,file);
35
+ return {path:file,sha256:sha256(bytes)};
36
+ }
37
+ async function activePointer(){
38
+ return parseActivePointer(await readFile(path.join(stateRoot,'active-release.json'),'utf8'));
39
+ }
40
+ async function bridgeArgs(){
41
+ const pointer=await activePointer();
42
+ const config=await loadPowerShellDataFile(pointer.config_path);
43
+ const raw=config?.Bridge?.WorkingDirectory;
44
+ insist(typeof raw==='string'&&path.isAbsolute(raw),'active Bridge.WorkingDirectory must be absolute');
45
+ const root=await realpath(path.resolve(raw));
46
+ const pkg=JSON.parse(await readFile(path.join(root,'package.json'),'utf8'));
47
+ insist(pkg?.name==='deadbyte-chatgpt-bridge','active Bridge package identity mismatch');
48
+ const script=path.join(root,'src','bridge.mjs');
49
+ return ['--bridge-root',root,'--bridge-script-sha256',sha256(await readFile(script))];
50
+ }
51
+ async function activationArgs(manifestSha256){
52
+ insist(HEX64.test(manifestSha256??''),'R45 finalizer manifest must be lowercase SHA-256');
53
+ const processPolicy=path.join(packageRoot,'controller','deadbyte-process-policy.json');
54
+ const hostPolicy=path.join(packageRoot,'controller','deadbyte-host-policy.json');
55
+ const desktopPolicy=path.join(packageRoot,'controller','deadbyte-desktop-policy.json');
56
+ const semantic=path.join(packageRoot,'controller','deadbyte-semantic-lsp-config.json');
57
+ return [
58
+ '--stage',packageRoot,'--development-root',packageRoot,'--expected-version',EXPECTED_VERSION,
59
+ '--expected-manifest',manifestSha256,
60
+ '--process-policy',processPolicy,'--process-policy-sha256',sha256(await readFile(processPolicy)),
61
+ '--host-policy',hostPolicy,'--host-policy-sha256',sha256(await readFile(hostPolicy)),
62
+ '--desktop-policy',desktopPolicy,'--desktop-policy-sha256',sha256(await readFile(desktopPolicy)),
63
+ '--semantic-lsp-config',semantic,'--semantic-lsp-config-sha256',sha256(await readFile(semantic)),
64
+ '--enable-machine-fs','--enable-observation','--enable-desktop','--enable-autonomous-supervisor',
65
+ '--restore-standing-grants',
66
+ ...await bridgeArgs()
67
+ ];
68
+ }
69
+ export function validateFinalizerAuthorityStatus(status){
70
+ insist(status?.process_armed===true,'R45 finalizer requires Process standing grant');
71
+ insist(status?.coding_armed===true,'R45 finalizer requires Coding standing grant');
72
+ insist(status?.autonomous_armed===true,'R45 finalizer requires Autonomous standing grant');
73
+ insist(status?.desktop_armed===false,'R45 finalizer requires Desktop DISARMED');
74
+ insist(status?.host_armed===false,'R45 finalizer requires Host DISARMED');
75
+ return true;
76
+ }
77
+ function currentAuthorityStatus(){
78
+ const result=spawnSync(ps,['-NoLogo','-NoProfile','-ExecutionPolicy','Bypass','-File',launcher,'status'],
79
+ {encoding:'utf8',windowsHide:true,timeout:20000,env:windowsPowerShellEnvironment()});
80
+ if(result.error) throw result.error;
81
+ if(result.status!==0) throw new Error(`R45 finalizer controller status failed: ${result.stderr||result.stdout}`);
82
+ return parseControllerStatus(result.stdout??'');
83
+ }
84
+ export function validateWindowsGateEvidence(value,manifestSha256,parent){
85
+ insist(value?.schema==='deadbyte.r45-windows-gate.v1'&&value.status==='passed'&&value.exit_code===0,'R45 Windows gate evidence invalid');
86
+ insist(value.version===EXPECTED_VERSION&&value.manifest_sha256===manifestSha256,'R45 Windows gate candidate mismatch');
87
+ insist(value.marker==='DEADBYTE V0.15.1 / R45 MACHINE FREEDOM WINDOWS BATCH GATE: PASS','R45 Windows gate marker mismatch');
88
+ insist(value.parent?.release_id===parent.release_id&&value.parent?.manifest_sha256===parent.manifest_sha256,'R45 Windows gate parent mismatch');
89
+ insist(value.parent?.generation_manifest_sha256===parent.generation_manifest_sha256,'R45 Windows gate parent generation mismatch');
90
+ insist(value.parent?.final_closure_sha256===PARENT_FINAL_CLOSURE&&value.parent?.final_closure_sha256===parent.closure_sha256,'R45 Windows gate parent final closure mismatch');
91
+ for(const key of ['skill_integrity','agent_backend_persistence','codex_protocol_contract','remote_device_identity','durable_job_supervisor','real_external_supervisor_smoke','full_regression_required','host_inline_native','native_hardware_observation','doctor_release_truth']) {
92
+ insist(value.features?.[key]===true,`R45 Windows gate feature contract missing ${key}`);
93
+ }
94
+ return true;
95
+ }
96
+ function disarmFailClosed(){
97
+ const results=[];
98
+ for(const command of ['disarmdesktop','disarmautonomous','disarmcoding','disarmprocess','disarmhost']){
99
+ const result=spawnSync(ps,['-NoLogo','-NoProfile','-ExecutionPolicy','Bypass','-File',launcher,command],
100
+ {encoding:'utf8',windowsHide:true,timeout:20000,env:windowsPowerShellEnvironment()});
101
+ results.push({command,status:result.status,signal:result.signal??null});
102
+ }
103
+ return results;
104
+ }
105
+ async function mirrorRoot(){
106
+ const pointer=await activePointer();
107
+ const policy=JSON.parse(await readFile(path.join(pointer.generation_root,'coding-policy.json'),'utf8'));
108
+ const raw=policy?.roots?.parity_scratch?.path??policy?.roots?.parity_scratch?.real_path;
109
+ if(typeof raw!=='string'||!path.isAbsolute(raw)) throw new Error('active generation parity_scratch root unavailable');
110
+ const stat=await lstat(raw);
111
+ if(!stat.isDirectory()||stat.isSymbolicLink()) throw new Error('parity_scratch root must be a real directory');
112
+ return raw;
113
+ }
114
+ async function writeMirror(manifestSha256,value){
115
+ const root=await mirrorRoot();
116
+ const file=path.join(root,`r45-final-${manifestSha256.slice(0,16)}.json`);
117
+ return atomicJson(file,value);
118
+ }
119
+ async function verifyInputs(manifestSha256){
120
+ insist(HEX64.test(manifestSha256??''),'R45 finalizer manifest invalid');
121
+ const manifestBytes=await readFile(path.join(packageRoot,'MANIFEST.SHA256'));
122
+ insist(sha256(manifestBytes)===manifestSha256,'R45 finalizer manifest drift');
123
+ const pkg=JSON.parse(await readFile(path.join(packageRoot,'package.json'),'utf8'));
124
+ insist(pkg?.name==='deadbyte-mcp'&&pkg?.version===EXPECTED_VERSION,'R45 finalizer package identity mismatch');
125
+ const parent=await verifyR45Parent(path.join(packageRoot,'R45-PARENT.json'));
126
+ const authorityStatus=currentAuthorityStatus();
127
+ validateFinalizerAuthorityStatus(authorityStatus);
128
+ const before=await activePointer();
129
+ insist(before.release_id===PARENT_RELEASE_ID&&before.manifest_sha256===PARENT_MANIFEST,'R45 finalizer must start from exact sealed R44 parent');
130
+ const windowsGatePath=path.join(stateRoot,'evidence','release',`r45-windows-gate-${manifestSha256.slice(0,16)}.json`);
131
+ const windowsGateBytes=await readFile(windowsGatePath);
132
+ const windowsGate=JSON.parse(windowsGateBytes.toString('utf8').replace(/^\uFEFF/,''));
133
+ validateWindowsGateEvidence(windowsGate,manifestSha256,parent);
134
+ return {parent,before,authorityStatus,windowsGatePath,windowsGateFileSha256:sha256(windowsGateBytes)};
135
+ }
136
+ async function runWorker(manifestSha256,operationId){
137
+ const statePath=path.join(evidenceRoot,`${operationId}.json`);
138
+ let activation=null;
139
+ let parity=null;
140
+ try{
141
+ await atomicJson(statePath,{schema:'deadbyte.r45-finalization-state.v1',operation_id:operationId,status:'running',
142
+ manifest_sha256:manifestSha256,started_at_utc:new Date().toISOString()});
143
+ const inputs=await verifyInputs(manifestSha256);
144
+ activation=await runSlotUpdateCli(await activationArgs(manifestSha256),{stateRoot});
145
+ insist(activation?.pointer?.version===EXPECTED_VERSION&&activation.pointer.manifest_sha256===manifestSha256,'R45 activation result mismatch');
146
+ insist(activation?.final_authority?.process_armed===true&&activation?.final_authority?.coding_armed===true&&activation?.final_authority?.autonomous_armed===true,
147
+ 'R45 activation must restore prior Process+Coding+Autonomous standing grants for detached parity');
148
+ insist(activation?.final_authority?.desktop_armed===false&&activation?.final_authority?.host_armed===false,
149
+ 'R45 activation must keep Desktop+Host disarmed');
150
+
151
+ parity=await runReleaseParity(activation.receipt_path);
152
+ insist(parity?.evidence?.status==='passed'&&parity.evidence?.candidate?.manifest_sha256===manifestSha256,'R45 parity result mismatch');
153
+
154
+ const closure=await writeFinalClosure({parityPath:parity.evidence_path,activationPath:activation.receipt_path,
155
+ windowsGatePath:inputs.windowsGatePath});
156
+ const envelope=JSON.parse(await readFile(closure.path,'utf8'));
157
+ const verified=await verifyFinalClosureObject(envelope,{stateRoot});
158
+ insist(verified?.ok===true&&verified.status==='passed'&&verified.manifest_sha256===manifestSha256,'R45 independent final closure verification failed');
159
+
160
+ const pointer=await activePointer();
161
+ const result={schema:'deadbyte.r45-finalization-result.v1',status:'passed',verified:true,
162
+ completed_at_utc:new Date().toISOString(),release_id:pointer.release_id,version:pointer.version,
163
+ manifest_sha256:pointer.manifest_sha256,generation_manifest_sha256:pointer.generation_manifest_sha256,
164
+ activation_receipt_sha256:activation.receipt_sha256,
165
+ parity_sha256:parity.evidence_sha256,windows_gate_sha256:inputs.windowsGateFileSha256,
166
+ closure_file_sha256:closure.sha256,closure_sha256:closure.closure_sha256,
167
+ full_tool_count:verified.full_tool_count,compact_tool_count:verified.compact_tool_count,
168
+ parent_release_id:inputs.parent.release_id,parent_manifest_sha256:inputs.parent.manifest_sha256};
169
+ const mirror=await writeMirror(manifestSha256,result);
170
+ await atomicJson(statePath,{...result,operation_id:operationId,mirror_path:mirror.path,mirror_sha256:mirror.sha256,
171
+ activation_receipt_path:activation.receipt_path,parity_path:parity.evidence_path,closure_path:closure.path});
172
+ return result;
173
+ }catch(error){
174
+ let rollback=null;
175
+ try{
176
+ if(activation?.receipt_path){
177
+ const pointer=await activePointer().catch(()=>null);
178
+ if(pointer?.version===EXPECTED_VERSION&&pointer?.manifest_sha256===manifestSha256){
179
+ rollback=await runSlotUpdateCli(['--rollback-receipt',activation.receipt_path],{stateRoot});
180
+ }
181
+ }
182
+ }catch(rollbackError){rollback={error:String(rollbackError?.message??rollbackError)};}
183
+ const disarm=disarmFailClosed();
184
+ const failed={schema:'deadbyte.r45-finalization-result.v1',status:'failed',verified:false,
185
+ completed_at_utc:new Date().toISOString(),manifest_sha256:manifestSha256,
186
+ error:String(error?.message??error),rollback:rollback?{ok:rollback?.ok===true,error:rollback?.error??null}:null,disarm};
187
+ await atomicJson(statePath,{...failed,operation_id:operationId}).catch(()=>{});
188
+ await writeMirror(manifestSha256,failed).catch(()=>{});
189
+ throw error;
190
+ }
191
+ }
192
+ export async function scheduleFinalization(manifestSha256){
193
+ insist(HEX64.test(manifestSha256??''),'R45 finalizer manifest invalid');
194
+ const operationId=`r45-${manifestSha256.slice(0,16)}-${randomBytes(8).toString('hex')}`;
195
+ const statePath=path.join(evidenceRoot,`${operationId}.json`);
196
+ await atomicJson(statePath,{schema:'deadbyte.r45-finalization-state.v1',operation_id:operationId,status:'scheduled',
197
+ manifest_sha256:manifestSha256,scheduled_at_utc:new Date().toISOString()});
198
+ const child=spawn(process.execPath,[fileURLToPath(import.meta.url),manifestSha256,'--worker',operationId],{
199
+ cwd:packageRoot,detached:true,stdio:'ignore',windowsHide:true,env:{...process.env,DEADBYTE_STATE_ROOT:stateRoot}
200
+ });
201
+ child.unref();
202
+ return {status:'scheduled',operation_id:operationId,state_path:statePath,manifest_sha256:manifestSha256,
203
+ execution_provider:'deadbyte_mcp',rdc_operation_count:0};
204
+ }
205
+
206
+ const invoked=process.argv[1]&&path.resolve(process.argv[1])===fileURLToPath(import.meta.url);
207
+ if(invoked){
208
+ const [manifestSha256,flag,operationId]=process.argv.slice(2);
209
+ try{
210
+ if(flag==='--worker'){
211
+ insist(/^r45-[0-9a-f]{16}-[0-9a-f]{16}$/.test(operationId??''),'R45 finalizer worker operation id invalid');
212
+ await sleep(4000);
213
+ await runWorker(manifestSha256,operationId);
214
+ }else{
215
+ insist(flag===undefined&&operationId===undefined,'usage: node scripts/finalize-r45.mjs <manifest_sha256>');
216
+ console.log(JSON.stringify(await scheduleFinalization(manifestSha256)));
217
+ }
218
+ }catch(error){console.error(error instanceof Error?error.stack:String(error));process.exitCode=1;}
219
+ }
@@ -0,0 +1,20 @@
1
+ import { spawnSync } from 'node:child_process';
2
+ import { readdir } from 'node:fs/promises';
3
+ import path from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+
6
+ const here=path.dirname(fileURLToPath(import.meta.url));
7
+ const root=path.resolve(here,'..');
8
+ const testDir=path.join(root,'test');
9
+ const files=(await readdir(testDir,{withFileTypes:true}))
10
+ .filter(entry=>entry.isFile()&&entry.name.endsWith('.test.mjs'))
11
+ .map(entry=>path.join('test',entry.name))
12
+ .sort((a,b)=>a.localeCompare(b,'en'));
13
+ if(files.length<1) throw new Error('R43 full regression found no test files');
14
+ console.log(`R43-FULL-REGRESSION files=${files.length}`);
15
+ const result=spawnSync(process.execPath,['--test',...files],{
16
+ cwd:root,stdio:'inherit',windowsHide:true,shell:false
17
+ });
18
+ if(result.error) throw result.error;
19
+ if(result.signal) throw new Error(`R43 full regression terminated by ${result.signal}`);
20
+ process.exitCode=Number.isInteger(result.status)?result.status:1;
@@ -0,0 +1,20 @@
1
+ import { spawnSync } from 'node:child_process';
2
+ import { readdir } from 'node:fs/promises';
3
+ import path from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+
6
+ const here=path.dirname(fileURLToPath(import.meta.url));
7
+ const root=path.resolve(here,'..');
8
+ const testDir=path.join(root,'test');
9
+ const files=(await readdir(testDir,{withFileTypes:true}))
10
+ .filter(entry=>entry.isFile()&&entry.name.endsWith('.test.mjs'))
11
+ .map(entry=>path.join('test',entry.name))
12
+ .sort((a,b)=>a.localeCompare(b,'en'));
13
+ if(files.length<1) throw new Error('R44 full regression found no test files');
14
+ console.log(`R44-FULL-REGRESSION files=${files.length}`);
15
+ const result=spawnSync(process.execPath,['--test',...files],{
16
+ cwd:root,stdio:'inherit',windowsHide:true,shell:false
17
+ });
18
+ if(result.error) throw result.error;
19
+ if(result.signal) throw new Error(`R44 full regression terminated by ${result.signal}`);
20
+ process.exitCode=Number.isInteger(result.status)?result.status:1;
@@ -0,0 +1,20 @@
1
+ import { spawnSync } from 'node:child_process';
2
+ import { readdir } from 'node:fs/promises';
3
+ import path from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+
6
+ const here=path.dirname(fileURLToPath(import.meta.url));
7
+ const root=path.resolve(here,'..');
8
+ const testDir=path.join(root,'test');
9
+ const files=(await readdir(testDir,{withFileTypes:true}))
10
+ .filter(entry=>entry.isFile()&&entry.name.endsWith('.test.mjs')&&entry.name!=='full-max-catalog-r44.test.mjs')
11
+ .map(entry=>path.join('test',entry.name))
12
+ .sort((a,b)=>a.localeCompare(b,'en'));
13
+ if(files.length<1) throw new Error('R45 full regression found no test files');
14
+ console.log(`R45-FULL-REGRESSION files=${files.length}`);
15
+ const result=spawnSync(process.execPath,['--test','--test-concurrency=1',...files],{
16
+ cwd:root,stdio:'inherit',windowsHide:true,shell:false
17
+ });
18
+ if(result.error) throw result.error;
19
+ if(result.signal) throw new Error(`R45 full regression terminated by ${result.signal}`);
20
+ process.exitCode=Number.isInteger(result.status)?result.status:1;
@@ -0,0 +1,14 @@
1
+ import { spawnSync } from 'node:child_process';
2
+ import { readdir } from 'node:fs/promises';
3
+ import path from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ const root=path.resolve(path.dirname(fileURLToPath(import.meta.url)),'..');
6
+ const files=(await readdir(path.join(root,'test'),{withFileTypes:true})).filter(e=>e.isFile()&&e.name.endsWith('.test.mjs')).map(e=>path.join('test',e.name)).sort();
7
+ const r=spawnSync(process.execPath,['--test','--test-reporter=spec',...files],{cwd:root,encoding:'utf8',windowsHide:true,shell:false,maxBuffer:64*1024*1024});
8
+ if(r.error) throw r.error;
9
+ const lines=(String(r.stdout||'')+'\n'+String(r.stderr||'')).split(/\r?\n/);
10
+ for(let i=0;i<lines.length;i++){
11
+ if(lines[i].startsWith('✖ ')||/^ℹ fail /.test(lines[i])||/^test at /.test(lines[i])) console.log(lines[i]);
12
+ }
13
+ console.log('EXIT='+String(r.status));
14
+ process.exitCode=Number.isInteger(r.status)?r.status:1;
@@ -0,0 +1,36 @@
1
+ $ErrorActionPreference = 'Stop'
2
+ Set-StrictMode -Version 2.0
3
+ function Invoke-GateStep {
4
+ param([Parameter(Mandatory = $true)][string]$Name,[Parameter(Mandatory = $true)][string[]]$NpmArgs)
5
+ Write-Host "==== $Name ===="
6
+ & npm.cmd @NpmArgs
7
+ if ($LASTEXITCODE -ne 0) { throw "DEADBYTE V0.14.1 / R43 gate failed at $Name with exit code $LASTEXITCODE" }
8
+ }
9
+ Invoke-GateStep -Name 'r43-parent-verify' -NpmArgs @('run','r43:parent:verify')
10
+ Invoke-GateStep -Name 'containment-build' -NpmArgs @('run','containment:build')
11
+ Invoke-GateStep -Name 'process-policy-refresh' -NpmArgs @('run','process:policy:refresh')
12
+ Invoke-GateStep -Name 'desktop-policy-refresh' -NpmArgs @('run','desktop:policy:refresh')
13
+ Invoke-GateStep -Name 'release-manifest-write' -NpmArgs @('run','manifest:write')
14
+ Invoke-GateStep -Name 'release-manifest' -NpmArgs @('run','manifest:verify')
15
+ Write-Host '==== r43-hardening-focused ===='
16
+ & powershell.exe -NoProfile -ExecutionPolicy Bypass -File (Join-Path $PSScriptRoot 'release-parity-tests-r43.ps1')
17
+ if ($LASTEXITCODE -ne 0) { throw "DEADBYTE V0.14.1 / R43 gate failed at r43-hardening-focused with exit code $LASTEXITCODE" }
18
+ Invoke-GateStep -Name 'full-regression' -NpmArgs @('run','r43:full:test')
19
+ Invoke-GateStep -Name 'mcp-smoke' -NpmArgs @('run','mcp:smoke')
20
+ Invoke-GateStep -Name 'mcp-agent-smoke' -NpmArgs @('run','mcp:agent:smoke')
21
+ Invoke-GateStep -Name 'mcp-coding-smoke' -NpmArgs @('run','mcp:coding:smoke')
22
+ Invoke-GateStep -Name 'mcp-machine-fs-smoke' -NpmArgs @('run','mcp:machine-fs:smoke')
23
+ Invoke-GateStep -Name 'mcp-observation-smoke' -NpmArgs @('run','mcp:observation:smoke')
24
+ Invoke-GateStep -Name 'mcp-process-smoke' -NpmArgs @('run','mcp:process:smoke')
25
+ Invoke-GateStep -Name 'mcp-autonomous-smoke' -NpmArgs @('run','mcp:autonomous:smoke')
26
+ Invoke-GateStep -Name 'tunnel-stdio-compat-smoke' -NpmArgs @('run','mcp:tunnel-compat:smoke')
27
+ Invoke-GateStep -Name 'mcp-host-smoke' -NpmArgs @('run','mcp:host:smoke')
28
+ Invoke-GateStep -Name 'authority-smoke' -NpmArgs @('run','authority:smoke')
29
+ Invoke-GateStep -Name 'containment-smoke' -NpmArgs @('run','containment:smoke')
30
+ Invoke-GateStep -Name 'contained-smoke' -NpmArgs @('run','contained:smoke')
31
+ Invoke-GateStep -Name 'mcp-contained-smoke' -NpmArgs @('run','mcp:contained:smoke')
32
+ Invoke-GateStep -Name 'release-manifest-final' -NpmArgs @('run','manifest:verify')
33
+ Write-Host '==== windows-gate-evidence ===='
34
+ & node.exe (Join-Path $PSScriptRoot 'windows-gate-evidence-r43.mjs')
35
+ if ($LASTEXITCODE -ne 0) { throw "DEADBYTE V0.14.1 / R43 gate failed at windows-gate-evidence with exit code $LASTEXITCODE" }
36
+ Write-Host '==== DEADBYTE V0.14.1 / R43 AUTHORITY HARDENING WINDOWS BATCH GATE: PASS ===='
@@ -0,0 +1,36 @@
1
+ $ErrorActionPreference = 'Stop'
2
+ Set-StrictMode -Version 2.0
3
+ function Invoke-GateStep {
4
+ param([Parameter(Mandatory = $true)][string]$Name,[Parameter(Mandatory = $true)][string[]]$NpmArgs)
5
+ Write-Host "==== $Name ===="
6
+ & npm.cmd @NpmArgs
7
+ if ($LASTEXITCODE -ne 0) { throw "DEADBYTE V0.15.0 / R44 gate failed at $Name with exit code $LASTEXITCODE" }
8
+ }
9
+ Invoke-GateStep -Name 'r44-parent-verify' -NpmArgs @('run','r44:parent:verify')
10
+ Invoke-GateStep -Name 'containment-build' -NpmArgs @('run','containment:build')
11
+ Invoke-GateStep -Name 'process-policy-refresh' -NpmArgs @('run','process:policy:refresh')
12
+ Invoke-GateStep -Name 'desktop-policy-refresh' -NpmArgs @('run','desktop:policy:refresh')
13
+ Invoke-GateStep -Name 'release-manifest-write' -NpmArgs @('run','manifest:write')
14
+ Invoke-GateStep -Name 'release-manifest' -NpmArgs @('run','manifest:verify')
15
+ Write-Host '==== r44-feature-focused ===='
16
+ & powershell.exe -NoProfile -ExecutionPolicy Bypass -File (Join-Path $PSScriptRoot 'release-parity-tests-r44.ps1')
17
+ if ($LASTEXITCODE -ne 0) { throw "DEADBYTE V0.15.0 / R44 gate failed at r44-feature-focused with exit code $LASTEXITCODE" }
18
+ Invoke-GateStep -Name 'full-regression' -NpmArgs @('run','r44:full:test')
19
+ Invoke-GateStep -Name 'mcp-smoke' -NpmArgs @('run','mcp:smoke')
20
+ Invoke-GateStep -Name 'mcp-agent-smoke' -NpmArgs @('run','mcp:agent:smoke')
21
+ Invoke-GateStep -Name 'mcp-coding-smoke' -NpmArgs @('run','mcp:coding:smoke')
22
+ Invoke-GateStep -Name 'mcp-machine-fs-smoke' -NpmArgs @('run','mcp:machine-fs:smoke')
23
+ Invoke-GateStep -Name 'mcp-observation-smoke' -NpmArgs @('run','mcp:observation:smoke')
24
+ Invoke-GateStep -Name 'mcp-process-smoke' -NpmArgs @('run','mcp:process:smoke')
25
+ Invoke-GateStep -Name 'mcp-autonomous-smoke' -NpmArgs @('run','mcp:autonomous:smoke')
26
+ Invoke-GateStep -Name 'tunnel-stdio-compat-smoke' -NpmArgs @('run','mcp:tunnel-compat:smoke')
27
+ Invoke-GateStep -Name 'mcp-host-smoke' -NpmArgs @('run','mcp:host:smoke')
28
+ Invoke-GateStep -Name 'authority-smoke' -NpmArgs @('run','authority:smoke')
29
+ Invoke-GateStep -Name 'containment-smoke' -NpmArgs @('run','containment:smoke')
30
+ Invoke-GateStep -Name 'contained-smoke' -NpmArgs @('run','contained:smoke')
31
+ Invoke-GateStep -Name 'mcp-contained-smoke' -NpmArgs @('run','mcp:contained:smoke')
32
+ Invoke-GateStep -Name 'release-manifest-final' -NpmArgs @('run','manifest:verify')
33
+ Write-Host '==== windows-gate-evidence ===='
34
+ & node.exe (Join-Path $PSScriptRoot 'windows-gate-evidence-r44.mjs')
35
+ if ($LASTEXITCODE -ne 0) { throw "DEADBYTE V0.15.0 / R44 gate failed at windows-gate-evidence with exit code $LASTEXITCODE" }
36
+ Write-Host '==== DEADBYTE V0.15.0 / R44 REMOTE AGENT SKILL WINDOWS BATCH GATE: PASS ===='