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
@@ -148,6 +148,9 @@ function EditProjectForm({
const [qualityCommand, setQualityCommand] = useState(
project.quality_command || "",
);
const [codegenCommand, setCodegenCommand] = useState(
project.codegen_command || "",
);
const [ciWatchEnabled, setCiWatchEnabled] = useState(
project.ci_watch_enabled,
);
@@ -226,6 +229,7 @@ function EditProjectForm({
typecheck_command: typecheckCommand || undefined,
build_command: buildCommand || undefined,
quality_command: qualityCommand || undefined,
codegen_command: codegenCommand || undefined,
ci_watch_enabled: ciWatchEnabled,
ci_watch_workflow: ciWatchWorkflow || undefined,
video_engine_enabled: videoEngineEnabled,
@@ -552,6 +556,22 @@ function EditProjectForm({
in the dev&apos;s workspace at hand-off to QA.
</p>
</div>
<div className="grid gap-2">
<HelpTip label="Command that regenerates checked-in generated files, e.g. `make codegen`; run and committed before push so codegen drift never fails CI. Leave blank if the project has no generated artifacts.">
<Label htmlFor="codegen_command">Codegen Command</Label>
</HelpTip>
<Input
id="codegen_command"
value={codegenCommand}
onChange={(e) => setCodegenCommand(e.target.value)}
placeholder="make codegen"
/>
<p className="text-xs text-muted-foreground">
Regenerates checked-in generated artifacts; any drift is
committed in the task&apos;s workspace before each push.
</p>
</div>
</>
)}
+1
View File
@@ -168,6 +168,7 @@ export const projectsApi = {
typecheck_command: project.typecheck_command ?? null,
build_command: project.build_command ?? null,
quality_command: project.quality_command ?? null,
codegen_command: project.codegen_command ?? null,
ci_watch_enabled: false,
ci_watch_workflow: null,
video_engine_enabled: false,
+3
View File
@@ -1052,6 +1052,7 @@ export interface Project {
typecheck_command: string | null;
build_command: string | null;
quality_command: string | null;
codegen_command: string | null;
// Autonomous maintenance opt-in
ci_watch_enabled: boolean;
ci_watch_workflow: string | null;
@@ -1091,6 +1092,7 @@ export interface ProjectCreate {
typecheck_command?: string;
build_command?: string;
quality_command?: string;
codegen_command?: string;
}
export interface ProjectUpdate {
@@ -1114,6 +1116,7 @@ export interface ProjectUpdate {
typecheck_command?: string;
build_command?: string;
quality_command?: string;
codegen_command?: string;
// Autonomous maintenance opt-in
ci_watch_enabled?: boolean;
ci_watch_workflow?: string;