Permissions & app data
Status: Merged to main 2026-10-06 21:54 IDT in #516 by yoni-monday (merge 2fa68450, branch permissions-refactor, epic #426). Not deployed yet. The merge does not cut staging or prod over. deploy.yml was disabled (disabled_manually) right after the merge, re-enabled around 22:00 IDT (staging deploy attempts for 2fa68450 and 09920110 failed or were skipped), disabled again at 22:26 IDT, and re-enabled at 00:10 IDT on 2026-10-07. A staging dispatch for the #541 merge ab35dfcc then failed in the candidate's e2e, which still expected agent-written collection files; #543 (merged) updated the e2e for platform-managed collections (see Verify & ship). Before any deploy retry, confirm the cutover runbook prerequisites (keys, legacy teardown and schema reset, reseed) are done. Until the runbook has run, staging and prod still serve the old model.
Decision: docs/decisions/permissions-model.md. Cutover: docs/plans/permissions-cutover-runbook.md. Release evidence: #440.
What changed
Apps no longer share data by living in the same container. A collection is now one SQLite-backed Durable Object, owned by a source app and governed by the platform rather than by generated app code. Each app gets its own app environment for building, and every request to a published app, preview, agent tool or API is admitted against current permissions read from the control plane.
The old access paths were deleted, not adapted (hard POC cutover, approved by the operator). There is no compatibility layer, data migration or dual write. Existing apps are retired at cutover.
Two authorities
Each person has two independently assigned authorities on an app. Both are resolved from current control-plane metadata, read uncached, on every admission.
- Runtime data role, one per person for the whole app (invitation default
DEFAULT_INVITATION_ROLEis Add and edit their own /ownsince merged #1017; it was View only before, and View only is now an explicit Invite role). - Combined builder/manager role. One role holds what was earlier discussed as separate Can build and Can manage. There is no separate app-management role.
The combined role can edit code, work with the coding agent and dev preview, publish and unpublish without an extra approval gate, invite people, assign runtime roles, delegate the combined role, change general access, attach connections the person owns or can use, and approve collection policy and shared structure changes. App transfer and deletion stay with the app owner or explicit workspace admin recovery.
A new app's owner gets the combined role plus Edit all data. Other builders keep their separately assigned runtime role, though they can deliberately assign themselves Edit all data.
Runtime roles
| Role | Read | Create | Update | Delete |
|---|---|---|---|---|
| View only | Normal collection visibility | No | No | No |
| Add only | Explicitly readable reference data only | Where permitted | No | No |
| Add and edit their own | Normal visibility, shared or own | Where permitted | Own records where permitted | No |
| Edit all data | All records exposed to the app | Yes | All exposed records | Yes |
Edit all data overrides own-row rules but never exceeds the consuming app's collection grant, never authorizes schema or policy changes and never bypasses workspace guardrails. Record ownership is platform-derived, not a client field. There is no "no access" block role: removing a direct grant falls back to any remaining group, inherited or general access.
Revocation
Admission leases last at most 30 seconds, so a revocation reaches existing sessions within 60 seconds. This is why the control-plane Hyperdrive now runs with caching disabled and the CP worker is placed at aws:us-east-1, close to Aurora.
The 30 s lease also bounds the conductor's draft preview HMR socket. Since #588 (merged 2026-10-07, live on staging since 2026-10-08) the conductor renews it with a fresh CP builder proof for the exact original request 12 s before each deadline instead of closing it (which had reloaded the preview about every 36 s), so a revoke still closes it within one lease. Renewal is not capped by the user token's 15 min exp; each renewal re-checks current CP builder authority. See Conductor — Preview socket lease renewal.
Merged #679 (2026-10-08 21:54 IDT; closes #674) lets draft preview page/module GET/HEAD reuse a matching signed authority proof until it has less than 15 s of that same (≤30 s) lease left, so a revoke is decided by the next fresh lookup rather than on every module read. That is a bounded window, not immediate revocation; the contract is in gotchas/cloudflare.md — Preview permission reuse and near-expiry data identity. Identity is still verified on every request; writes, media, data authorization and socket renewals stay fresh. See Conductor — Preview admission reuses signed leases.
Builder admission also gates the agent's browse screenshots in chat. Since #516 the conductor's __thumb route served nothing; #591 (merged 2026-10-07, live on staging since 2026-10-08) lets any admitted builder load 32-hex screenshot ids (Yoni's call: they can already read the chat), still no-store, while version thumbnails stay unserved. See Conductor — Chat screenshots served again.
App card draft screenshots are separate: #684 (merged 2026-10-09) restores them for builders only. Capture uses the turn's verified user after a fresh control-plane builder check (no stored builder identity), and the list only returns a signed thumbUrl to builders — viewers keep the placeholder. A signed URL can keep working for 1–2h after its holder loses access. See Conductor — App card draft screenshots.
Clock skew on authority proofs (#544)
The control plane, conductor and dispatch run on different workers and sign authority proofs with their own clocks. Every verifier used to reject a proof whose issue time (iat, or observedAt for dispatch's collection-admin authority) was even a second in the future. A signer slightly ahead across a second boundary then looked forged: BuilderAccessRejected, and the publish failed with intermittent HTTP 403 deploy_failed: forbidden that succeeded on retry (seen in staging candidate e2e STEP 4, run 37537372999, and once in the permp04 journey).
#544 (merged 2026-10-07 01:57 IDT by yoni-monday, merge ee6343fb) adds CLOCK_SKEW_SECONDS = 5 in packages/service-contracts/src/collection-proofs.ts (re-exported from app-access and collection-consumers) under the new security contract authority-clock-skew-forgives-only-future-issue:
- A verifier may accept an issue time at most 5 s after its own clock. That's the only thing it relaxes.
- The skew is verify-only. Each
check*helper takes averifyingflag, sosign*paths still refuse aniatahead of the signer's own clock (a review on the first revision caught signers getting the tolerance too, which brokepackages/collections/test/collection-proofs.test.ts). - Expiry (
exp > now), the 30 s lease bound from the original observation, and every signature and peer check stay exactly as before, so the skew never stretches a lease. - It applies to app-access proofs, collection proofs, collection admin and consumers envelopes (
packages/capabilities/src/) and dispatch's collection-admin authority (services/dispatch/src/access/collection-admin.ts). Dispatch's internal published identity keeps zero tolerance. - The regression test in
packages/capabilities/test/app-access.test.tschecks that 4 s ahead verifies, 6 s ahead is refused, and expiry is still enforced. - Known follow-up, not addressed in #544: in dispatch's collection-admin path, the seal uses
iat: nowfrom dispatch's clock withobservedAtfrom the control plane. A reviewer flagged that when the control plane is ahead, signing then refusesobservedAt > iatand the request still fails, now as a retryable 503unavailableinstead of a 401. The suggested fix isiat = Math.max(now, a.observedAt); the data permit seal ingateway.tshas the same shape.
Collections
- A project has one logical dataset made of shared and app-specific collections. Sharing data does not need a shared container.
- A collection is governed by its source app. Its owner starts as the collection owner, and holders of the combined role on that app approve later changes.
- A consuming app gets an app-to-collection grant at Read or Read/write. That grant is a ceiling for everyone in the consuming app, including Edit all data.
- The coding agent sets the initial defaults when it creates a collection. After that, permission and shared structure changes need an explicit human approval from the source app. Code edits, rollback, republish or recreating the definition cannot reset an approval.
- Shared collections are not silently deleted with their source app.
- Atomicity is per collection DO only. Multi-collection operations are retryable workflows with idempotency, not transactions. The query surface stays collection-scoped (get, create, update, delete, upsert, query, aggregate), with no cross-collection joins.
Request path
Published apps, previews and agent tools all reach data through the same stateless PlatformData gateway in dispatch, using the control-plane database as the collection directory. The gateway binds the verified app and user identity, resolves current permissions and guardrails, and routes to the collection DO, which enforces its own policy, validation and record ownership. Generated code never gets raw DO namespace access, arbitrary SQL or authority from caller-supplied ids. Agents act with the authority of the person directing them, with no agent-only shortcut.
| Piece | Where |
|---|---|
| Collection DO | services/dispatch/src/do/collection.ts, services/dispatch/src/lib/collection-*.ts |
| Gateway and admission | services/dispatch/src/access/ (gateway.ts, admission.ts, published.ts, collection-admin.ts) |
| Collection policy and validation | packages/collections |
| Directory, permissions, sharing, governance | apps/control-plane/src/collections/, src/permissions/, src/resources/; routes permissions.ts, app-access.ts, collections.ts, resources.ts |
| Contracts | packages/service-contracts/src/ (permissions.ts, collections.ts, app-access.ts, app-environment.ts, platform-data-identity.ts, …) |
| Template SDK over the platform transport | packages/template/packages/db/src/ (client.ts, wire.ts, model-generator.ts) |
| App environments and builder admission | services/conductor/src/do/app-environment.ts, oc-admission.ts, src/lib/builder-admission.ts, src/workspace/data-relay.ts |
| Studio surfaces | apps/control-plane/web/src/components/ sharing/, collections/, projects/, admin/AdminGovernance.tsx |
The old per-workspace D1 data path is gone: the control plane's src/data/ (D1 client, rows, record queries) and the studio's components/data/ were removed, and the conductor's deploy/data-worker.ts was deleted.
Collection create requestIds are scoped to the app (#611, merged; fixes #583)
When a builder turn creates a collection (create_collection or scaffold_model), the conductor calls the control plane's POST /internal/collections/conductor with op=create and an idempotency requestId. The control plane (collections/directory.ts createCollection) looks up an earlier request by actor and requestId across the whole tenant, and answers 409 conflict when that earlier request's digest differs. The digest includes sourceAppId.
Before #611 the conductor derived the create requestId as sha256(canonicalJson({ alias, configuration })) with no app identity (scaffold-model-tool.ts, collection-tools.ts). So once a person had created a collection in one app, creating the same alias and configuration in any other app got 409 forever. On staging the seeded E2E user had many earlier runs, so nearly every STUDIO-CHAT-001 e2e turn wrote no files and staging promotion was blocked. Free-form runs only collide some of the time because the model settles on one of two configurations (content required or not).
#611 (opened 2026-10-07 23:47 IDT by Brilliant Fixer, merged 2026-10-08 09:00 IDT by yoni-monday, merge dce2558b; live on staging since 2026-10-08 09:22 IDT (deploy dce2558b, run 37735680926)) adds deps.wsId to both derivations. wsId binds one-to-one to the app environment (do/agent-runtime.ts bindOrReadAppEnvironment), so retries in the same app keep the same requestId and stay idempotent, while different apps get different ones. No control-plane or permissions code changes. test/fake-collection-directory.ts can now share a request ledger between two fake apps for one actor and conflicts on a digest mismatch the way directory.ts does. Verified on side env fix-583: the pinned prompt that failed STEP 2 on the old main passed twice, and scripts/e2e.ts --env fix-583 passed all 5 steps twice in a row.
Settings › Data records table (#565, merged)
After the refactor, studio Settings › Data showed records as a flat list with inline forms. Operators said the old table was better, so #565 (merged 2026-10-07 12:02 IDT by yoni-monday, merge 81d8cc56, branch studio/data-table-restore) ports the pre-refactor components/data/* table onto the new collections API only (POST /apps/:id/data). The code lives in apps/control-plane/web/src/components/collections/ (RecordsView.tsx, RecordTable.tsx, RecordEditor.tsx, FilterPopover.tsx, record-query.ts, record-rights.ts).
- Restored: typed columns and cells (booleans, enums, numbers, JSON, timestamps), a sticky first column, sortable headers (server
orderBy), search (server-side when the collection has searchable fields, otherwise current page only and labelled so), filter chips compiled to the gatewaywheregrammar, page size and pager with anaggregatecount, a side record editor with typed inputs, two-step delete, bulk delete with confirm, and a Fields tab. - Kept from the new model: whether you can write comes from the bound descriptor's live access. Read-share consumers see records and the reason, with no write controls (a keyboard-reachable View opens a read-only sheet). "Add and edit their own" edits only its own rows. Each delete or editor opening has a stable request id, and a fresh id is used only for a changed edit after a conflict.
- Not ported: URL query state, reference-field navigation, realtime (the new API has no channel, so the table only refreshes), and a "contains" filter (the gateway has no substring match).
- Verified live on side env
permp03: table, filter, server search, sort, create and edit, bulk delete, and the read-only Read consumer, both in standalone settings and inside the app editor at 1440px and 390px. That run caught and fixed a real bug where editing 64 to 65 saved 6465. Tests: newtest/records-table.client.test.tsx(12 browser tests) and a rewrittentest/records-view.test.tsx(13); journey selectors inscripts/e2e/journeys/permissions/studio-ui.tswere updated. - Known and pre-existing: at 390px the in-editor settings panel keeps its side nav, leaving about 124px for any section (filed separately).
App environments
There is now one app environment per app (P04, #430). Each conductor turn is pinned to the builder directing it. If another builder is already driving that app, the request gets 409 busy-builder, which the studio shows as a builder-busy state.
Sharing and membership
- Runtime-only invitations do not create workspace membership. Granting the combined role does, but with #641 (merged 2026-10-08) a builder grant to someone who is not yet a member becomes a pending builder invitation, and membership starts only when they accept. Turning builder off, setting it to inherit, or removing them revokes that pending invitation (details). #662 also stops a data-role edit for a non-member who already has builder from silently joining them (phase 2).
- Invitations require a verified email.
- New projects and apps start private. General access grants runtime authority only, never the combined role.
- Signed-in public links grant a chosen runtime role (View only by default). Anonymous links allow View only or Add only.
- Signed-in public links support app-only self-registration that never grants access by itself (P11, #436). Registration history survives link revocation.
- Billing (planned, not shipped): under the agreed subscriptions, credits & access model, authenticated external app users can count toward the organization's ordinary-user capacity (counted once per organization, based on granted access, not activity); anonymous visitors and unaccepted invitations do not count.
- The app's registered customers (studio Settings › Customers) come from
GET /apps/:id/app-users, which returns the whole roster as a capped bare array, not a cursor page. The studio crashed on that tab until #547 fixed the client to read the array (client inapps/control-plane/web/src/api/permissions.ts, UI incomponents/sharing/AppUsersSection.tsx). - Workspace owners and admins get explicit recovery and unpublish authority, not automatic access to Restricted apps. Recovery can only target people already reachable from that tenant (see Recovery only reaches people in the tenant).
- Connections keep their own Can use and Can manage. The combined app role does not grant connection management, and runtime roles do not limit what connected services can do.
Recovery only reaches people in the tenant (#553, merged; fixes #548)
Security fix (sev:high), merged 2026-10-07 09:46 IDT by yoni-monday (merge faea2465, opened by Brilliant Fixer).
The bug. POST /tenants/:tenantId/recovery with kind: "set_app_access" looked up userId globally and never checked that the person was reachable from the acting tenant. With builder: true, joinBuilder then inserted a memberships row. Any tenant Owner or Admin could pull a user from another tenant into theirs, and because Studio login picks the newest membership, the victim's next login landed in the attacker's tenant.
The fix. recover() now runs the same reachablePerson gate as changePerson (exported from sharing.ts), before the revision check and before any write. A target that isn't reachable answers 404 not_found, with no email in the body and no membership, grant or recovery row written. Existing members still get 200. The contract recovery-is-explicit-current-and-durable now states the rule. Evidence: a new test in apps/control-plane/test/permissions.test.ts (fails with 200 if the gate is reverted), and a live check on side env fix-548.
Still open (needs a product decision):
- #554: once someone accepts even a view-only app invitation they count as reachable, so a builder grant via
PUT /apps/:id/permissions/people/:idcan still create a membership they never agreed to. The contractssharing-writes-independent-overrides-atomicallyandbuilder-grants-create-real-membershipallow this today; closing it means requiring an accepted builder invitation first. Also tracks whether recovery should be limited to current members. Resolved: Yoni chose pending builder invitations; fixed by #641 (merged 2026-10-08). See Builder grants to non-members become pending invitations. - #555: defence in depth. Studio login chooses the tenant from the newest membership (
routes/auth/studio.ts) rather than the tenant the user last chose. - #549: the staging agent key could write staging Pulumi state. Yoni chose option A (agent read-only on staging state, CI the only writer); fixed by #557 (merged 2026-10-07). See Secrets & environments.
Builder grants to non-members become pending invitations (#641, merged; fixes #554)
Merged to main 2026-10-08 15:40 IDT by yoni-monday (merge 746e134a); opened 15:09 IDT by Brilliant Fixer (branch fix-554-builder-grant-invitation). Decision from Yoni in Slack: a builder grant to someone who is not a member of the tenant creates a pending builder invitation instead of a membership.
The problem. Accepting even a view-only app invitation makes someone reachablePerson in the tenant. After that, a builder grant (PUT /apps/:id/permissions/people/:userId with {builder: true}) or an admin recovery set_app_access ran joinBuilder, which inserted a memberships row the person never agreed to, and their next Studio login could land there.
The new behavior (permissions/sharing.ts, permissions/recovery.ts, new grantAppPerson):
- For an app builder grant to a non-member, any other part of the change (for example the data role) applies at once.
- The builder part becomes a pending app invitation
{builder: true, dataRole: <their resulting direct role> ?? "view"}. An existing pending builder invitation for the same email is reused, and it follows the latest direct data role on every later change (including aPUTthat only changesdataRole), so accepting never downgrades it. - Turning builder off (Not a builder), setting it to Inherit, or removing the person's direct access revokes every pending builder invitation for that email on the app, each with a
permission.invitation.revokeaudit row. The owner's latest word wins. AdataRole-only change leaves the invitation pending. - The membership and builder override appear only when the person accepts, through the existing
acceptInvitationpath. In Studio, after Give builder access the person shows under Pending invitations · Builder; the existing copy already says builder access makes them a member when they accept, so there is no UI change. - Grants to existing members behave as before. Recovery
set_app_accessuses the same path. - Projects have no invitations, so a project builder grant to a non-member is refused with 400
invalid_input. Invite them as a builder on an app instead; once they are a member, project builder needs a separate grant. Studio still offers project Builder to non-members, tracked in #645.
Edge worth knowing. Accepting writes the invitation's data role as an explicit override. Someone who had no direct data role (inheriting) ends up pinned to View only unless the grant set one.
Not covered (separate, pre-existing): app invitations have no delivery mechanism. Nothing emails the invitee, for grant-created or manual invitations.
Evidence. New tests in apps/control-plane/test/permissions.test.ts (all fail on main): view invite accepted then builder grant twice gives no membership and exactly one pending builder invitation, and accepting it creates the membership and builder grant; recovery builder to a non-member gives no membership and one pending invitation; project builder grant to a non-member gives 400 with nothing written; builder off, inherit, or remove before accept revokes the invitation so a later accept gives no builder or membership; and the pending invitation tracks the latest data role. Control plane: tsc clean, bun test 1534 pass, biome ci clean. Live check on side env sec-batch (the accept step is covered by the test only, since it needs a verified Auth0 identity). docs/decisions/permissions-model.md is updated in the same PR.
Task breakdown (P01–P14)
| Task | Issue | Scope |
|---|---|---|
| P01 | #427 | Contracts, schema subset and the Effect permission core |
| P02 | #428 | Project and app CRUD, private directory visibility |
| P03 | #429 | Collection DO storage, policy, atomic mutations |
| P04 | #430 | One app environment per app, turns pinned to the directing builder |
| P05 | #431 | App and project permissions, verified-email invitations, tenant admin, current snapshots |
| P06 | #432 | Dispatch admits published apps through the current CP snapshot; stateless PlatformData gateway |
| P07 | #435 | Template SDK over the platform transport; deterministic model generator |
| P08 | #433 | Collection directory, sharing, source-only human approval |
| P09 | #438, #503 | Agent schema tools, model sync, safe run_script; preview and agent data relay |
| P10 | #434 | Studio navigation by project and app |
| P11 | #436 | App-only self-registration that never grants access |
| P12 | #437 | Studio sharing, approvals, tenant-admin surfaces |
| P13 | #439 | Durable cross-app invalidation |
| P14 | #440 | Integration, bypass retirement, release gate |
Follow-ups: #515 (data access for agents, workflows and evals), #471, #425 (richer customer and app-user management).
Verification before merge
On side env permp04, the real-browser permissions journey passed 16/16 at head 5ab6fe1b: invitation acceptance, both real Auth0 identities, CRUD and read-only controls, publish, realtime and revocation. CI verify and Semgrep were green on the same head. The journey uses the staging Auth0 test users from #521 (see Secrets & environments). Run it with bun scripts/e2e/journeys/permissions-journey.ts --env <env> after bun scripts/e2e/auth0-storage-state.ts --env <env>.
Deploy notes
- Migrations
0032_resource_directorythrough0036_app_registrationsinapps/control-plane/drizzle/. All are non-destructive. - Five new per-env keys, listed as
generatedfor deployed envs ininfra/secrets/catalog.tsand minted per side env automatically. For staging and prod, Pulumi mints them intobrilliant/<env>/permission-keyssince #541 (merged); see Secrets & environments:
| Key | Consumers |
|---|---|
APP_ACCESS_AUTHORITY_KEY | control plane, dispatch, conductor |
APP_ACCESS_CONDUCTOR_REQUEST_KEY | control plane, conductor |
APP_ACCESS_DISPATCH_REQUEST_KEY | control plane, dispatch |
COLLECTION_PROOF_KEY | dispatch |
PLATFORM_DATA_IDENTITY_KEY | dispatch |
- Infra: Hyperdrive caching disabled and
hyperdrive.AUTHORITY_HYPERDRIVEadded tobrilliant/<env>/cloudflare-ids(the wrangler renderer requires it). Applied byinfra.ymlon the push tomainfor staging; prod only throughinfra.ymlworkflow_dispatchwithstack: prod. deploy.ymlnow deploys dispatch before the control plane.
Cutover (hard reset, not a migration)
The full steps are in permissions-cutover-runbook.md. The shape, in order, for staging and then prod:
- Pause auto-deploy (
gh workflow disable deploy.yml) and announce a studio freeze. - Confirm the five keys exist in
brilliant/<env>/permission-keys(names only). Since #541 Pulumi mints them in theinfra.ymlapply, so nobody writes them by hand. - Tear down every pre-cutover app with
bun scripts/cutover/retire-legacy-apps.ts --env <env> --apply --expect <n> --teardown-only(dry run first, then--limit 1). It destroys each app's D1, scripts, data worker and DO state, and writes 30-day:deletedtombstones intoAPP_POLICIES. - Merge #516 and let
infra.ymlapply the Hyperdrive change. - Reset the
publicschema of thebrilliantdatabase (drop and recreate in one transaction, behind a confirm token). This loses tenants, memberships, users, connections and their secrets, templates, workflows, agents, usage history and the audit log. Admin D1 and R2 survive, but R2 objects keyed by tenant id are orphaned. - Migrate the empty schema, re-apply admin read-only grants, and on staging only reseed the E2E tenant and user with
scripts/env/seed.ts. - Re-enable and run
deploy.ymlon the merge sha, then verify: smoke, permissions journey, Hyperdrive caching off, no legacy apps left, and an old published app answering 404.
Sign-ins during the cutover window (#545, merged)
Between the schema reset (step 5 above) and the new deploy going live (step 7), the old control plane is still serving against the new schema. Anyone who signs in during that window gets a tenant and owner membership written by old code, with no tenant_resource_rules row. Every colleague who later joins that tenant automatically then gets {"error":"unavailable"} (503), because the join fails closed without rules.
This happened on staging: the Monday.com tenant was created at 21:27 by the old control plane, and the first new deploy only went green at 23:03 (times as the PR gives them), so monday.com users couldn't sign in. Staging was repaired by inserting the default rules row, the same values bootstrapResources writes. #545 (docs only, merged 2026-10-07 09:03 IDT by yoni-monday, merge dafc4449) records the window under runbook step 4 and adds the repair to the step 9 verify list so prod doesn't hit it:
- Keep the window between the schema reset and the live deploy short.
- After the deploy, run the repair against
$DB_URL. It inserts default rules (revision 1, project creation and builder allowed, full runtime ceiling, no mandatory rules,join_policyautomatic) for every tenant that has an owner but no rules row, and the follow-up count of tenants without rules must be 0. This is the SQL from the runbook's step 9:
INSERT INTO tenant_resource_rules (tenant_id, revision, project_creation_allowed,
builder_allowed, runtime_ceiling, mandatory_rules, join_policy)
SELECT t.id, 1, true, true,
'{"read":"all","create":true,"update":"all","delete":true}'::jsonb, '[]'::jsonb, 'automatic'
FROM tenants t
WHERE NOT EXISTS (SELECT 1 FROM tenant_resource_rules r WHERE r.tenant_id = t.id)
AND EXISTS (SELECT 1 FROM memberships m WHERE m.tenant_id = t.id AND m.role = 'owner');
SELECT count(*) FROM tenants t
WHERE NOT EXISTS (SELECT 1 FROM tenant_resource_rules r WHERE r.tenant_id = t.id);Note the runbook numbers its steps differently from the shape above: its step 4 is the schema reset, step 8 the deploy, and step 9 the post-deploy verify list.
There is no data rollback. Reverting #516 restores the old worker code and auth path but not the deleted apps or data. Aurora point-in-time recovery (7 days) means restoring to a new cluster, which is an outage-level admin call. Prod follows the same order with an admin session, BRILLIANT_CUTOVER_CONFIRM=prod, its own Pulumi-minted keys (never copied from staging), no E2E seed, and the prod gate still needing a green deploy staging <same sha> run first.
Authorization as compile-time proofs: gdp-ts (#647, merged)
Merged 2026-10-08 15:42 IDT by yoni-monday (merge ff69849c, 2 commits, +1,835/−12 in 37 files). This is phase 0 of moving platform authorization onto gdp-ts (“Ghosts of Departed Proofs”): it adds the foundations and a lint gate on main, and changes no runtime behavior.
The idea. A sensitive function (one that reads or changes something only some callers may touch) takes a proof about its exact arguments, so calling it without the check, or with a check about a different value, does not compile. Values get compile-time names with name(...), a small trusted module in a proofs/ folder runs the check and mints the proof (or returns null), and the sensitive function demands Named<…> arguments plus the matching proof. It applies to platform authorization only; generated app code does not use it.
- Library:
gdp-tsis vendored at upstream commit0b6ebee(rauchg/gdp-ts, MIT) as@gdp-ts/coreinpackages/proofs-core, because npm0.1.0predates the lint fix for assertion-free proof forging. When a fixed release is on npm the package is meant to be deleted and replaced by the npm dependency; call sites don’t change. Don’t edit itssrc/except to take an upstream fix. Only the Oxlint preset (@gdp-ts/core/lint/oxlint) and the rule plugin are kept; upstream’s ESLint preset is not vendored, since the repo lints with Biome and runs these rules through Oxlint. - Branded ids:
UserId,TenantId,AppId,WorkspaceId,ProjectId,ThreadId,BindingId,AgentIdinpackages/api-types/src/ids.ts(import@brilliant/api-types/ids). Brand a value at the boundary that checked it; HTTP wire types staystring. That file is the only place an id brand is asserted withas. - Trusted modules:
apps/control-plane/src/proofs/andservices/conductor/src/proofs/are the only places allowed to calldefineProof. Phase 0 adds onlyapps/control-plane/src/proofs/mistakes.ts, a type-checked file that never runs: each// @ts-expect-errorline is a mistake the compiler must keep refusing (proof about the wrong tenant, raw id instead of a named value, no proof, hand-built proof, name escaping its callback,AppIdused as aUserId). Add a line when a review finds a path that should not compile. - New verify gate
gdp: see Verify & ship. Strict mode (ban everyasandanyoutside trusted modules) stays off for now. - New agent rule in
AGENTS.md: “Sensitive store and resource writes take a proof. Mint it only in aproofs/module. Neverasa proof or aNamedvalue.” Its task table sends anyone changing authorization, membership, or a store write that decides access to the newskills/gdp-ts/SKILL.md. - Repo-agent skill only:
skills/gdp-tsis listed inscripts/repo-agent-skills.tsand filtered out of the conductor workspace bundle and the app-building agent’s system prompt, so the app agent never learns about platform authorization. - Worktrees:
scripts/worktree-node-modules.shnow links@gdp-ts/*to the worktree’s own packages, like@brilliant/*.
Later phases (separate PRs, per the PR body): operations proofs, permissions, capability minting, route checks, a store facade, conductor, then strict mode.
Operations mint proofs: phase 1 (#660, merged)
Merged 2026-10-08 16:10 IDT by yoni-monday (merge ce7e9516, branch yonibr/gdp-ts-ops, 2 commits, +399/−63 in 7 files). Opened 15:53 IDT.
- Proofs minted in the operation wrappers:
tenantOp,appOpandworkspaceOp(apps/control-plane/src/operations/define.ts) now run the body insidename(...)and hand itctx.namedUser,ctx.namedTenantandctx.proofs:TenantMember,TenantActive, plusTenantAdmin(owner or admin) andBuilderSeat(builder seat), eachnullwhen it doesn’t hold.appOpalso passesnamedAppwithAppInTenant,CanBuildAppandWorkspaceInTenant;workspaceOppassesnamedWorkspacewithWorkspaceInTenant. Existing operations still compile and nothing downstream requires a proof yet. - New trusted modules:
apps/control-plane/src/proofs/tenant.ts(openTenant, which returnsnullunless the membership is this user in this tenant and the tenant is active) andapps/control-plane/src/proofs/app.ts(appInTenant,workspaceInTenant,canBuildApp). A proof is minted only from the row that was loaded, never from a tenant id the caller supplies.mistakes.tsgains a line proving a membership proof can’t stand in forTenantActive. - Behavior change: inactive tenants are forbidden before
run. A suspended (or otherwise not active) tenant getsforbiddenand the body never runs. Studio sessions already rejected this; MCP tool calls did not, and now do, because they go through the same wrapper. - Unchanged: an app or workspace in another tenant is still
not_found. When the app has a resource row,CanBuildAppcomes fromloadApp, and an inactive lifecycle is still aconflict. Runtime and invitation operations are untouched, since they already reject an inactive tenant and may have no membership.
Resource and permission writes mint proofs: phase 2 (#662, merged)
Merged 2026-10-08 16:46 IDT by yoni-monday (merge 1fe535b4, branch yonibr/gdp-ts-access, 2 commits, +652/−76 in 11 files). Continues the gdp-ts work from phase 1 (#660) and phase 0 (#647).
- Sharing and owner/builder resource writes run behind proofs. Paths that used to call
loadApp/loadProjectdirectly now go through trusted helpers inapps/control-plane/src/proofs/access.tsandproofs/app.ts:withViewApp(CanViewApp, used bygetApp),withBuilderApp/requireCanBuild(CanBuildApp),withOwnedApp/requireOwnsApp(OwnsApp), andwithOwnedProject/requireOwnsProject(OwnsProject). Product allow and deny results stay the same, with one legacy exception below. - Membership only on accepted builder invitation. A data-role edit for a non-member who already has
builder: trueused to silently re-add them to the tenant viajoinBuilder. It now applies the role and does not create a membership.proofs/consent.tsmintsConsentedToJoinonly when that person is accepting their own pending builder invitation;joinBuilderrequires that invitation (andrequireConsent) before inserting a membership. This tightens the #641 invitation model. - Collection gates mint proofs on the same allow/deny path. Surface admission, builder, view, and admin checks moved into
proofs/collections.ts(admitSurface,holdCollectionBuilder,holdCollectionView,holdCollectionAdmin). Callers still return plain data; nothing downstream takes the collection proof yet. appPolicyKindclassifies why app authority held. Newproofs/policy.tsmaps existing reasons toAppOwner,AppPersonGrant,ProjectGrant, orGeneralAccess(ownership wins, then direct app grant, then project grant, then general/link). It is not attached to the authority result until a caller records it. Tenant-scope person or group grants have no kind here.- Unchanged for product callers: allow/deny decisions match the previous checks. Staging still needs a run of invite-as-builder → accept → membership (called out in the PR test plan).
Token scopes mint from the checks that authorize them: phase 3 (#664, merged)
Merged 2026-10-08 18:02 IDT by yoni-monday (merge cdb6ba2c, branch yonibr/gdp-ts-tokens, 5 commits, +602/−122 in 17 files; opened 17:01 IDT). Continues phase 2 (#662). The merged version grew well past the first commit: every place the control plane hands out a capability token now goes through the same helpers, not only POST /tokens.
- Capability scopes come only from proofs. The new trusted module
apps/control-plane/src/proofs/scopes.tsis the only place that stampsthread:,ws:andapp:strings (threadScope,wsScope,appScopes,appWorkspaceScope,conductorWsScope). The result is typedCapabilityScope, a branded string, so pushing a raw string likews:${id}no longer typechecks.mistakes.tsgains lines for that and for using a tenant membership in place ofWorkspaceInTenant. - Where it applies:
POST /tokens(routes/tokens.ts); the old studio-origin preview redirect (routes/session-common.ts:redirectToPreviewmints from the workspace row, and the newredirectAppToPreviewcovers apps with no workspace row); app sign-in (/auth/app/callbackinroutes/auth/app.ts, which stampsapp:scopes after its access decision, not as a second gate); and workspace-token operations such as screenshots, which now callmintWorkspaceToken(env, principal, workspaceTokenScope(ctx))with the scopeappOpalready proved instead of a bare container id. - What each scope requires:
thread:<id>needs the caller to be that thread’s participant in the active tenant (a newThreadParticipantproof).app:<id>(plusapp:<scriptName>when the app has one) is the in-tenant check (AppInTenant), not a view grant.ws:<container id>is the container id of a workspace row in the tenant (WorkspaceInTenant). An app with no workspace row getsws:of the app’s own workspace id, only after the app is proven in the tenant. - Error codes: a missing row, or one in another tenant, is
404 not_found; a thread non-participant is still403 forbidden. The preview redirect answers404 workspace_not_foundor404 app_not_found. - Behavior change: the preview path refuses another tenant’s workspace row. That mint used to proceed from the container id alone. The container id is now computed in one place (
containerWsIdOf, shared byappOpand the scope mint), so a token can’t name a different container than the one the operation sends the conductor. - Decision: workspace scopes don’t require builder authority. Requiring it would refuse members who can open a container today, so non-builder members still get the
ws:scope. - Decision:
mintUserTokenstill acceptsstring[]andmintCapability’s authorizer still returns a boolean. Switching it to a proof would break the existing factories.
Tenant admin and in-tenant rows are proved before routes use them: phase 4 (#675, merged)
Merged 2026-10-08 21:22 IDT by yoni-monday (merge ee8cdf6f, branch yonibr/gdp-ts-routes, 2 commits, +387/−122 in 31 files; opened 19:47 IDT). Continues phase 3 (#664) and moves the remaining hand-written role and tenant checks in apps/control-plane/src/routes/ onto proofs. The follow-up that carries the proof into deleteAgent and the proxy write itself is #676.
- Owner/admin gates go through one helper,
isTenantAdmin.isOwnerOrAdmin(inroutes/agent-helpers.ts) is gone.isTenantAdmin(store, userId, tenantId)inproofs/tenant.tsloads the membership row, mintsTenantAdminthroughasTenantAdmin(only when the row is this user and tenant with roleowneroradmin) and consumes it withrequireTenantAdmin, so no route reimplements the role check. The second commit replaced the copied per-file blocks with this helper. It coversdenyUnlessAdmin, agent delete, agent and workflow grant decisions, workflow edits (canMutateWorkflow), thread access, custom integrations, the tenant integration routes, and the custom-integration proposal routes (custom-proposals.ts,direct-connect-proposal.ts), which used to comparerole === "owner" || "admin"by hand. GET /threadsstill lists insideasTenantAdmin. Admins see every thread; a non-admin falls through to the threads they participate in.- Decision: the admin proof does not also require an active tenant. These routes only checked the role before, and the session has already decided the tenant is usable, so phase 4 doesn’t add that check.
- Rows are in the session tenant only through a proof helper. The trusted module
proofs/held.tshasrowInTenant,appInSession,workspaceInSession,agentInSession,threadInSession,pathInSession(a/tenants/:idpath param must be the session tenant, now including the seat-count routeGET /tenants/:id/seats) andskillInSession(a platform skill with no tenant stays visible everywhere). RawtenantId !==comparisons are gone fromroutes/. Checks that only ask “is this person a member” stay as they are. - Status codes and messages don’t change. A cross-tenant app, thread or connection stays
404; a path tenant mismatch stays403; a thread token for another tenant is404while a same-tenant non-participant is403; a cross-tenantGET /v1/memberslookup still returns an empty list. - Integration writes are a
WritePermit.proofs/binding.tstypes a caller’s write permission as a mintedBindingWrite,"denied", or"approval"(it used to beboolean | null). Agent and workflow grants mint the write from the grant and connection profile:agentBindingWritemints for a full-profile connection when the connection allows agent writes or the grant isread_write;workflowBindingWritemints for aread_writegrant on a full-profile connection. Conductor and app callers stay on"approval"and still go through the approval challenge. - The
x-brilliant-actorheader is trusted only behind the ops key. A canonical app must also present a matching signed agent identity, and the actor’s role comes from the membership row, never the header. - Not covered yet:
deleteAgentand the proxy write itself don’t take the proof yet; that’s #676. - Unchanged for product callers: the PR test plan checks that owners/admins can still delete agents, decide grants and edit custom integrations (members can’t), the member who created a workspace connection can still assign it, a read-write agent or workflow can still proxy a write while a read grant gets
access_denied, and conductor writes still hit the challenge. New test:test/proofs-held.test.ts(also coversisTenantAdmin).
Store writes demand the authorizing proof: phase 5 (#682, merged)
Merged 2026-10-08 22:13 IDT by yoni-monday (merge a6f3e55d, branch yonibr/gdp-ts-store, head dcdcb6f6, 3 commits, +287/−31 in 16 files; opened 21:33 IDT). Continues phase 4 (#675) by moving the demand down to the store: the store methods that create memberships and apps, change tenant status, and change who can use an app now take the proof minted by the check that already allowed the write, so a route can’t call them with only raw ids. The new trusted module is apps/control-plane/src/proofs/writes.ts.
- Which methods demand what. On the
ControlPlaneStoreinterface:createMembershiptakesConsentedToJoin(accepting an invitation) orFoundedTenant;createApptakesTenantMemberorInternalAdmission;updateTenantStatustakesStaffAdmission;grantAppUser,revokeAppUserandupdateAppAccessPolicytakeCanManageApp. - Creating an app still needs only tenant membership. An active tenant membership is enough (no builder seat required), or, on the internal route, the ops key or public guard.
FoundedTenantis only the first membership.foundedTenantmints only when the person has no memberships yet, so the first studio login that creates a tenant still gets an owner membership, while someone who already belongs to a tenant can’t found a second one this way. The login callback (/auth/callback) checks the membership count before it creates the tenant row, so a non-zero count returns503 unavailablewithout leaving an orphan tenant behind; the proof names the new tenant, so it is minted right aftercreateTenant.foundedTenantdoes not make two concurrent first logins unique, since both can still read an empty membership list.CanManageAppis the tenant owner or admin, or the app’s creator.canManageAppmints from aTenantAdminproof or a matchingcreatedBy.- Staff and internal admissions come from the middleware that already checked.
staffAssertionnow callsadmitStaffand setsstaffAdmissionnext tostaff; staff suspend and resume (POST /admin/tenants/:id/suspend,/resume) pass it toupdateTenantStatusand return401without it.internalGuardcallsadmitInternal(ops key or public guard) and setsinternalAdmission, which internal app creation passes tocreateApp. Both are opaque frozen marker objects, not named proofs. - Impersonation still works. A proof carried on the input object passes through the impersonation store wrapper unchanged.
revokeAppUserkeeps its proof as its own third argument, so the wrapper now passes the staff email as the fourth. - The demand lives on
GuardedWrites. The proof-taking signatures are in their own interface,apps/control-plane/src/store/guarded-writes.ts, whichControlPlaneStoreextends, sostore/types.tsstays under the 600-line file-size cap (check-file-size). grantAppUser,revokeAppUserandupdateAppAccessPolicyhave no production caller yet. They still demandCanManageAppso the next caller can’t pass a raw id; deleting them is left for later (#676). The impersonation test now mintsCanManageAppthroughcanManageAppinstead of casting.- The proof is never stored. Only the interface demands it; code typed as the memory or Drizzle store class is unchanged, and stored columns are picked by name. The in-memory access-policy audit entry now records only
accessPolicy,allowedDomainsandseatCapinstead of the whole input. - Not covered yet: vault and secret reads,
deleteAgent, and the proxy write takingBindingWrite; #676 stays open for the last two. - Tests: new
test/proofs-writes.test.ts; the PR test plan also checks first-login tenant creation (auth-studio), internal app creation (internal), staff suspend/resume with403for a missing role and401for a bad assertion (admin), and impersonated access-policy updates still recording the staff email (impersonation).proofs/mistakes.tsgains lines checking that a membership is neither a staff admission nor app management.
Workers require the admission already checked: phase 6 (#685, merged)
Merged 2026-10-09 01:12 IDT by yoni-monday (merge 766f3261, branch yonibr/gdp-ts-workers, head 445f8bdc, 2 commits, +219/−113 in 19 files; opened 2026-10-08 22:48 IDT). Continues phase 5 (#682) on the worker side: filesystem, source paths, shell, the agent route, dev, warm, mcp run-script, deploy state, restore, and ops deploy/rollback open the workspace named by the builder admission. admittedWorkspace reads scope.environmentId from that admission, so dropping the check and still calling the stub does not typecheck. Gated conductor routes still need the same workspace gate as before; ungated routes keep the builder check they already run. The agents service forwards a thread only after the token carries thread:<id>. Workflow routes run only after the ops key or public guard. Dispatch already verifies at the sink, so it is not in this change. Strict mode stays off.
- Branded admissions on the conductor. New
services/conductor/src/proofs/admission.tsbrandsBuilderAdmittedandWorkspaceAdmitted(Symbol marks).sealBuilderAdmissionseals the builder check;admittedWorkspace(env, admission)replaces bareworkspaceStuband opens only the environment id on that admission.admitBuilderRequestinlib/builder-admission.tsnow returnsBuilderAdmission & BuilderAdmitted. - Workspace gate is the same checks, now a proof.
proofs/workspace-gate.tsholdsextractUserTokenandopenWorkspaceGate, which returnsWorkspaceAdmitted | nullusing the same rules as the oldisWorkspaceAuthorized: aws:<id>token,PUBLIC_GUARD, or bare local dev with neither configured.lib/auth.tsdelegatesisWorkspaceAuthorizedto that gate; preview importsextractUserTokenfrom the gate module. - Builder paths take the sealed admission.
routes/workspace.ts(fs, source paths, exec),routes/ops.ts(agent tools, deploy state, restore draft, deploy, rollback), plus agent, dev, warm, and mcp run-script calladmittedWorkspacewith the admission from the builder check. Session deploy opens that samescope.environmentIdafter refusing a path that does not match. - Global gate on gated conductor routes.
worker-routes.tsopens the workspace gate once for gated routes and returns401without it. Ungated routes that already returned above keep their own builder check and are not given that gate. Handlers do not take theWorkspaceAdmittedbrand (the old wrappers never put it on them), so those wrappers are gone. - Agents: thread forward needs
thread:<id>.services/agents/src/proofs/thread.tsaddsadmitThreadwith aThreadTokenbrand that requires the token to carrythread:<id>; the agent index uses that instead of callingverifyUserTokendirectly. - Workflows: internal caller before dispatch.
services/workflows/src/routes/guard.tsmakesauthorizeInternalreturnInternalCaller | Response; the router only dispatches after that gate. Health still answers with no credentials. - Still on bare
workspaceStub. The agent runtime’s publish admission is not the sealed brand, so that call still usesworkspaceStub. Other direct stub callers (destroy, templates, blobs, the dispatcher destroyed check, and similar) stay as they are — tracked in #692, closed by #706. Dispatch is unchanged. Strict mode stays off. - Type-checked mistakes.
services/conductor/src/proofs/mistakes.tsis never imported; it exists so a raw object is not assignable toBuilderAdmittedorWorkspaceAdmitted.knip.jsonincludes it as a conductor entry. - Tests: the PR test plan checks that a workspace token, the public guard, and bare local dev still authorize the same way; filesystem, shell, dev, warm, mcp run-script, and session deploy still reach the workspace (a foreign deploy script name is still refused); a thread token without the thread scope is
403while a matching token still forwards; workflow routes still refuse a missing key and accept the ops key.
A workspace opens only from a check that named it (#706, merged)
Merged 2026-10-09 09:42 IDT by yoni-monday (merge 9d47286e, branch yonibr/gdp-ts-opened-workspace, 3 commits, +391/−182 in 26 files). Fixes #692 and finishes phase 6 (#685): the conductor opens a workspace only from an id a check already accepted, meaning the workspace gate, a builder admission, an operator check, the container host's intercept id, a published snapshot after it matches the path, or an init scope that already matched the route.
workspaceStubis implementation only.opened-workspace.test.tscounts every spelling ofworkspaceStub,unboundWorkspaceandsealOpenedWorkspaceper file, so a renamed dynamic import or a second mention in an allowlisted file fails the test.- Three raw-id reads remain, all before a brand can exist: loading the environment inside builder admission, the same read for a published snapshot (the brand is minted after the scope matches), and a caption queue message naming the workspace the upload already authorized.
- Session deploy. Uses the sealed builder admission when it admits the request itself; when the agent runtime passes a publish admission, the stub follows that admission's environment id after the existing mismatch refusal.
- Follow-up:
sealOpenedWorkspaceis still exported; minting it only insideproofs/is tracked in #711. - Tests: auth, filesystem, shell, dev, warm, blobs, images, captions, published artifacts, template claim, deploy and the container AI proxy pass. A live staging
/w/:id/fscheck was not run.
Vault reads, agent deletes and proxy writes need a proof (#713, merged)
Merged 2026-10-09 15:49 IDT by yoni-monday (merge 2da76bed, branch yonibr/gdp-ts-binding-writes, +384/−60 in 19 files). Refs #676 but does not close it; the rest of #676 and the concrete-store bypass are #718. No behavior change on paths that already passed the check.
- Vault open. Opening a vault credential takes
CanUseBinding, minted from an active binding or from a pending connection the same user created. A proof for a different connection is refused. - Agent delete. Takes the tenant-admin proof on the input. Impersonation rewrites the actor, not the proof (member gets
403, admin can delete). - Proxy write. Takes the grant (
BindingWrite) or a stamp from the check that allowed it: a verified approval challenge, the agent-write flag, or an app caller. The stamp names that binding. Reads stay read-only. - Tests: vault seal/open (including a foreign-connection proof), direct connect, direct proxy, proxy approval checks and agent delete pass. A live staging check was not run.
Proofs at the class, the held row and the write (#734, merged)
Merged 2026-10-10 10:19 IDT by yoni-monday (merge 3558423c, branch yonibr/gdp-ts-proofs-reach, +621/−277 in 48 files). Refs #718 and extends #713.
- Admin thread list. Takes the admin proof the route already minted. A member still sees only their own threads. Listing a tenant's vault keys is unchanged when that proof is non-empty.
- Held row. A row counts as in the tenant only as the value the tenant check returns, and routes use that returned value, so skipping the check no longer leaves the original row usable.
- Class-level proofs.
grantAppUser,revokeAppUserandupdateAppAccessPolicyrequire the management proof on the concrete class, not only the interface (nothing in production calls them; sharing writes a different table).deleteAgentrequires tenant admin and deletes only when both the id and the route's loaded tenant match; a mismatch deletes nothing. - Vault and writes. Vault reads refuse a proof that does not name that connection. The three write sinks refuse a stamp for a different binding before reaching the transport, the vault or Composio. Binding mints take the loaded row, and a bare
{ status: "active" }literal no longer typechecks. - Tests: tsc, gdp-lint, knip and file-size pass, plus proofs-held, vault/connect/proxy, custom integrations, members, seats, threads, agent routes, grants and impersonation. A live staging check was not run.
Related
- Share & Invite / Projects: the studio UI design from #445
- Merged #1017: User invite
dataRole: own, explicit View only role — section below / Share & Invite - Template & app data, Dispatch & published apps, Conductor, Control plane
- Secrets & environments, Verify & ship
- Glossary
API reads and cursor pagination (#691, merged)
#691 "Optimize API reads and roll out bounded cursor pagination" merged 2026-10-09 14:08 IDT by yoni-monday (merge aa44d3ca, 80 files, +2931/−645). It's one slice of the wider read optimization; the rest is tracked in #722.
Rules that landed
- List endpoints are bounded and cursor-paged: the tenant/ACL predicate runs first, then a tuple seek on the sort key, then
LIMIT n+1to decide whether to return a scopednextCursor. Timestamp-only cutoffs are gone, so rows with tied timestamps are no longer dropped. An invalid cursor answers 400. - Cursors are query keys, never authorization. Tenant and ACL filters always apply before the limit.
- Authority snapshots are complete: the principal is joined fresh and the authority snapshot is read in one consistent statement. They are never paginated and never cached as eventually-consistent truth. Never cache membership, grants, visibility, credentials or authority.
- Integration connection views are batched (206 enriched connections in 4 statements); runtime direct resolution is 1 statement with no display statistics. Internal tools get the complete list.
- Thread activity history is incremental and uses immutable creation order; the studio Activity UI follows the cursor (not a
beforetimestamp) and hides the pager when done. - Also fixed: aggregate usage int32 overflow (now bigint), partial thread/skill writes (now atomic), negative history limits, and wrong latest-deployment summaries.
- New indexes support these reads. If a concurrent index build is interrupted, the migration runner now refuses the INVALID index and writes no ledger entry: repair the index, then retry; don't mark the file applied.
Measured (controlled local runs): authority snapshot 1491 ms to 92 ms, authority observation 1667 ms to 89 ms. This isn't a claim about every endpoint's production latency.
Owner decisions: incremental browsing and search-backed pickers instead of loading everything, no backward-compatibility requirement, and measure before adding any environment-isolated derived-statistics cache.
User invite default data role is add-and-edit-own (#1017, merged)
PR #1017 (Brilliant Fixer / monday-sphera-ai[bot]; merged 2026-10-19 08:16 IDT / 2026-10-19T05:16:21Z by yoni-monday, merge 0bed6bed, head fe6363dd, 8 commits, +355/−87 in 28 files) makes DEFAULT_INVITATION_ROLE in @brilliant/service-contracts/permissions "own" instead of "view", and adds View only as an explicit studio role.
| Path | dataRole written |
|---|---|
| Invite as User or Builder | own (add and edit their own) |
| Invite as View only | view |
| Role change into View only | view |
| Role change out of View only (to User or Builder) | own |
| Any other role change | unchanged (builder override only) |
| App Everyone at account, newly opened | own; re-saving an already-open app keeps its role |
| Project Everyone at account, User/Builder | keeps own/all; add or unset becomes own |
| Already-invited people and pending pre-deploy invitations | stay on what they had (usually View), shown as View only |
own matches the runtime role table's Add and edit their own row and the role signed-in link visitors already get. DATA_ROLE_LABEL (View only, Add only, Add and edit their own, Edit all data) and offeredAppAccess now live in service-contracts, shared by the studio, the invitation page and the invitation email.
Studio/UI detail: Share & Invite — User invite data role. Symptom: Troubleshooting.
App data page direction (design, 2026-10-19)
Brilliant Daily, 2026-10-19 (Amichay, Dan), Slack #brilliant-ai ts 1792398743.018189. Design direction, not on main yet:
- Use one term for app data in the UI, either databases or tables.
- Show records as a full table (compare today's Settings › Data records table).
- Default: all users can do everything. Per-table and per-role permissions become an advanced layer, added gradually, on top of today's per-person data roles (#1017).
- Cross-app data golden flow starts from the consuming app ("save responses to <app>"), not from the app that owns the data.
Open: the access-control model still has to be aligned with how it is built today (Amichay with Yoni), and the cross-app connect flow is still to be designed (Dan). Decision record: Product & growth decisions.