chore: initialize POM 2 repo (docs guards green; release gates recorded NOT RUN pending install)

This commit is contained in:
Antigravity
2026-08-19 10:31:00 +02:00
commit 7ffd00b5c5
111 changed files with 12522 additions and 0 deletions

30
tests/state.test.ts Normal file
View File

@@ -0,0 +1,30 @@
import assert from "node:assert/strict";
import test from "node:test";
import { mkdtemp, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { bumpPatchVersion, createState, gotoStage, passStage, recordEvidence, startStage } from "../src/state";
import { stage } from "../src/domain";
test("state machine rejects skipped prerequisites and evidence-free completion", async () => {
assert.equal(bumpPatchVersion("1.2.9"), "1.2.10");
assert.throws(() => bumpPatchVersion("latest"), /Invalid semantic version/);
const root = await mkdtemp(join(tmpdir(), "pom-state-"));
try {
let state = createState("State Test", root);
assert.throws(() => gotoStage(state, 1), /incomplete prerequisites/);
state = startStage(state, 0);
assert.equal(state.stageRuns["0"].status, "active");
assert.throws(() => passStage(state, "report.json"), /lacks evidence/);
for (const criterion of stage(0).acceptance) {
state = recordEvidence(state, criterion.id, `Verified ${criterion.label}`, ["01_planning/00_project_brief.md"], "Test");
}
state = passStage(state, "00_admin/validation/stage-0.json");
assert.equal(state.stageRuns["0"].status, "complete");
assert.equal(state.currentStage, 1);
assert.deepEqual(state.completedStages, [0]);
} finally {
await rm(root, { recursive: true, force: true });
}
});