Repository navigation
feat(hub): port Learnings management - #225
Merged
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved digest-handling flaws can apply drafts to unreviewed suggestion versions and leave administrators repeatedly submitting stale data after conflicts.
8 open issues
Reject dot-segment learning IDs · New Calculate 30-day usage from all runs with exact decimals · New Revalidate after decision errors · New Include repository context in the document title · New Honor Hub administration when capabilities are omitted · New Include the digest in decision form keys · New Test stale-digest rejection through the decision handler · New Test authorization on both POST endpoints · New
What changed in this PR
Ports repository Learnings management from provisional settings records to a dedicated typed frontend API boundary. This remains a frontend/mock implementation; backend endpoints and persistence are not added.
Changes:
- Adds dedicated read, run, and decision contracts and route handling.
- Maps evidence, accepted guidance, recall, usage, permissions, and failure states into the retained page.
- Adds local mock handlers and integration coverage, and updates stories and documentation.
| File | Description |
|---|---|
hub/docs/frontend.md |
Documents Learnings endpoints and backend responsibilities. |
hub/client/pages/learnings-page/types.ts |
Separates denied and authorized page data. |
hub/client/pages/learnings-page/stories.tsx |
Updates access-denied and failed-run examples. |
hub/client/pages/learnings-page/index.tsx |
Renders access denial separately from learning content. |
hub/client/application/hub/view-models/settings-learnings/index.ts |
Maps the dedicated contract into page presentation. |
hub/client/application/hub/settings-contracts/types.ts |
Removes obsolete settings-based learning types. |
hub/client/application/hub/settings-contracts/index.ts |
Removes legacy learning schemas and operations. |
hub/client/application/hub/screens/settings-workspace-screen/index.tsx |
Removes Learnings from the generic settings screen. |
hub/client/application/hub/routes/sidebar-consistency.test.tsx |
Adapts navigation coverage to the new endpoint. |
hub/client/application/hub/routes/settings-meta/index.ts |
Removes generic Learnings metadata handling. |
hub/client/application/hub/routes/settings-learnings/index.tsx |
Implements dedicated loading and decision submissions. |
hub/client/application/hub/routes/settings-form-operation/index.tsx |
Removes legacy learning form translation. |
hub/client/application/hub/routes/settings-controller/index.tsx |
Removes Learnings from shared settings loading. |
hub/client/application/hub/routes/route-naming.test.tsx |
Updates repository-scoped run and acceptance coverage. |
hub/client/application/hub/routes/learnings-flow.test.tsx |
Adds contract, decision, access, and failure coverage. |
hub/client/application/hub/routes/expanded-flows.test.tsx |
Migrates route wiring and removes superseded cases. |
hub/client/application/hub/mocks/create-settings-store/index.ts |
Removes legacy learning state and exposes shared services. |
hub/client/application/hub/mocks/create-mock-store/index.ts |
Initializes the dedicated learning store. |
hub/client/application/hub/mocks/create-mock-handlers/index.ts |
Registers Learnings handlers. |
hub/client/application/hub/mocks/create-learnings-store/index.ts |
Adds tab-lifetime learning state and mutations. |
hub/client/application/hub/mocks/create-learnings-handlers/index.ts |
Implements the three mock HTTP endpoints. |
hub/client/application/hub/learnings-contracts/types.ts |
Defines response and decision types. |
hub/client/application/hub/learnings-contracts/index.ts |
Adds runtime response and input validation. |
hub/client/application/hub/learnings-contracts/index.test.ts |
Covers response shapes and decision validation. |
Review effort: Max (auto)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the frontend and local-mock Learnings contract migration.
No open issues 🎉
8 resolved since last review
Include the digest in decision form keys Honor Hub administration when capabilities are omitted Include repository context in the document title Revalidate after decision errors Calculate 30-day usage from all runs with exact decimals Reject dot-segment learning IDs Test authorization on both POST endpoints Test stale-digest rejection through the decision handler
Review effort: Balanced (auto)
weastler
approved these changes
Nov 11, 2026
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
The new Hub already includes a Learnings page, but the page was still filled from temporary settings data. That made it difficult to review the real experience or connect the page to the learning backend. This change defines what the page needs and ports the existing Learnings management flow to the new Hub.
What changes
Repository administrators can now review suggested guidance together with the comments that support or disagree with it. They can accept a suggestion, edit its wording before accepting it, reject it with a reason, or retire guidance that no longer applies. The page also previews what an agent will receive and shows recent learning runs, Copilot usage, and failures.
The page handles the states people may encounter while managing learnings, including missing evidence, guidance that replaces an earlier learning, a suggestion that changed while it was being reviewed, denied access, a disconnected Copilot account, and a failed request. A failed form keeps the person's draft so they can correct or retry it.
The browser now has a dedicated contract for loading this page, requesting a learning run, and recording a decision. Local development uses the same contract with temporary in-browser data, so the stories and mock experience exercise the interface the backend will implement.
The backend still needs to provide these three repository-authorized endpoints:
GET /api/repositories/:repositoryId/learningsPOST /api/repositories/:repositoryId/learnings/runsPOST /api/repositories/:repositoryId/learnings/:learningId/decisionThis PR does not add the learning store, review-comment import, background processing, or vision-model management.
Storybook screenshots
Hub/Pages/Learnings, dark theme, 1440 × 2400
Default
Access Denied
Opposing Evidence
First Visit
Missing Metadata
Identity Revalidation
Replacing Guidance
Copilot Refused
Running
Daily Run Waiting
Failed Run
Load Error