Skip to content

ci(loop): mirror CI's non-test gates so cycles stop leaving master red - #71

Merged
rslayer merged 1 commit into
masterfrom
fix/loop-ci-parity-gate
Jul 22, 2026
Merged

ci(loop): mirror CI's non-test gates so cycles stop leaving master red#71
rslayer merged 1 commit into
masterfrom
fix/loop-ci-parity-gate

Conversation

@rslayer

@rslayer rslayer commented Jul 22, 2026

Copy link
Copy Markdown
Owner

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 the loop/cycle-N PR the loop opens — 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 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

  • Node 20 setup step — needed to regenerate web/src/lib/api.gen.ts.
  • "CI parity" step after BUILD that deterministically fixes the mechanical gates: ruff --fix (import order / unused), regenerate openapi.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 ::warning and by ci.yml on the PR. Placed before EVAL and the product-snapshot so the changes are part of the reviewed cycle.
  • Build-prompt HARD RULE: run ruff + mypy and fix real errors, and regenerate openapi.json on model changes (mypy / non-autofixable lint can't be fixed mechanically, so the agent must).

⚠️ Not merged — needs your review + a test dispatch

workflow_dispatch workflows can't be run from my environment, so this is static/YAML-validated only:

  • YAML parses; 18 steps in the right order (CI-parity sits between Build and Eval).
  • The ruff --fix and openapi export commands run clean (no-ops on green master).
  • I could not exercise the Node setup, npm ci, or the full dispatch (needs secrets + the Actions env).

Please review and do one gh workflow run loop.yml to 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

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>
@rslayer
rslayer merged commit ccd4d34 into master Jul 22, 2026
3 checks passed
@rslayer
rslayer deleted the fix/loop-ci-parity-gate branch July 22, 2026 13:48
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.

1 participant