deadbyte-mcp 0.15.65 → 0.15.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MANIFEST.SHA256 +68 -21
- package/PROVENANCE.json +35 -9
- package/README.txt +31 -18
- package/RELEASE.json +43 -7
- package/SBOM.cdx.json +2 -2
- package/TEST-MATRIX.json +45 -2
- package/bridge/package.json +1 -1
- package/controller/deadbyte-process-policy.json +4 -4
- package/docs/R168-ACTIVATION-RECONCILIATION-BLOCKER-20261026.md +39 -0
- package/docs/R168-CRASH-JOURNAL-PROTECTED-PREFLIGHT-20261026.md +46 -0
- package/docs/R168-FIVE-PLANE-FENCE-20261026.md +41 -0
- package/docs/R168-NATIVE-EXCLUSION-TERMINAL-CONTRACT-20261026.md +53 -0
- package/docs/R168-NPX-REMOTE-SKEW-HOTFIX-20261026.md +41 -0
- package/docs/R168-READONLY-AUDIT-AND-RESUME-20261026.md +56 -0
- package/docs/R168-SIGNED-RECONCILIATION-PRECOMMIT-20261026.md +45 -0
- package/docs/R169-NPX-ACTIVE-CONTROLLER-DELEGATION-20261026.md +57 -0
- package/node_modules/which/CHANGELOG.md +166 -0
- package/package.json +5 -2
- package/scripts/gate-windows-r168.ps1 +75 -0
- package/scripts/npm-release-r48.mjs +23 -3
- package/scripts/npm-release-readiness-r168.mjs +70 -0
- package/scripts/r168-audit-readonly.mjs +32 -0
- package/scripts/r168-npm-registry-readonly.mjs +19 -0
- package/scripts/r168-protected-preflight.mjs +65 -0
- package/scripts/r168-release-scan.mjs +28 -0
- package/scripts/r168-source-full-test-runner.mjs +46 -0
- package/scripts/r168-subject-readonly.mjs +49 -0
- package/scripts/r172-protected-preflight.mjs +42 -0
- package/src/activation-continuity-abort-r172.mjs +108 -0
- package/src/activation-lock-r65.mjs +5 -1
- package/src/activation-preflight-r65.mjs +2 -1
- package/src/activation-reconciliation-audit-r168.mjs +200 -0
- package/src/activation-reconciliation-consent-r168.mjs +235 -0
- package/src/activation-reconciliation-fence-r168.mjs +87 -0
- package/src/activation-reconciliation-journal-r168.mjs +100 -0
- package/src/activation-reconciliation-receipt-store-r168.mjs +42 -0
- package/src/activation-reconciliation-terminal-r168.mjs +111 -0
- package/src/active-controller-delegation-r169.mjs +57 -0
- package/src/deadbyte-cli.mjs +38 -0
- package/src/npm-publication-resume-r168.mjs +25 -0
- package/src/remote-one-shot-coherence-r168.mjs +43 -0
- package/src/version.mjs +1 -1
- package/test/r130-release-security-contract.test.mjs +7 -7
- package/test/r132-release-identity.test.mjs +8 -8
- package/test/r153-prepublish-identity.test.mjs +1 -1
- package/test/r163-isolated-slot-rollback-restore.test.mjs +2 -2
- package/test/r165-live-cli-skew.test.mjs +7 -7
- package/test/r167-release-contract.test.mjs +11 -10
- package/test/r168-combined-targeted-runner.mjs +14 -0
- package/test/r168-crash-journal.test.mjs +149 -0
- package/test/r168-five-plane-fence-runner.mjs +11 -0
- package/test/r168-five-plane-fence.test.mjs +128 -0
- package/test/r168-focused-suite.test.mjs +4 -0
- package/test/r168-native-five-plane-runner.mjs +11 -0
- package/test/r168-native-five-plane-scratch.test.mjs +49 -0
- package/test/r168-native-r85-protected-scratch.test.mjs +44 -0
- package/test/r168-npm-resume-identity.test.mjs +49 -0
- package/test/r168-owner-reconciliation-contract.test.mjs +250 -0
- package/test/r168-protected-entrypoint.test.mjs +53 -0
- package/test/r168-reconciliation-audit.test.mjs +42 -0
- package/test/r168-release-contract.test.mjs +46 -0
- package/test/r168-remote-one-shot-coherence.test.mjs +66 -0
- package/test/r169-delegate-active.test.mjs +36 -0
- package/test/r169-delegate-cli-integration.test.mjs +93 -0
- package/test/r169-targeted-runner.mjs +16 -0
- package/test/r172-activation-recovery.test.mjs +95 -0
- package/test/r172-release-contract.test.mjs +35 -0
- package/test/r59-tool-surface-compat.test.mjs +1 -1
- package/test/r63-one-shot-coherence.test.mjs +10 -5
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import {createHash} from 'node:crypto';
|
|
4
|
+
import {mkdtemp, mkdir, readFile, rm, writeFile} from 'node:fs/promises';
|
|
5
|
+
import os from 'node:os';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import {classifyActivationPreflight} from '../src/activation-preflight-r65.mjs';
|
|
8
|
+
import {createActivationClaimManager} from '../src/activation-lock-r65.mjs';
|
|
9
|
+
import {createAuthorityEpochStore} from '../src/authority-continuity-r65.mjs';
|
|
10
|
+
import {prepareAuthorityTestTrust} from './r65-authority-test-trust.mjs';
|
|
11
|
+
import {withAuthorityProof} from './helpers/r75-authority-proof.mjs';
|
|
12
|
+
|
|
13
|
+
const hex = c => c.repeat(64);
|
|
14
|
+
const sha = bytes => createHash('sha256').update(bytes).digest('hex');
|
|
15
|
+
const planes = ['process', 'coding', 'autonomous', 'desktop', 'host'];
|
|
16
|
+
|
|
17
|
+
test('R172 accepts epoch-revoked only when independent proof says verified disarmed', () => {
|
|
18
|
+
const parent = {release_id: 'v0-parent', version: '0.15.61', manifest_sha256: hex('1'), generation_manifest_sha256: hex('2')};
|
|
19
|
+
const authority = Object.fromEntries(planes.map(plane => [plane, {
|
|
20
|
+
configured: true, armed: false, reason: plane === 'coding' ? 'epoch-revoked' : 'disarmed',
|
|
21
|
+
epoch_seq: null, epoch_sha256: null
|
|
22
|
+
}]));
|
|
23
|
+
const policy_sha256 = Object.fromEntries(planes.map((plane, index) => [plane, hex(String(index + 3))]));
|
|
24
|
+
const observation = withAuthorityProof({state: 'ONLINE', local_ready: true,
|
|
25
|
+
bridge: {alive: true, reason: 'verified', pid: 10}, core: {alive: true, reason: 'verified', pid: 11},
|
|
26
|
+
cloud: {alive: true, reason: 'verified', pid: 12}, supervisor: {running: true}, authority, policy_sha256,
|
|
27
|
+
active_release_id: parent.release_id, active_manifest_sha256: parent.manifest_sha256,
|
|
28
|
+
active_generation_manifest_sha256: parent.generation_manifest_sha256});
|
|
29
|
+
const result = classifyActivationPreflight({pointer: parent, expectedParent: parent,
|
|
30
|
+
candidate: {version: '0.15.67', manifest_sha256: hex('9')},
|
|
31
|
+
expectedCandidate: {version: '0.15.67', manifest_sha256: hex('9')}, observation});
|
|
32
|
+
assert.equal(result.state, 'ONLINE_READY');
|
|
33
|
+
const forged = structuredClone(observation);
|
|
34
|
+
forged.authority_proof.coding.state = 'UNVERIFIED';
|
|
35
|
+
assert.equal(classifyActivationPreflight({pointer: parent, expectedParent: parent,
|
|
36
|
+
candidate: {version: '0.15.67', manifest_sha256: hex('9')},
|
|
37
|
+
expectedCandidate: {version: '0.15.67', manifest_sha256: hex('9')}, observation: forged}).state, 'AUTHORITY_UNVERIFIED');
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test('R172 reclaims a pre-dispatch continuity abort only after signed revoke has a trusted terminal grant', async () => {
|
|
41
|
+
const root = await mkdtemp(path.join(os.tmpdir(), 'deadbyte-r172-continuity-abort-'));
|
|
42
|
+
try {
|
|
43
|
+
const runtime = await prepareAuthorityTestTrust(root), updates = path.join(root, 'evidence', 'updates');
|
|
44
|
+
const generation = path.join(root, 'generations', 'v0-parent-g1');
|
|
45
|
+
await mkdir(updates, {recursive: true}); await mkdir(generation, {recursive: true});
|
|
46
|
+
const grantFile = path.join(runtime, 'coding-grant.json');
|
|
47
|
+
const policy = {schema: 'deadbyte.coding-policy.v1', enabled: true, lease_file: grantFile,
|
|
48
|
+
roots: {project: {path: path.join(root, 'project')}}};
|
|
49
|
+
const policyBytes = Buffer.from(JSON.stringify(policy));
|
|
50
|
+
await writeFile(path.join(generation, 'coding-policy.json'), policyBytes);
|
|
51
|
+
const oldGrant = Buffer.from(JSON.stringify({schema: 'deadbyte.coding-grant.v1', policy_sha256: sha(policyBytes),
|
|
52
|
+
instance_nonce: hex('a'), root_ids: ['project'], granted_at_utc: new Date().toISOString()}));
|
|
53
|
+
await writeFile(grantFile, oldGrant);
|
|
54
|
+
const store = createAuthorityEpochStore({runtimeDir: runtime, policyBytes});
|
|
55
|
+
const armed = await store.append({plane: 'coding', action: 'grant', grantBytes: oldGrant,
|
|
56
|
+
grantInstanceNonce: hex('a'), updateId: null});
|
|
57
|
+
const manager = createActivationClaimManager({stateRoot: root}), subject = hex('b');
|
|
58
|
+
const claim = await manager.claim(subject), continuity = 'r65-' + 'c'.repeat(32);
|
|
59
|
+
const revoked = await store.append({plane: 'coding', action: 'transaction_revoke', grantBytes: oldGrant,
|
|
60
|
+
grantInstanceNonce: hex('a'), updateId: continuity, expectedHeadSha256: armed.event_sha256});
|
|
61
|
+
const newGrant = Buffer.from(JSON.stringify({schema: 'deadbyte.coding-grant.v1', policy_sha256: sha(policyBytes),
|
|
62
|
+
instance_nonce: hex('d'), root_ids: ['project'], granted_at_utc: new Date().toISOString()}));
|
|
63
|
+
await writeFile(grantFile, newGrant);
|
|
64
|
+
await store.append({plane: 'coding', action: 'grant', grantBytes: newGrant,
|
|
65
|
+
grantInstanceNonce: hex('d'), updateId: null, expectedHeadSha256: revoked.event_sha256});
|
|
66
|
+
const pointer = {schema: 'deadbyte.active-release.v1', release_id: 'v0-parent', version: '0.15.61',
|
|
67
|
+
manifest_sha256: hex('1'), generation_manifest_sha256: hex('2'), generation_root: generation};
|
|
68
|
+
await writeFile(path.join(root, 'active-release.json'), JSON.stringify(pointer));
|
|
69
|
+
await writeFile(path.join(updates, 'r65-activation-outcome-r172.json'), JSON.stringify({
|
|
70
|
+
schema: 'deadbyte.r65-activation-outcome.v1', claim_operation_id: claim.operation_id,
|
|
71
|
+
preflight_subject_sha256: subject, candidate_version: '0.15.66', candidate_manifest_sha256: hex('9'),
|
|
72
|
+
predecessor_release_id: pointer.release_id, outcome: {state: 'ACTIVATION_OUTCOME_UNKNOWN', preflight: 'AUTHORITY_UNVERIFIED'},
|
|
73
|
+
update_id: null, state_path: null, continuity_update_id: continuity,
|
|
74
|
+
observed_at_utc: new Date().toISOString()
|
|
75
|
+
}));
|
|
76
|
+
const next = await manager.claim(hex('e'));
|
|
77
|
+
assert.notEqual(next.operation_id, claim.operation_id);
|
|
78
|
+
await next.release();
|
|
79
|
+
} finally { await rm(root, {recursive: true, force: true}); }
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
test('R172 keeps the claim when continuity revoke is not followed by a trusted terminal state', async () => {
|
|
83
|
+
const root = await mkdtemp(path.join(os.tmpdir(), 'deadbyte-r172-continuity-blocked-'));
|
|
84
|
+
try {
|
|
85
|
+
const updates = path.join(root, 'evidence', 'updates'); await mkdir(updates, {recursive: true});
|
|
86
|
+
const manager = createActivationClaimManager({stateRoot: root}), claim = await manager.claim(hex('a'));
|
|
87
|
+
await writeFile(path.join(updates, 'r65-activation-outcome-r172.json'), JSON.stringify({
|
|
88
|
+
schema: 'deadbyte.r65-activation-outcome.v1', claim_operation_id: claim.operation_id,
|
|
89
|
+
preflight_subject_sha256: hex('a'), candidate_version: '0.15.66', candidate_manifest_sha256: hex('9'),
|
|
90
|
+
predecessor_release_id: 'v0-parent', outcome: {state: 'ACTIVATION_OUTCOME_UNKNOWN', preflight: 'AUTHORITY_UNVERIFIED'},
|
|
91
|
+
update_id: null, state_path: null, continuity_update_id: 'r65-' + 'c'.repeat(32), observed_at_utc: new Date().toISOString()
|
|
92
|
+
}));
|
|
93
|
+
await assert.rejects(() => manager.claim(hex('e')), /unresolved|in progress/i);
|
|
94
|
+
} finally { await rm(root, {recursive: true, force: true}); }
|
|
95
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import {readFile} from 'node:fs/promises';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import {fileURLToPath} from 'node:url';
|
|
6
|
+
import {DEADBYTE_VERSION} from '../src/version.mjs';
|
|
7
|
+
|
|
8
|
+
const root=path.resolve(fileURLToPath(new URL('..',import.meta.url)));
|
|
9
|
+
const read=async rel=>JSON.parse(await readFile(path.join(root,rel),'utf8'));
|
|
10
|
+
const readOptional=async rel=>{try{return await read(rel);}catch(error){if(error?.code==='ENOENT')return null;throw error;}};
|
|
11
|
+
|
|
12
|
+
test('R172 binds the published source predecessor separately from the active runtime predecessor',async()=>{
|
|
13
|
+
const [pkg,lock,bridge,release,provenance,matrix,bom]=await Promise.all([
|
|
14
|
+
read('package.json'),readOptional('package-lock.json'),read('bridge/package.json'),read('RELEASE.json'),
|
|
15
|
+
read('PROVENANCE.json'),read('TEST-MATRIX.json'),read('SBOM.cdx.json')]);
|
|
16
|
+
const versions=[pkg.version,bridge.version,release.version,provenance.version,matrix.version,
|
|
17
|
+
bom.metadata.component.version,DEADBYTE_VERSION];
|
|
18
|
+
if(lock)versions.push(lock.version,lock.packages[''].version);
|
|
19
|
+
for(const value of versions)assert.equal(value,'0.15.67');
|
|
20
|
+
assert.equal(release.train,'R172'); assert.equal(matrix.train,'R172');
|
|
21
|
+
assert.equal(release.source_predecessor.version,'0.15.66');
|
|
22
|
+
assert.equal(release.source_predecessor.manifest_sha256,'962e227dace247d59aa860211388fbde461c5f9c8a7e8a878e34a14a27d355f8');
|
|
23
|
+
assert.equal(release.source_predecessor.tarball_sha256,'31b194a4fbff7dbdb9f4f275b4ea49c5115f7b0bb2241c0c72d72ef690311a5d');
|
|
24
|
+
assert.equal(release.runtime_predecessor.release_id,'v0.15.61-055d1ff0aa99e60b');
|
|
25
|
+
assert.equal(release.r172.public_tool_delta,0); assert.equal(release.r172.authority_scope_delta,0);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test('R172 recovery remains fail closed until final protected and publication gates pass',async()=>{
|
|
29
|
+
const [release,matrix]=await Promise.all([read('RELEASE.json'),read('TEST-MATRIX.json')]);
|
|
30
|
+
assert.equal(release.r172.current_predispatch_claim,'PENDING_VERIFIED_RECONCILIATION');
|
|
31
|
+
assert.equal(release.r172.protected_full_regression,'PENDING_FINAL_BYTES');
|
|
32
|
+
assert.equal(matrix.r172.protected_native_positive,'PASS_27_TESTS_0_FAILURES');
|
|
33
|
+
assert.equal(release.r172.npm_publish,'NOT_RUN');
|
|
34
|
+
assert.equal(release.r172.production_activation,'NOT_RUN');
|
|
35
|
+
});
|
|
@@ -83,7 +83,7 @@ test('R72 compact baseline permits only R64 read offset and authorized coding-on
|
|
|
83
83
|
assert.deepEqual(diff.added,[]);
|
|
84
84
|
assert.deepEqual(diff.removed,[]);
|
|
85
85
|
const packageVersion=JSON.parse(await readFile(path.join(repoRoot,'package.json'),'utf8')).version;
|
|
86
|
-
if(['0.15.41','0.15.42','0.15.43','0.15.44','0.15.45','0.15.46','0.15.47','0.15.48','0.15.49','0.15.50','0.15.51','0.15.52','0.15.53','0.15.54','0.15.55','0.15.56','0.15.57','0.15.58','0.15.59','0.15.60','0.15.61','0.15.62','0.15.63','0.15.64','0.15.65'].includes(packageVersion)){
|
|
86
|
+
if(['0.15.41','0.15.42','0.15.43','0.15.44','0.15.45','0.15.46','0.15.47','0.15.48','0.15.49','0.15.50','0.15.51','0.15.52','0.15.53','0.15.54','0.15.55','0.15.56','0.15.57','0.15.58','0.15.59','0.15.60','0.15.61','0.15.62','0.15.63','0.15.64','0.15.65','0.15.66','0.15.67'].includes(packageVersion)){
|
|
87
87
|
assert.deepEqual([...diff.schema_changed].sort(),['machine_fs','native_diff_preview']);
|
|
88
88
|
assert.equal(diff.unchanged.length,41);
|
|
89
89
|
const prior=baseline.tools.find(tool=>tool.name==='machine_fs');
|
|
@@ -24,15 +24,20 @@ test('R63 one-shot upgrade restore plan reproduces the exact pre-upgrade authori
|
|
|
24
24
|
]);
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
test('R63
|
|
27
|
+
test('R63 coherent one-shot still synchronizes before dispatch; R168 rejects skew before mutation',async()=>{
|
|
28
28
|
const source=await readFile(path.join(root,'src','deadbyte-cli.mjs'),'utf8');
|
|
29
29
|
const start=source.indexOf('async function runRemote(args){');
|
|
30
30
|
const end=source.indexOf('\nasync function runSupervisor(',start);
|
|
31
31
|
assert.ok(start>=0&&end>start,'runRemote source boundary missing');
|
|
32
32
|
const body=source.slice(start,end);
|
|
33
|
+
const guarded=body.indexOf('selectR168OneShotRemotePath(');
|
|
34
|
+
const reject=body.indexOf("decision.mode==='blocked_version_skew'");
|
|
35
|
+
const observe=body.indexOf("decision.mode==='observe_active'");
|
|
33
36
|
const sync=body.indexOf("await synchronizeOneShotRuntime(ctx,{displayMode:'ascii'});");
|
|
34
|
-
const dispatch=body.indexOf(
|
|
35
|
-
assert.ok(
|
|
36
|
-
|
|
37
|
-
assert.
|
|
37
|
+
const dispatch=body.indexOf("invokeController(ctx,command,{allowFailure:true})");
|
|
38
|
+
assert.ok(guarded>=0&&reject>guarded&&observe>guarded,
|
|
39
|
+
'R168 one-shot skew must choose read-only status or fail closed before synchronization');
|
|
40
|
+
assert.ok(sync>reject&&sync>observe,
|
|
41
|
+
'version-skew guard must precede coherent runtime sync');
|
|
42
|
+
assert.ok(dispatch>sync,'coherent R63 runtime synchronization must complete before dispatch');
|
|
38
43
|
});
|