Skip to content

ci(migrate): run committed fixture asserters in every build - #163

Merged
icarthick merged 2 commits into
awslabs:mainfrom
herosjourney:ci/run-asserters
Jul 22, 2026
Merged

ci(migrate): run committed fixture asserters in every build#163
icarthick merged 2 commits into
awslabs:mainfrom
herosjourney:ci/run-asserters

Conversation

@herosjourney

Copy link
Copy Markdown
Contributor

Summary

The plugin's 8 committed fixture asserters (check_expected_*.py) encode exact-math guarantees — workshop scenario deltas, reprice totals, drift detection, secret hygiene — but nothing ran them automatically: they were a run-it-by-hand convention. This PR adds a fixtures:assert mise task, wired into mise run build (and therefore CI), that runs all of them on every build. Golden guarantees become permanent invariants, and asserter bitrot becomes a build failure instead of a silent gap.

Changes

  • tools/run-asserters.py (new, stdlib-only): runs every asserter in two tiers.
    • Golden (3): workshop asserters executed against their committed golden run trees (after-arm64-reprice, after-graviton-reprice, after-outcome-b-x86) — must PASS.
    • Smoke (5): replay-validating asserters (no golden output is committed; producing one requires an agent run) executed against an empty scratch dir — must fail cleanly (non-zero exit, no traceback), proving the script parses and its failure path works.
    • Registry completeness check: a new check_expected_*.py on disk that isn't registered fails the build, so future asserters can't ship un-run.
  • mise.toml: new fixtures:assert task, added to the lint task group (runs in build and pre-existing CI).
  • Fixed 4 asserters that crashed with a FileNotFoundError traceback when the run dir was missing its primary artifact (heroku-live-capture/check_expected_drift.py, heroku-live-capture/check_expected_estimate.py, vercel-capture/check_expected_estimate.py, vercel-capture/check_expected_generate.py): they now report a clean one-line FAIL and exit 1, matching check_expected_discovery.py's existing guard style. This is also better replay UX — a failed replay gets "missing estimation-infra.json" instead of a stack trace.

Relationship to other PRs

Independent — based on current main (post-#162). Complements #151 (fixtures-check.ts validates fixture JSON shape; this PR executes the asserters). No file overlap with #151 or any other open PR.

Test plan

  • mise run fixtures:assert green: 8/8 (3 golden PASS, 5 smoke clean-fail)
  • Failure detection verified: asserter pointed at a wrong dir exits 1 and the runner reports it
  • The 4 guarded asserters keep identical behavior when the artifact exists (guard is an early-exit only)
  • Full mise run build green (160/160 checks) including the new task and bandit with inline # nosec justifications matching house convention

Union-resolved mise.toml lint group: fixtures:assert (this PR) + fixtures:check +
pricing:staleness (from awslabs#151/awslabs#155, now on main) all run in build.

Registered the two gcp-live-capture asserters that landed via awslabs#149/awslabs#156 after this
branch was cut (the PR's own registry-completeness guard correctly flagged them):
- gcp-live-capture/check_expected_baseline.py (smoke — already exits 1 cleanly)
- gcp-live-capture/check_expected_drift.py (smoke — added the same missing-artifact
  guard this PR applies to the other 4, replacing a FileNotFoundError traceback with
  a clean one-line FAIL + exit 1)

fixtures:assert now 10/10 (3 golden, 7 smoke). Full build green.
@icarthick
icarthick merged commit f407906 into awslabs:main Jul 22, 2026
8 checks passed
icarthick added a commit to herosjourney/startups that referenced this pull request Jul 22, 2026
Clean merge to current main (through awslabs#163). No conflicts. Full build green.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants