The schema-side index of every upstream commit affecting dev's migrations, newest-first, recording APPLIED / SKIPPED / DEFERRED / NOT-APPLICABLE with reasoning from May through June 2026. Recurring divergences: upstream's schema.sql is always REJECTED (dev's numbered 0000–0015 are the source of truth), RLS/anon grants are stripped (authz is app-layer), auth.users FKs become plain Entra-oid text. Records why mfa_on_login and title_model were skipped, and the deferred-drop "run everywhere then verify" rule. Running an upstream sync, or wondering why a migration looks the way it does.
Upstream sync log
A running record of every upstream commit that affects dev's schema, with the per-decision reasoning. Future syncs append entries here so we can reconstruct why dev's migrations look the way they do.
This is dev's complement to MikeMigrate/notes/upstream-sync/*.md. The
notes file records the full per-migration narrative (cherry-pick state,
conflicts, application changes); this log is the schema-side index.
Read order: newest entry on top.
2026-06-12 — upstream 1fa0554ea519bd164f7c43ae8b5824842b130877
Subject: "Refactor ProjectPageParts and ProjectPageHeader components ..." (PR #178 bundle: soft-deleted document versions, legal-research feature flag, LLM adapter rework, UI refactors)
Schema changes upstream made (schema.sql + oss-migrations/20260610_soft_deleted_document_versions.sql):
document_versions.storage_path→ nullable; newdeleted_at/deleted_bycolumns; partial indexdocument_versions_active_document_id_idx (... where deleted_at is null)— soft-delete tombstones for version files.user_profiles.legal_research_us boolean not null default true— Features > Legal Research > Jurisdiction > US toggle (gates CourtListener tools in chat viagetLegalResearchUsEnabled).- (Carried
quote_model/mfa_on_loginagain — both remain skipped per the 44e868e and 3a10943 entries.)
Decision: APPLIED (both deltas).
0000_initial.sqlupdated for fresh databases; new0009_soft_deleted_versions_and_legal_research_flag.sqlfor existing databases (adapted from upstream's oss-migration; no Supabase-only content in this one).- Backend/frontend wiring for
legal_research_usadapted into dev's idiom: GET/PATCH/user/profilein dev's route shape,updateLegalResearchUsin dev's UserProfileContext; upstream's PROFILE_SELECT fallback cascade not adopted (dev applies migrations at deploy and selects the column directly, matching the fast_model/0004 precedent).
2026-06-12 — upstream 3a109432000f97b636ddbcd8c2f267461cde030c
Subject: "feat: implement multi-factor authentication (MFA) setup and verification flow"
Schema changes upstream made (schema.sql + oss-migrations/20260606_oss_schema_diff.sql):
user_profiles.mfa_on_login boolean not null default false— user preference for upstream's Supabase Auth app-level MFA login gate.
Decision: SKIPPED.
- Dev did not adopt app-level Supabase MFA (the feature this column
serves). Dev's production auth provider is Entra, where MFA/step-up is
enforced by the identity provider (Conditional Access), not application
code; Supabase Auth MFA APIs (
auth.mfa.*, factor enrolment) have no equivalent on dev's other providers. Inline divergence comments at the rejection sites in0000_initial.sql, backend/src/middleware/auth.ts, andbackend/src/routes/user.ts. - The rest of the commit (user data export/cleanup libs + routes, safeError log redaction) is schema-neutral and WAS adopted.
2026-06-12 — upstream 44e868eb4235b131dd3f3169042e5436ce792a7a
Subject: "Add courtlistener intergration, liquid glass redesign, UI improvements, version control, various fixes"
Schema changes upstream made (schema.sql + oss-migrations/20260606_oss_schema_diff.sql):
user_profiles.title_model,user_profiles.quote_model— new model preference columns.user_api_keysprovider check widened withopenrouter,courtlistener.- Document metadata moved:
documents.filename/file_type/size_bytes/ page_count/structure_treedropped;document_versionsgainsfilename/file_type/size_bytes/page_count, losesdisplay_name. - New
courtlistener_citation_index/courtlistener_opinion_cluster_indextables + indexes; Supabase anon/authenticated revokes for them.
Dev decisions:
- title_model / quote_model: skipped. Dev's
fast_model(0004) covers the lightweight-task preference; nothing reads quote_model. Inline comment at the rejection site in0000_initial.sql. - Provider check: applied + extended. 0008 swaps the constraint to
dev's full set (upstream's five +
azure_openai); 0006's CREATE updated for fresh installs. - Credential ownership: intentional Azure divergence. Upstream Mike is a
multi-user/multi-tenant service and allows users to store personal provider
keys. MikeOssAzure is one customer-owned deployment shared by that
organisation's users: Anthropic, Gemini, Kimi K3, OpenAI, OpenRouter,
CourtListener, and Azure OpenAI credentials are therefore organisation-owned
Key Vault values configured by an administrator through
/install. Kimi K3 uses the canonicalmoonshot-api-keysecret. The encrypteduser_api_keysmachinery remains for upstream compatibility and rollback, but Azure user-facing write routes returnorganisation_api_key_required; do not re-enable personal provider-key UI during a future upstream sync. User-created MCP connectors remain per-user. - Document metadata move: applied with deferred drops. Fresh schema
(0000) follows upstream; 0008 adds the
document_versionscolumns and backfills fromdisplay_name+ the parentdocumentsrow (adapted from upstream's oss-migrations file), and relaxesdocuments.filenameNOT NULL. The actual column DROPs (documents legacy metadata columns, document_versions.display_name) are DEFERRED to a follow-up migration per the §4.3 rule — run 0008 everywhere and verify before landing the drop. - CourtListener tables: applied (0000 for fresh, 0008 for existing); the anon/authenticated revokes were NOT ported (no Supabase roles on dev — see 0005_postgres_roles.sql).
- Upstream's backend/oss-migrations/20260606_oss_schema_diff.sql lands
in dev's tree verbatim via the cherry-pick as upstream documentation;
dev's migration runner only executes
backend/migrations/000X_*.sql.
2026-06-12 — upstream 4f3384334a01fa0e759a964e7569e7b9ff207f01
Subject: "Update document UI, tabular reviews, and storage caching"
Schema changes upstream made (in upstream's backend/schema.sql):
tabular_reviews.document_ids jsonb— explicit per-review document membership (replaces inferring membership from cells / project docs).
Dev decisions:
- Applied. Git's rename detection auto-merged the column into
0000_initial.sql(fresh installs);0007_tabular_review_document_ids.sqladds it idempotently for existing databases. Backend usage inroutes/tabular.tsauto-merged cleanly and falls back to the legacy cell-derived membership when the column is NULL.
2026-05-13 — upstream f39f175273e398ffa4781b7c4a604bec6de3126e
Subject: "Sync deployment and project page fixes"
Schema changes upstream made (in upstream's backend/schema.sql):
Removal only — upstream deleted all RLS policies, the
current_user_id_text() / current_user_email() /
email_is_shared() / project_is_accessible() helper functions, and
the enable row level security statements (~708 lines), replacing
them with a comment that authorization is now enforced by the backend
verifying the user's JWT.
Decisions for dev:
| Item | Decision | Rationale |
|---|---|---|
| RLS removal | NOT APPLICABLE (nothing to do) | Dev's numbered migrations never contained RLS, and dev's authorization has been app-layer (backend/src/lib/access.ts) since the fork. Upstream has converged on the model dev already uses. No numbered migration is needed; there is no applicable schema delta. |
(Sync branch: upstream-sync/mikeOssOrig-f39f175; full narrative in
MikeMigrate/notes/upstream-sync/mikeOssOrig-f39f175.md.)
2026-05-08 — upstream ba6f7711449de47bd25cad7ac21bdc2a53355963
Subject: "Sync security and backend profile updates"
Schema changes upstream made (in upstream's backend/schema.sql):
- Removed two columns from
user_profiles:claude_api_key textgemini_api_key text
- Added new table
user_api_keyswith AES-GCM at-rest encryption (encrypted_key, iv, auth_tag), provider check (claude | gemini),unique(user_id, provider). - ~600 lines of Supabase RLS policies and
auth.uid()/auth.jwt()helper functions covering most public tables.
Decisions for dev:
| Item | Decision | Rationale |
|---|---|---|
Upstream's backend/schema.sql file |
REJECTED | Dev uses numbered migrations as the source of truth (see MIGRATION_KNOWLEDGE.md §2.2). Never import upstream's schema.sql — it would drift from the numbered migrations. |
New user_api_keys table |
APPLIED (with adaptation) — see 0006_user_api_keys.sql. |
Encryption-at-rest for provider keys is a clear security win. Dev's adaptation: no auth.users FK, no RLS (access control in app layer), provider check extended to dev's 4-provider set (`claude |
Removal of claude_api_key, gemini_api_key from user_profiles |
DEFERRED to a follow-up migration after the one-shot data move | Dev has user data in these columns (and also openai_api_key and the four azure_openai_* columns added in 0003). They get emptied by backend/scripts/migrate-user-api-keys.ts (run after this migration), and dropped by a 0007_drop_legacy_provider_keys.sql only after the script has been verified. |
RLS policies + auth.uid()/auth.jwt() helpers |
NOT APPLICABLE | Azure Postgres has no auth.uid(). Equivalent intent (per-user/per-share access scoping) is enforced in backend/src/lib/access.ts at the application layer. Existing dev migrations (0000_initial.sql's TODO(entraid) headers, 0005_postgres_roles.sql) already document this divergence. |
Application changes that accompany the schema work (separate commits
on the migration branch upstream-sync/mikeOssOrig-ba6f771):
backend/src/lib/userApiKeys.ts— encryption library (Key Vault primary, env-var fallback for local dev only; AES-256-GCM; supports all 4 providers; serialises Azure OpenAI's compound shape).backend/scripts/migrate-user-api-keys.ts— one-shot script that reads every user's plaintext provider keys, encrypts them, inserts rows intouser_api_keys, andUPDATEs the legacy columns toNULL. Idempotent — re-running sees no rows to migrate. Wired asnpm run migrate:user-api-keys.- Refactor of
backend/src/lib/userSettings.ts,backend/src/routes/user.ts,backend/src/routes/diagnostics.tsto read provider keys viauserApiKeys.getApiKey(...)instead of selecting plaintext columns.routes/user.tsno longer returns plaintext keys to the client — it returns{configured: bool}per provider (security improvement beyond upstream's scope). - helmet + per-route rate limiters in backend/src/index.ts (taken from upstream's same commit — applied in a separate logical commit on this branch).
Process to drop the legacy plaintext columns (separate, later commit):
- Ensure
0006_user_api_keys.sqlhas been applied in every environment. - Run
npm run migrate:user-api-keysin each environment until it reports zero rows remaining. - Land
0007_drop_legacy_provider_keys.sql:alter table public.user_profiles drop column if exists claude_api_key, drop column if exists gemini_api_key, drop column if exists openai_api_key, drop column if exists azure_openai_endpoint, drop column if exists azure_openai_api_key, drop column if exists azure_openai_api_version, drop column if exists azure_openai_deployment;
- Audit
git grepfor any remaining references to those column names before merging step 3.
9a1277b — MCP connectors + by-date migration reorg + overview RPCs (2026-06-17)
Upstream 9a1277ba99cbd7dfae77e5b882e5cef8521fca2f ("refactor: add table
primitive and migrations by date; feat: add mcp connectors"). Migrated on
branch upstream-sync/mikeOssOrig-batch-20260617. Full narrative:
MikeMigrate/notes/upstream-sync/mikeOssOrig-batch-20260617.md.
REJECTED
- The entire by-date migration reorganization. Upstream replaced its
numbered/loose migrations with ~38 date-prefixed files
(
backend/migrations/20260419_*.sql…20260615_*.sql). Every one wasgit rm'd from the cherry-pick — dev uses numbered migrations 0000-0009 and must not carry date-based files beside them. Everything dated <= 20260611 is already represented in dev's 0000-0009. backend/schema.sql(+393 in upstream). Dev deleted schema.sql long ago (§2.2); the modify/delete conflict was resolved keeping ours (deleted). All schema.sql changes rejected.
APPLIED — new numbered migrations (re-authored in dev's style)
| dev migration | from upstream date-migration | notes |
|---|---|---|
0010_user_mcp_connectors.sql |
20260613_04_user_mcp_connectors.sql |
auth.users FK → plain text user_id; RLS + anon/authenticated grants stripped (app-layer authz) |
0011_mcp_connector_oauth.sql |
20260615_01_mcp_connector_oauth.sql |
same divergences; adds OAuth columns + oauth_states table |
0012_chats_overview_rpc.sql |
20260613_01_chats_overview_rpc.sql |
plain SQL function, p_user_id text; wired by GET /chat |
0013_projects_overview_rpc.sql |
20260613_02_projects_overview_rpc.sql |
wired by GET /projects; replaces dev's hand-rolled shared_with + N+1 counts |
0014_tabular_reviews_overview_rpc.sql |
20260613_03_tabular_reviews_overview_rpc.sql |
wired by GET /tabular-reviews |
0015_workflows_overview_rpc.sql |
20260613_05_workflows_overview_rpc.sql |
wired by GET /workflows; shared_by_name from user_profiles.display_name (NOT auth.admin — dev divergence) |
None of the 4 overview RPCs were deferred — each is consumed by a backend
route adopted in this sync. All RPCs verified against dev's schema:
projects/chats/tabular_reviews/workflows.user_id and
workflow_shares.shared_by_user_id are text (compared to p_user_id
directly); user_profiles.user_id is uuid (cast to text for joins). No
column adaptation was required.
Schema items considered and SKIPPED
- All
enable row level security/revoke ... from anon, authenticatedstatements in the MCP tables — Azure Postgres has no PostgREST anon/ authenticated roles; access is scoped by user_id inbackend/src/lib/mcp/{servers,oauth}.ts. - All
references auth.users(id)FKs — replaced with plain text user_id columns (Entra oid).
Sync batch 2026-07-20 (mikeOssOrig PR#206 — a5fe6d6 + 82dcaef)
Branch upstream-sync/mikeOssOrig-batch-20260720. This batch adopted the
BACKEND of PR#206 (chat/* refactor, backend excel+ppt text extraction,
userLookup helpers) and DEFERRED the frontend + the workflow-sync engine as
a coherent unit (frontend is OSS-5-scale un-portable; see the migration notes
notes/upstream-sync/mikeOssOrig-batch-20260720.md).
a5fe6d6 — schema
backend/schema.sql— modify/delete conflict resolved keeping dev's deletion (§2.2). All schema.sql changes rejected.0015_workflows_overview_rpc.sql— cherry-pick auto-modified it via rename-detection against upstream's20260613_05; RESTORED to dev's version. Dev keeps its is_system-column overview model.- DEFERRED —
workflow_metadata(upstream20260625_01): would addlanguage/jurisdictionscolumns, set defaults, backfill, AND rewriteget_workflows_overviewto DROP theis_systemcolumn model (system workflows move to repo metadata). That rewrite is INCOMPATIBLE with dev's keptworkflows.ts/0015 (which filterw.is_system = false). Deferred as one unit with the workflow-sync engine + frontend workflow modals. Not a no-op — a real future reconciliation (like OSS-5 for ProjectWorkspace). SUPERSEDED by OSS-6 — applied as0040_workflow_metadata.sql(see the OSS-6 section at the end of this log). - DEFERRED —
workflow_open_source_submissions(upstream20260629_01): submissions table for the open-source workflow feature whose route (workflows.ts engine) + frontend are deferred. Adding an orphan table for deferred code would be speculative; deferred with the feature. SUPERSEDED by OSS-6 — applied as0041_workflow_open_source_submissions.sql.
82dcaef — schema
| dev migration | from upstream date-migration | decision |
|---|---|---|
| — | 20260703_01_user_profile_email.sql |
Pattern A (no-op). Dev's 0002_user_profile_email.sql already adds user_profiles.email + a lower(email) index. Skipped: the update ... from auth.users backfill and handle_new_user() trigger (Supabase auth.users — dev is Entra, email populated by middleware upsertUserProfile), and the extra UNIQUE lower(email) index (dev's non-unique index suffices; enforcing uniqueness on existing data is an out-of-scope behavioral change). |
0017_project_practice.sql |
20260703_02_project_practice.sql |
APPLIED (additive). Adds projects.practice text and the practice field to get_projects_overview. Re-authored from dev's 0013 (identical structure minus practice); no Supabase coupling. Forward-compatible: dev's kept projects.ts create path does not yet write practice (that path is coupled to the deferred ProjectPracticeField frontend), but the column + RPC field stage it cleanly. |
0018_chat_message_citations.sql |
20260704_01_chat_message_citations.sql |
APPLIED WITH ROLLOUT COMPATIBILITY (required). Adds citations and backfills it from annotations, while retaining and synchronizing the old column. The upstream hard rename would break the still-running v0.3 backend during migrate-before-promote and make rollback lose citations written by v0.4. Dev deliberately keeps both interfaces until the old revision is retired. |
0020_chat_message_citations_compatibility.sql |
— | LOCAL REPAIR MIGRATION. Reapplies the additive/backfill/trigger contract under a new migration number so environments that already recorded the earlier hard-rename form of 0018 are repaired; fresh upgrades are already safe when 0018 runs. |
Removed all upstream date-named migration files after translation. Backend
build (pnpm run build = tsc) passes with these migrations' consuming code.
Sync batch 2026-07-20 chunk 2 (mikeOssOrig PR#215/#216 + readme)
Branch upstream-sync/mikeOssOrig-batch-20260720 (continued). Chunk 2 SHAs:
f0b90ab, 1d61634, f5abbac, 81590ea, 9eb63ef. Same policy as chunk 1:
adopt separable backend, keep dev's frozen frontend (deferred to the future
frontend PRD). See notes/upstream-sync/mikeOssOrig-batch-20260720.md.
f0b90ab — schema (Library feature)
| dev migration | from upstream date-migration | decision |
|---|---|---|
0019_library_documents.sql |
20260710_01_library_documents.sql |
APPLIED (additive, required by new backend route). Adds the personal Library: new library_folders table (per-user, nestable via parent_folder_id, library_kind in ('file','template')), plus documents.library_kind (default 'file', NOT NULL, check constraint) and documents.library_folder_id (FK → library_folders ON DELETE SET NULL), and three supporting indices. REQUIRED by the new backend/src/routes/library.ts adopted in the same commit. |
- Divergence: dropped upstream's trailing
revoke all on public.library_folders from anon, authenticated;— theanon/authenticatedPostgREST roles don't exist on dev's Azure Postgres (§2.1/§2.2).user_idkept as plaintext(noauth.usersFK), matching every other dev table. Fully idempotent; no column drops (§4.3). backend/schema.sql— modify/delete conflict resolved keeping dev's deletion (dev doesn't track schema.sql, §2.2). Delta captured in 0019.- Backend adopted: new
routes/library.ts(+414; uses dev's existingcreateServerSupabasequery-builder,requireAuth/res.locals.userId,deleteFile,attachActiveVersionPaths/attachLatestVersionNumbers,singleFileUpload, and the now-exportedhandleDocumentUpload) wired in dev'sapp.ts(buildApp) under the/api-prefix convention — NOT upstream'sindex.ts, which dev has refactored to a bootstrap-only shim (Pattern B relocation). Auto-applied edits:documents.ts(exportedhandleDocumentUpload+libraryKind/libraryFolderIdoptions, library filtering, cross-library version-move rule),projects.ts(clearlibrary_folder_idwhen a doc is assigned to a project),tabular.ts(new PATCH rename-chat route),chat/prompts.ts(+reasoning-trace safety),systemWorkflows.ts(generated constants). - Post-review divergence — keep on future conflicts: upstream
f0b90abdeletes document-version blobs before deleting the correspondingdocumentsrows and suppresses the storage failures. That ordering can leave live database rows pointing at missing blobs when the later database delete fails. Dev intentionally deletes the scoped document rows first, then performs logged, best-effort blob cleanup. The conflict-site marker inroutes/library.tssays UPSTREAM BUG / KEEP DEV'S DB-FIRST ORDERING / DO NOT restore upstream's blob-first ordering; future syncs must preserve it. - Post-review privacy divergence — keep on future conflicts: upstream
f0b90abaddedlibrary_folderswithout adding the table to account export or account deletion. Dev includes the user's complete folder hierarchy in exports and deletes those rows after deleting documents. Conflict-site markers inuserDataExport.tsanduserDataCleanup.tssay UPSTREAM OMISSION / KEEP DEV; removing either correction makes exports incomplete or leaves user-owned folder names behind after account deletion.
f0b90ab / f5abbac — frontend
Deferred wholesale to the future frontend PRD (frozen-frontend policy). The
entire Library UI (icons, library/* pages, LibraryWorkspace, DocTable,
QuickActionsModal, liquid-surface components, etc.) plus f5abbac's document-
review-panel refresh build on the a5fe6d6/82dcaef doc-viewer + message/* +
liquid-surface architecture dev has NOT adopted. dev's frontend/ stays
byte-identical to dev HEAD.
9eb63ef — docs: update readme
Pattern A (kept dev's). Upstream edits its OSS product intro (marketing image
- "MikeOSS legal AI platform" blurb + a Supabase-Auth/Postgres + Cloudflare-R2
stack line). Dev's README.md is a deliberate Azure-fork rewrite
(
# MikeOSS.Azure, Entra + Azure Postgres + Azure Blob) and shares none of those lines — upstream's copy is inapplicable. Empty anchor commit.
Sync batch 2026-09-29 (mikeOssOrig)
562a8139 (PR #279) — schema: document_versions.content_sha256
Applied as 0038_document_version_content_sha256.sql (upstream's dated
20260731_01_... file renumbered; schema.sql not imported). Nullable text
column, idempotent (add column if not exists); legacy rows stay unhashed.
The signing key (MANIFEST_SIGNING_KEY) follows the KV-primary rule:
resolved from Key Vault secret manifest-signing-key at boot
(initManifestSigningKey), env var is the local-dev fallback.
5f996cf6 (PR #274) — folder-grouped tabular review rows
Applied as 0039_tabular_folder_rows.sql (upstream's dated
20260724_02_... file renumbered; schema.sql not imported). Adds
tabular_reviews.document_grouping, tabular_review_rows,
tabular_review_row_sources, tabular_cells.row_id (+ nullable
document_id) with an idempotent backfill of existing document rows.
enable row level security / revoke ... from anon, authenticated dropped
(dev has no such roles; access is enforced in lib/access.ts).
6ae1f98d (PR #274) — folder-grouped tabular review UX + library folders
Folded into 0039_tabular_folder_rows.sql (same file as 5f996cf6): adds
library_folder_id on tabular_review_rows, backfills row/source rows from
tabular_reviews.document_ids, then inserts pending cells for every row/column
and sets tabular_cells.row_id NOT NULL. RLS / revoke ... anon, authenticated / grant ... service_role omitted (no such roles in dev;
lib/access.ts is the authorization layer). Backend routes/tabular.ts is
row-keyed (row_id in regenerate-cell / clear-cells / SSE cell_update).
OSS-6 — adopt upstream's workflow engine (upstream @ 204d2d53)
Branch feat/oss-6-upstream-structure. Reconciles the a5fe6d6 deferrals
above (spec docs/prd/OSS-6/spec.md §3.1).
| dev migration | from upstream date-migration | decision |
|---|---|---|
0040_workflow_metadata.sql |
20260625_01_workflow_metadata.sql |
APPLIED (step A, contract-neutral). Adds workflows.language (default 'English') and workflows.jurisdictions text[] (default {General}), sets the practice default to 'General Transactions', backfills user rows with upstream's coalesce/trim, then drops and recreates get_workflows_overview returning language/jurisdictions and a constant false as is_system (no w.is_system = false filter). Divergences: drop column is_system NOT applied here (§4.3 — dropped later by 0043 once routes/workflows.ts stops reading it); drop column author, category omitted (dev never had them). Idempotent. |
0041_workflow_open_source_submissions.sql |
20260629_01_workflow_open_source_submissions.sql |
APPLIED (step A). Table + 3 indexes verbatim. enable row level security / revoke ... from anon, authenticated dropped (no such roles; access is the route's owner-only filter and lib/access.ts). submitted_by_user_id stays text, no FK (no auth.users). Idempotent. |
0042_workflow_legacy_ids.sql |
— (dev-only) | APPLIED (step D). Renames the three legacy system-workflow ids in hidden_workflows (builtin-cp-checklist → builtin-draft-cp-checklist, builtin-credit-summary → builtin-credit-agreement-review, builtin-sha-summary → builtin-shareholder-agreement-review), deleting the legacy row where the user already hid the current id (unique(user_id, workflow_id)). Historical chat_messages.workflow untouched (decision 6). Replaces the fa21ac8 aliases in contextBuilders.ts, now removed. Idempotent. |
0043_drop_workflows_is_system.sql |
20260625_01_workflow_metadata.sql (its drop column is_system) |
APPLIED (step E). Split out of 0040 per §4.3. Decision 5 default: owner-less is_system rows are deleted (code serves SYSTEM_WORKFLOWS), rows with a user_id are kept as ordinary user rows, then drop column if exists is_system. Header asks operators to run select count(*), count(user_id) from workflows where is_system before deploying to a database with data. is_system survives only as the synthesized response field in routes/workflows.ts / SYSTEM_WORKFLOWS. Idempotent. |
userDataCleanup.ts / userDataExport.ts now delete and export the user's
workflow_open_source_submissions rows (the a5fe6d6 NOT SUPPORTED markers are
gone).
- 9dbe9d59: 0048_word_addin_chats adds Word document/chat/message tables, indexes and cascading cleanup; text user ids retained. Supabase RLS/browser ACLs omitted; authenticated routes enforce user and document scope.
c5c0de9d — workflows, quick actions and reference assets
Applied upstream workflow tables and atomic default-install RPC as 0049; pack metadata as 0050. Text user IDs remain compatible with Entra. Mapped anon to web_anon while retaining service_role grants and restricting function execution. Upstream migration 03 repeats the nullable workflow foreign key already defined in 01, so needs no separate migration. schema.sql and Supabase stack tests remain absent.
8164db48 and 5140365c — user identity and project-sharing emails
- 8164db48: Upstream converts application user IDs to UUID and adds foreign keys to
auth.users. Dev retains Entra text IDs and has no Supabase auth schema, so the conversion, foreign keys, and corresponding RPC casts are inapplicable. No numbered migration was added. - 5140365c: Applied the legacy
projects.shared_withlowercase/trim/dedupe backfill as0051_normalize_project_sharing_emails.sql. The access, overview, export, audit, and project routes normalize input emails before indexed JSONB containment. Dev's existing query-error handling and private PostgREST JSONB encoding remain intact.
6a423ecc — assistant quick actions and directory navigation
Applied upstream's quick-action name and user visibility preference as 0052_assistant_quick_actions.sql: backfills existing names, removes tabular quick actions, and creates only assistant quick actions for new default workflows. The replacement install RPC keeps Entra text user IDs and grants only the private PostgREST service_role execute access; upstream auth.users casts and anon role were not imported. The SQL is idempotent; existing table grants from 0049 remain.
972cf22 — router selections and Vercel credentials
Applied 0053 ordered per-user router models and atomic replacement RPC using text identity, web_anon/authenticated revokes and service_role grants. Supabase auth.users/RLS omitted; routes enforce authenticated user scope. 0054 extends encrypted provider constraint retaining azure_openai. schema.sql not adopted.
f465ea32 / 57cf3b11 — serialize router selection replacements
Upstream 20260819_01 is 0055_harden_replace_user_router_models.sql in dev. The forward replacement retains text user IDs and the (text,text,text[]) signature, revokes PUBLIC/web_anon/authenticated RPC access, grants service_role, and serializes each user/router pair with hashtextextended(...,0) advisory transaction locking. 0053 remains unchanged; both fresh and existing deployments use numbered migrations. schema.sql remains absent.
-
92a54c23: 0056_quick_action_surfaces.sql adopts separate app/Word actions and default workflow seeding; text user IDs and web_anon/service_role grants, no Supabase identity primitives.
-
ff787c41: 0057_word_chat_edit_decisions.sql retains ownership-scoped atomic merge, text identities and real PostgREST role grants.
-
1c49b9f3: 0058_word_document_edits.sql adopts canonical edit rows, lifecycle constraints, indexes and service_role grants without Supabase RLS. Historical 0057 remains; no destructive column/RPC removal.
2ba234fd — application onboarding
0062_user_onboarding.sql adds jurisdiction, practice areas and versioned
onboarding to the existing text-ID user_profiles table. Existing rows become
version 0 only when the column is first introduced; new rows retain NULL until
completion (version 1). Replays do not exempt newer accounts. The upstream
auth.users trigger is omitted: authenticated middleware already seeds rows
without overwriting a user's chosen display name. No Supabase RLS or auth
schema is required.
c315896d — password capability
0063_password_capability.sql adds the password marker without querying
Supabase auth.users or installing its provider-specific RPC. The authenticated
Supabase-only application route writes the marker only after the provider's
admin API confirms the password update; an assertion from the browser cannot
set it. Entra/local modes do not advertise password management. Legacy
password state remains unknown until a verified operation, rather than being
inferred from linked identity metadata.
d6f3c169 — folder upload path resolution
0064_resolve_folder_upload_paths.sql adapts upstream's dated folder-path
migration to Dev's numbered schema. Both RPCs accept text user IDs, use
transaction advisory locks to serialize a project's or user's library path,
and return root conflicts before creating any folder. New suffixed roots can
reuse existing nested segments only within that resolved root. The HTTP routes
check project or library scope before invoking the private RPC. Execute is
revoked from PUBLIC, web_anon and authenticated and granted to service_role;
there is no Supabase auth schema, auth.users FK or user RLS.
3663a104–0648fbae — direct upload sessions
0076_upload_sessions.sql adapts the consolidated upstream schema after Dev's
durable queue migrations. Application user IDs and worker IDs remain text; the
session/file/resource IDs remain UUIDs. 0077_private_upload_claims.sql adds
8 MiB receipts, exact verification claims, expired-lease recovery and atomic
cancellation/cleanup for private Azure Blob. 0078_upload_processing_fences.sql
publishes a prepared document/version/reference result only under the current
job claim in the same PostgreSQL transaction as its file/job terminal state.
R2 uses size/type-bound signed PUTs; private Azure Blob uses authenticated
/api streaming parts rather than browser SAS. The service role alone can
invoke the new RPCs; web_anon/authenticated and PUBLIC are revoked. Each
completed or cancelled upload queues immediate and post-URL-expiry storage
cleanup. There is no Supabase auth schema, RLS or browser database access.
bdce4fe7 — organization access and legacy sharing
0083_organization_access.sql replaces the dated upstream schema with additive
organization/membership/override tables and role-aware access RPCs. Resource
owners remain TEXT while UUID profile principals are validated through the
application profile table; no Supabase auth schema or RLS is installed. The
service role alone receives the new table and function privileges.
0084_organization_legacy_sharing_backfill.sql copies valid legacy project,
review and workflow shares once, preserving later explicit roles on replay.
Legacy columns and data remain for a later verified cleanup. 0085_account_erasure_storage_paths.sql
keeps version and text-cache keys retryable after version/profile rows are
deleted; prefix cleanup checks surviving document-version claims so organization
bytes remain intact. All three migrations are idempotent on PostgreSQL 16.
54e66261 — server-owned streaming across Azure replicas
0097_server_stream_runs.sql replaces the upstream process-only Map as the
authority for run keys, owner fences, Stop, leases and Word tool-call routing.
Frames and Word tool arguments/results stay in volatile memory and travel
through an encrypted transient relay; only metadata is stored in PostgreSQL.
Assistant-row completion and ask-input event appends lock and verify the run
owner in the same SQL transaction as their write. Text user IDs and the
web_anon/authenticated/service_role grant boundary match Dev; no
Supabase auth schema or RLS is introduced.
6e3ef6fa — DOCX editor autosave compare-and-swap
Upstream #559 compares an editor save's expected content hash and the
version's storage path inside the upload worker, then swaps the row with a
PostgREST conditional update. Dev publishes uploads through the claim-fenced
finish_upload_processing_job RPC, so 0098_upload_replace_content_cas.sql
moves that comparison into the same transaction that publishes the
replacement. A lost comparison or a pre-publish hash mismatch completes the
file terminally as document_changed, queues only the losing upload's staged
objects for cleanup and never modifies the winning version. An RPC error
(uncertain outcome) cleans nothing. generate_pdf: false skips the eager PDF
rendition for editor saves; the previous rendition is still retired by the
normal replacement cleanup. Grants are unchanged: service_role only, with
PUBLIC, web_anon and authenticated revoked. No Supabase auth schema or RLS.
Upstream's schema.sql was not imported. Accept/reject edit resolution adopts
upstream's immutable new object plus conditional storage_path update.
2ec7cfc1 — unified connector settings and protected write actions (#566)
0099_connector_write_access.sql ports upstream 20261001_01, 20261002_01,
20261002_02, 20261002_03 and 20261002_05. 20261002_04 (drop
user_profiles.time_zone) is skipped: Dev never added that column; chat
requests carry the browser time zone as upstream intends.
Applied: connector read_only, Google enabled/disabled_tools/
require_write_approval, Drive grant_id/account_email, MCP OAuth
grant_id, the merged Google OAuth state table (google-drive provider),
reconnect-preserves-settings completion functions with text actor IDs and
transaction advisory locks, and service-role-only function grants (PUBLIC,
web_anon, authenticated revoked).
Diverged deliberately (keep during future syncs):
- No bulk re-enable of
requires_confirmationMCP tools. Dev has no record of whether a disabled tool was forced off or turned off by its owner; every disabled tool stays disabled until the owner turns it on. require_write_approvaldefaults totrue(upstreamfalse) on all three connector tables, and the backend treats only an explicitfalseas "no approval". Writes that previously needed human confirmation (MCP) or an approved proposal (Gmail/Calendar) still need approval after upgrade.- Gmail/Calendar grants that opted out of writes (
write_enabled = false) becomeread_only = trueonce, when the column first appears. - Recoverable data is retained:
google_drive_oauth_states(in-flight rows copied intogoogle_workspace_oauth_states) andgoogle_workspace_actions(pending proposals settled asrejectedwith an explanatory message; executing/uncertain rows untouched). Onlyclaim_google_workspace_actionis dropped. A later numbered migration drops both tables after the switch is verified in each deployment.
Upstream's schema.sql was not imported. No Supabase auth schema or RLS.
e38827e4 — workflow metadata backend-only access (#563)
Upstream 20260930_01_workflow_metadata_access.sql enables RLS with no
policies on default_workflow_installations and quick_actions, revokes all
from PUBLIC/anon/authenticated and grants select, insert, update, delete
to service_role. Dev already enforces the same backend-only model in
0049_workflow_restructure.sql (revoke from web_anon/authenticated, the
same service_role grant; PUBLIC holds no table privileges) and no later
migration re-grants those tables. No new numbered migration was needed.
Skipped: RLS enablement (dev has no RLS; access is app-layer plus role
grants), schema.sql, the Compose replay wiring and the Supabase stack test.
48df0f40 — user custom instructions
Upstream 20261002_06_user_custom_instructions.sql adds
user_profiles.custom_instructions text not null default '' with an
8000-character check constraint. Applied verbatim (idempotent) as
0100_user_custom_instructions.sql. The column inherits the existing
user_profiles table privileges; the backend reads and writes it through the
private PostgREST service_role path behind /user/custom-instructions.
Skipped: schema.sql and the Compose replay wiring.
d19fdc6d — user response style (first draft: one column per setting)
Upstream's first draft of 20261006_01_user_response_style.sql adds
response_verbosity, response_formatting and response_tone (text, default
'balanced', each with an enum-style check constraint). Applied verbatim
(idempotent) as 0101_user_response_style.sql; inherited user_profiles
privileges, no RLS. Upstream later rewrites its dated file in place to a
sparse response_style jsonb column that carries any draft-column values
across and drops the draft columns (8cc1ffcc, batch-20261009 unit 02). Dev's
numbered history is append-only, so that rewrite must land as a new numbered
migration that performs the same carry-over.
Skipped: schema.sql and the Compose replay wiring.
663d3b16 / 190f0a2f — user response language
Upstream 20261007_01_user_response_language.sql adds
user_profiles.response_language text not null default 'auto' with a BCP 47
tag-shape check. Applied verbatim (idempotent) as
0102_user_response_language.sql; inherited user_profiles privileges, no
RLS. Upstream's next commit 190f0a2f deletes that dated file while its code
still reads the column (the sparse-JSON rewrite that removes the column use
arrives in 8cc1ffcc). Dev keeps 0102: numbered migrations are append-only and
the code at 190f0a2f still needs the column. 190f0a2f is an empty anchor in
Dev; the 8cc1ffcc migration must carry response_language into the jsonb
column like upstream's draft carry-over.
Skipped: schema.sql and the Compose replay wiring.
8cc1ffcc — response style as one sparse JSON column
Upstream rewrites 20261006_01_user_response_style.sql in place: a
user_profiles.response_style jsonb not null default '{}' column (object, at
most 2000 bytes), a carry-over block that copies any non-default draft-column
value into the JSON and drops the draft column, and
merge_user_response_style(uuid, jsonb) (jsonb_strip_nulls(old || patch),
service_role only). Applied as 0103_user_response_style_json.sql with these
Dev changes:
- Append-only history:
0101/0102stay.0103carriesresponse_verbosity,response_formatting,response_toneandresponse_languageinto the JSON with upstream's rule (non-default values, keys not already present). The carry-over runs only in the run that createsresponse_style, so a replay cannot restore a draft value a user has since reset to the default. - The draft columns are not dropped (MIGRATION_KNOWLEDGE §4.3). The code no longer reads or writes them; a later numbered migration drops them.
- The function takes a text actor ID (
user_id::text = lower(p_user_id), as in the overview RPCs), EXECUTE is revoked frompublic,web_anonandauthenticatedand granted toservice_roleonly. The column inherits the existinguser_profilestable privileges. No RLS, no auth.users.
Skipped: schema.sql and the Compose replay wiring.
2f30082a — direct Mistral provider (user_api_keys provider constraint)
Upstream adds 20261007_01_add_mistral_user_api_key_provider.sql, which only
re-creates user_api_keys_provider_check with mistral so users can store an
encrypted personal Mistral key. Skipped, no numbered migration. Dev's
provider credentials are organisation-owned: saveApiKey refuses every
personal key write with 403 organisation_api_key_required, so no
user_api_keys row for mistral can be written. The Mistral credential is the
Key Vault secret mistral-api-key (vault-first via resolveProviderSecret,
MISTRAL_API_KEY local fallback), set by an administrator in /install. Do
not add the constraint migration unless Dev deliberately re-enables personal
provider keys.
Skipped: schema.sql and the Compose replay wiring.
cf5fa985 / f3fa62e6 — PDF text-layer detection (textless_page_count)
Upstream adds 20260927_01_document_version_textless_pages.sql (later renamed
20261002_06_…, 20261007_01_… and finally 20261008_02_… by merges
28a3e43f/6d1cb731/61337418, unchanged apart from the date). Applied as
0104_document_version_textless_pages.sql:
document_versions.textless_page_count integer(nullable; null = not measured: non-PDF files and versions created before 0104). No backfill.create_document_version= 0089's body plus the column, so copies of a version (project copy, workflow-asset copy, assistant edit batches) carry it.search_library_documents= 0046's Dev body (textuser_id, no::textcasts) plus the output column; dropped first because the return type changes.finish_upload_processing_job= 0098's body plus the column on the three version writes (document create, version create, version replace) and in the document-create result. Dev's worker (uploads.processing.ts) measures the count while it prepares the claim-specific objects and sends it in the payload; upstream instead writes it from its restructured processing functions, which Dev does not have.- Exact grants: all three functions EXECUTE for
service_roleonly (revoked frompublic,web_anon,authenticated). Before 0104,search_library_documentskept PostgreSQL's default PUBLIC EXECUTE; it is invoker-rights and only the backend (service_role) calls it.
Skipped: schema.sql and the Compose replay wiring.
d146998d / 4cc88fa3 — email change moves email-keyed grants (#603)
Upstream adds 20261007_01_email_change_moves_grants.sql (renamed
20261008_01_… by 4cc88fa3, header date only): handle_user_email_updated
on auth.users now moves project/chat/review grants and workflow shares from
the old address to the new one, keeping the stronger role on conflict, and
deletes them when the new address is empty. Applied as
0105_email_change_moves_grants.sql, adapted:
- Dev has no auth schema. The IdP email reaches
user_profiles.emailon every authenticated request (upsertUserProfile), so the trigger isuser_profiles_email_moves_grants(after update of email) callingmove_email_keyed_grants_on_profile_email_change()(security definer,search_path = public, pg_temp, EXECUTE revoked frompublic,web_anon,authenticated). - Dev sees an Entra rename lazily (at the account's next sign-in). If another profile already holds the old address, nothing moves: the grants stay with the address holder, as email-keyed matching already treats them.
- An empty new address moves and deletes nothing (upstream deletes).
- Any error rolls back the whole move and raises a WARNING; sign-in is never blocked by it.
- Upstream's mailer-autoconfirm
.env.example/Compose changes have no Dev file. The "confirmed email only" half of d146998d is application code (authorizationEmail, SupabaseemailVerified).
Also in 0105: finish_upload_processing_job (0104 body) checks workflow-share
editors with role in ('owner','editor') instead of the legacy allow_edit
column, which new shares never set (0083/0084 made role authoritative). The
publish-time recheck denied real share editors and could admit a legacy share
since downgraded to viewer. Grants unchanged: service_role only.
Skipped: schema.sql and the Compose replay wiring.
9c5ffa31 — Bedrock and Azure router credentials
Applied the provider constraint/settings delta as 0106_cloud_provider_key_settings.sql, retaining Dev-only Kimi and legacy azure_openai providers. No auth schema, RLS, UUID identity conversion, or schema.sql import. The legacy encrypted Azure JSON payload and SHA-256 encryption derivation remain intact. Bedrock and Azure Responses routers use awaited Key Vault-first deployment credentials; personal key write/settings requests remain refused. Existing aoai: Chat Completions deployment discovery remains supported alongside the upstream router IDs.
25779536 — provider expansion and enablement
Applied provider constraint expansion as 0107, preserving Kimi and azure_openai. Migration 0108 retains upstream legacy row enabled shape and adds a separate user_profiles.provider_enabled map with an atomic, service-role-only text-identity RPC. Provider switches mask only that user's centrally supplied credentials; no user-facing key writes or cross-user mutation. Applied cloud protocol/catalog interfaces with Key Vault-first credentials and retained the legacy Azure compound.
49efc046 — migration history integrity
Mapped upstream schema_migrations safety intent into 0109_migration_history_checksums.sql: extend canonical numbered public.pgmigrations with nullable checksums; revoke public/web_anon/authenticated access and all application writes/sequence use, retaining service_role SELECT for startup schemaCheck. New TypeScript operator wrapper uses node-pg-migrate and its existing lock/history, reports pending/drift/unverified records, and requires explicit bounded recovery. No second ledger, schema.sql manifest, automatic baseline or upstream Compose replay. Historical/manual rows stay unverified. Hashes are LF-normalized UTF-8 for portable Windows/Linux checks. Fresh/upgraded deployments keep the same numbered SQL and Azure/local completion steps.
-
d8eef26291cd0394c54b74763ffb54c5354044d1 → 0110_org_owner_role.sql: application owner tier; TEXT resource-owner RPC signatures; profile-erasure guard; private service-role grants.
-
e8be96a5a26fc72759174f19db373ccabfad1b5b → 0111_workspace_list_filter.sql: narrow existing access predicates by workspace; private service-role RPCs.
-
ec33d99109a4bb9b86c08d469b2f030fb7488ae5 → 0112_workspace_project_summaries.sql: appended workspace summaries RPC, leaving0111 immutable.
-
0e2b3c9439152c2953d18ab53c06db7cabada1c8 → 0113_org_private_by_default.sql: one-time historical visibility backfill; new work private, deny/share/creator rights preserved; application owner policy and SQL adopted together; TEXT resource-owner RPCs, private service-role grants.
-
cca3e01bd6eaed1ab6852375aa7c6db43b255f79 → 0114_public_private_list_scopes.sql: public/nonpublic list filters retain effective role/workspace narrowing, private service-role grants.
-
db8d42c3e894944e5783010780fc9ee4dbfcdd78 → 0115_org_api_keys.sql: owner-aware compatibility table/settings, private PostgREST grants, TEXT provenance. Managed central Key Vault credentials remain authoritative; API personal/org secret writes and personal opt-in explicitly refused, org settings read-only.
-
7a45bd0e47b24f8f64057a873a5db3c169378bc8 → 0116_org_router_models.sql: manager-authorized per-org model allowlists govern centrally credentialed org work; private table/RPC grants. Models permission is independent of refused credential editing.
-
943c1abb527505b29950781594d6bb30644e6901 → 0117_org_owner_private_access.sql: org owners inherit only public/ownerless content, never member-owned private work; app policy adopted together. Resource owner TEXT signatures/casts, private service-role grants.
-
d6356e310b1d15d385563b0b5ba152eec0b62927 → 0118_org_logos.sql: private provider-backed organization logos, object_key metadata only, owner/admin writes and member reads in application services, TEXT actor provenance, private service_role grants. Reuses existing Azure Blob/R2/filesystem StorageProvider; validates <=512 KiB PNG/JPEG/WebP bytes and cleans replaced/removed objects. No RLS/auth schema/schema.sql import.
-
3ca82155cd3ebc8f2b94215bcca178d79c808f12 → 0119_personal_organizations.sql: personal org uniqueness/backfill and profile-owned cascade; TEXT ensure RPC resolves supported UUID principal; Dev auth middleware initialization replaces provider auth trigger; private grants.
-
0b87767d2a8322bff6016c8f34665923a434d27d → 0120_standalone_org_content.sql: standalone team workspace filing with current-membership/privacy/retention rules; TEXT creator/chat/review RPC signatures; private service-role grants.
-
46b336ea11b343e1b76a759e26b84c40efb3a0a7 → 0121_member_handover.sql: complete successor transfer and private standalone departure cleanup; TEXT external-identity RPCs/comparisons with explicit supported UUID membership/provenance insertion; private grants.
-
b4146ed976ed4f7bcd6516ce4da604c288f40bff → 0122_workspace_memory.sql: per-user/workspace private memory and scoped scheduling/write/status fences; canonical TEXT actors/updated_by retained, profile init uses new.user_id. UUID membership/TEXT memory composite lifecycle adapted via locking membership guard plus same-transaction delete trigger; private RPCs.
-
f7a8f0d8f275a49f9e03e7205f202e47690ac5a3 → 0123_workspace_library.sql: full workspace library/uploads, TEXT owner/folder/user RPCs and private grants. UUID-org FK plus exact locked membership guard/scoped departure trigger preserve TEXT library owner lifecycle. Workspace document stamping relocated into canonical claim/lease/CAS-fenced finish_upload_processing_job (0104 body retained), validating membership before standalone/library publish; worker never resurrects rows.
-
53197afce1f016f62f8a91e48c750bb12d568853 → 0124_public_member_handover.sql: public successor/private departure policy, hidden private titles and pre-cascade ownership inspection; TEXT user arrays/RPCs with UUID membership/provenance boundary, private grants.
-
63c83cc86df82234331803cd95f92cfe47b75c96 → 0125_memory_prerequisites.sql: bounded current-prerequisite check with canonical0092 TEXT signatures and baseline-repair diagnostics. Original0122 remains immutable; this forward check guards later migrations and cannot retroactively precede0122. Full application workspace isolation/invitation changes adopted.
c1f8258b31b4f77bc2967032257aecf16b907bfc — Playbooks foundation
backend/migrations/20261016_02_playbooks.sql→0142_playbooks.sqlbackend/migrations/20261017_01_playbook_autosave_workspaces.sql→0143_autosave_expand_backfill.sqlbackend/migrations/20261017_01_playbook_autosave_workspaces.sql→0144_autosave_contract.sqlbackend/migrations/20261017_02_playbook_content_column.sql→0145_content_column.sqlbackend/migrations/20261017_03_playbook_sources.sql→0146_playbook_sources.sqlbackend/migrations/20261017_04_playbook_access.sql→0147_access_expand_backfill.sqlbackend/migrations/20261017_04_playbook_access.sql→0148_access_contract.sqlbackend/migrations/20261017_05_playbook_reviews.sql→0149_playbook_reviews.sqlbackend/migrations/20261017_06_remove_unused_playbook_structure.sql→0150_remove_unused_structure.sqlbackend/migrations/20261017_07_playbook_storage_cleanup.sql→0151_storage_cleanup.sql
TEXT owners/actors, existing UUID member keys and resource IDs, explicit private service_role grants; no auth schema/RLS. Expand/backfill precedes separate guarded contract for snapshots/shares. Override functions preserve canonical 0126 archive, 0117 public-only owner promotion and active-org checks; new resource triggers reuse 0135 require_active_organization. Storage retirements use the existing transactional storage.cleanup outbox. Full feature release also requires165 and180.
3eec266319d87e42b38805aebb6f771753810d42 — Playbooks pane/History continuation
backend/migrations/20261018_01_remove_playbook_global_guidance.sql→0152_remove_playbook_global_guidance.sqlbackend/migrations/20261018_02_playbook_run_history_index.sql→0153_playbook_run_history_index.sqlbackend/migrations/20261019_01_playbook_run_scope.sql→0154_playbook_run_scope.sqlbackend/migrations/20261020_01_playbook_import_status.sql→0155_playbook_import_status.sql
Live content removes global guidance; run snapshots remain immutable. Run scope and owner History index retain TEXT actors. Import org attachment uses existing UUID organization FK and canonical0135 active-org guard, private service_role grants. Source180 durable jobs/privacy/Word counterparts remain required before release.
- Source177 bbfca12939958a77bccc76bf4f7dc013e85d3187: numbered0156/0157 add opt-in web_search JSON/atomic TEXT-actor merge plus search provider allowances; preserve kimi/azure_openai, UUID profile identity and private service-role grants. No schema.sql/RLS/auth schema.
e8f73821f0a0ea7b7a665f62cec77043e9706264 — delegation
- Dated chat_subagent_runs/user_subagent_defaults →0158/0159. Dev0160 extends the canonical fenced assistant append with defaulted continuation payload, current actor/chat/message/workspace/document/version checks and one transaction. TEXT actors, UUID resource/member keys and private grants retained.
d9c0f573d41d01dd5acda0103c4024b9ce505a68 — response details
- Dated user_response_details →0161; Dev profile fallbacks/fast_model retained.
19fb8ea19d89cda5057508eaff1ddc3095b28bbb — durable Playbooks lifecycle
- Dated playbook_import_target_version →0162; word_chat_message_playbook →0163. -0164 introduces the domain transaction through the existing Playbooks module: canonical db_jobs claim/attempt/token/live lease, guarded heartbeat/failure, import CAS and atomic outcome/audit. Terminal hooks match retained failed-job token/attempt after lease clearing.0165 extends existing create_document_version with optional job identity/expected version/edit rows; backward-compatible defaults retain the document facade and text-revision triggers.0166 extends canonical account departures with public Playbook handover before membership removal.0167 extends existing organization audit redaction with current Playbook roles, without audited-private/admin access.
- NULL replacement snapshot fails closed; staged output keys include claim token and cleanup proves unreferenced ownership. Real durable UUID claims/runner are awaited when disabled; no detached-promise substitute. User/org export/erasure/retention, storage outbox and Word Personal boundary retained. needs_review.
18035cf6 — workspace connectors
Mapped 20261022_01_workspace_connectors.sql to 0168_workspace_connectors.sql. TEXT connector owners/RPC actors retain UUID org/member provenance using locked exact-pair guards/cascade. OAuth state consumption preserves existing advisory/profile locks and erasure refusal. Private service_role grants; no schema.sql/auth.users/RLS. Central CourtListener credentials remain read-only with per-workspace enable rows.
540fb8a2 — central organization keys
Mapped 20261024_01_org_keys_central_only.sql to 0169_org_keys_central_only.sql. Personal-key opt-in is removed; Dev continues central KV/managed-identity credentials and separate manager-authorized configured/router model lists. CourtListener personal token writes remain refused.
040e17ac — workspace-scoped privacy deletion
Mapped 20261024_02_workspace_scoped_data_deletion.sql to 0170_workspace_scoped_data_deletion.sql (private TEXT/UUID RPC and memory epochs). Mapped 20261024_03_backfill_project_child_org_id.sql to 0171_backfill_project_child_org_id.sql: native transaction locks only three child tables, checks canonical parent/guard contracts, disables/re-enables only exact active-org guards, including inactive authoritative parents. No DB execution; final disposable gate required. Canonical erasure, durable cleanup and Playbook public handover remain separate.
d4fd8999 — scoped exports and member data policy
Mapped 20261024_04_org_member_data_policy.sql to 0172_org_member_data_policy.sql. Owner-governed exports/bulk deletes default closed for other members. Settings jobs retain original resolved workspace and recheck active membership/policy before build/upload/status/download. Personal Library metadata stays Personal; canonical parent-aware document scope plus roles remain authoritative. Existing queue claims and canonical result publication remain intact.
2619ea72c491aa5561bc0a64b328c509da10dbf8 — parser isolation and worker roles
- Dated document_text_failed_jobs →0173. Canonical failure RPC supports live claim-token/lease resource refusal and failed terminal transitions; stale-sweep repair/trigger keep job→version→text locks and successor/revision guards.
- Native parser isolation modules adopted. Dev awaited KV/session/storage/signing warm-up, migration/queue probes, fail-boot role workers and process guards retained; startup waits for jobs/uploads role readiness. Canonical text claim/publication and actual UUID inline runner preserved. needs_review.
15d516798b6106e60983cb65c102746ce66f114d — bounded parser processes
- Root combined Dockerfile retains Dev packaging and adds util-linux/prlimit. Native subprocess, resource bounds and busy deferral adopted; canonical text attempt/token/lease claim/publication and real inline runner preserved.
- Dev0174 extends existing queue_document_text/read_document_text with optional guarded legacy enqueue identity/expected path, unambiguous default-compatible signatures. Legacy precompute redirects to canonical revision-aware text jobs instead of a stale fixed-key blob. Reader reconciliation follows202. needs_review.
dde73c39ba3a8b4be8921f784935ddb17344f6c8 — priority and resource containment
- Native warm pool/admission/priority and tabular terminal resource containment adopted. Dev claim cancellation is advisory; canonical job token/attempt/lease/revision RPCs stay authoritative. Cancellation removes queued waiters or retires active parser; admission finally releases/transfers slots.
- Legacy precompute/read now share canonical revision/access text contract0174 with initiating actor + expected storage path. No stale fixed-key object is read or newly published; consumers without actor context parse authorized bytes directly. Existing source153 workspace/current-resource checks remain. Real inline claims/defer/refund retained. needs_review.