Files
waggle-os/packages/core/tests/install-audit-check-parity.test.ts
shumeiko.it c6a9fbf85a test(core): drop the legacy memory engine from core tests (P1.5)
- install audit: build fixtures on WaggleDB, the store's real home; drop the
  substrate SCHEMA_SQL parity half and the two MindDB-only recovery cases
  for rows stranded in install_audit__mig_old.
- workspace manager: create() and ensure() no longer leave a workspace.mind;
  getMindPath tests create the legacy file themselves. Drop the
  MultiMindCache cases (reopen of a missing mind, post-resolution junction
  swap): they tested the legacy cache, not the manager.
- transformers model load: use core's own in-process reranker.
2026-10-24 17:43:11 +02:00

37 lines
1.3 KiB
TypeScript

/**
* P7/D15 A3 — drift-lock for the install_audit CHECK constraints.
*
* install-audit.ts generates the table DDL from the canonical @waggle/shared
* arrays. This test pins every CHECK list to that single source, so a drift
* fails CI instead of crashing auditStore.record() in production.
*/
import { describe, it, expect } from 'vitest';
import {
sqlInList, RISK_LEVELS, APPROVAL_CLASSES, AUDIT_ACTIONS,
AUDIT_CAPABILITY_TYPES, AUDIT_INITIATORS, TRUST_SOURCES,
} from '@waggle/shared';
import { INSTALL_AUDIT_TABLE_SQL } from '../src/install-audit.js';
const COLUMNS = [
{ col: 'capability_type', values: AUDIT_CAPABILITY_TYPES },
{ col: 'risk_level', values: RISK_LEVELS },
{ col: 'trust_source', values: TRUST_SOURCES },
{ col: 'approval_class', values: APPROVAL_CLASSES },
{ col: 'action', values: AUDIT_ACTIONS },
{ col: 'initiator', values: AUDIT_INITIATORS },
] as const;
describe('install_audit CHECK parity (A3)', () => {
for (const { col, values } of COLUMNS) {
const expected = `${col} IN (${sqlInList(values)})`;
it(`core install-audit DDL pins ${col} to the canonical list`, () => {
expect(INSTALL_AUDIT_TABLE_SQL).toContain(expected);
});
}
it('the DDL accepts the P5/D4 uninstalled action', () => {
expect(INSTALL_AUDIT_TABLE_SQL).toContain("'uninstalled'");
});
});