Repository navigation
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 836fcecf-e7a9-4975-acd2-bf761098f711
Preserve overlapping histories and their consent, redaction, and snapshot records during offline migration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 836fcecf-e7a9-4975-acd2-bf761098f711
Allow deletion recovery without exposing legacy learning stores and keep repository lookups in the repository layer. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 836fcecf-e7a9-4975-acd2-bf761098f711
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 836fcecf-e7a9-4975-acd2-bf761098f711
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 836fcecf-e7a9-4975-acd2-bf761098f711
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 836fcecf-e7a9-4975-acd2-bf761098f711
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical migration and redaction defects can reintroduce removed text, omit required deletion follow-ups, and permanently block learning proposals.
15 open issues
Keep legacy withdrawal discovery durable and visible · New Surface affected exports and learnings during redaction merges · New Propagate deletion markers across matching comment versions · New Load migration metadata in the public learning-store API · New Use an unambiguous scope after duplicate legacy IDs · New Restore repository setup for the decision walkthrough · New Resolve GitHub IDs only for scope-dependent commands · New Preserve explicit scope during repeated hosted migrations · New Skip migration when a durable scope mapping already exists · New Identify latest comment versions across merged episodes · New Reject conflicting stable authors during history merges · New Index comments to avoid scanning unrelated threads for retractions · New Replay snapshots from retained repository names after renames · New Label each logical comment version only once · New Move legacy review redaction logic into the learning domain · New
What changed in this PR
This PR moves Solo and Hub learning scopes to numeric GitHub repository IDs so repository renames and transfers can retain their learning history.
Changes:
- Resolves and caches GitHub repository identities, and blocks Hub learning access when an ID is unavailable.
- Adds transactional SQLite scope migration and offline copying from legacy providers.
- Updates Hub learning, decision-model, and redaction flows, along with fixtures and recovery guidance.
| File | Description |
|---|---|
packages/learning/test/labeling.test.mjs |
Supplies numeric and legacy scopes to labeling commands. |
packages/learning/test/decision.test.mjs |
Seeds cached repository identities for decision tests. |
packages/learning/test/config.test.mjs |
Tests numeric scope parsing and name rejection. |
packages/learning/test/cli.test.mjs |
Updates CLI fixtures and assertions for ID-based scopes. |
packages/learning/test/agent-memory-repo.test.mjs |
Exercises migration before publishing learning records. |
packages/learning/src/store.mjs |
Reconciles migrated evidence, consent, redactions, and proposal identities. |
packages/learning/src/scope-migration.mjs |
Adds verified scope transformation and history reconciliation. |
packages/learning/src/providers/sqlite.mjs |
Adds atomic migration, durable mappings, and old-writer fencing. |
packages/learning/src/providers/json-lines.mjs |
Adds discovery of legacy repository scopes. |
packages/learning/src/consolidators/recurrence.mjs |
Accounts for duplicate evidence across migrated histories. |
packages/learning/src/config.mjs |
Resolves identities and manages migration and legacy maintenance. |
packages/learning/src/cli.mjs |
Exposes migration commands and scope options. |
packages/learning/README.md |
Documents stable scopes, migration, and retained-copy risks. |
packages/learning/index.d.mts |
Adds source-repository context and migration-related store options. |
packages/learning/examples/demo.mjs |
Seeds a cached identity for the standalone demo. |
packages/learning/examples/agent-memory-repo/demo.mjs |
Uses numeric scopes in the publishing demo. |
packages/learning/contracts/v1/collection.schema.json |
Clarifies matching historical collection retention. |
hub/server/scripts/seed-decision-model-walkthrough/index.ts |
Uses persisted GitHub scope and shared command arguments. |
hub/server/routes/api/learnings/respond-learning-error/index.ts |
Maps unavailable repository scopes to HTTP 409. |
hub/server/routes/api/learnings/create-learnings-route-dependencies/index.ts |
Resolves and rechecks scopes around learning operations. |
hub/server/repositories/repository-access/find-repository-github-id/index.ts |
Adds the persisted GitHub ID lookup. |
hub/server/repositories/learning-runs/list-due-learning-repositories/index.ts |
Requires positive GitHub IDs during scheduled discovery. |
hub/server/repositories/learning-runs/list-due-learning-repositories/index.db.test.ts |
Gives scheduling evidence an ID-backed repository fixture. |
hub/server/repositories/learning-runs/is-learning-run-repository-available/index.ts |
Requires a positive GitHub ID when requested. |
hub/server/integrations/learning/redact-legacy-review-comment/index.ts |
Invokes restricted redaction for UUID-scoped stores. |
hub/server/domains/learning/review-comment-learning-source/types.ts |
Carries numeric scope and legacy snapshot digest metadata. |
hub/server/domains/learning/reconcile-learning-decision-operation/index.ts |
Uses migration-aware arguments during decision recovery. |
hub/server/domains/learning/reconcile-learning-decision-operation/index.test.ts |
Checks numeric and legacy recovery arguments. |
hub/server/domains/learning/process-review-comment-redaction/index.ts |
Selects ID-backed or legacy-only redaction. |
hub/server/domains/learning/process-review-comment-redaction/index.test.ts |
Covers legacy redaction, retries, and migrated mappings. |
hub/server/domains/learning/process-learning-run/index.ts |
Checks scope drift and accepts legacy queued-run digests. |
hub/server/domains/learning/process-learning-run/index.test.ts |
Covers migration arguments and scope changes during runs. |
hub/server/domains/learning/prepare-learning-store/index.ts |
Validates numeric scopes while retaining UUID storage directories. |
hub/server/domains/learning/prepare-learning-store/index.test.ts |
Updates store-preparation expectations for numeric scopes. |
hub/server/domains/learning/learning-store-arguments/index.ts |
Centralizes numeric and legacy CLI scope arguments. |
hub/server/domains/learning/get-learning-repository-scope/index.ts |
Resolves valid GitHub IDs or reports learning unavailability. |
hub/server/domains/learning/get-learning-overview/index.ts |
Reads the overview using the resolved numeric scope. |
hub/server/domains/learning/get-learning-overview/index.test.ts |
Verifies migration-aware overview arguments. |
hub/server/domains/learning/execute-learning-decision/index.ts |
Passes the resolved scope to decision commands. |
hub/server/domains/learning/execute-learning-decision/index.test.ts |
Checks numeric and legacy decision arguments. |
hub/server/domains/learning/create-review-comment-learning-source/index.ts |
Binds captured review evidence to a checked repository scope. |
hub/server/domains/learning/create-review-comment-learning-source/index.test.ts |
Covers missing IDs, large IDs, and capture-time scope drift. |
hub/server/domains/learning/create-learning-job-processors/index.ts |
Wires ID-based learning and legacy redaction into workers. |
hub/server/domains/learning/create-learning-job-processors/index.test.ts |
Covers redaction recovery and persisted-ID selection. |
hub/server/domains/learning/create-hub-review-collection/index.ts |
Adds numeric scope to review digests while preserving source identity. |
hub/server/domains/learning/create-hub-review-collection/index.test.ts |
Checks scope-sensitive and legacy digest behavior. |
hub/server/domains/decision-model/create-hub-decision-taskset-source/index.ts |
Uses ID-backed stores and scope-bound taskset evidence. |
hub/server/domains/decision-model/create-hub-decision-taskset-source/index.test.ts |
Covers ID-less rejection and migration-aware commands. |
hub/docs/learning-foundation.md |
Explains Hub scope migration and legacy maintenance behavior. |
docs/adr/0001-learning-extension-architecture.md |
Updates the identity model and migration rationale. |
Review effort: Max (adaptive)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 836fcecf-e7a9-4975-acd2-bf761098f711
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 836fcecf-e7a9-4975-acd2-bf761098f711
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 836fcecf-e7a9-4975-acd2-bf761098f711
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 836fcecf-e7a9-4975-acd2-bf761098f711
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 836fcecf-e7a9-4975-acd2-bf761098f711
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
Repository names can change. Learnings need a stable identity so a rename or transfer does not mix histories or hide existing guidance.
What changes
Solo and Hub now use the numeric GitHub repository ID for learning scope. Solo saves the ID after looking it up with the person's GitHub CLI sign-in. Hub reports learnings as unavailable when a repository has no GitHub ID.
Existing SQLite history moves transactionally and rejects older writers. Solo users confirm the old repository identity and stop all clients first. JSON Lines and custom providers can be copied offline into SQLite without changing the original store. Providers that cannot discover old names require an explicit old name or confirmation of a new empty store. Matching histories retain their records and respect prior redactions and consent withdrawals. The guides explain recovery, retained copies, and renamed repositories.
Hub can still remove deleted review text from an ID-less legacy store without exposing the store for learning.
The inherited PR workflows have not been scheduled on the base commit, so its full CI evidence remains unavailable.
The fresh decision-model walkthrough has not been verified end to end.
Storybook screenshots
Repository administrators can see redaction follow-ups in Learnings.
Hub/Pages/Learnings — RedactionFollowUp, light theme, 1200 × 1279.