Skip to content

feat(hub-zero)!: T6 signup policy to native authz (CL-8130) - #751

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-8130-hub-zero-t6
Sep 17, 2026
Merged

TheGreatAxios merged 3 commits into
mainfrom
cl-8130-hub-zero-t6

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

Hub-zero T6 (CL-8130, parent CL-7575). Deletes @workbench/access-policy — the closed-by-default signup/sub-workbench-creation policy table, checkSignupGate, and its tenant-scoped routes — rather than keeping it around unwired.

Per CL-7575's locked ruling ("later users sign up too; they do not mint tenants", "native POST /api/tenants grant-gating is the only gate"), this package had no native equivalent worth keeping. It also turned out to already be fully disconnected on main: hub-zero T1/T2 (#747, #748) had already repointed first-login onto native /api/setup status and left packages/onboarding's POST /provision route unmounted from apps/hub, so checkSignupGate was always called with no operator tenant and no caller ever passed an accessPolicy gate into it — dead code with a live-looking surface.

What was deleted

  • packages/access-policy (whole package: policy table/schema, checkSignupGate, evaluateSignupGate, canCreateTenancy, the tenant-scoped /access-policy and /access-policy/child-tenants routes, migrations)
  • packages/settings-ui's "Who can join" People-section panel and its API client (called a route no hub composition ever mounted)
  • WORKBENCH_SIGNUP / WORKBENCH_ALLOWED_EMAIL_DOMAINS — confirmed these envs were already gone from apps/hub/src/config.ts before this PR (an earlier cutover already removed them); rg "access-policy|HubSignupTenancy" apps/hub now returns zero non-comment hits

What moved rather than deleted

  • Nothing — apps/hub/src/index.ts's auth handler already carries no signup-gate wrap to remove (confirmed via rg); the native /api/setup cold-boot status route (CL-8112) is the only signup-adjacent surface left, and it was already native
  • packages/onboarding's genesis/join first-login flow keeps POST /api/tenants as its only gate — it no longer threads an optional accessPolicy gate through (that parameter was always undefined in production)

Docs

Updated docs/TENANCY.md's Signup and sub-workbench-creation sections, docs/GLOSSARY.md, docs/package-migrations.md's reference-implementation pointer, and two package READMEs to stop naming @workbench/access-policy as a retained-but-unwired package.

Concurrency note

PR #745 (CL-8085, being rebased concurrently) independently deletes packages/onboarding's genesis/provisioner and adds a small empty-hub count read to packages/access-policy. Whichever of the two merges second will need a small rebase against the other — this PR's onboarding edits are minimal (drop the now-dead accessPolicy plumbing) specifically to keep that conflict small.

Verification

  • bun run typecheck — clean
  • bun run lint — clean (pre-existing unrelated warnings only)
  • bun run check:structural — all checks pass, 217 tests green
  • packages/onboarding and packages/settings-ui unit suites run directly — all green

https://claude.ai/code/session_01RweuMUskU2nvcFhdckc7EG

@linear-code

linear-code Bot commented Sep 17, 2026

Copy link
Copy Markdown

CL-8130

…letion

The closed-signup gate genesis.ts called through @workbench/access-policy
was never wired into any hub composition; these cases tested behavior
the next commit deletes.

Claude-Session: https://claude.ai/code/session_01RweuMUskU2nvcFhdckc7EG
…-8130)

The closed-signup/sub-workbench policy table, checkSignupGate, and the
tenant-scoped access-policy routes had no native equivalent and were
never mounted by any hub composition (T1/T2 already repointed
first-login onto native setup-status and left onboarding's provisioning
routes unwired). Per CL-7575's ruling, native POST /api/tenants
grant-gating is the only signup/child-tenant gate now; there is nothing
to keep as a Workbench-side gate, so the package is deleted rather than
carried forward unwired.

- packages/onboarding: drops its dependency on @workbench/access-policy;
  genesis/provision no longer thread an accessPolicy gate through
  first-login (it was already always-undefined in production).
- scripts/db-setup.ts, scripts/checks/no-product-tenancy.ts,
  scripts/checks/report-error-baseline.txt, tsconfig.build.json: drop
  the deleted package from migration wiring, the schema-table
  allowlist, the report-error baseline, and the build project graph.
- packages/settings-ui: deletes the "Who can join" People-section panel
  and its API client — it called
  /api/tenants/:tenantId/access-policy, a route no hub composition ever
  mounted.

Overlaps with the in-flight PR #745 (CL-8085), which independently
deletes packages/onboarding's genesis/provisioner and adds an
empty-hub count read to access-policy; whichever of the two lands
second will need a small rebase against the other.

Claude-Session: https://claude.ai/code/session_01RweuMUskU2nvcFhdckc7EG
TENANCY.md's Signup mode and sub-workbench-creation sections, the
package glossary, the migration-shape reference implementation
pointer, and two package READMEs all named @workbench/access-policy
as retained-but-unwired; it is now deleted outright.

Claude-Session: https://claude.ai/code/session_01RweuMUskU2nvcFhdckc7EG
@TheGreatAxios
TheGreatAxios merged commit 6ea5595 into main Sep 17, 2026
1 of 12 checks passed
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.

1 participant