Skip to content

feat(hub): connect the V2 prototype workflow to the real API - #305

Merged
arniebradfo merged 24 commits into
build/hub/newfrom
build/hub/local-validation
Nov 19, 2026
Merged

arniebradfo merged 24 commits into
build/hub/newfrom
build/hub/local-validation

Conversation

@arniebradfo

@arniebradfo arniebradfo commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Why

Designers should be able to start from a template, open a real Build, review it with teammates, and share it without relying on browser mock data. This PR connects those Hub workflows to Express and PostgreSQL. The goal is to make the workflow usable in local mode first, then prove it against a real GitHub repository before Azure staging.

What changes

On this branch: Create uses saved templates from the latest successful default-branch Build. Users can copy the kickoff prompt or, with current GitHub write access, hand it off to Copilot. The same Build-preview system that landed in #276 serves the template previews and Build-pinned share links. Hub now saves review reactions, mentions, thread read state, and Inbox activity, and refreshes open reviews when conversations change.

Repository users can edit listings and register eligible drafts. Repository administrators can view a scoped security audit and configure analytics destinations. Hosted sharing and outbound analytics are off by default. Welcome can be hidden per user, and the Replica Canvas can pair with Hub, read repository and Build status, renew its connection, and be revoked.

This branch uses #300's Build importer, with webhooks and recovery polling, rather than a second importer or migration. Successful imports and automatic registration record their corresponding analytics events. #295's stored grants remain in place for Learnings; this PR still checks fresh GitHub permissions for sensitive listing, audit, sharing, and analytics actions.

Still needed before review: Use an approved scratch GitHub repository and two accounts to verify that an Actions Build opens in the existing preview, supplies templates, and supports the Copilot handoff, listing permissions, review and Inbox delivery, and share revocation. Imported start-page and commit-author metadata are not end-to-end complete; commit-author metadata is needed for non-admin creators to manage their own hosted share links. Verify outbound analytics only against an approved receiver. Azure identity, storage, ingress, and preview DNS/TLS require a staging deployment.

Out of scope: Redesigning the repository gallery, prototype shell, or user filters; standalone Rails Build-detail pages; one-click workflow installation; migrating Rails records; and legacy GitHub App registration and credential screens. Create does not write Git branches or run Builds. This PR does not add a template editor, an analytics dashboard, external notifications, Canvas publishing or review/share writes, Pick & polish sync, Learnings changes, or decision-model UI.

Storybook screenshots

Components/Mention input — light, 1440 × 1000 viewport

Components/Mention input / People — light, 1440 × 1000 viewport

Components/Mention input / Plain Text — light, 1440 × 1000 viewport

Hub/Features/Review/Thread Conversation — light, 1440 × 1000 viewport

Hub/Features/Review/Thread Conversation / Bottom Right Pin — light, 1440 × 1000 viewport

Hub/Features/Review/Thread Conversation / Multiple — light, 1440 × 1000 viewport

Hub/Features/Review/Thread Conversation / Cannot edit or delete comments — light, 1440 × 1000 viewport

Hub/Features/Review/Thread Conversation / Read Only Profile — light, 1440 × 1000 viewport

Hub/Features/Review/Thread Conversation / Resolved Without Resolver — light, 1440 × 1000 viewport

Hub/Features/Review/Thread Conversation / Resolved — light, 1440 × 1000 viewport

Hub/Features/Review/Thread Conversation / Single — light, 1440 × 1000 viewport

Hub/Features/Review/Thread Conversation / Upper Right Pin — light, 1440 × 1000 viewport

Hub/Features/Review/Thread Message — light, 1440 × 1000 viewport

Hub/Features/Review/Thread Message / Actions Disabled — light, 1440 × 1000 viewport

Hub/Features/Review/Thread Message / Delete Confirmation — light, 1440 × 1000 viewport

Hub/Features/Review/Thread Message / Edit Confirmation — light, 1440 × 1000 viewport

Hub/Features/Review/Thread Message / Edited — light, 1440 × 1000 viewport

Hub/Features/Review/Thread Message / Editing — light, 1440 × 1000 viewport

Hub/Features/Review/Thread Message / Reply — light, 1440 × 1000 viewport

Hub/Features/Review/Thread Message / Root — light, 1440 × 1000 viewport

Hub/Features/Workspace Sidebar — light, 1440 × 1000 viewport

Hub/Features/Workspace Sidebar / Administrator — light, 1440 × 1000 viewport

Hub/Features/Workspace Sidebar / Read Only — light, 1440 × 1000 viewport

Hub/Features/Workspace Sidebar / Without Repository — light, 1440 × 1000 viewport

Hub/Pages/Canvas/Connection — light, 1440 × 1000 viewport

Hub/Pages/Canvas/Connection / Approval Denied — light, 1440 × 1000 viewport

Hub/Pages/Canvas/Connection / Approval — light, 1440 × 1000 viewport

Hub/Pages/Canvas/Connection / Approved Pending — light, 1440 × 1000 viewport

Hub/Pages/Canvas/Connection / Connected — light, 1440 × 1000 viewport

Hub/Pages/Canvas/Connection / Empty — light, 1440 × 1000 viewport

Hub/Pages/Canvas/Connection / Multiple — light, 1440 × 1000 viewport

Hub/Pages/Canvas/Connection / Ready To Connect — light, 1440 × 1000 viewport

Hub/Pages/Home — light, 1440 × 1000 viewport

Hub/Pages/Home / Authorization Failed — light, 1440 × 1000 viewport

Hub/Pages/Home / Canvas Sign In — light, 1440 × 1000 viewport

Hub/Pages/Home / Default — light, 1440 × 1000 viewport

Hub/Pages/Home / Git Hub And Microsoft Entra — light, 1440 × 1000 viewport

Hub/Pages/Home / Local Developer — light, 1440 × 1000 viewport

Hub/Pages/Home / Microsoft Entra — light, 1440 × 1000 viewport

Hub/Pages/Home / Session Restore Failed — light, 1440 × 1000 viewport

Hub/Pages/Inbox prototype — light, 1440 × 1000 viewport

Hub/Pages/Inbox prototype / Collapsed Sidebar — light, 1440 × 1000 viewport

Hub/Pages/Inbox prototype / Empty — light, 1440 × 1000 viewport

Hub/Pages/Inbox prototype / Full Page — light, 1440 × 1000 viewport

Hub/Pages/Inbox prototype / Inbox Preview — light, 1440 × 1000 viewport

Hub/Pages/Inbox prototype / Workspace — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Branch Handoff — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Composer — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Conversation With Comments Closed — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Conversation — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Editing Details Without Start Page — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Editing Details — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Editing Draft — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Empty — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Expanded Branch Input — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Failure — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Hub Toolbar Controls Open — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Hub Toolbar Controls — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Introduction — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Local Conversation — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Minimized Hub Toolbar Controls — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Minimized With Comments — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Minimized — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Multiple — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Preview Hosting Unavailable — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Preview Only — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Rate Limited With Draft — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Rate Limited — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Read Only — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Returning Owner — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Returning Visitor — light, 1440 × 1000 viewport

Hub/Pages/Prototype Review / Single — light, 1440 × 1000 viewport

Hub/Pages/Replica Browse — light, 1440 × 1000 viewport

Hub/Pages/Replica Browse / Deep Link — light, 1440 × 1000 viewport

Hub/Pages/Replica Browse / Empty — light, 1440 × 1000 viewport

Hub/Pages/Replica Browse / Local Empty — light, 1440 × 1000 viewport

Hub/Pages/Replica Browse / Local — light, 1440 × 1000 viewport

Hub/Pages/Replica Browse / Minimized Template Controls — light, 1440 × 1000 viewport

Hub/Pages/Replica Browse / Minimized — light, 1440 × 1000 viewport

Hub/Pages/Replica Browse / Newer Build Failed — light, 1440 × 1000 viewport

Hub/Pages/Replica Browse / Read Only — light, 1440 × 1000 viewport

Hub/Pages/Replica Browse / Ready — light, 1440 × 1000 viewport

Hub/Pages/Replica Browse / Template Controls — light, 1440 × 1000 viewport

Hub/Pages/Replica Browse / Template branch from here — light, 1440 × 1000 viewport

Hub/Pages/Replica Browse / Template Handoff — light, 1440 × 1000 viewport

Hub/Pages/Replica Browse / Template — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Analytics — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Analytics / Configured — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Analytics / Custom Configured — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Analytics / Custom Failed — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Analytics / Custom Invalid — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Analytics / Custom Multiple — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Analytics / Empty — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Analytics / Failed — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Analytics / Local Outbound Disabled — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Analytics / Multiple — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Analytics / Paused — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Analytics / Read Only — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Analytics / Verified Git Hub Change — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Analytics / Waiting For Git Hub — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Create — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Create / Canceled Details — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Create / Cleared Details — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Create / Details Open — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Create / Empty — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Create / Local — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Create / Multiple — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Create / Narrow Desktop — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Create / No Preview — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Create / Read Only — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Create / Saved Details — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Create / Single — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Create / Submitted — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Create / Template Picker Open — light, 1440 × 1000 viewport

Hub/Pages/Repositories/Create / Template Selected — light, 1440 × 1000 viewport

Hub/Pages/Welcome — light, 1440 × 1000 viewport

Hub/Pages/Welcome / Hidden — light, 1440 × 1000 viewport

Hub/Pages/Welcome / Introduction — light, 1440 × 1000 viewport

Hub/Pages/Welcome / Local Repository — light, 1440 × 1000 viewport

Hub/Pages/Welcome / No Repository — light, 1440 × 1000 viewport

Hub/Pages/Welcome / Video Not Configured — light, 1440 × 1000 viewport

arniebradfo and others added 18 commits November 18, 2026 21:13
Add and edit discovered prototypes through the real local API. Verify listing persistence and the signed-out share-link lifecycle with Playwright and disposable PostgreSQL.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use saved default-branch Builds for templates and isolated previews. Keep local prompts offline and require current GitHub write access for hosted handoffs. Persist Hide welcome against the current Hub user.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Implement the versioned extension lifecycle, exact browser approval, scoped status, and durable renewable credentials. Verify the unchanged extension against local Express and PostgreSQL.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Require fresh GitHub repository permission and immutable author identity for hosted share-link management. Reuse public preview storage, permanently revoke on confirmed loss, and retain the independent local sharing policy.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the preview callback bound at startup and verify the exact public payload in the route tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Record scoped activity and queue durable export work. Connect local administrator settings and keep hosted writes and live delivery disabled without their required authorization.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Poll the selected GitHub installation for branch heads and approved workflow attempts. Retain independent branch histories and publish only after validating and durably storing the Build package.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reuse the GitHub OAuth callback for exact, encrypted destination changes.
Recheck live repository administration and consume each verified change once.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Persist review reactions, mentions, thread receipts, and recipient Inbox activity. Signal committed review changes through PostgreSQL and recheck current access before WebSocket delivery.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Apply new product migrations after the V2 baseline. Exercise the local Build upgrade with Prisma deploy for each schema stage instead of resolving every predecessor individually.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Only connect the Inbox when the session advertises review routes. Keep the audit regression fixture on the real client routes and fail on unexpected requests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bring in portable Starter preparation (#293), runtime taskset registration and cancellation (#297), and runtime budgets and promotion guards (#298). Leave the open Hub and learning PRs out of this merge.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reuse the saved Build fixture and real API from the automated smoke. Start a disposable workspace for manual checks and discard it when the tester stops Hub.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This reverts commit 13ee0da. Keep the existing automated smoke and use normal local mode for manual checks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the upstream webhook and recovery importer instead of the branch-only poller. Keep repository permission checks, template previews, and durable analytics for successful publications and automatic registrations.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI adaptive review requested due to automatic review settings November 19, 2026 19:37

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

Build previews do not recheck repository permissions, allowing users with valid sessions and existing preview cookies to continue reading private artifacts after their repository access is revoked.

5 open issues
What changed in this PR

This PR connects Hub’s V2 prototype workflow to Express and PostgreSQL, building on the existing Build preview and GitHub Actions importer. It adds persisted collaboration and repository-scoped controls while keeping hosted sharing and outbound analytics disabled by default.

Changes:

  • Connect templates, Copilot handoff, prototype listings, and Build-pinned sharing to real APIs.
  • Persist review reactions, mentions, read state, and Inbox activity, with live updates.
  • Add Canvas connections, repository audits, analytics configuration, and supporting schemas and documentation.
File Description
hub/​vite.config.ts Enables preview-server WebSocket forwarding.
hub/​server/​workers/​configuration.test.ts Checks analytics queues and schedules.
hub/​server/​utils/​public-sharing-setting-key/​index.ts Adds the hosted sharing policy key.
hub/​server/​utils/​can-write-repository/​index.ts Centralizes write-permission checks.
hub/​server/​shutdown-server/​index.test.ts Updates the realtime shutdown fixture.
hub/​server/​run-api/​test/​review-api.ts Adds an isolated review API fixture.
hub/​server/​run-api/​index.test.ts Preserves the expanded realtime interface.
hub/​server/​routes/​types.ts Uses workspace product dependencies.
hub/​server/​routes/​build-preview/​types.ts Extends template and hosted preview contracts.
hub/​server/​routes/​build-preview/​authorize/​get/​index.ts Exchanges template and screenshot grants.
hub/​server/​routes/​api/​workspace/​welcome/​patch/​index.ts Saves the user’s Welcome preference.
hub/​server/​routes/​api/​security-audits/​present-security-audit/​index.ts Presents actors for new audit actions.
hub/​server/​routes/​api/​review-comments/​respond-review-error/​index.ts Maps collaboration errors to API responses.
hub/​server/​routes/​api/​review-comments/​present-review-thread-comments/​index.ts Returns persisted collaboration state.
hub/​server/​routes/​api/​repositories/​prototypes/​show/​patch/​index.ts Supports listing edits and provider failures.
hub/​server/​routes/​api/​repositories/​prototypes/​review-comments/​get/​index.ts Supplies viewer and session context.
hub/​server/​routes/​api/​repositories/​prototypes/​builds/​get/​index.ts Adds per-prototype sharing capability.
hub/​server/​routes/​api/​repositories/​prototypes/​builds/​get/​index.test.ts Updates product dependency mocks.
hub/​server/​routes/​api/​repositories/​prototype-management/​get/​index.ts Exposes prototype listing management.
hub/​server/​routes/​api/​repositories/​analytics/​types.ts Defines analytics route dependencies.
hub/​server/​routes/​api/​public-sharing/​respond-public-sharing-error/​index.ts Handles hosted sharing failures.
hub/​server/​routes/​api/​public-sharing/​read-hosted-sharing-capability/​index.ts Computes sharing management capability.
hub/​server/​routes/​api/​public-sharing/​index.test.ts Checks sharing audit actor context.
hub/​server/​routes/​api/​public-sharing/​create-public-sharing-route-dependencies/​index.ts Configures hosted sharing prerequisites.
hub/​server/​routes/​api/​public-sharing/​authorize-hosted-share-link-request/​index.ts Rechecks hosted sharing authority.
hub/​server/​routes/​api/​product/​template-repository-access/​index.ts Defines template and handoff access.
hub/​server/​routes/​api/​product/​read-product-with-current-authority/​index.ts Detects external identity changes.
hub/​server/​routes/​api/​product-index/​index.db.test.ts Creates persisted users for workspace fixtures.
hub/​server/​routes/​api/​github/​webhooks/​create-github-webhook-route-dependencies/​index.db.test.ts Checks default-branch rename preservation.
hub/​server/​routes/​api/​auth/​types.ts Extends identity and analytics proof contracts.
hub/​server/​routes/​api/​auth/​start/​post/​index.ts Accepts validated Canvas return paths.
hub/​server/​routes/​api/​auth/​session/​get/​index.ts Advertises Inbox availability.
hub/​server/​routes/​api/​auth/​create-authentication-route-dependencies/​index.db.test.ts Checks restored external identity IDs.
hub/​server/​repositories/​users/​welcome-preference/​index.ts Reads and saves Welcome preferences.
hub/​server/​repositories/​security-audits/​record-repository-audit/​index.ts Records repository-scoped product audits.
hub/​server/​repositories/​security-audits/​list-security-audits/​index.ts Separates repository and Hub audit scopes.
hub/​server/​repositories/​review-comments/​find-repository-review-access/​index.ts Returns GitHub repository identity.
hub/​server/​repositories/​repository-access/​upsert-connected-repositories/​index.ts Retains renamed default branches as internal.
hub/​server/​repositories/​repository-access/​mark-repositories-disconnected/​index.ts Revokes hosted links on disconnection.
hub/​server/​repositories/​public-sharing/​revoke-share-link/​index.ts Separates local and hosted revocation.
hub/​server/​repositories/​public-sharing/​revoke-hosted-creator-links/​index.ts Revokes a creator’s repository links.
hub/​server/​repositories/​public-sharing/​revoke-all-share-links/​index.ts Scopes bulk revocation by sharing mode.
hub/​server/​repositories/​public-sharing/​lock-sharing-setting/​index.ts Locks sharing policy during mutations.
hub/​server/​repositories/​public-sharing/​list-share-links/​index.ts Filters hosted links by active state.
hub/​server/​repositories/​public-sharing/​list-share-link-expirations/​index.ts Separates expiration queries by mode.
hub/​server/​repositories/​public-sharing/​initialize-sharing-setting/​index.ts Supports distinct sharing policy keys.
hub/​server/​repositories/​public-sharing/​get-sharing-setting/​index.ts Reads the selected sharing policy.
hub/​server/​repositories/​public-sharing/​find-shareable-build/​index.ts Adds hosted Build eligibility checks.
hub/​server/​repositories/​public-sharing/​find-share-link/​index.ts Returns artifact kind for validation.
hub/​server/​repositories/​public-sharing/​find-hosted-sharing-prototype/​index.ts Finds eligible hosted prototypes and creators.
hub/​server/​repositories/​public-sharing/​find-hosted-sharing-identity/​index.ts Resolves the creator’s GitHub identity.
hub/​server/​repositories/​public-sharing/​create-share-link/​index.ts Stores external creator identity.
hub/​server/​repositories/​public-sharing/​count-active-share-links/​index.ts Counts active links by mode.
hub/​server/​repositories/​prototypes/​lock-imported-prototype/​index.ts Returns repository identity for analytics.
hub/​server/​repositories/​prototypes/​lock-editable-prototype/​index.ts Adds listing eligibility and source checks.
hub/​server/​repositories/​prototype-index/​find-repository-permission-subject/​index.ts Resolves active GitHub permission subjects.
hub/​server/​repositories/​prototype-index/​find-local-prototype-management/​index.ts Lists registered prototypes and candidates.
hub/​server/​repositories/​local-builds/​prepare-local-build/​index.ts Adds transactional registration recording.
hub/​server/​repositories/​local-builds/​complete-local-build-success/​index.ts Adds transactional publication recording.
hub/​server/​repositories/​github-builds/​complete-github-build-success/​index.ts Records imported Build publication context.
hub/​server/​repositories/​canvas/​record-audit/​index.ts Records Canvas lifecycle audits.
hub/​server/​repositories/​canvas/​read-prototype/​index.ts Reads Canvas prototype and Build status.
hub/​server/​repositories/​build-artifacts/​find-build-preview-target/​index.ts Resolves default-branch template previews.
hub/​server/​repositories/​authorization-attempts/​lock-consumed-authorization-attempt/​index.ts Uses the shared authorization-purpose enum.
hub/​server/​repositories/​authorization-attempts/​create-authorization-attempt/​types.ts Extends authorization attempt typing.
hub/​server/​repositories/​authorization-attempts/​create-authorization-attempt/​index.ts Validates shared authorization purposes.
hub/​server/​repositories/​authorization-attempts/​consume-authorization-attempt/​index.ts Isolates analytics authorization consumption.
hub/​server/​repositories/​analytics/​lock-repository/​index.ts Serializes repository analytics changes.
hub/​server/​repositories/​analytics/​authorization-store/​index.ts Reads and expires analytics authorizations.
hub/​server/​integrations/​ws/​upgrade-connection/​index.ts Passes subscription revalidation settings.
hub/​server/​integrations/​ws/​types.ts Defines revalidation and resynchronization state.
hub/​server/​integrations/​ws/​revalidate-subscription/​index.ts Rechecks access before live delivery.
hub/​server/​integrations/​ws/​remove-subscription/​index.ts Cancels pending subscription checks.
hub/​server/​integrations/​ws/​register-connection/​index.ts Initializes and cleans up revalidation.
hub/​server/​integrations/​ws/​check-connections/​index.ts Revalidates access during heartbeats.
hub/​server/​integrations/​ws/​broadcast/​index.ts Authorizes broadcasts before sending.
hub/​server/​integrations/​ws/​attach-realtime-server/​index.ts Adds client resynchronization support.
hub/​server/​integrations/​postgres/​listen-for-review-changes/​index.ts Listens for committed review changes.
hub/​server/​integrations/​github/​read-repository-permission/​types.ts Defines repository permission lookup inputs.
hub/​server/​integrations/​github/​create-user-authentication-adapter/​types.ts Adds identity-only proof support.
hub/​server/​integrations/​github/​create-user-authentication-adapter/​index.ts Skips repository evidence for identity-only proofs.
hub/​server/​integrations/​github/​create-review-directory/​types.ts Defines collaborator lookup contracts.
hub/​server/​integrations/​github/​create-review-directory/​index.test.ts Checks immutable repository and user lookup.
hub/​server/​integrations/​github/​create-installation-client/​types.ts Defines installation credentials and transport.
hub/​server/​integrations/​express/​redirect-authentication-start/​index.ts Binds Canvas return paths to sign-in.
hub/​server/​integrations/​express/​read-cookie/​index.ts Supports header-only request inputs.
hub/​server/​integrations/​express/​canvas-sign-in-return/​index.ts Validates bound Canvas return destinations.
hub/​server/​index.test.ts Isolates sharing dependency composition.
hub/​server/​domains/​review-comments/​serialize-review-collaboration/​index.ts Serializes mentions, reactions, and read state.
hub/​server/​domains/​review-comments/​errors.ts Adds collaboration availability errors.
hub/​server/​domains/​public-sharing/​read-hosted-public-sharing-enabled/​index.ts Validates hosted sharing opt-in.
hub/​server/​domains/​public-sharing/​lock-hosted-sharing-approval/​index.ts Rechecks sharing approval under locks.
hub/​server/​domains/​public-sharing/​errors.ts Adds hosted sharing error types.
hub/​server/​domains/​public-sharing/​configure-hosted-sharing-policy/​index.ts Applies policy changes and revocation.
hub/​server/​domains/​prototypes/​types.ts Carries external viewer identity.
hub/​server/​domains/​prototypes/​register-imported-prototype/​index.ts Records automatic registration analytics.
hub/​server/​domains/​github-builds/​import-github-dist-package/​index.ts Connects successful imports to analytics.
hub/​server/​domains/​canvas/​credentials/​index.ts Defines Canvas tokens and lifetimes.
hub/​server/​domains/​build-preview/​template-screenshot-path/​index.ts Validates template screenshot paths.
hub/​server/​domains/​build-preview/​read-preview-session/​index.ts Recognizes template preview sessions.
hub/​server/​domains/​build-preview/​read-preview-grant/​index.ts Validates template and screenshot grants.
hub/​server/​domains/​build-preview/​read-build-preview-file/​types.ts Adds distribution-only serving input.
hub/​server/​domains/​build-preview/​read-build-preview-file/​index.ts Resolves template screenshots and restricted files.
hub/​server/​domains/​build-preview/​create-preview-session/​index.ts Marks template preview sessions.
hub/​server/​domains/​build-preview/​create-preview-grant/​index.ts Encodes template screenshot grants.
hub/​server/​domains/​authentication/​types.ts Adds identity-only authentication input.
hub/​server/​domains/​authentication/​start-authentication-proof/​types.ts Shares authorization-purpose typing.
hub/​server/​domains/​authentication/​start-authentication-proof/​index.ts Accepts the analytics proof purpose.
hub/​server/​domains/​authentication/​complete-authentication-proof/​types.ts Extends completed proof purposes.
hub/​server/​domains/​authentication/​complete-authentication-proof/​index.ts Separates analytics identity verification.
hub/​server/​domains/​analytics/​types.ts Defines destinations and export settings.
hub/​server/​domains/​analytics/​read-settings/​index.ts Validates analytics keys and outbound policy.
hub/​server/​domains/​analytics/​protect-configuration/​index.ts Encrypts destination configuration.
hub/​server/​domains/​analytics/​parse-configuration/​index.test.ts Checks pending-event recipient restrictions.
hub/​server/​domains/​analytics/​hosted-authorization/​types.ts Defines fresh repository authorization contracts.
hub/​server/​domains/​analytics/​errors.ts Defines typed analytics failures.
hub/​server/​domains/​analytics/​constants.ts Sets retention and delivery limits.
hub/​server/​domains/​admission/​run-admission-transaction/​types.ts Shares authorization-purpose typing.
hub/​server/​domains/​admission/​admit-authentication-proof/​index.ts Restricts admission to sign-in purposes.
hub/​server/​create-app/​index.ts Extends protected routes and parser boundaries.
hub/​server/​create-app/​index.test.ts Updates collaboration integration expectations.
hub/​schema/​user.prisma Adds Canvas IDs and collaboration relations.
hub/​schema/​share-link.prisma Associates hosted links with external identities.
hub/​schema/​security-audit.prisma Adds repository-scoped audit records.
hub/​schema/​review-thread.prisma Adds collaboration versions and reads.
hub/​schema/​review-thread-read.prisma Stores per-user thread read versions.
hub/​schema/​review-reaction.prisma Stores unique user reactions.
hub/​schema/​review-notification.prisma Stores versioned Inbox activity.
hub/​schema/​review-notification-kind.enum.prisma Defines Inbox activity kinds.
hub/​schema/​review-mention.prisma Stores comment mention recipients.
hub/​schema/​review-comment.prisma Links comments to collaboration records.
hub/​schema/​repository.prisma Adds Canvas, audit, and analytics relations.
hub/​schema/​prototype.prisma Tracks first publication time.
hub/​schema/​migrations/​20261203150000_hosted_build_sharing/​migration.sql Adds hosted share creator references.
hub/​schema/​migrations/​20261203133100_analytics_destination_authorization/​migration.sql Creates analytics authorization storage.
hub/​schema/​migrations/​20261203132000_repository_security_audit/​migration.sql Adds repository audit scope and index.
hub/​schema/​migrations/​20261203131000_add_user_welcome_preference/​migration.sql Adds persisted Welcome preferences.
hub/​schema/​membership.prisma Relates memberships to Canvas grants.
hub/​schema/​hub-session.prisma Links sessions to pairing and analytics approval.
hub/​schema/​external-identity.prisma Links identities to Canvas and sharing.
hub/​schema/​canvas-pairing.prisma Stores expiring Canvas pairing requests.
hub/​schema/​canvas-grant.prisma Stores renewable, revocable Canvas grants.
hub/​schema/​authorization-attempt.prisma Links analytics authorization attempts.
hub/​schema/​authorization-attempt-purpose.enum.prisma Adds repository analytics authorization.
hub/​schema/​authentication-provider-revision.prisma Relates provider revisions to Canvas grants.
hub/​schema/​analytics-repository-state.prisma Stores repository analytics coordination state.
hub/​schema/​analytics-provider.enum.prisma Defines supported analytics providers.
hub/​schema/​analytics-event.prisma Stores retained product events.
hub/​schema/​analytics-event-name.enum.prisma Defines recorded product event names.
hub/​schema/​analytics-destination.prisma Stores encrypted destination settings.
hub/​schema/​analytics-destination-authorization.prisma Binds destination changes to authorization.
hub/​schema/​analytics-delivery.prisma Tracks delivery attempts and scheduling.
hub/​schema/​analytics-delivery-state.enum.prisma Defines delivery lifecycle states.
hub/​README.md Describes connected Hub capabilities.
hub/​package.json Adds runtime validation and local smoke support.
hub/​package-lock.json Aligns runtime dependency classification.
hub/​docs/​testing-and-operations.md Documents the local browser smoke workflow.
hub/​docs/​telemetry.md Distinguishes tracing from repository analytics.
hub/​docs/​README.md Links hosted sharing and analytics guides.
hub/​docs/​development.md Documents connected local and hosted workflows.
hub/​docs/​build-previews.md Documents template preview authorization.
hub/​Dockerfile Includes Controls validation runtime files.
hub/​client/​utils/​review-comment/​schemas.ts Allows mentions without GitHub IDs.
hub/​client/​utils/​prototype-controls/​controls-validation.d.mts Declares the Controls validator interface.
hub/​client/​utils/​notification/​types.ts Adds connected Inbox configuration.
hub/​client/​utils/​notification/​schemas.ts Accepts API notification update paths.
hub/​client/​utils/​notification/​read-updates.ts Broadcasts local Inbox read changes.
hub/​client/​utils/​notification/​inbox-configuration.ts Shares Inbox endpoint and copy.
hub/​client/​utils/​mention-candidate/​schemas.ts Supports non-GitHub mention candidates.
hub/​client/​utils/​get-url-origin/​index.ts Resolves template preview origins.
hub/​client/​storybook/​inbox-prototype-conversation/​index.tsx Uses declarative notification targeting.
hub/​client/​pages/​welcome-page/​types.ts Allows an explicit Create destination.
hub/​client/​pages/​welcome-page/​stories.tsx Updates the local Welcome state.
hub/​client/​pages/​welcome-page/​index.tsx Honors explicit Create availability.
hub/​client/​pages/​replica-browse-page/​types.ts Adds route and handoff capability props.
hub/​client/​pages/​replica-browse-page/​stories.tsx Uses explicit read-only branching capability.
hub/​client/​pages/​prototypes-show-page/​types.ts Adds notification and handoff callbacks.
hub/​client/​pages/​home-index-page/​types.ts Carries the Canvas sign-in destination.
hub/​client/​pages/​home-index-page/​stories.tsx Adds Canvas sign-in presentation.
hub/​client/​pages/​home-index-page/​index.tsx Submits the Canvas return path.
hub/​client/​pages/​canvas-pairings-page/​types.ts Adapts pairing props to current APIs.
hub/​client/​pages/​analytics-page/​types.ts Adds export and authorization states.
hub/​client/​pages/​analytics-page/​stories.tsx Covers analytics authorization and disabled export.
hub/​client/​pages/​analytics-page/​preview.ts Aligns examples with anonymous event payloads.
hub/​client/​pages/​analytics-page/​index.test.tsx Checks updated analytics preview values.
hub/​client/​hooks/​use-prototype-viewer-url/​index.ts Supports initial routes and optional URL updates.
hub/​client/​hooks/​use-mention-source/​context.ts Makes GitHub candidate identity optional.
hub/​client/​hooks/​use-copilot-handoff/​index.ts Checks permission before handoff.
hub/​client/​features/​workspace-sidebar/​types.ts Adds the Canvas connections destination.
hub/​client/​features/​workspace-sidebar/​stories.tsx Shows Canvas access in sidebar fixtures.
hub/​client/​features/​workspace-sidebar/​index.tsx Adds Canvas connections navigation.
hub/​client/​features/​review-thread-message/​types.ts Adds notification target state.
hub/​client/​features/​review-thread-message/​index.tsx Makes notification targets focusable.
hub/​client/​features/​review-thread-conversation/​types.ts Adds notification opening callbacks.
hub/​client/​features/​review-thread-conversation/​index.tsx Focuses Inbox targets and updates read handling.
hub/​client/​components/​mention-input/​index.tsx Keys candidates without GitHub IDs.
hub/​client/​application/​hub/​view-models/​settings-workspace/​index.ts Passes real-mode navigation context.
hub/​client/​application/​hub/​view-models/​settings-notifications/​index.ts Reuses shared Inbox configuration.
hub/​client/​application/​hub/​view-models/​repository-workspace/​index.ts Uses repository-specific capabilities.
hub/​client/​application/​hub/​view-models/​repository-show-data/​index.ts Gates listing management navigation.
hub/​client/​application/​hub/​view-models/​prototype-show-data/​index.ts Connects sharing, branching, and collaboration.
hub/​client/​application/​hub/​view-models/​prototype-show-data/​index.test.ts Checks per-prototype sharing decisions.
hub/​client/​application/​hub/​view-models/​product-sharing-settings-data/​index.ts Uses real navigation and sign-out paths.
hub/​client/​application/​hub/​view-models/​product-share-links-data/​index.ts Adapts sharing navigation to real mode.
hub/​client/​application/​hub/​view-models/​product-management-data/​index.ts Maps real listing capabilities and limits.
hub/​client/​application/​hub/​view-models/​build-history-data/​index.ts Gates sharing from Build history.
hub/​client/​application/​hub/​view-models/​administrator-workspace/​index.ts Adds connected Inbox navigation.
hub/​client/​application/​hub/​settings-contracts/​index.ts Expands selectable analytics events.
hub/​client/​application/​hub/​screens/​real-inbox-screen/​index.tsx Connects the Inbox page to persisted activity.
hub/​client/​application/​hub/​routes/​settings-notifications/​index.tsx Separates real Inbox and mock routes.
hub/​client/​application/​hub/​routes/​settings-canvas/​index.tsx Redirects to real Canvas connections.
hub/​client/​application/​hub/​routes/​settings-canvas-approval/​index.tsx Retires mock approval routes in real mode.
hub/​client/​application/​hub/​routes/​product-sharing-settings/​index.tsx Supplies real-mode sharing context.
hub/​client/​application/​hub/​routes/​product-share-links/​index.tsx Supplies real-mode share-link context.
hub/​client/​application/​hub/​routes/​product-new/​index.tsx Connects Create to fresh handoff authorization.
hub/​client/​application/​hub/​routes/​product-management/​index.test.ts Explicitly isolates mock management tests.
hub/​client/​application/​hub/​routes.ts Registers Canvas pairing and connection pages.
hub/​client/​application/​hub/​requests/​update-prototype/​index.ts Routes listing edits to management APIs.
hub/​client/​application/​hub/​requests/​get-workspace/​index.ts Requests selected repository capabilities.
hub/​client/​application/​hub/​requests/​get-security-audits/​index.ts Supports repository-scoped audit requests.
hub/​client/​application/​hub/​requests/​get-prototype/​index.ts Marks Inbox-originated prototype requests.
hub/​client/​application/​hub/​requests/​authorize-copilot-handoff/​index.ts Requests current handoff permission.
hub/​client/​application/​hub/​requests/​acknowledge-inbox-activity/​index.ts Validates and acknowledges opened notifications.
hub/​client/​application/​hub/​read-review-query/​index.ts Parses message and notification targets.
hub/​client/​application/​hub/​product-contracts/​index.ts Extends template and management contracts.
hub/​client/​application/​hub/​mocks/​create-product-store/​index.ts Aligns mock management capability naming.
hub/​client/​application/​hub/​is-public-route/​index.ts Allows signed-out Canvas route entry.
hub/​client/​application/​hub/​create-review-transport/​index.ts Preserves drafts during mention lookup outages.
hub/​client/​application/​hub/​contracts/​index.ts Adds connected workflow capabilities.
hub/​client/​application/​hub/​canvas-connections/​index.tsx Connects Canvas forms and sign-in presentation.
hub/​client/​application/​hub/​canvas-connections/​contract.ts Validates Canvas API and form data.
hub/​client/​application/​hub/​administrator-contracts/​index.ts Accepts session Inbox availability.
hub/​client/​application/​hub-application/​index.tsx Preserves Canvas destinations through sign-in.
hub/​AGENTS.md Removes outdated capability limitations.
hub/​.env.example Documents hosted sharing opt-in.
.github/​extensions/​replica-prototype/​README.md Clarifies current Hub Canvas endpoint support.

Review effort: Balanced (adaptive)

Comment on lines +52 to +57
return session.t
? Boolean(
target?.templateRepository &&
(await canReadTemplate?.(session.s, target.templateRepository)),
)
: Boolean(target)
Comment on lines +18 to +20
if (connection.revalidate) {
for (const channel of connection.subscriptions)
revalidateSubscription(state, socket, connection, channel)
Comment on lines +72 to +75
export const CanvasSignIn: Story = {
args: {
data: {
...data,
arniebradfo and others added 3 commits November 19, 2026 12:44
Keep the sidebar steady across Hub-wide routes and show a useful local empty state. Restore the Welcome introduction and link its Create card to the selected repository.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve the sidebar and Welcome fixes alongside the upstream webhook importer and repository authority.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep Analytics and GitHub Build recovery alongside the new scheduled learning processors.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@arniebradfo
arniebradfo marked this pull request as ready for review November 19, 2026 21:48
@arniebradfo
arniebradfo requested review from a team and nshki as code owners November 19, 2026 21:48
arniebradfo and others added 2 commits November 19, 2026 13:56
Preserve route-local request parsing for Decision Model and the hosted Hub routes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@arniebradfo arniebradfo self-assigned this Nov 19, 2026
@arniebradfo

Copy link
Copy Markdown
Collaborator Author

Follow-up for broader hosted rollout: bound GitHub API calls from live review and Inbox. Preserve prompt access-revocation checks, avoid duplicate provider lookups, and ensure that opening one Inbox item does not depend on unrelated repositories. This is deferred from #305; I’ll track it separately.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@weastler weastler 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.

Rechecked the earlier assessment against 35c65de7f79ca724fa36081a86e804d7fdcecd26 and the existing review threads. Two findings remain below: mention discovery truncation and the kickoff/Copy prompt permission mismatch.

The database-free import and missing Prototype canvasId issues are fixed in 655d47ed; notification acknowledgment is fixed in 35c65de7 and already covered by an existing thread, so I have not duplicated those comments. The earlier merge conflict is also gone: GitHub now reports this head mergeable against fa056718. Current Controls/extension checks pass on both Node versions, so the old generated-asset failure is not a current finding. At the check snapshot, Hub unit/database jobs and some other jobs were still running, with no reported failures; this is not an all-checks-passed claim. Remaining comments are source-revalidated, not new rendered-browser validation.

Comment on lines +66 to +69
load: async () => {
const { candidates } = await requestJson(
new URL(`${pageData.reviewCommentsPath}/mention-candidates`, routeUrl),
MENTION_CANDIDATES_SCHEMA,

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.

[P2] Pass the typed mention query to the server

This always loads candidates without q, but createReviewDirectory.search() stops after 20 matching collaborators. MentionInput then filters only that initial subset and does not reload when the query changes. In a repository with more than 20 collaborators, typing another eligible person's exact login therefore never offers them as a suggestion.

The earlier source-level reproduction used the actual directory with 25 synthetic collaborators: the empty query returned 20 and omitted zoe, while querying zoe returned her. Those directory/filter paths and this request are unchanged at this head; this was not a rendered-browser test. Please carry the typed query through MentionSource.load and refresh the server-filtered suggestions when it changes.

Comment on lines +14 to +16
if (viewer.sessionProvider !== "github") return false
const permission = await product.getRepositoryPermission?.(viewer, repositoryId)
return permission === "write" || permission === "maintain" || permission === "admin"

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.

[P2] Keep kickoff and Copy prompt available to repository viewers

The agreed canStartPrototypeSession policy allows any signed-in member who can see the repository to start or copy a prompt, because Hub kickoff does not write to the repository. This gate instead rejects GitHub read-only viewers and Entra members. The template catalog uses this result as canCreate, and ProductNew disables the composer when it is false, so those users cannot even reach Copy prompt in the continuation.

Executing this helper from the current head confirms that a GitHub read viewer and an Entra viewer both return false, while GitHub write returns true. Please base kickoff eligibility on the live signed-in member's repository visibility, retaining the existing permission checks for actual registration, listing, sharing and repository writes. This is a mismatch with the accepted product policy, not an authorization-bypass finding.

@arniebradfo
arniebradfo requested an adaptive review from Copilot November 19, 2026 23:15
@arniebradfo
arniebradfo merged commit 1cf8ab2 into build/hub/new Nov 19, 2026
52 checks passed
@arniebradfo
arniebradfo deleted the build/hub/local-validation branch November 19, 2026 23:24

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.

: null
return {
administrationWorkspace: session ? administratorWorkspace(session, "sessions") : null,
administrationWorkspace: input.workspace ?? null,
Comment on lines +71 to +74
case "prototype.registered":
case "share_link.created":
case "canvas_pairing.create":
case "canvas_pairing.approve":
Comment on lines +40 to +44
export function canvasFormDestination(form: FormData, base: string) {
const action = form.get("_action")
const url = typeof action === "string" ? URL.parse(action, base) : null
return url?.origin === new URL(base).origin ? url : null
}
Comment on lines +21 to +25
canvasConnectionsPath: "/canvas/connections",
currentUser: {
...data.currentUser,
provider: "local",
login: "local-developer",
Comment on lines +14 to +17
export function onInboxReadChanged(listener: (update: Update) => void) {
function receive(event: Event) {
listener((event as CustomEvent<Update>).detail)
}
Comment on lines +19 to +23
export function canvasCredentials(
grant: { id: number; expiresAt: Date; inactiveAt: Date | null },
accessToken: string,
repository: string,
login: string,
Comment on lines +17 to +20
export function readCanvasSignInReturn(request: Request, browserBinding: string) {
const [digest, destination, extra] = (readCookie(request, canvasSignInReturnCookie) ?? "").split(
":",
)
Comment on lines +31 to +35
export function findAnalyticsAuthorization(
tx: Prisma.TransactionClient,
id: string,
repositoryId: string,
) {
Comment on lines +14 to +17
export async function hideWelcome(
database: Pick<Prisma.TransactionClient, "user">,
userId: string,
) {
Comment on lines +9 to +13
export async function canHandOffToCopilot(
product: Pick<WorkspaceProductRouteDependencies, "getRepositoryPermission">,
viewer: ProductViewer,
repositoryId: string,
) {
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