Skip to content

Learning loops proven: every reviewed PR teaches calibration, the coder learns specific lessons and its own variants, and a health check shows a quiet loop - #502

Merged
nambok merged 1 commit into
mainfrom
learning-loops-proven
Nov 7, 2026
Merged

nambok merged 1 commit into
mainfrom
learning-loops-proven

Conversation

@nambok

@nambok nambok commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

An audit of production found learning loops that ran but taught little, and one that didn't exist:

  • Calibration could only raise. Comments left open were scored only on CoderHelm's own PRs. Most reviews are of people's PRs, and since the reviewer approves with notes, a person merging over a Nit fed nothing. 34 of 44 calibration counters stayed under the 8-sample minimum, and none was ever downgraded or suppressed.
  • Coder lessons were generic. They said "read the surrounding code", came in near copies, and rested on an edit share that counted a merge of the base branch as people's edits. That made almost every updated PR read as 100% rewritten. The lessons never reached the coder's own prompt.
  • The coder had no prompt variants, so its outcomes credited nothing.
  • Missed closes were never scored. The reconcile sweep wrote them to the run only, and reverts had no area or variant.
  • The stop judge's outcome log was incomplete. It never recorded an approval over a block, read every later commit as a fix, and fed only analytics.

Changes

  • Every reviewed PR is scored at close. This covers people's PRs and CoderHelm's own. Each CoderHelm thread is recorded as:

    • acted on: CoderHelm resolved it, or its lines changed;
    • dismissed: a person resolved it with the lines unchanged;
    • left open: untouched at merge. An FYI never counts.

    Events are credited to the review's prompt variant. Dedup keys are shared with the existing paths, so nothing counts twice.

  • People's edits are measured accurately. Only their own non-merge commits count, with the files they touched and their commit subjects. The close reason joins the closed event, including an answer given later.

  • One coder lesson per area names what people changed and said, and what to do next. Old generic lessons are replaced, and numbers no longer make a lesson look new. Lessons and the variant's addendum go into the coder's system prompt (capped) as well as the planner's.

  • The coder has three prompt variants, chosen once per run, noted on the run, and credited at close (reverts included). They can be pinned like the reviewer's.

  • The reconcile and backfill sweeps score what they record.

  • The decision log is complete. A merge compares each block's head with the merged head. A person approving over a standing block is recorded as overrode. The stop judge's picture carries the team's recent decisions of the same kind that people overturned.

  • New GET /api/learning/health. Per loop it returns the last signal, the 7-day count, what should have fed it, and red when a loop that should fire stayed quiet. Viewers and up can read it.

  • Replay cases 10 to 13 cover the four gaps, with new case kinds learning_threads, learning_edits, learning_coder_lesson and decision_overturned.

Verification

  • cargo fmt --all --check is clean.
  • cargo clippy -p common -p gateway -p worker --all-targets -- -D warnings is clean. WorkerMessage now allows large_enum_variant: the ticket message grew one in-process field.
  • cargo test -p common -p gateway -p worker passes: common 1512, gateway 750, worker 1355. The replay suite runs inside the worker tests.
  • The OpenAPI document is unchanged: the new route is dashboard-only.

…er learns specific lessons and its own variants, and a health check shows a quiet loop

An audit of production learning found loops that ran but taught little:
- Review comments left open were scored only on CoderHelm's own PRs, so
  calibration of people's PRs could only raise a category, never quiet one.
  Since the reviewer approves with notes, a person merging over a Nit fed
  nothing.
- Coder lessons said only "read the surrounding code", came in near
  copies, and rested on an edit share that counted a merge of the base
  branch as people's edits (100% on almost every updated PR). They never
  reached the coder's own prompt.
- The coder had no prompt variants, so its outcomes credited nothing.
- Closes the webhook missed were written to the run but never scored;
  reverts carried no area or variant.
- The stop judge's outcome log never recorded an approval over a block,
  read every later commit as a fix, and fed only analytics.

Changes:
- Every PR CoderHelm reviewed is scored at close. Each thread is acted on
  (resolved by CoderHelm or its lines changed), dismissed (resolved by a
  person, lines unchanged) or left open (untouched at merge; an FYI never
  counts), credited to the review's arm, with idempotent keys.
- People's edits come from their own non-merge commits, with the files
  they touched and their commit subjects. The close reason joins the
  closed event, including an answer given later.
- One coder lesson per area names what people changed and said and what
  to do next. Old generic lessons are replaced, and numbers no longer make
  a lesson look new. Lessons and the arm's addendum go into the coder's
  system prompt, capped, as well as the planner's.
- The coder has three variants, chosen once per run, noted on the run and
  credited at close (reverts included).
- The reconcile and backfill sweeps score what they record.
- Merge outcomes compare each block's head with the merged head. A person
  approving over a standing block is recorded as overrode. The stop judge
  is given the team's recent decisions of the same kind that people
  overturned.
- GET /api/learning/health: per loop, the last signal, the 7-day count,
  what should have fed it, and red when a loop that should fire is quiet.
- Replay cases for the four gaps.
@nambok
nambok merged commit de34e9c into main Nov 7, 2026
10 checks passed
@nambok
nambok deleted the learning-loops-proven branch November 7, 2026 01:03
coderhelm Bot pushed a commit that referenced this pull request Dec 3, 2026
Moves dashboardRef from 6593784 to 1002bc7, carrying CoderHelm/coderhelm #502, #514, #513, #527, #530, #531, #533, #529, #536, #535, #499 and #537.
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