Skip to content

A pull request's description is a view of the facts recorded for its head - #674

Merged
nambok merged 10 commits into
mainfrom
description-from-facts
Nov 14, 2026
Merged

nambok merged 10 commits into
mainfrom
description-from-facts

Conversation

@nambok

@nambok nambok commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator

A pull request's description is now rendered from the facts recorded for its head: every written sentence is checked against them, what a reader sees first is about ten lines, and everything else is collapsed.

Check: cd services && cargo test --workspace; the cases alone: cargo test -p worker description_eval -- --nocapture.
Risk: Medium: every write of a description now passes through a new layout, and every rebuild through a new fact check that can remove a sentence.
Needed from you: a review. Nothing here is merged or deployed.
Review: decide whether this shape is the one wanted for every pull request. Feedback wanted: the fact check's rules in services/common/src/pr_claims.rs (what it removes), and the three decisions under "Look at first".
Look at first:

  • Built on A description names the head it was built for and is rebuilt whenever the head differs #665, which merged while this was written: branched from description-stamped-to-head, then main merged in (through Pin the dashboard for the quarantine and infrastructure findings release #670).
  • The fact check removes text. A sentence it wrongly judges unsupported is lost from the description (it is logged with the fact it disagreed with). The rules are conservative and listed below; this is the part most worth a second reader.
  • Commit consolidation (one commit per risk group before a pull request is marked ready) is not built. Titles and commit messages follow the repository's form; the design for consolidation is under Changes.
  • Three things need a decision and are off or partial until then: creating a tracker ticket for a run that has none (built, off unless create_ticket is set on the team's git conventions record; no dashboard switch yet), the missing "Actions: write" permission as an item for an admin (recorded on the run as permission_needed; no API route or dashboard yet), and the installer still asks for actions: read only.
  • Not verified live: no run was made against GitHub, a model or DynamoDB. Everything below is verified by tests on fixtures.

Summary

Two pull requests CoderHelm opened were read by people who found the code fine and the description unusable. A dependency security pull request was wrong in five places (a package "not moved on the head" that the lockfile resolves at the patched version, a lockfile "out of sync" that installs frozen, a fixed advisory listed as open, a wrong count of high advisories left, the package still listed as open), said "contract unchanged" with nothing behind it, gave no reason any major version jump was safe, was titled fix(deps): ... in a repository that titles by ticket key, and carried commits prefixed KEY-1:. A three-file feature carried a page about its outside steps: a raw 403 with its JSON body twice, "needs access CoderHelm doesn't have" beside "(owner: CoderHelm)", "CoderHelm does this after the pull request opens" long after it had opened, and found facts and a query already run listed as items with owners.

The cause is the same in both: many code paths each appended a section, and nothing held the result against what was recorded or read it as a person would.

Changes

A description is a view of facts (common/src/pr_facts.rs, worker/src/passes/description_facts.rs, description.rs)

  • Facts per head: the diff's files, the head's recorded check results with links, the ticket, the risk, what is open and who closes it, the steps outside the code, and for a dependency update the lines the lockfile resolves, advisories fixed, remaining and introduced, families, evidence per major, probes.
  • description::build gathers them and calls description_facts::shape, the one path every description takes. It runs on every rebuild of every kind of run.
  • The stamp now carries a digest of the text the fact check reads. A writer that changes that text any other way makes the description not current, so the check runs again before anything rests on it.

Every written sentence is checked (common/src/pr_claims.rs)

  • Caught: a file said to be changed that the diff does not contain; a check said to pass that no recorded result shows passing; a count that is not the recorded one; "unchanged", "no impact", "fully fixed", "no breaking changes" and the like with no supporting fact; and on a dependency update a package "not moved" or "still open" that the head moved, a lockfile "out of sync" when a frozen install passes, a fixed advisory listed as open.
  • A count is rewritten with the recorded number and a table cell with the versions the head resolves; anything else is removed, a blanket word clause by clause so the rest of the sentence stays.
  • Never read: code, and the sections CoderHelm renders from records.
  • What a model writes is checked before it is saved (description::save_checked), and a first description is held against its diff before the pull request opens.

What a reader sees first (pr_facts::lead, common/src/pr_layout.rs)

  • The lead: one line saying the change, how to check it, the risk, "Needed from you" (numbered steps, or "Nothing."), what is asked of the reviewer, and anything out of the ordinary with its evidence (a major version jump with its safety evidence or that none is recorded, a behaviour change, a failed or missing check, advisories left).
  • Everything else is collapsed under its own name with a stable anchor. A section with nothing in it is dropped. Only four blocks stay in sight, each present only when something is wrong: why it is a draft, a reviewer's objection, open review findings, planned work not done.
  • description::save lays out every write, so no writer can leave a section in sight that belongs below or a fold unbalanced.

The reader pass (common/src/pr_reader.rs)

  • One model call reads the assembled text with the facts and fills two slots of the lead: the summary and the check. It may name written sections to drop.
  • It cannot invent: the summary goes through the same fact check, may name only code and numbers the description or the facts already hold, and carries no raw machinery; the check must be a command the description already gives, word for word; only sections a person or a model wrote can be dropped, never Changes or Risk. The risk, what is needed, the anomalies, tables, counts, check results and steps never pass through the model.

Steps outside the code (common/src/pr_steps.rs, outside_work.rs, outside_exec.rs)

  • A step has one owner and one state (done, waiting on a named event, waiting on an approval with who and where, failed with a plain cause and what lifts it, needs a person), and its text is generated from that state on every build.
  • A raw error becomes a cause a person can act on; raw queries, ids and responses go in the collapsed evidence; CoderHelm's own tool names never appear.
  • A check CoderHelm can make is reported as a result ("Checked: ..."), never listed as a step. "Not in this PR" lists only work still to come.
  • Why a step that said "deploy the staging Studio" started a test workflow: a workflow counted as a deploy when the words "deploy" and "studio" appeared anywhere in it. It now needs a run line that deploys.
  • Whether the app may start workflows is read from its token before trying: a start that would be refused is not attempted, the refusal is remembered for the steps after it, and the missing permission is recorded once on the run.

Titles and commits (common/src/pr_conventions.rs, worker/src/passes/conventions.rs)

  • The form is detected, in order: the team's template, the repository's guide, commitlint and pull request title checks, then recent merged pull requests and base commits (at least 8 samples, a 60% majority, merges and bots left out). The evidence is kept on the run and shown in the collapsed part.
  • A key is real or absent: the run's own ticket, or one that exists in the connected tracker. With a form that needs a key and none available, the closest valid form is used and the pull request says so once.
  • Applied to the pull request title, the squash commit, the security bundle's title and the dependency run's commits.

Placeholders are never learned (common/src/placeholders.rs, worker/src/passes/lesson_cleanup.rs)

  • How KEY-1: was learned: the line a review fix round writes into the description to say how it chose its commit message gave the convention as the example KEY-1: . The description is read back by the steps that learn from a pull request's outcome, and no lesson was checked for a placeholder.
  • That line now says it in words. A lesson, a reviewer ask or a repository memory that holds a placeholder is refused when learned, and a one-time cleanup from the maintenance tick removes kept ones.

CoderHelm's own review threads

  • A rebuild resolves CoderHelm's own unresolved thread that said the description was behind the code. Only threads its own reviewer opened. An app that may not resolve threads is said once and the thread stays open.

Not built: commit consolidation. The design: before a pull request is marked ready, and only while every commit is CoderHelm's and no person has reviewed or pushed, rebuild the branch as one commit per risk group, one for lockfiles and one for code a major required, with the same final tree. Two things make it unsafe to do here: a lockfile changes with every bump, so a per-group commit needs the manifest and lockfile regenerated per group, not hunks moved; and take-outs revert by the original commits, which would no longer be on the branch, so they would have to rebuild from the bump records (kept under a hidden ref) and not from history.

Not built, said plainly: the same reading for every ticket comment (only the outside-steps note is rewritten); re-running a confirmation after merge or deploy; the dashboard side of the two settings above.

Shared files touched: worker/src/passes/description.rs, pr.rs, security_fixes.rs, dep_fix.rs, outside_work.rs, outside_exec.rs, fix_location.rs, own_review.rs, review_fix/commit_style.rs, mod.rs, main.rs, memory/mod.rs, incidents/mod.rs; common/src/lib.rs, git_conventions.rs, github_grants.rs, reviewer_prefs.rs, rewards/lessons.rs; docs/incidents.md.

Verification

  • cargo fmt --check --all, cargo clippy --workspace --all-targets -- -D warnings and cargo test --workspace pass locally on the pushed head.
  • The quality eval (worker/src/passes/description_eval.rs) keeps the dependency pull request, the feature pull request and an ordinary ticket's as cases, each with what the reviewer flagged as assertions, the rubric (what the reader must do is in the first five lines; no raw error, query, id or tool name in sight; nothing contradicts a recorded fact; the visible part is within the budget; nothing said twice) and recorded model replies. A second test shows the text as it was written fails it. The module says how to add a case.
  • Incident av_description_from_facts passes only when the description check, the convention check and the lesson check each catch every defect of the dependency pull request.
  • The guard tests in description.rs still pass and now also require the first description to be checked against its diff and read once, every write to be laid out, a model's text to be fact checked before it is saved, and every rebuild to gather the facts, ask the reader pass, shape, stamp, save and settle CoderHelm's own thread, with no other module shaping a description.
  • Not verified live: the GitHub calls (reading merged pull requests and workflows, resolving a thread), the model's replies to the reader pass, the tracker calls, and the DynamoDB scan of the cleanup.

… the head differs

A dependency run's description was built on the commit that changed the
manifest, where the lockfile still resolved the old version. The lockfile
was regenerated in later commits and the run completed with a description
that still said "not moved on the head", still counted the advisory as not
fixed and still listed items of the earlier head.

- description: a hidden stamp names the head the description was built
  for. reconcile rebuilds it when the stamp is not the pull request's
  head: after every message in which CoderHelm moved the branch, in the
  checks and settle step, before a review of its own pull request, in the
  pull request watch and at the end of the run, which returns an error
  instead of completing on another head's description.
- GitHub client: every request leaves through send_tracked, which notes
  the branch a successful ref update, contents write or merge moved. No
  caller has to remember to ask for a rebuild.
- review: its open findings are written on the description as it is now
  and only while the reviewed head is still the head. It used to write
  back the copy it read when it started.
- settle: an item that says a lockfile is out of sync is checked on the
  head by the repository's checks, never carried as CoderHelm's own.
- own review: a finding that the description is behind the code triggers
  the rebuild and is dropped when the rebuild settles it. Every finding
  that is not pure style is CoderHelm's to act on.
- dep_head: tests for suffixed versions, exact-version override keys and a
  package moved on a later head.
- Incident case ar and its row in docs/incidents.md.
# Conflicts:
#	docs/incidents.md
#	services/worker/src/passes/description.rs
#	services/worker/src/passes/incidents/mod.rs
#	services/worker/src/passes/own_review.rs
#	services/worker/src/passes/pr.rs
#	services/worker/src/passes/security_fixes.rs
… evidence reads as a sentence

- description: the source test now also requires that every write is laid
  out, that a model's text is fact checked before it is saved, and that a
  rebuild gathers the facts, asks the reader pass, shapes, stamps, saves
  and settles CoderHelm's own thread about the description. No module
  other than the rebuild, the eval and the incident cases shapes a
  description.
- pr_facts: the evidence after an item under "Look at first" starts with
  an upper case letter ("crosses a major version. No safety evidence is
  recorded ...").
Brings in #672 (GitHub request budget, Integrations) and #671
(dependency updates decided and proven). Incident ids au (#671) and av
(this branch) are distinct and both kept; the worker tick keeps the
lesson cleanup and runs the skill sweep under its GitHub budget.
…facts check

The section #671 records (advisories on the head, families released
together, the verification set) is built into a dependency pull
request's body, shaped by description_facts::shape against the head's
dependency facts, and must come out whole; a rebuild reads it through
security_fixes::at_head.
@nambok
nambok merged commit 48cac82 into main Nov 14, 2026
10 checks passed
@nambok
nambok deleted the description-from-facts branch November 14, 2026 04:22
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