Skip to content

feat(hub): suggest learning updates daily - #401

Draft
nshki wants to merge 3 commits into
nshki/feat/learning/propose-learning-updatesfrom
nshki/feat/hub/learning-update-suggestions
Draft

nshki wants to merge 3 commits into
nshki/feat/learning/propose-learning-updatesfrom
nshki/feat/hub/learning-update-suggestions

Conversation

@nshki

@nshki nshki commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Why

The learning package can now suggest better wording when the same problem keeps showing up after agents follow a learning. Hub already scores how learnings do, but nothing asks for those suggestions yet. Hub should check learnings that got new scores on its own, without anyone remembering to, and without going over the shared evaluation budget.

What changes

Each new score now flags its learning. A new job runs every day at 03:00 UTC and queues one low-priority check per flagged learning, oldest first. Each check runs replica-learning propose-update on its own, so other scheduled work runs in between and one repository's failure doesn't hold up the others. For example, two Builds score "Use the shared empty state" low because it never says where the empty state goes. The next morning's check keeps a suggestion that names the position.

Hub records every check with its result and what it cost. That cost counts toward the same monthly budget as scoring. When the budget runs out or Copilot isn't available, a check keeps its flag for the next day. Each check confirms, under the learning lock, that evaluations are still on and the repository is still connected. A learning that gets another score during its check stays flagged for the next day. Suggestions only wait for review; showing and deciding them comes in the next PR.

sequenceDiagram
    participant S as Scoring job
    participant H as Hub database
    participant J as Daily job (03:00 UTC)
    participant L as Learning package
    S->>H: Flag the scored learning
    J->>H: Read flags, oldest first
    loop Each flagged learning, as its own job
        J->>H: Check consent, connection, and budget
        J->>H: Start a check
        J->>L: propose-update
        L-->>J: Result and cost
        J->>H: Record result and cost
        J->>H: Clear the flag unless scored again
    end
Loading

Needs design review

  • Any new score flags its learning, and the package decides whether there is enough evidence.
  • One daily job queues a check per flagged learning across all repositories. A check pauses, keeping its flag, when the budget or Copilot runs out.
  • Scoring now refuses a score whose learning doesn't match the one the usage report named.
  • Suggestion checks share the evaluation budget with scoring.
  • The package can't resume a check. An interrupted one is recorded as interrupted and may have spent credits Hub didn't see.
  • Flags for repositories with evaluations off are dropped rather than kept.
  • Each check records its result, such as not enough evidence, so the next PR can show it.

@nshki
nshki added this pull request to stack #367 November 26, 2026 10:20
@nshki
nshki requested an adaptive review from Copilot November 26, 2026 10:20

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

Missing repository-availability and in-lock consent checks can expose private learning text and score issues to Copilot after GitHub access is removed or evaluations are disabled.

10 open issues
What changed in this PR

Adds Hub’s daily integration with the learning package to suggest wording updates from newly scored learnings. Suggestions remain pending review; the review interface is outside this PR.

Changes:

  • Flag scored learnings and check them oldest-first at 03:00 UTC.
  • Record check outcomes and costs against the shared monthly evaluation budget.
  • Add persistence, focused tests, and documentation for the daily workflow.
File Description
hub/​server/​workers/​configuration.ts Registers the processor and daily schedule.
hub/​server/​repositories/​learning-update-runs/​start-learning-update-run/​index.ts Starts checks and closes earlier interrupted runs.
hub/​server/​repositories/​learning-update-runs/​start-learning-update-run/​index.db.test.ts Tests interrupted-run handling.
hub/​server/​repositories/​learning-update-runs/​finish-learning-update-run/​index.ts Saves check outcomes and usage.
hub/​server/​repositories/​learning-update-requests/​record-learning-update-request/​index.ts Flags learnings after new scores.
hub/​server/​repositories/​learning-update-requests/​list-learning-update-requests/​index.ts Lists pending flags oldest-first.
hub/​server/​repositories/​learning-update-requests/​delete-learning-update-request/​index.ts Clears flags using a score-time cutoff.
hub/​server/​repositories/​learning-update-requests/​delete-learning-update-request/​index.db.test.ts Tests retaining flags after newer scores.
hub/​server/​repositories/​learning-evaluation-runs/​sum-learning-evaluation-credits/​index.ts Includes update checks in budget totals.
hub/​server/​repositories/​learning-evaluation-runs/​sum-learning-evaluation-credits/​index.db.test.ts Tests combined scoring and update costs.
hub/​server/​domains/​learning/​score-applied-learnings/​index.ts Requests update checks after successful scoring.
hub/​server/​domains/​learning/​score-applied-learnings/​index.test.ts Tests flagging scored learnings.
hub/​server/​domains/​learning/​propose-learning-updates/​index.ts Coordinates checks, usage recording, and flag cleanup.
hub/​server/​domains/​learning/​propose-learning-updates/​index.test.ts Covers results, failures, disabled settings, and budget pauses.
hub/​server/​domains/​learning/​jobs/​propose-learning-updates.ts Defines the job and retry options.
hub/​server/​domains/​learning/​create-learning-job-processors/​index.ts Connects the workflow to storage, credentials, and locking.
hub/​schema/​repository.prisma Adds repository relations for requests and runs.
hub/​schema/​migrations/​20261227090000_learning_update_runs/​migration.sql Creates request and run tables.
hub/​schema/​learning-update-run.prisma Defines check history and usage fields.
hub/​schema/​learning-update-request.prisma Defines pending learning flags.
hub/​docs/​learning-foundation.md Documents daily checks and shared budget behavior.

Review effort: Max (adaptive)

nshki and others added 3 commits November 26, 2026 02:39
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/learning-update-suggestions branch from 39ff497 to 452ce52 Compare November 26, 2026 10:39
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