ci(loop): mirror CI's non-test gates so cycles stop leaving master red - #71
Merged
Conversation
Root cause of the recurring red master: the loop's EVAL is pytest-only, but ci.yml (which runs on the loop's PR) also enforces ruff, mypy, an openapi.json drift check, and the frontend gen:api:check. The build agent's Python-only runner can't even regenerate the frontend types. So every cycle's PR is red on those extra gates, and merging it reddens master (cleaned up manually in #69, and again this round). Close the gap at the source: - Add a Node 20 setup step (needed to regenerate web/src/lib/api.gen.ts). - Add a "CI parity" step after BUILD that deterministically fixes the MECHANICAL gates: `ruff --fix` (import order / unused), regenerate openapi.json, and regenerate the frontend API types. Non-fatal by design (the loop must still open a PR for review); anything left red is surfaced as a ::warning and by ci.yml on the PR itself. Placed before EVAL and the product-snapshot so the changes are part of the reviewed cycle. - Add a HARD RULE to the build prompt: run ruff + mypy and fix real errors, and regenerate openapi.json on model changes (mypy/non-autofix lint can't be fixed mechanically). NOTE: workflow_dispatch workflows can't be run from here, so this is static/YAML-validated only. Review and do one test dispatch before relying on it — hence left as a PR, not merged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause (from this round's analysis)
The recurring "master is red after a loop cycle" problem: the loop's EVAL gate is pytest-only, but
ci.yml— which runs on theloop/cycle-NPR the loop opens — also enforcesruff,mypy, anopenapi.jsondrift check, and the frontendgen:api:check. The build agent's Python-only runner can't even regenerate the frontend types. So every cycle's PR lands red on those gates, and merging it reddens master (cleaned up manually in #69, and again this round).The fix — close it at the source
web/src/lib/api.gen.ts.ruff --fix(import order / unused), regenerateopenapi.json, regenerate the frontend API types. Non-fatal by design (the loop must still open a PR for review); anything left red is surfaced as a::warningand byci.ymlon the PR. Placed before EVAL and the product-snapshot so the changes are part of the reviewed cycle.ruff+mypyand fix real errors, and regenerateopenapi.jsonon model changes (mypy / non-autofixable lint can't be fixed mechanically, so the agent must).workflow_dispatchworkflows can't be run from my environment, so this is static/YAML-validated only:ruff --fixandopenapi exportcommands run clean (no-ops on green master).npm ci, or the full dispatch (needs secrets + the Actions env).Please review and do one
gh workflow run loop.ymlto confirm before relying on it. I left it as a PR rather than merging blind.Companion to the budget-fix PR from the same review round.
🤖 Generated with Claude Code