Skip to content

A run builds every repository of its plan, and nothing waits on a person without a typed reason - #956

Merged
coderhelm[bot] merged 5 commits into
mainfrom
plan-builds-every-repo
Dec 3, 2026
Merged

coderhelm[bot] merged 5 commits into
mainfrom
plan-builds-every-repo

Conversation

@nambok

@nambok nambok commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A run whose plan spans two repositories could open one pull request and finish with most of the second repository's tasks still to do. Its own review then asked for changes that only the other repository's tasks would make. A fix round spent hours on a branch where that fix couldn't live, the findings were listed as deferred, and the run ended "Done". Its page said "Waiting on: a person" next to "Nothing needed from you", and a finding with no file rendered as "💬 `` — …".

This makes four rules hard invariants, each enforced in code with a guard test:

  1. A run never ends while its own plan has undone tasks in a repository it can write to. Every done or waiting ending goes through the one ending gate (common::run_ending), which now writes it only under PLAN_GATE: the run's plan_owed count is 0. A source scan fails if a new ending path is written outside run_status.
  2. A pull request is never offered for review while it ships a placeholder or stub in place of what its ticket needs, or while another part of the plan is unbuilt. common::stub_check reads the diff for placeholder files, empty handlers, "not implemented" errors and TODOs where the implementation goes. The ready decision waits on them, and the one call that marks a pull request ready checks again right before GitHub is asked. Pull requests open as drafts, so a part is never offered for review on its own. The parts are built, linked ("part 1 of 2", "part 2 of 2", with the merge order) and only then offered together.
  3. "Deferred" only for a typed person-only reason. A finding the run's own plan or routes can satisfy is never deferred. The rest of the plan is built first, and only a reason that types as PersonOnly defers. CoderHelm's own limits become an internal alert and a typed stop through the supervisor's ending. They are never "Done", never deferred and never a person's wait.
  4. Every "waiting on a person" goes through PersonOnly (A hand-off to a person is typed, and CoderHelm owns its own limits #930). The merge standing, the draft hold and the page's line name a person only through it, so "Needs a person" and the top line come from one state and can't disagree. When the only wait left is the repository's required approval, the line reads exactly "Needs 1 approval from a person (repo rule) on #N". A source scan fails when a new text claims a person is needed without the type.

Changes

  • common::plan_repos (new) keeps a run's plan repository by repository, with what each part built, its pull request, and what the run still owes. Next::Build builds what is owed; Next::Person covers only a repository CoderHelm can't write to, as a typed PersonOnly.
  • The multi-repository loop no longer treats a repository whose plan check says "unfinished" (or any error) as a failed repository it can skip. It records the plan, takes a fresh step for what is still owed, and links the pull requests in plan order once every part has one.
  • plan_continue (new): continue_if_owed runs before any fix round or deferral on the run's own review. sweep runs on deploy and every 15 minutes and picks up runs that still owe a repository, including runs from before the record kept the plan (their plan is read from the task list they wrote). Each continuation is claimed and bounded.
  • run_ending: done and waiting endings carry PLAN_GATE. Stops (an error, a person cancelling) are not held.
  • ready: offer_blocked (plan owed, stubs) makes a draft wait, and make_ready refuses it before GitHub is asked. Stubs go to CoderHelm's coder as findings of its own.
  • own_review_ledger::typed_settle, resume, pr_watch and ready: deferral is typed. CoderHelm's own leftovers (OwnRound::Own) are alerted and never listed as deferred. The completion guard never completes over CoderHelm's notes. The self-review rounds no longer defer what they couldn't fix.
  • merge_standing: new building_plan and plan_needs_access codes, approvals counted from the branch rules, Standing::person_only, and needs_person only through it. review_changes_requested is CoderHelm's next fix round, never a person's.
  • waiting_line and draft_hold: a person only through the typed hand-off. The required approval reads "Needs N approval(s) from a person (repo rule) on #N".
  • The reviewer is told which part of the ticket a pull request is and where the other parts are, so an acceptance line another part delivers is met there.
  • review_agent: a finding with no file is listed by its title, never with an empty place. rendered::person_text also fails on an empty name ("- 💬 — …", "****").
  • await_merge: a base merge conflict no longer says it "needs a person's call".
  • API: RunDraftHold.needs_person and RunMergeStanding.approvals, with docs/api/openapi.json regenerated.
  • Incident case xj_plan_builds_every_repo with its page.

Verification

  • cargo fmt --all --check, rustfmt --check --edition 2021 worker/src/passes/incidents/*.rs
  • cargo clippy -p common -p worker -p gateway --all-targets -- -D warnings
  • cargo test -p common -p worker -p gateway
  • brand_spelling.py and domain_examples.py
  • New tests, all on invented data (the acme bookstore's nightly stock sync across acme/bookstore-infra and acme/bookstore-api):
    • a two-repo plan opens both pull requests and finishes both;
    • an own-review block whose fix is in the other repo is built there, not deferred;
    • a placeholder is never offered for review;
    • only a typed person-only reason defers;
    • the page never says "waiting on a person" and "nothing needed" at once;
    • a repo-rule approval reads exactly that;
    • an empty finding place fails the guard and is never rendered;
    • a stuck run is picked up by the sweep;
    • source scans: no ending path outside the plan gate, no untyped claim that a person is needed.

Dashboard: CoderHelm/coderhelm#537

@nambok nambok added the ch-review CoderHelm reviews this pull request label Dec 1, 2026
coderhelm[bot]

This comment was marked as outdated.

Comment thread services/common/src/plan_repos.rs Fixed
coderhelm[bot]

This comment was marked as outdated.

@coderhelm
coderhelm Bot dismissed their stale review December 1, 2026 20:50

Superseded by CoderHelm's latest review

@coderhelm

coderhelm Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

🟡 Post-merge health check: deploy cancelled: the deploy for 059d6fa was cancelled; nothing later deployed it.

  • Customer details guard rerun (cancelled, started 2026-12-03T21:47:48Z)
    No new failures in what ran. Run the deploy again if this commit should go out.
    Auto-merge
    The rest is in the pull request description.

coderhelm[bot]

This comment was marked as outdated.

…queued is put back

- The placeholder check reads each changed file's status: a file the diff
  removes ships nothing, and only a file added, renamed or copied under a
  placeholder path is a placeholder file. A file only changed there is
  read by the lines it adds. The diff is read in full (every page), and a
  listing that fails keeps the draft waiting for the next read instead of
  passing it unread.
- The Python handler rule reads the names a function runtime calls
  (handler, lambda_handler), and a stub or stubs folder is no longer read
  by its name: generated RPC stubs and no-op hooks are real code.
- A plan continuation whose step couldn't be queued puts back what its
  claim changed (status, its index key, the pass, the wait, the count), so
  the run is never left running with no step.
- A run whose continuations are spent while its plan still owes a
  repository stops with a typed reason, never waiting behind the end gate.
- A task list's section is a repository only under the plan repository's
  owner: folder headings are not parts.
- The waiting line's API example and two comments on deferral now say
  what the code does.
coderhelm[bot]

This comment was marked as outdated.

@coderhelm
coderhelm Bot dismissed their stale review December 3, 2026 20:27

Superseded by CoderHelm's latest review

@coderhelm coderhelm Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved with notes a590f34 (merged)

@coderhelm
coderhelm Bot merged commit 059d6fa into main Dec 3, 2026
21 checks passed
coderhelm Bot added a commit that referenced this pull request Dec 4, 2026
#961 merged into `plan-builds-every-repo` after #956 had merged that branch into `main`, so its change never reached `main`. This is that change, picked onto `main`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ch-review CoderHelm reviews this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants