Rust development slice / linux (push) Failing after 7s
Bind the administrative connection-205 review to original signed history and preserve closed readiness. Include the qualified server dependency closure, UI review, native ARM64 build provenance, and guarded deployment evidence. Migration, API/gateway replacement and TLS checks passed with unchanged job authority, protected mounts and time/database services; native Windows receipt application remains separate.
22 lines
2.2 KiB
TypeScript
22 lines
2.2 KiB
TypeScript
import { expect, it } from 'vitest';
|
|
import { canonicalJson } from './api';
|
|
import { sha256 } from './safety';
|
|
import { alignmentReview } from './sync-alignment-review';
|
|
it('binds the exact 205 witness and refuses job authority, altered history and extended receipts', async () => {
|
|
const witness = { schema_version: 1, tenant_id: '11111111-1111-4111-8111-111111111111', asset_id: 'a176520e-8a91-4e93-a78b-8e7620f430e0', agent_id: '63ea15b2-0643-403d-b5b4-cba1288dbea3',
|
|
enrollment_generation: 1, assignment_version: 1, connection_generation: 205, boot_id: 'a9ad0895-5a96-8f2c-8fb6-cfdc2d5225ea', agent_checkpoint: 10137, helper_checkpoint: 155,
|
|
agent_last_decision: '2af359c5-5b5c-4992-b445-1c00e271a288', helper_last_decision: '1a4758ad-0b39-449e-8551-16846851b09a', verification_key_id: 'a'.repeat(64),
|
|
counts: { agent_jobs: 2, agent_consumed: 1, agent_starts: 1, agent_outcomes: 1, helper_consumed: 0, helper_starts: 0, helper_outcomes: 0, system_intents: 0 } };
|
|
const witness_sha256 = await sha256(new TextEncoder().encode(canonicalJson(witness)));
|
|
const request_id = '78009224-dcb3-4877-a519-8bf3284d0572';
|
|
const receipt = { domain: 'rmm.dev.windows-sync-admin-closed-alignment.v1', schema_version: 1, request_id, witness, witness_sha256, key_id: witness.verification_key_id,
|
|
issued_at: '2026-11-16T12:00:00Z', valid_until: '2026-11-16T12:05:00Z', confirmed_by: 'simulated-testprincipal-a', approval_origin: 'dev_test_browser_simulation', testsimulation: true, ready: false, helper_ready: false, unlock: false };
|
|
const view = { request_id, witness, witness_sha256, receipt };
|
|
expect((await alignmentReview(view)).witness_sha256).toBe(witness_sha256);
|
|
for (const changed of [{ ready: true }, { helper_ready: true }, { unlock: true }, { testsimulation: false }, { confirmed_by: 'Administrator' }, { valid_until: '2026-11-16T12:05:01Z' }, { witness: { ...witness, helper_checkpoint: 134 } }]) {
|
|
await expect(alignmentReview({ ...view, receipt: { ...receipt, ...changed } })).rejects.toThrow();
|
|
}
|
|
await expect(alignmentReview({ ...view, witness: { ...witness, connection_generation: 150 } })).rejects.toThrow();
|
|
await expect(alignmentReview({ ...view, witness: { ...witness, counts: { ...witness.counts, helper_consumed: 1 } } })).rejects.toThrow();
|
|
});
|