Skip to content

Phase 6: Projects — team-first access control - #65

Merged
LikelyCause merged 109 commits into
mainfrom
phase-6
Nov 15, 2026
Merged

LikelyCause merged 109 commits into
mainfrom
phase-6

Conversation

@LikelyCause

Copy link
Copy Markdown
Owner

Every dataset, baseline, model, endpoint, notebook job and connection-to-be now belongs to a project, and every person has a personal space.

  • Roles per project: owner, contributor, reviewer, viewer; instance roles are admin and member. Memberships can end on a date. Open and private projects; private names never reach non-members. Admins manage people and projects but never open a private project's contents (no break-glass).
  • Sharing and moving: a dataset or finalized baseline can be shared read-only into another project; borrowers always read the finalized snapshot, and their derived work stays readable after a revoke ("no longer shared"). Moves are journaled and reconciled after a crash.
  • Enforcement: one access module (loaders, list filters, target project), Postgres row-level security on every meta.* table and dataset table as the backstop, a lint guard that fails when code reads around access, and a route matrix that calls every route as every persona (including a private project, an admin outsider, a notebook token and a serving key).
  • SQL console: rebuilt on DuckDB over the caller's own Parquet only (no file, network or extension access).
  • Notebooks: a Lab mounts only its user's projects; losing access warns, then restarts the Lab and cancels its runs; the client gains .pandas(), rf.projects() and use_project.
  • UI: project switcher and /p/<slug>/ URLs, project home (members, requests, notices), Move/Share dialogs, admin People/Projects/Audit.
  • Migration 041. No backward compatibility: deployments are reinstalled fresh.

Every task was reviewed (security-heavy ones on the most capable model) and fixed before it counted as done. Full API suite: 2,439 passed; UI unit tests 547 passed; client 66; chart 228.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS

LikelyCause and others added 30 commits November 15, 2026 09:17
Migration 041 adds projects, memberships, shares, join requests, notices and the audit log, a project_id on every
top-level table, personal spaces, the rf_* scope functions and one row-level-security policy per meta table. The pool
connects as the non-owner app role and db.connection() pushes the request's scope into the session. Instance roles
become admin and member; auth computes access.Scope per request; Me carries personal space and projects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
…plit, shares and memberships guarded

Drops every older meta policy (the *_public ones were permissive and leaked), splits each table into rf_read and share-free
write policies, restricts shares/projects/memberships writes to owners, revokes TRUNCATE on meta, creates a missing
personal space, and adds tests for each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
…space slug fallback, list_filter prefix

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
…scope datasets

- console.py: one in-memory DuckDB connection per query, a view (ds_<id> and an alias) over the Parquet of each
  dataset the caller can read, external access off and configuration locked; one SELECT only; timeout, memory
  and row limits; GET /api/sql/tables, /api/sql/examples, POST /api/sql.
- ingest.create_raw_table: rf_access policy on every raw table, forced after the COPY (Postgres refuses COPY
  FROM into a table with row-level security on).
- duckdb 2.0.0, SQL_MEMORY_MB through config, Compose, .env.example, docs and chart.
- Chart: the read-only Secret key and env are gone; smoke.sh's console step queries ds_<id>.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
…more refusal tests, PIVOT message, HTTP tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
…(formatting)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Every project page moves under /p/<slug>/ (all is the cross-project view); links go through usePaths(),
the client sends X-Rainforest-Project from the page's slug, list keys and hooks take the slug, and
can() becomes canIn(role, action) with roleOf() counting a borrowed object as viewer. Contract types,
the projects API client, a fake projects API for the fixtures and gallery, and live stories.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
…arry the slug

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
…admin routes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
…, role-change owner check, committed projects test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
… General, a personal space)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
…dataset with the project

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
… stream re-reads the scope

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
LikelyCause and others added 29 commits November 15, 2026 11:20
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
…ole-gated routes

PATCH, activity, join requests (list, grant, decline) and shares of a private project answered an admin who is not in it
with "You need the <role> role in <name>", naming a project the admin may only see the summary and members of. They now
answer the same 404 as everyone else; GET the project and its member routes still show an admin what the owner's rule
allows. Found by the route matrix.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Every route of the API and the serve process, as an outsider, an admin outside both projects, and a viewer, reviewer and
contributor of an open project, against a table kept beside it (a route without a row fails). A private project is hidden
from everyone outside it, an admin never adds themselves, a Lab's token reaches no admin route, a serving key reaches only
its own endpoint, and no list names a private project to a non-member. The lint test's PENDING allow-list is gone.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
…s 422, replay parks formats), chart tests match the values, smoke names a project

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
…n place of OPEN cells, every notebook-refused route, owner rows run, vault admin pages and ?project= filters

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
… wording)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
…w fields

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LqNnEU86Q4fmrJnN2rXovS
@LikelyCause
LikelyCause merged commit 569c62d into main Nov 15, 2026
7 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