mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
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:
@@ -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'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's workspace before each push.
|
||||
</p>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user