Skip to content

Runs act like a senior engineer before, during and after the pull request - #654

Merged
nambok merged 6 commits into
mainfrom
senior-engineer-runs
Nov 13, 2026
Merged

nambok merged 6 commits into
mainfrom
senior-engineer-runs

Conversation

@nambok

@nambok nambok commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Three changes that were built side by side and touch the same files, combined so they are tested and merged once: the habits a run keeps before and while it writes code, staying with the pull request through review, merge and deploy, and learning from how its pull requests end. This replaces #650, #651 and #652, whose descriptions have the detail for each part.

Changes

Verification

  • On the combined tree: cargo fmt --check --all clean, cargo clippy --workspace --all-targets -- -D warnings clean, cargo test --workspace passes (common 2,175, gateway 906, worker 1,721).
  • Incident cases: 190 pass, including the new ones for each part.
  • Not verified on a live run, against GitHub or against AWS.

… closes and reverts, reviewer asks, and guide pull requests

What becomes of every pull request CoderHelm opens is now counted, and what
people do with one teaches the next run.

Scorecard (common::scorecard). Per repository and per team: opened, merged,
closed without merging, reverted, review rounds to approval, open to merge,
merged after a person's commit, finished with open items. Each pull request
has one small record the webhooks change (opened, a person's review, a
person's push to its branch, closed or merged, reopened, a revert pull
request or revert commit naming it). Every change adds the difference
between what the record counted for before and after to the counters, in
the transaction that writes the record, so a redelivered or late event
counts nothing twice and nothing is recomputed by reading runs. The worker's
reconcile path counts a close the webhook missed. GET
/api/learning/scorecard serves it.

Lessons from outcomes (common::rewards::lessons, passes::outcome_learning).
When people push commits on top of a CoderHelm pull request, close one with
a comment, or revert one with a reason, the worker reads their own words
and the lines they changed and asks the team's model for at most one lesson.
A lesson is kept only when it names code and says how to check a change
against it. It goes through the existing lessons store with the evidence
attached, is counted once per pull request, reinforces the kept lesson that
says the same, and counts against the kept lessons it contradicts, which
lose weight until they are no longer recalled. A revert now writes the
area's lesson again and carries the reason; a revert by commit is
recognised as well as GitHub's revert pull request. Only people with
standing in the repository are read.

Reviewer asks (common::reviewer_prefs). What each reviewer asked for on
CoderHelm's pull requests is distilled into general asks kept per login
within the team, in a fixed list of review categories, with mentions,
addresses and links removed and anything about a person dropped. An ask
seen on two pull requests is given to the build and to CoderHelm's review
of its own pull request when that reviewer is a code owner of the files or
reviewed that part of the repository recently. The team can list the asks
and forget a reviewer or one ask.

Guide file (common::guide, passes::guide_pr). The run already reads the
repository's guide files every run; CONTRIBUTING.md is now read too. A
lesson seen on two pull requests and never contradicted is proposed for
the guide file as a pull request of its own: one commit on a new branch,
never a write to the default branch, at most one open per repository, with
a pause after one merges and a longer one after one is closed. When it
closes, lessons still in the merged file are marked as in the guide and
leave the prompt; lessons people removed, or all of a closed one, are
declined and count as contradicted.

No new tables, indexes or permissions: every record is on the settings
table under the team's own key.
… and no review by CoderHelm of its own lessons

A team can turn guide pull requests off, for every repository or for one
(SETTINGS#GUIDE_PRS; on unless turned off, a repository's own setting wins
over the team's). The switch is read before anything is claimed, read from
GitHub or created: off, there is no branch, no commit, no pull request and
no claim on the repository's record, and lessons reach the prompt exactly
as before. A switch that cannot be read counts as off. A guide pull request
already open when the switch goes off is still settled when it closes.
GET and PUT /api/settings/guide-prs serve it; saving needs the learning
capability's admin role.

A guide pull request says where it comes from three ways: its title starts
"CoderHelm lessons:", its description opens by saying it comes from
CoderHelm's lessons and not from a ticket and that an admin can turn these
off, and it carries the coderhelm-lessons label.

CoderHelm's reviewer leaves a guide pull request to the team. Before this,
a repository with the reviewer on would have reviewed it as CoderHelm's own
pull request once it carried the review label or someone asked: findings
written into its description as open, with no run behind it to fix them.
Now the gateway queues no review job for one, and the worker's review ends
before any model call with a neutral check that says it is for the team to
review, whatever started it.
Both sides added a module to common, an incident case and its row in docs/incidents.md; all are kept.
…uest

Reproduce a bug first, read the files' history, account for dependents, ask early with a default and prove tests fail without the change. Stay with the pull request through review, merge and deploy, and judge a red check flaky or broken before changing code. Keep a scorecard, learn from edited, closed and reverted pull requests, remember what reviewers ask for, and propose lessons to the repository's guide.
Both sides added an incident case and its row in docs/incidents.md; all are kept.
@nambok
nambok merged commit 271458d into main Nov 13, 2026
10 checks passed
@nambok
nambok deleted the senior-engineer-runs branch November 13, 2026 17:20
nambok added a commit that referenced this pull request Nov 13, 2026
…::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