Repository navigation
Plan check before the PR; fix rounds get their own budget, push once, and never fail an open PR; generated files are regenerated - #331
Merged
Conversation
nambok
force-pushed
the
fix/plan-coverage-and-round-budgets
branch
2 times, most recently
from
October 27, 2026 17:15
cce0252 to
123a42c
Compare
…d never fails an open PR
A complex ticket's plan listed several new files. The first implement pass
changed one, the proof check listed the rest as "gaps under Open items" and
the PR opened anyway. CoderHelm's reviewer then asked for changes three
times; each round re-entered implement inside what was left of one worker
invocation, the third was killed mid-way, the stuck-run sweep marked the run
failed while its PR was open and green, and nothing said what the round had
pushed.
Plan coverage (plan_coverage.rs):
- The plan's task checklist is compared with the branch's diff, task by
task. Missing tasks get up to two implement rounds aimed at exactly them,
then a continuation in a fresh invocation (bounded); a continuation keeps
its branch and is told what is left.
- Planned work still missing stops the run before any PR, with a plain
status naming the tasks; the branch is copied to <branch>-wip so a later
run's reset can't lose it. Only tasks the plan marks optional may be left
out, and the PR names them under Open items with the reason.
- The proof judge sees the checklist and reports planned_work; it gets a fix
round and is never downgraded to Open items.
- tasks.md marks only the tasks the branch did.
- A continuation no longer resets its own branch to base.
Fix rounds (common::run_round, passes/round.rs):
- CI fix, review fix and feedback rounds each run with their own deadline,
measured from the invocation they run in, recorded on the run as `round`.
A round with too little of its invocation left is parked and runs first in
a fresh one; a round that uses its budget with work left continues there
(up to three steps).
- A round that can't finish leaves the run completed with
`round_incomplete` (why, the commits it pushed, the files): "Pull request
open; the last fix round didn't finish: <reason>". Feedback and resume
errors on a run with an open PR end the same way instead of failed.
- The stuck-run sweep waits for a round's own deadline, and a stuck run
with an open PR becomes completed with round_incomplete, never failed.
No lost work: every coder write is already its own commit on the branch;
the coder is told to write each task's files as soon as the task is done,
the deadline note asks it to write any finished file before stopping, and
an unfinished round records the commits it pushed.
API: Run.round_incomplete (OpenAPI), and POST /api/runs/{id}/retry resumes
the unfinished round on the same run ("resuming"), giving one automated-fix
slot back.
…block it A pull request in a web repository changed its CMS schema files but not the types generated from them; the repository has a type generation script and the reviewer had to point it out. generators.rs finds the generators a repository uses and what each reads and writes: package scripts named like typegen/codegen/generate/gen:types (mapped to the tool they run), Sanity typegen config, GraphQL codegen config (YAML or TS: schema, documents, generates), OpenAPI client generators (spec in, -o out), Prisma, buf/protobuf, and "regenerate after changing X" rules in AGENTS.md, CLAUDE.md or CONTRIBUTING. Before the pull request opens (single and multi-repo), each generator whose inputs the diff touches runs in the sandbox and its output is committed with the change, in the team's commit style. A generator still out of date (its known outputs not in the change, or its run failing) gets one fix round, then stops the run with a plain reason naming the files and the generator; the work is kept on the WIP branch. The coder's run_codegen tool falls back to every detected generator when the repo has no codegen script. Tests use small fixture repos per kind: npm-script typegen with Sanity config, GraphQL codegen in YAML and in TS through a nested script, OpenAPI, Prisma, buf and a documented rule.
…them
Builds the generator gate on the worker's existing codegen path: package
script generators run through detect_codegen_command (the root script or
pnpm -r typegen/codegen) once, with the repository's public codegen
environment from load_codegen_env. When a generator fails, the run no longer
goes on to open the PR without regenerated files.
common::codegen_env holds the rules for that environment
(SETTINGS#CODEGEN_ENV#<owner>/<repo>): public values only; names and values
that look like credentials are refused. A failed generator's missing values
are the public names its configs read (sanity.cli/sanity.config/codegen
configs: process.env and import.meta.env) or its output names, less those
set. When any are missing, the run stops before the PR with a plain reason
naming them and where to set them (Settings, Repositories, the repository's
Codegen environment), and keeps them on the run as codegen_env_missing (in
the API's Run, documented in OpenAPI). No fix round: a person sets them.
Gateway: GET/PUT /api/repos/{owner}/{repo}/codegen-env for admins (the
repos capability), validated by the same rules.
Every push to a pull request branch re-runs CI and, on repositories that dismiss stale approvals, dismisses them. A fix round now pushes to the pull request exactly once. - CI fix, review fix and feedback rounds write their checkpoint commits to coderhelm-wip/<pr branch>, opened at the PR head when the round starts (a continuing round reuses its own). - When the round is done, everything it changed since it started lands on the PR as ONE commit in the team's commit style (round::land: removals and renames included), and the WIP branch is deleted. If the PR changed the same files meanwhile, nothing lands and the round is left unfinished. - A round that times out, errors or is cancelled keeps its WIP branch; the run records it (round / round_incomplete.wip_branch and base_sha, also written by the stuck-run sweep), Resume continues from it, and nothing partial reaches the PR. The status note says the PR is unchanged. - API: RoundIncomplete.wip_branch (OpenAPI). The pre-PR stop copy is now coderhelm-wip/<branch> too.
A run that finds its ticket's PR open with failing checks or review comments fixed them by writing straight to the PR branch, one push per edit. It now works like the other fix rounds: checkpoints on coderhelm-wip/<branch>, one commit landed on the PR at the end in the team's commit style, and a fix that runs out of time or can't land keeps its work on the WIP branch and never reaches the PR. It also gets the run's implement deadline instead of none. Also updates the run_of tests for the trigger lookups argument main added.
nambok
force-pushed
the
fix/plan-coverage-and-round-budgets
branch
from
October 27, 2026 19:55
123a42c to
2be1858
Compare
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.
Summary
In a real run, a complex ticket's plan listed several new files. The first implement pass changed one of them. The proof check listed the rest as "gaps under Open items", and the draft PR opened anyway. CoderHelm's reviewer then asked for changes several times. Each round re-entered implement inside whatever was left of a single 15-minute worker invocation, with no deadline of its own. The last round was killed partway through. The stuck-run sweep then marked the whole run failed, even though its PR was open and CI was green. Nothing recorded what the round had pushed.
A second case: a PR in a web repo changed its CMS schema files but not the types generated from them. When the generator did run, it could fail for a missing public project id, and the run opened the PR without the regenerated types.
This PR makes five changes:
Changes
Plan coverage (
worker/passes/plan_coverage.rs)- [ ] path: taskchecklist with the branch diff, task by task. A task counts as done only when the branch changes its file. The coder's summary doesn't count.coderhelm-wip/<branch>.planned_work. It gets a fix round and is never downgraded to Open items.tasks.mdnow checks off only the tasks the branch actually did.Round budgets (
common::run_round,worker/passes/round.rs,resume.rs,feedback.rs)round.One push per round
coderhelm-wip/<pr branch>, never to the PR head. A continuing round reuses its own WIP branch.round::land, including removals and renames), and the WIP branch is deleted. This means one CI run per round, and on repos that dismiss stale approvals, one dismissal.Unfinished rounds
completedwithround_incomplete: the reason, the checkpoint commits and files,wip_branchandbase_sha.failed.round_incomplete, neverfailed.Generated files (
worker/passes/generators.rs,common::codegen_env)detect_codegen_command(root script orpnpm -rtypegen/codegen), once, with the repo's publicload_codegen_env.sanity.cli,sanity.configand codegen configs, plus the failure output, minus what is already set) and where to set them. The run records them ascodegen_env_missing.run_codegentool falls back to every detected generator.API and gateway
Run.round_incomplete(includingwip_branch) andRun.codegen_env_missingare documented in OpenAPI.POST /api/runs/{id}/retryon a run with an unfinished round resumes that round on the same run (resuming), continuing from its WIP branch. It gives one automated-fix slot back.GETandPUT /api/repos/{owner}/{repo}/codegen-envare admin-only (thereposcapability). They accept public values only: names and values that look like credentials are refused, with the reason.The dashboard part is in CoderHelm/coderhelm#242.
Existing-PR paths in
run_passesVerification
cargo fmt --check,cargo clippy --workspace --all-targets -D warningsandcargo test --workspaceall pass: common 1208, gateway 585, worker 760 (rebased on main with Runs that stop to ask: keep the questions, answer from CoderHelm, never ask twice #330, Hosted two-factor sign-in: per-team rule, one factor per person on every way in #332, Learning examples: clean title, summary, reason and recent uses #334 and Runs: say how each run was started and by whom (trigger on the runs API) #335).python3 -m unittest discover -s lambda/tests).planned_workgets a round, then holds the PRrun_round: per-round budget, bounded continuation, record round trip, WIP branch naming and Resume continuing from it, the status line never says "failed"round: start threshold, compare parsing, overlap refusaldetect_codegen_commandcodegen_env: secret refusal, missing values found from configs and output, the plain reasonround_incomplete,codegen_env_missing, the codegen-env write validation and the resume routing