Skip to content

A pull request's description is rebuilt from its head; every app a dependency change can break is built - #655

Closed
nambok wants to merge 3 commits into
mainfrom
pr-description-from-head
Closed

nambok wants to merge 3 commits into
mainfrom
pr-description-from-head

Conversation

@nambok

@nambok nambok commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

A dependency run's pull request had the right code after a review round and the wrong description. Its table still showed the plan (five packages as major version jumps the final manifest no longer makes), its count of fixed advisories had never been compared with the final lockfile, the round that fixed the code wrote that it could not edit the description and left the corrections to a person, and the repository's second app, which no CI job builds, was never built.

This change makes the description a function of the head, and makes the runtime proof cover every project a change can break:

  1. A dependency pull request's table and headline are what the lockfile on the head resolves, compared with the base branch. Every write of a description goes through one function, and every path that moves the head rebuilds the description there.
  2. A fix round is never left to conclude it cannot change the description. The cause is fixed, and a sentence that hands the description to a person is caught and becomes the rebuild.
  3. A sentence a run writes into a repository file that says a check passes needs that check's recorded passing result, or it is taken out.
  4. In a workspace, every project that takes a changed package line is built when its manifest declares a build, with or without a CI job. A project that can't be proven is named with why.

Changes

The description is rebuilt from the head

  • common/src/dep_head.rs (new): resolve compares each lockfile on the base branch with the same lockfile on the head, one answer per package version line: moved (with the real versions and whether it crosses a major), not moved, no longer installed, or not known with why. HeadFacts::fixed counts an advisory as fixed only when every copy left on its line is at or past the patched version. headline writes the first sentences from those counts.
  • common/src/reachability.rs: lock_copies reads every copy a lockfile resolves (pnpm, npm, yarn classic and berry, Cargo, poetry, uv, Bundler). A lockfile it can't read gives no answer, and the description says so.
  • common/src/security_fixes.rs: pr_body_at_head writes the table, the headline and the per-tier lists from the head's facts. A line that could not be read is shown as "planned; not read from the head", and no count of fixed advisories is claimed when nothing could be read. pr_body_linked (the plan) is no longer called by the worker.
  • worker/src/passes/security_fixes.rs: head_facts reads the lockfiles on both sides. rebuild_at_head replaces Summary (headline and table), What to check and Proof in place and keeps the rest. The first description, a bundle a fix joins or leaves, and the CI result all use it.
  • worker/src/passes/description.rs (new):
    • save is the only caller of the GitHub client's body write. All 29 call sites in 12 files now go through it.
    • head_moved is the one rebuild: the prose is rewritten from the whole diff, then the dependency sections are rebuilt from the lockfile, so the model is never the source of a version or a count. CI fix rounds, review fix rounds and feedback call it. A bump CI takes out calls dependency_sections.
    • A test reads the worker's sources and fails on a body write outside this module, on a raw request to a pull request, and on a description rewrite that passes head_moved by.

A round never hands the description to a person

  • The cause, in worker/src/passes/feedback.rs: the round's instructions told it to call update_pr_description for any request about the description, but the tool was only offered when a person triggered the round. A round started by CoderHelm's own review or a security follow-up was told to call a tool it did not have. The tool is now offered in every round; with no person behind the round, the call asks for the rebuild from the branch.
  • The other fix rounds (implement.rs, used by CI fix and review fix) had no word about the description at all. They are now told it is rebuilt for them (description_handoff::ROUND_NOTE).
  • common/src/description_handoff.rs (new): handoffs finds a sentence that says the description can't be edited or leaves an edit of it to a person; scrub takes it out. A fix round's account and a feedback round's reply are checked, and a match runs the rebuild even when no code was pushed. description::save applies the same check to every description.

No unproven claims in files the run writes

  • common/src/file_claims.rs (new): reads the lines a change adds to prose files (.md, .mdx, .rst, .adoc, .txt, README, CHANGELOG) and returns each sentence that states that the build, the tests, the linter or the type check passes. Instructions, conditions, plans, questions, negatives, headings, code blocks and sentences where the word means something else are left alone.
  • worker/src/passes/file_claims.rs (new): the recorded results are the run's sandbox check record, the same one the pull request's sections are written from. A claim without a passing record is taken out of the file in one commit and named on the run page. It runs after the proof check on both ways a run opens its pull request, and after a fix round lands, before the description is rebuilt.

Every app the change can break is built

  • common/src/reachability.rs: lock_projects reads the workspace projects of a lockfile and which changed package lines each one's dependencies bring in, through other workspace projects too. pnpm from importers, npm from the packages outside node_modules, yarn from the workspace manifests.
  • common/src/runtime_proof.rs: add_projects adds each affected project's build script to the proof, whether or not CI builds it. add_lockfile adds the project of every other lockfile with bumps, after its own install (this replaces "covers the project with the most bumps only"). unproven_projects names a project that has no build, gave no result, or fails on the base branch too, with the reason. A project build that passes on the base branch and fails with the bumps is blamed like any other, which is what the take-out acts on. Another project's failing build never keeps the main project's start from running.
  • worker/src/passes/dep_fix.rs: proof_plan works out the affected projects and adds them. The proof still runs as its own step with the existing time rules and base-branch comparison.

Incident suite

  • incidents/aj_description_from_the_head.rs and its row in docs/incidents.md.

Not in this change

  • The proof is still one sandbox run, so it builds at most 5 projects beside the main one. A project over that is named as not built, never dropped silently.
  • An unproven claim in a file is removed, not proven by starting a new check run for it.
  • The run's own account under Change is still rewritten by the model from the diff. Only the sections listed above are computed.
  • The settle stage (Runs settle their own open items before finishing #649) needed no new call: it sends a run with stale open items back to its checks step, and that step writes the description through the same path as the first one, which now reads the head.

Verification

  • cargo fmt --check --all: clean
  • cargo clippy --workspace --all-targets -- -D warnings: clean
  • cargo test --workspace: passes (common 2146, gateway 902, worker 1652, 0 failed)
  • New tests cover: the table and headline from a head's lockfiles, including a line the plan called major that the head keeps on its line, a line short of its patch, a line no longer installed and a head that can't be read; the single-writer guard; the round-summary check with phrasings that must and must not match; the claim detector with ordinary prose that must not match; affected projects for pnpm, npm and yarn (classic and berry) workspaces; a project with no CI job; a project that fails on the base branch too.
  • Not verified in a live run: no real pull request was rebuilt and no sandbox build ran. The lockfile readers were tested on small made-up lockfiles, not on a large real one.

…pendency change can break is built

A dependency run's pull request had the right code after a review round
and the wrong description: its table still showed the plan (packages as
major version jumps the final manifest no longer makes), its count of
fixed advisories was never compared with the final lockfile, the round
that fixed the code said it could not edit the description, and a second
app no CI job builds was never built.

- common::dep_head: what the lockfile on the head resolves for each
  package version line, compared with the base branch. The dependency
  description's table and headline are written from it; an advisory is
  fixed only at or past its patched version; what can't be read is said
  as not known and the plan is marked as a plan.
- passes::description: the one place a description is written from
  (save), the one rebuild every path that moves the head calls
  (head_moved), and a source test that fails on a body write anywhere
  else.
- common::description_handoff: fix rounds are told the description is
  rebuilt for them; a round's sentence that hands it to a person is taken
  out and becomes the rebuild. Feedback rounds with no person behind them
  now have the description tool they were told to call.
- common::file_claims and passes::file_claims: a sentence a run writes
  into a prose file that says a check passes needs that check's recorded
  passing result, or it is taken out before the run finishes.
- runtime_proof: every workspace project whose dependencies bring in a
  changed package line is built when its manifest declares a build, and
  the project of every other lockfile with bumps; a project that can't be
  proven is named with why.
- Incident case aj and its row in docs/incidents.md.
…::save

- pr_watch.rs, flaky.rs and reviewer_guide.rs wrote the description
  directly; each now goes through description::save.
- A dependency rebuild lifts every owned section out before it replaces
  the computed ones and puts them back as they were (rebuilt_body), so the
  settled items, CI notes, the reviewer guide, review fixes and the draft
  status survive wherever they sit. The model's rewrite puts the "before
  and after the code" section back word for word.
- Feedback rounds settle the claims they write into files against their
  own run of the full test suite, before the description is rebuilt.
- The incident case is renamed am_description_from_the_head (aj is taken).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant