Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
An outdated database constraint blocks every apply/dismiss request, while consent-filtering and decision-recovery flaws can expose withdrawn details or falsely record successful actions.
10 open issues
Allow apply and dismiss decisions in the database constraint · New Reject decisions for suggestions that are no longer open · New Verify operation-specific receipts before marking recovery successful · New Recheck screenshot consent before exposing or applying suggestions · New Preserve the current title when a proposed title is cleared · New Resolve support links against original readable scores · New Close the update dialog when its proposal disappears · New Exclude unapproved proposals from earlier guidance · New Project new learning decisions in the security audit API · New Allow editing guidance at the newly supported length · New
What changed in this PR
Connects Hub’s generated learning-update suggestions to its review workflow, letting authorized users revise guidance and compare results across versions.
Changes:
- Adds suggested-update details and apply/dismiss forms that require a reason.
- Extends decision APIs, persistence, audit types, and crash recovery for suggestion decisions.
- Displays earlier guidance and insufficient-evidence feedback, with supporting stories, tests, and documentation.
| File | Description |
|---|---|
hub/server/routes/api/learnings/types.ts |
Extends history dependencies with updates and earlier guidance. |
hub/server/routes/api/learnings/decision/post/index.ts |
Validates apply and dismiss requests. |
hub/server/routes/api/learnings/create-learnings-route-dependencies/learning-outcomes.db.test.ts |
Updates history fixtures for the expanded response. |
hub/server/routes/api/learnings/create-learnings-route-dependencies/index.ts |
Projects historical outcomes and persists proposal IDs. |
hub/server/repositories/security-audits/parse-security-audit-event/index.ts |
Accepts the new decision event types. |
hub/server/repositories/security-audits/create-security-audit/types.ts |
Extends typed learning-decision audits. |
hub/server/repositories/learning-update-runs/find-latest-learning-update-result/index.ts |
Reads the latest successful update-check result. |
hub/server/repositories/learning-decision-operations/create-learning-decision-operation/index.ts |
Supports suggestion decisions and proposal IDs. |
hub/server/domains/learning/types.ts |
Defines suggestion and earlier-guidance domain types. |
hub/server/domains/learning/reconcile-learning-decision-operation/index.ts |
Adds recovery paths for suggestion decisions. |
hub/server/domains/learning/reconcile-learning-decision-operation/index.test.ts |
Covers completed and partially saved applies. |
hub/server/domains/learning/get-learning-history/index.ts |
Loads open suggestions and groups historical wording with scores. |
hub/server/domains/learning/get-learning-history/index.test.ts |
Covers suggestion filtering and historical scores. |
hub/server/domains/learning/execute-learning-decision/index.ts |
Checks proposal ownership and invokes package decisions. |
hub/server/domains/learning/execute-learning-decision/index.test.ts |
Covers apply arguments and cross-learning rejection. |
hub/server/domains/learning/create-learning-job-processors/index.ts |
Extends recovery audit typing. |
hub/schema/migrations/20261228090000_learning_update_decisions/migration.sql |
Adds the persisted proposal-ID column. |
hub/schema/learning-decision-operation.prisma |
Models the optional proposal ID. |
hub/docs/learning-foundation.md |
Documents suggestion review and earlier guidance. |
hub/client/pages/learnings-page/stories.tsx |
Adds suggestion, apply-dialog, and historical-guidance stories. |
hub/client/features/learnings-library/types.ts |
Adds presentation types for the new detail sections. |
hub/client/features/learnings-library/styles.css |
Styles suggested wording and earlier-guidance groups. |
hub/client/features/learnings-library/index.tsx |
Renders suggestions, decision dialogs, and earlier guidance. |
hub/client/application/hub/view-models/learnings-library/index.ts |
Maps history into detail sections and Build links. |
hub/client/application/hub/view-models/learnings-library/index.test.ts |
Covers suggestion support-link mapping. |
hub/client/application/hub/routes/settings-learnings/index.tsx |
Builds apply and dismiss request bodies. |
hub/client/application/hub/learnings-contracts/types.ts |
Extends browser request and response types. |
hub/client/application/hub/learnings-contracts/index.ts |
Validates expanded history and decision contracts. |
Review effort: Max (adaptive)
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
force-pushed
the
nshki/feat/hub/review-learning-updates
branch
from
November 26, 2026 11:51
080181c to
7c552cf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Why
Hub now asks Copilot for better wording when later Builds keep showing the same problem with a learning. Those suggestions only wait in the learning store, though. People need to see them, decide whether to use them, and compare how the old wording did against the new one.
What changes
An active learning's detail view now shows a Suggested update section when Copilot has one. It shows the issue, the new wording, why Copilot suggested it, and links to the Builds that showed the issue. For example, "Use one primary button per form" gets a suggestion that says which button wins when two actions are equal.
People who can decide on learnings can apply or dismiss the suggestion, and both need a reason. Apply update opens the suggested title and wording in a form so they can adjust it first. Agents then get it as the learning's next version. Dismiss closes it, and Copilot only suggests the same issue again after new Builds show it.
The detail view also gains an Earlier guidance section. It lists each wording agents had before, with the scores that wording got, so people can tell whether an update helped. When the last check found too few Builds to suggest anything, Observed outcomes says so.
These decisions use the same durable decision record as edits. Hub stores the suggestion's ID on it and checks the suggestion is still open and belongs to the learning before running anything. Both decisions pass the record's ID to the package. After a crash, recovery asks the package whether the apply landed, and counts a dismissal as Hub's own only when it carries that ID. An apply that saved the new wording but stopped before closing the suggestion still counts as applied, because agents already get the wording.
sequenceDiagram participant P as Person participant H as Hub participant L as Learning package P->>H: Apply update (reason, wording) H->>H: Save decision record with suggestion ID H->>L: updates (check the suggestion is open and this learning's) H->>L: apply-update --operation-id L-->>H: New version H->>H: Finish decision and write audit Note over H,L: After a crash, recovery asks the package<br/>whether this operation landedNeeds design review
Storybook screenshots
Hub/Pages/Learnings › Suggested Update (light, 1280×1500)
Hub/Pages/Learnings › Applying Suggested Update (light, 1280×1500)
Hub/Pages/Learnings › Earlier Guidance (light, 1280×1500)
Hub/Pages/Learnings › Update Needs More Evidence (light, 1280×1500)