feat(run): resume-aware per-check runs, verify hooks, run-state hardening

/pygienium-<check> is now resume-aware (terminal checks skipped unless
--fresh) and shares run-state with all/resume; every check gets a verify
hook that fails loudly when a sub-agent returns ok with no artifact;
run-state clears stale errors on retry success and reconciles a run as
failed only when every check failed. Drops the superseded
hygiene-state.ts model.
This commit is contained in:
2026-08-09 16:45:30 -04:00
parent 5f8a5cbe5f
commit c605a709fb
15 changed files with 804 additions and 643 deletions

View File

@@ -345,6 +345,24 @@ describe("/pygienium-all orchestrator (task 12)", () => {
expect(md).toContain("phases: recon:C");
});
it("all-summary never shows a stale error under a complete check", async () => {
const { initRunState } = await import("../src/run-state.js");
const state = initRunState(cwd, [
{ name: "alpha", label: "Alpha", fix: false },
]);
const alpha = fakeCheck("alpha");
// A hand-edited/legacy state can carry an error on a completed check
// (the MagnaFluo run showed exactly this shape).
markCheckStatus(state, "alpha", "complete", "legacy verify error");
const md = renderAllSummary(state, [alpha]);
expect(md).toContain("## alpha — complete");
expect(md).not.toContain("- error:");
// A genuinely failed check still surfaces its error.
markCheckStatus(state, "alpha", "failed", "scan exploded");
const md2 = renderAllSummary(state, [alpha]);
expect(md2).toContain("- error: scan exploded");
});
it("the unified strip surfaces every check name over the run", async () => {
registerCheck(fakeCheck("alpha"));
registerCheck(fakeCheck("beta"));