Skip to content

feat(hub): score again when a reviewer verifies the work - #399

Draft
nshki wants to merge 7 commits into
nshki/feat/hub/observed-outcomesfrom
nshki/feat/hub/reviewer-verified-outcomes
Draft

nshki wants to merge 7 commits into
nshki/feat/hub/observed-outcomesfrom
nshki/feat/hub/reviewer-verified-outcomes

Conversation

@nshki

@nshki nshki commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Why

An automated score only guesses whether a learning helped. The strongest sign is the person who gave the review feedback saying the fix worked. Until now, Hub ignored that signal, so a learning's outcomes could never show that a reviewer confirmed the result.

What changes

When the person who wrote a review thread's first comment resolves that thread, Hub treats it as verification. It finds the prototype's newest successful Build after the one they commented on, and asks for that commit to be scored again. Each learning an agent applied in that commit gets one more score. That score tells the scorer a reviewer confirmed the work, and records reviewer_verification as one of its inputs. The first, automated score is kept in the store.

On a learning's detail view, the newer score replaces the earlier one for the same use and reads "Reviewer-confirmed" instead of "Automated assessment".

The learning package's score command gains --reviewer-verified-at. Hub sends only that time, never the thread's text.

sequenceDiagram
    participant Reviewer
    participant Hub
    participant Worker
    participant CLI as replica-learning
    Reviewer->>Hub: resolve own thread on Build 3
    Hub->>Hub: newest later Build is 5
    Hub->>Hub: save verification for the prototype and Build 5's commit
    Hub->>Hub: save score request for Build 5's commit
    Worker->>Hub: recovery pass finds the ready request
    Worker->>CLI: score (usage), already done, skipped
    Worker->>CLI: score --reviewer-verified-at
    CLI-->>Worker: second score with reviewer_verification
Loading

Needs design review

  • Only the thread's original commenter counts as a verifier. Another reviewer confirming the result isn't supported yet.
  • The verified change is the prototype's newest successful Build after the feedback Build, not the commit that first followed it. A thread resolved on its own Build verifies nothing.
  • Each use gets at most one verification score, even if several threads on that Build are resolved.
  • Reopening a thread doesn't undo the verification score.
  • A verification is recorded for any repository, even with evaluations off. The scoring job skips it there, and unscored score requests are dropped after 30 days as before.
  • The Library shows only the newest score for each use. The earlier automated score stays in the store.
  • A usage report gets a verification only when its prototype ID matches the Hub prototype. A report that names no prototype gets the latest verification for its commit.
  • Verifications are kept until their prototype is deleted, so late usage reports still get the extra score.
  • "Newest Build" means the one whose workflow started last.

Storybook screenshots

All screenshots use the light theme at 1280×800, scrolled to the "Observed outcomes" section. The first outcome in the shared active fixture is now reviewer-confirmed.

Hub/Pages/Learnings: Active Detail (changed)

Hub/Pages/Learnings Active Detail, light, 1280×800

Hub/Pages/Learnings: stories that share the active fixture

Editing Learning

Hub/Pages/Learnings Editing Learning, light, 1280×800

Member Detail

Hub/Pages/Learnings Member Detail, light, 1280×800

Shared By This Repository

Hub/Pages/Learnings Shared By This Repository, light, 1280×800

Shared From Another Repository

Hub/Pages/Learnings Shared From Another Repository, light, 1280×800

Unavailable Wording

Hub/Pages/Learnings Unavailable Wording, light, 1280×800

@nshki
nshki added this pull request to stack #367 November 26, 2026 09:39
@nshki
nshki requested an adaptive review from Copilot November 26, 2026 09:39
Comment thread packages/learning/src/evaluation.mjs Resolved

Copilot AI 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.

🟡 Changes recommended

Reviewer-verification handling can discard verification or associate it with the wrong prototype or Build, producing missing or incorrect reviewer-confirmed scores.

9 open issues
What changed in this PR

Adds reviewer-confirmed scoring to Hub’s learning evaluation flow. Automated scores remain stored, while the Library shows the latest assessment for each learning use.

Changes:

  • Request a separate score when a reviewer resolves their own thread and a later successful Build exists.
  • Extend the learning CLI and score contracts with reviewer-verification context.
  • Display reviewer-confirmed outcomes and update supporting tests, stories, and documentation.
File Description
packages/​learning/​test/​evaluation.test.mjs Covers verification context sent to the evaluator.
packages/​learning/​src/​store.mjs Accepts reviewer verification as a score input.
packages/​learning/​src/​evaluation.mjs Includes verification in scoring prompts and records.
packages/​learning/​src/​cli.mjs Adds the verification timestamp option.
packages/​learning/​README.md Documents verification-based rescoring.
packages/​learning/​index.d.mts Extends score input types.
packages/​learning/​contracts/​v1/​score.schema.json Allows verification in score records.
hub/​server/​routes/​api/​learnings/​create-learnings-route-dependencies/​learning-outcomes.db.test.ts Updates automated outcome expectations.
hub/​server/​repositories/​learning-score-requests/​record-reviewer-verification/​index.ts Records scoring requests from reviewer confirmation.
hub/​server/​repositories/​learning-score-requests/​record-reviewer-verification/​index.db.test.ts Covers reviewer eligibility and Build selection.
hub/​server/​repositories/​learning-score-requests/​find-learning-score-request/​index.ts Reads pending scoring requests.
hub/​server/​repositories/​learning-score-requests/​delete-learning-score-request/​index.ts Preserves requests containing unseen verification.
hub/​server/​repositories/​learning-evaluation-runs/​start-learning-evaluation-run/​index.ts Separates usage and verification attempts.
hub/​server/​domains/​review-comments/​create-review-comment-service/​index.ts Records verification during thread resolution.
hub/​server/​domains/​learning/​types.ts Adds the outcome assessment source.
hub/​server/​domains/​learning/​score-applied-learnings/​index.ts Runs verification-triggered scoring attempts.
hub/​server/​domains/​learning/​score-applied-learnings/​index.test.ts Covers rescoring arguments and request cleanup.
hub/​server/​domains/​learning/​get-learning-history/​index.ts Selects the latest score per use and identifies its source.
hub/​server/​domains/​learning/​get-learning-history/​index.test.ts Covers replacement by a reviewer-confirmed score.
hub/​server/​domains/​learning/​create-learning-job-processors/​index.ts Connects verification lookup and scoring triggers.
hub/​schema/​migrations/​20261226090000_reviewer_verified_scores/​migration.sql Adds verification timestamps and per-trigger uniqueness.
hub/​schema/​learning-score-trigger.enum.prisma Defines scoring triggers.
hub/​schema/​learning-score-request.prisma Stores pending verification timestamps.
hub/​schema/​learning-evaluation-run.prisma Distinguishes evaluation runs by trigger.
hub/​docs/​learning-foundation.md Explains verification scoring and displayed outcomes.
hub/​client/​pages/​learnings-page/​stories.tsx Shows a reviewer-confirmed outcome fixture.
hub/​client/​features/​learnings-library/​types.ts Adds the reviewer-confirmation presentation flag.
hub/​client/​features/​learnings-library/​index.tsx Labels reviewer-confirmed outcomes.
hub/​client/​application/​hub/​view-models/​learnings-library/​index.ts Maps assessment source to the presentation flag.
hub/​client/​application/​hub/​view-models/​learnings-library/​index.test.ts Covers confirmed outcome mapping.
hub/​client/​application/​hub/​learnings-contracts/​types.ts Adds assessment source to client response types.
hub/​client/​application/​hub/​learnings-contracts/​index.ts Validates the outcome assessment source.

Review effort: Max (adaptive)

Comment thread packages/learning/src/cli.mjs Resolved
Comment thread hub/docs/learning-foundation.md Resolved
Comment thread packages/learning/src/evaluation.mjs Resolved
nshki and others added 3 commits November 26, 2026 02:03
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
@nshki
nshki force-pushed the nshki/feat/hub/reviewer-verified-outcomes branch from 65a6afa to 42ece62 Compare November 26, 2026 10:03
nshki and others added 4 commits November 26, 2026 02:10
…tion

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
@nshki
nshki force-pushed the nshki/feat/hub/reviewer-verified-outcomes branch from 42ece62 to 39f20b1 Compare November 26, 2026 10:10
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.

3 participants