test(audit): lock phase0 rolling script TAG wiring
Add regression tests that verify rolling and rolling:prune scripts keep shared overridable TAG semantics and tagged prune reports. No architecture/protocol flow changes; diagram files reviewed and no updates were needed.
This commit is contained in:
@@ -428,6 +428,17 @@
|
||||
],
|
||||
"test_status": "pnpm typecheck passing"
|
||||
},
|
||||
"phase0-live-baseline-script-wiring-regression-coverage": {
|
||||
"status": "completed",
|
||||
"date": "2026-02-27",
|
||||
"updated": "2026-02-27",
|
||||
"summary": "Added regression coverage to lock phase-0 rolling package script wiring (`refresh:drift:rolling` and `...rolling:prune`) so both continue honoring shared caller-provided `TAG` overrides and emit prune reports with the same tag.",
|
||||
"files_modified": [
|
||||
"src/audit/phase0BaselineScriptWiring.test.ts",
|
||||
"docs/plans/state.json"
|
||||
],
|
||||
"test_status": "pnpm test:run src/audit/phase0BaselineScriptWiring.test.ts + pnpm typecheck passing"
|
||||
},
|
||||
"phase0-instrumentation-ticket-checklist": {
|
||||
"status": "completed",
|
||||
"date": "2026-02-25",
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { resolve } from 'node:path';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
interface PackageManifest {
|
||||
scripts?: Record<string, string>;
|
||||
}
|
||||
|
||||
function loadPackageScripts(): Record<string, string> {
|
||||
const raw = readFileSync(resolve(process.cwd(), 'package.json'), 'utf8');
|
||||
const manifest = JSON.parse(raw) as PackageManifest;
|
||||
return manifest.scripts ?? {};
|
||||
}
|
||||
|
||||
describe('phase0 baseline script wiring', () => {
|
||||
it('keeps rolling script TAG override semantics', () => {
|
||||
const scripts = loadPackageScripts();
|
||||
const rolling = scripts['audit:phase0-baseline:live:refresh:drift:rolling'];
|
||||
|
||||
expect(rolling).toBeDefined();
|
||||
expect(rolling).toContain('TAG=${TAG:-$(date -u +%F-%H%M%S)}');
|
||||
expect(rolling).toContain('--tag "$TAG"');
|
||||
expect(rolling).toContain('--report-tag "$TAG"');
|
||||
});
|
||||
|
||||
it('keeps rolling prune script on shared overridable TAG', () => {
|
||||
const scripts = loadPackageScripts();
|
||||
const rollingPrune = scripts['audit:phase0-baseline:live:refresh:drift:rolling:prune'];
|
||||
|
||||
expect(rollingPrune).toBeDefined();
|
||||
expect(rollingPrune).toContain('TAG=${TAG:-$(date -u +%F-%H%M%S)}');
|
||||
expect(rollingPrune).not.toContain('TAG=$(date -u +%F-%H%M%S)');
|
||||
expect(rollingPrune).toContain('pnpm audit:phase0-baseline:live:refresh:drift:rolling');
|
||||
expect(rollingPrune).toContain('--report-tag "$TAG"');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user