Repository navigation
Conversation
nshki
force-pushed
the
nshki/feat/learning/propose-learning-updates
branch
from
November 26, 2026 10:10
5d4ee23 to
951f177
Compare
nshki
force-pushed
the
nshki/feat/learning/propose-learning-updates
branch
from
November 26, 2026 10:14
951f177 to
a022c57
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Critical consent-enforcement gaps expose withheld learning content and allow unauthorized model use, while non-atomic application can commit edits from dismissed or stale proposals.
14 open issues
Recheck score access before returning an existing proposal · New Withhold proposal content when its evidence is no longer permitted · New Prevent applying proposals after dismissal or supersession · New Require evaluation permission before sending data to Copilot · New Require human actors in stored update decisions · New Quote untrusted issue text before printing · New Require an operation ID for recoverable update application · New Recover applied updates from history after intervening edits · New Test apply recovery and update decision lifecycle paths · New Require new supporting Builds after dismissal · New Reject superseded or conflicted learnings before drafting · New Track all examined scores to avoid repeat drafting costs · New Bound proposal evidence before drafting · New Test reviewer-confirmed proposals and insufficient evidence · New
What changed in this PR
Adds a human-reviewed update workflow to the learning package. Recurring problems in scored Builds can prompt Copilot to suggest clearer learning text; Hub integration remains deferred.
Changes:
- Uses current-version score evidence to group recurring issues and draft new wording.
- Adds commands to propose, list, apply, and dismiss updates.
- Extends storage contracts, audit records, migration, deletion, documentation, and tests.
| File | Description |
|---|---|
packages/learning/test/updates.test.mjs |
Tests evidence thresholds, grouping, and dismissal suppression. |
packages/learning/test/fixtures/json-file-provider.mjs |
Adds update streams to the test provider. |
packages/learning/src/validate.mjs |
Registers the new sealed record kinds. |
packages/learning/src/updates.mjs |
Selects evidence and drafts proposals with Copilot. |
packages/learning/src/store.mjs |
Persists proposals, handles decisions, and extends deletion. |
packages/learning/src/scope-migration.mjs |
Migrates update records and referenced version digests. |
packages/learning/src/records.mjs |
Adds update schema identifiers. |
packages/learning/src/provider-contract.mjs |
Declares proposal and decision streams. |
packages/learning/src/cli.mjs |
Adds propose, list, apply, and dismiss commands. |
packages/learning/README.md |
Documents update rules and the command workflow. |
packages/learning/index.d.mts |
Defines update records and store method types. |
packages/learning/contracts/v1/update-proposal.schema.json |
Defines proposed wording, evidence, and provenance. |
packages/learning/contracts/v1/update-decision.schema.json |
Defines decisions and applied-version requirements. |
packages/learning/contracts/v1/invalid/update-decision.applied-without-version.json |
Adds an invalid applied-decision fixture. |
packages/learning/contracts/v1/examples/update-proposal.example.json |
Provides a proposal example. |
packages/learning/contracts/v1/examples/update-decision.example.json |
Provides an applied-decision example. |
packages/learning/contracts/v1/audit-entry.schema.json |
Adds update operations and audit subject kinds. |
packages/learning/conformance/index.mjs |
Covers proposal idempotence, application, and staleness. |
Review effort: Max (adaptive)
A suggested wording change and a person's decision on it are separate append-only records, so a decision never rewrites the suggestion. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
A suggestion is stored once per issue and evidence, applied through the same edit path people use, and goes stale when the learning or its evidence changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
nshki
force-pushed
the
nshki/feat/learning/propose-learning-updates
branch
from
November 26, 2026 10:34
a022c57 to
bdd3054
Compare
Copilot drafts new wording only when the same problem shows up in more checked Builds than went well, so most runs spend nothing. 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/learning/propose-learning-updates
branch
from
November 26, 2026 10:34
bdd3054 to
143025c
Compare
| ? { earlierIssues: [...known].map(([issueKey, issue]) => ({ issueKey, issue })) } | ||
| : {}), | ||
| } | ||
| const { result: answer, route, usage } = await drafter.draft({ |
| !updateAllowed({ support, successes, dismissedBuilds, content, current: record.content }) | ||
| ) | ||
| continue | ||
| const stored = await store.proposeUpdate(context, { |
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
Scores now show when an agent followed a learning and the Build still had a problem. Today someone has to notice that pattern and rewrite the learning by hand. If the same problem keeps coming back, the learning store should suggest better wording, explain why, and let a person decide.
What changes
The learning package gains
replica-learning propose-update <memory-id>. For example, agents followed "Keep form labels visible" in two Builds but still put labels beside the fields. The command might suggest "Show a visible label above every form field" and point to the scores that led to it.The command looks only at scores of the learning's current version, and only those based on a Build's diff or a reviewer's confirmation. Each Build counts once. Copilot is asked only when at least two Builds had the agent follow the learning and still score 1 or 2. Copilot groups the issues, names each group, and drafts new wording. A group becomes a suggestion only when it shows up in more Builds than went well. Runs with too little evidence, or nothing new since the last suggestion, spend nothing.
A person then runs
apply-updateordismiss-update. Applying saves the suggested wording, or the person's edit, as the learning's next version, just likeedit. A suggestion goes stale when the learning changes or a newer suggestion names the same issue. A dismissed issue comes back only with two new Builds, one of them confirmed by a reviewer.The store contract, both reference stores, the conformance suite, and the README cover the new suggestion records. Hub doesn't run this yet. That comes in the next PR.
flowchart LR S[Scores for current version] --> G{Same problem in 2+ Builds?} G -- no --> N[No suggestion, nothing spent] G -- yes --> C[Copilot groups issues and drafts wording] C --> K{More problem Builds than good ones?} K -- no --> N K -- yes --> P[Suggestion with its evidence] P --> A[apply-update: new version] P --> D[dismiss-update]Needs design review
propose-updateonly after new scores arrive, because runs where Copilot suggests nothing aren't recorded.