@mcpose/testing
The @mcpose/testing package provides compliance assertion helpers for audit chains produced by @mcpose/audit 2.x.
[!NOTE] Distinguish
@mcpose/testingfrommcpose/testing. Themcpose/testingexport in core provides test utilities for proxy transports.@mcpose/testingprovides audit-chain validation helpers.
Installation
npm install --save-dev @mcpose/testing@2.0.3Peers: mcpose@2.1.1, @mcpose/audit@2.0.3.
Available Assertions in v2
assertAuditChainIntegrity(events): Verifies sequentialreplayManifestPositionand that no duplicatechainHashvalues exist.assertReplayManifestValid(events, manifest): Checks event count and validates Merkle proofs against the manifest root.assertPiiRedacted(event, patterns): Asserts regex patterns do not match plaintext fields; skips encrypted high-tier payloads.assertDelegationHonored(chain): Asserts the delegation chain is non-empty and every entry has asub.
Example
import { test } from 'vitest';
import {
assertAuditChainIntegrity,
assertReplayManifestValid,
} from '@mcpose/testing';
test('verifies v2 audit chain consistency', async () => {
const events = await getLoggedEvents();
const manifest = await getSessionManifest();
assertAuditChainIntegrity(events);
assertReplayManifestValid(events, manifest);
});