feat(git): auto-regenerate + commit codegen drift before push (#632)

A project that checks in generated artifacts (RoboCo's lifecycle renders,
verb tables) drifts whenever their source changes. The agent pre-submit gate
(make gate) omits foundation-check, so drift is invisible at the desk and only
fails on CI's drift gate — a failure with no link back to the task, which made
one live task thrash 8 revision rounds.

New per-project codegen_command (migration 078): run in the task's worktree
right before push, and any drift committed into the same push, so CI never
sees stale artifacts. Fail-open — a broken/timeout codegen command logs and
lets the push proceed (CI's drift gate is the safety net); a null command
(every project without checked-in codegen) is a pure no-op. Hooked at both
push_branch (open_pr's first push, the PR head CI grades) and push_task_branch
(later re-pushes). RoboCo sets codegen_command='make codegen' (a new Makefile
target — the write counterpart to foundation-check's read) via the panel.

Co-authored-by: Renn F <rennf93@users.noreply.github.com>
This commit is contained in:
Renzo F
2026-07-21 16:38:07 +02:00
committed by GitHub
co-authored by Renn F
parent 0527e9ebf3
commit 5f42a93b4f
12 changed files with 415 additions and 0 deletions
+9
View File
@@ -577,3 +577,12 @@ foundation-check:
# `foundation-check` is now the canonical drift gate; this alias just forwards.
.PHONY: ci-lifecycle-check
ci-lifecycle-check: foundation-check
# Write counterpart to foundation-check's read: regenerates the same checked-in
# artifacts IN PLACE (no diff/exit-code guard) so a project can point its
# `codegen_command` at this and have drift committed before a push, instead of
# only ever discovering it at CI's foundation-check hard-fail.
.PHONY: codegen
codegen:
@$(MAKE) lifecycle
@uv run python scripts/regenerate_verb_tables.py