Repository navigation
ci(design): run contracts.py in lint and re-anchor the post-#1051 contracts - #1075
Conversation
…tracts scripts/design/contracts.py has been RESULT: FAIL on main since #1051 renamed `## STATS` to `## PROGRESS` in docs/screen-contracts.md, and no CI job or mise task ran it, so nobody noticed. - Re-anchor C-4 / C-5 / C-25 / C-29 to `## PROGRESS`, each checked against the section text: C-4 (PROGRESS replaces the retired STATS contract, record display), C-5 (STATS' "per-interaction outcome: none" no longer holds, PROGRESS has an outcome table for its GC rows), C-25 (6 tiles -> merged personal-best rows + streak calendar), C-29 (Achievements / Leaderboards rows bound to HIG terms). Output is now byte-identical to design.md Appendix A. - Add `mise run scan:design_contracts` (gate mode, exit 1 on a broken anchor or canonical drift). - Add lint.yml job 7 `design-contracts` on ubuntu-latest. Closes #1064 part of #1014 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Negative test for #1064: C-4 now anchors to a non-existent `## PROGRES`. The design-contracts job must fail on this commit. Reverted in the next commit. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…te goes red" Negative test for #1064 recorded (design-contracts job red on ac67ed2). Restore C-4's anchor to `## PROGRESS`. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Dual CR + fresh-context acceptance: ACCEPTTwo independent read-only reviewers (sonnet and haiku) ran the same prompt. Each also served as the fresh-context acceptance check against the 6 done-when criteria of #1064. Both read the PR head via
In-scope MINOR (fixed in Verified by both reviewers:
Out-of-scope drift (pre-existing; this PR does not touch these docs; follow-up candidate): these anchors still resolve for the gate, but the prose still describes the retired HOME entry points.
Not verified: 🤖 Generated with Claude Code |
Closes #1064
part of #1014
What
scripts/design/contracts.pyhas printedRESULT: FAILon main since #1051, and no CI job or mise task ran it. This PR fixes the four broken anchors and wires the gate into CI so the next broken anchor fails its PR.scripts/design/contracts.pySTATS→PROGRESS(4 lines)mise-tasks/scan/design_contractsscan:design_contracts(bash wrapper, stdlib python, gate mode).github/workflows/lint.ymldesign-contracts(ubuntu-latest) + job index / count in the headerRe-anchoring: checked row by row, not a blind rename
contracts.py's one-line descriptions are the only change-table text for these IDs. design.md §9 and prototype.html only give counts. I read each row against the retired## STATSsection (git show 8867b583^:docs/screen-contracts.md) and the current## PROGRESSsection:## PROGRESSPersonalBestRows merging Daily + Practice, plus the monthStreakCalendarView.Achievementsrow "HIG-mandated term, never Trophies/Awards/Medals";Leaderboardsrow.All four have a valid home; none had to be forced. With PROGRESS now counted as touched, the coverage output is byte-identical to design.md Appendix A (19/23 sections, same untouched list), which was measured while
## STATSstill existed. So PROGRESS is the section Appendix A was counting.Local before / after
Before (origin/main b92ad5e),
python3 scripts/design/contracts.py:After (this branch):
mise tasks lslistsscan:design_contracts, andmise run scan:design_contractsexits 0.CI mode
The job runs the script's default gate mode (no args). For the record,
--coveragewould not have been a silent bypass either:main()returns 1 on any failure before thecoverage_onlybranch, so the flag only changes the PASS message. The job still uses the default mode, as the issue asked.Negative test (CI)
Design contract anchoring gate (#1064)f4ebeb09ac67ed23PROGRESC-4 anchors to '## PROGRES' which does not exist in screen-contracts.md/RESULT: FAIL/Process completed with exit code 1. The other 6 jobs stayed green, so the red comes from this gate alone.8d49dff2git revertof the break (tree identical tof4ebeb09)Squash-merge collapses the break and revert commits, so neither lands on main.
Not verified
shellcheckon the new task: the binary has no version set on this machine, so it didn't run. The script is a 3-lineset -euo pipefail/cd/execwrapper, the same shape asstore_baseline_orphans.actionlintisn't installed.lint.ymlparses as YAML (RubyYAML.load_file: 7 jobs,design-contractson ubuntu-latest), and the CI runs below exercise it for real.🤖 Generated with Claude Code