Repository navigation
Conversation
Hosted stores keep no screenshot bytes, so a host that saves them itself needs the store to check that the repository allowed screenshots. Reports may now carry base64 screenshot data and name the consent grant. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5
Hub needs a Hub-wide evaluation budget, a per-repository opt-in, the repository's screenshot consent grant, and a record of each stored agent screenshot so it can delete the bytes when consent ends. 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
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
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Critical consent, retention, and authorization flaws can allow unauthorized screenshot storage, prevent cleanup after consent withdrawal, and permit budget changes from revoked sessions.
20 open issues
Ensure staged screenshot reports are cleaned up after restart · New Enforce a durable quota for retained screenshot storage · New Prevent screenshot publication from racing consent withdrawal · New Reconcile consent state and deletion work after interruption · New Lock the authorizing session during administrator writes · New Notify Hub when deleting unreferenced hosted screenshots · New Validate screenshot consent before returning existing reports · New Enforce evidence bounds when validating screenshot consent · New Display budget limits without losing fractional precision · New Expose screenshot permission before agents capture images · New Report unavailable storage separately from consent denial · New Defer artifact storage initialization until deletion · New Group screenshot recovery pairs in the database · New Serialize budget decimals in fixed-point notation · New Forward the configured screenshot grant to reportUsage · New Update declarations for the hosted screenshot contract · New Make Storybook switches and budget form interactive without navigation · New Add focused screenshot deletion and persistence tests · New Add route-level tests for evaluation and budget PATCH handlers · New Document screenshot deletion and recovery jobs · New
What changed in this PR
Adds opt-in settings and screenshot consent to Hub’s Learnings flow, preparing for automated evaluations without running them yet.
Changes:
- Combines the prototype pages into one settings page with separate Hub and repository administrator controls.
- Adds consent checks for hosted screenshot reports and storage for accepted images.
- Adds database models, withdrawal cleanup jobs, tests, and documentation.
| File | Description |
|---|---|
packages/learning/test/cli.test.mjs |
Tests hosted screenshot consent. |
packages/learning/src/store.mjs |
Validates and records screenshot grants. |
packages/learning/src/screenshots.mjs |
Adds host-kept screenshot support. |
packages/learning/src/mcp.mjs |
Accepts base64 screenshot data. |
packages/learning/src/config.mjs |
Configures hosted screenshot handling. |
packages/learning/src/cli.mjs |
Reads screenshot data and grant arguments. |
packages/learning/README.md |
Documents hosted screenshot reporting. |
hub/server/workers/configuration.ts |
Registers screenshot deletion work. |
hub/server/workers/configuration.test.ts |
Updates processor registration expectations. |
hub/server/utils/evaluation-setting-key/index.ts |
Defines the shared settings key. |
hub/server/routes/index.ts |
Mounts evaluation settings endpoints. |
hub/server/routes/api/security-audits/present-security-audit/index.ts |
Presents evaluation administration denials. |
hub/server/routes/api/learnings/types.ts |
Defines settings dependency contracts. |
hub/server/routes/api/learnings/index.test.ts |
Tests settings access denial. |
hub/server/routes/api/learnings/evaluations/patch/index.ts |
Handles repository settings changes. |
hub/server/routes/api/learnings/evaluations/get/index.ts |
Returns settings and permissions. |
hub/server/routes/api/learnings/evaluation-budget/patch/index.ts |
Handles shared budget changes. |
hub/server/routes/api/learnings/create-learnings-route-dependencies/index.ts |
Coordinates settings, consent, and cleanup. |
hub/server/routes/api/learnings/create-learnings-route-dependencies/evaluation-settings.db.test.ts |
Tests persisted settings and budget authority. |
hub/server/routes/agent-connections/types.ts |
Adds optional screenshot storage. |
hub/server/routes/agent-connections/index.ts |
Connects agent reports to screenshot storage. |
hub/server/repositories/security-audits/parse-security-audit-event/index.ts |
Recognizes evaluation denial events. |
hub/server/repositories/security-audits/create-security-audit/types.ts |
Types evaluation denial operations. |
hub/server/repositories/evaluation-settings/update-evaluation-budget/index.ts |
Saves the shared budget. |
hub/server/repositories/evaluation-settings/save-repository-evaluation-setting/index.ts |
Saves repository evaluation settings. |
hub/server/repositories/evaluation-settings/initialize-evaluation-setting/index.ts |
Initializes shared settings. |
hub/server/repositories/evaluation-settings/get-repository-evaluation-setting/index.ts |
Reads settings and consent attribution. |
hub/server/repositories/agent-screenshots/list-grant-agent-screenshots/index.ts |
Batches images for deletion. |
hub/server/repositories/agent-screenshots/list-agent-screenshot-grants/index.ts |
Finds retained images by grant. |
hub/server/repositories/agent-screenshots/delete-agent-screenshot/index.ts |
Removes screenshot tracking records. |
hub/server/repositories/agent-screenshots/create-agent-screenshot/index.ts |
Deduplicates screenshot records. |
hub/server/index.ts |
Supplies artifact storage to agent routes. |
hub/server/domains/learning/jobs/delete-agent-screenshots.ts |
Defines deletion payloads and retries. |
hub/server/domains/learning/delete-withdrawn-agent-screenshots/index.ts |
Deletes images for inactive grants. |
hub/server/domains/learning/create-learning-job-processors/index.ts |
Adds deletion processing and recovery. |
hub/server/domains/learning/create-learning-job-processors/index.test.ts |
Updates recovery test dependencies. |
hub/server/domains/learning/change-screenshot-consent/index.ts |
Adds or withdraws learning-store consent. |
hub/server/domains/agent-connections/save-agent-screenshot/index.ts |
Persists image records and bytes. |
hub/server/domains/agent-connections/create-learning-mcp-backend/index.ts |
Applies consent to screenshot reports. |
hub/server/domains/agent-connections/create-learning-mcp-backend/index.test.ts |
Tests report consent and storage decisions. |
hub/server/create-app/index.ts |
Allows route-specific request size limits. |
hub/schema/repository.prisma |
Links repositories to settings and images. |
hub/schema/repository-evaluation-setting.prisma |
Models repository settings and consent attribution. |
hub/schema/migrations/20261224170000_evaluation_settings/migration.sql |
Creates settings and screenshot tables. |
hub/schema/membership.prisma |
Links members to consent changes. |
hub/schema/evaluation-setting.prisma |
Models the shared credit budget. |
hub/schema/agent-screenshot.prisma |
Models stored screenshot tracking. |
hub/docs/learning-foundation.md |
Documents settings, consent, and cleanup. |
hub/client/pages/screenshot-consent-prototype/types.ts |
Removes obsolete prototype types. |
hub/client/pages/screenshot-consent-prototype/styles.css |
Removes obsolete prototype styles. |
hub/client/pages/screenshot-consent-prototype/stories.tsx |
Removes replaced consent stories. |
hub/client/pages/screenshot-consent-prototype/index.tsx |
Removes the standalone consent prototype. |
hub/client/pages/screenshot-consent-prototype/index.test.tsx |
Removes replaced prototype tests. |
hub/client/pages/learnings-page/types.ts |
Adds the evaluation settings link contract. |
hub/client/pages/learnings-page/stories.tsx |
Shows the evaluation settings entry point. |
hub/client/pages/learnings-page/index.tsx |
Adds the Automated evaluations button. |
hub/client/pages/evaluation-settings-prototype/types.ts |
Removes obsolete evaluation prototype types. |
hub/client/pages/evaluation-settings-prototype/index.tsx |
Removes the evaluation prototype page. |
hub/client/pages/evaluation-settings-prototype/index.test.tsx |
Removes replaced prototype tests. |
hub/client/pages/evaluation-settings-page/types.ts |
Defines combined settings page props. |
hub/client/pages/evaluation-settings-page/styles.css |
Styles the combined settings page. |
hub/client/pages/evaluation-settings-page/stories.tsx |
Shows administrator and budget states. |
hub/client/pages/evaluation-settings-page/index.tsx |
Renders budget, evaluation, and consent controls. |
hub/client/pages/evaluation-settings-page/index.test.tsx |
Tests screenshot control availability. |
hub/client/application/hub/view-models/settings-learnings/index.ts |
Exposes settings navigation by authority. |
hub/client/application/hub/routes/product-routes.ts |
Registers the settings page route. |
hub/client/application/hub/routes/learning-evaluations/index.tsx |
Loads settings and submits changes. |
hub/client/application/hub/learnings-contracts/types.ts |
Types the settings API response. |
hub/client/application/hub/learnings-contracts/index.ts |
Validates settings response data. |
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
…sion 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
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 is about to check whether learnings actually help, and suggest updates when they don't. That work costs Copilot credits and, for UI prototypes, works best with screenshots from the agent. Neither should happen without someone choosing it. This adds the switches that let people opt in: a shared budget, a per-repository switch, and permission for agents to send screenshots.
What changes
The Learnings page gets an Automated evaluations button for people who administer Hub or the repository. It opens one settings page. Hub administrators set a monthly credit budget shared by all repositories. Repository administrators turn evaluations on for their repository and choose whether to allow screenshots. Hub and repository administration stay separate, so each person sees only the controls they own. Nothing runs evaluations yet; that comes in the next layer.
Allowing screenshots records a consent grant in the repository's learning store, with who allowed it. Hub passes that grant to every
report_usagecall from a connected agent, so the store accepts screenshots only while it is active. Hub keeps a copy of each accepted image only while the grant stands. Turning screenshots off, or turning evaluations off, withdraws the grant and queues a job that deletes those copies. The worker's regular recovery pass finds withdrawn grants again, so a failed queue or a copy saved mid-change is still cleaned up.The learning package gains the grant check for hosted screenshots. Hub gains tables for the budget, per-repository settings, and stored screenshots. This replaces the two evaluation prototype pages with the real page.
Needs design review:
Storybook screenshots
Hub/Pages/Learnings/Evaluation settings/Hub And Repository Admin (light, 1280×800)
Hub/Pages/Learnings/Evaluation settings/Repository Admin (light, 1280×800)
Hub/Pages/Learnings/Evaluation settings/Hub Admin (light, 1280×800)
Hub/Pages/Learnings/Evaluation settings/Budget Reached (light, 1280×800)
Hub/Pages/Learnings/Evaluation settings/Budget Not Set (light, 1280×800)
Hub/Pages/Learnings/Default (light, 1280×800)