Repository navigation
Phase 6: Projects — team-first access control - #65
Merged
Merged
Conversation
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
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
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
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
… 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
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
…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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every dataset, baseline, model, endpoint, notebook job and connection-to-be now belongs to a project, and every person has a personal space.
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)..pandas(),rf.projects()anduse_project./p/<slug>/URLs, project home (members, requests, notices), Move/Share dialogs, admin People/Projects/Audit.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