Repository navigation
Hard-cut chat tenancy to client-minted Interchange tenants - #740
Closed
TheGreatAxios wants to merge 4 commits into
Closed
TheGreatAxios wants to merge 4 commits into
TheGreatAxios wants to merge 4 commits into
Conversation
Summary: - New forward migration 0031 drops chat.workbench_tenancy and its index; history untouched, chat_bench_settings kept (product data, no drop). - Delete workbench-tenancy.ts, workbench-tenancy-routes.ts (POST /kinds), POST /workbenches/:id/move, and POST /participants/mint-dm. - Delete mint wrappers (createWorkbenchTenant, mintNativeChildTenant, mintAgentDm, provisionSpaceWorkbench), tenancy compensations, grant planting, addWorkbenchMember conferral, withTenancy annotator, legacy true/false and no_tenancy paths, find-or-reopen. - Retain pure native principal reads in new neutral module src/native-principal.ts (refId projection for DM 1:1 validation); server mints nothing, settings writes take client-minted ids. - Update no-product-tenancy structural allowlist (workbench_tenancy removed) and chat-local README. Verification: - bun run typecheck (packages/chat): exit 0 - bun test (packages/chat): 928 pass, 0 fail (two consecutive full runs) - bunx prettier --check on changed files: pass; bunx eslint packages/chat: exit 0 - bun run check:structural no-product-tenancy: ok
Summary: Collapse the second person-DM principal lookup into the pre-mint gate's validated result, reusing it with the full kind/status predicate instead of re-fetching with an undefined-only check. Add pins for agent-kind and cross-bench principalId rejection plus a single-lookup assertion. Clear stale deleted-test-file and workbenchTenancy comment pointers. Verification: bun test (931 pass, 0 fail), bun run typecheck (exit 0), prettier --check and eslint on touched files (clean).
HARD REFRESH - EXISTING DATABASES MUST RESET (bun run reset). There is no upgrade path for the removed entries: any dev/test database whose chat.chat_migrations ledger already contains 0005_channel_tenancy or 0006_channel_tenancy_parent_index will NOT replay them (they no longer exist in the chain), and must be rebuilt from scratch rather than migrated forward. Summary: - Delete the dead chain rendered moot by 0031_drop_workbench_tenancy: 0005_channel_tenancy CREATE, 0006_channel_tenancy_parent_index, and the three 0018 tenancy rename rows (table/column/index renames that only ever served the link table). Fresh databases now build clean with no backfill and no legacy rows; the tenancy table is never created. - Keep 0031 as the forward-drop guard (SQL untouched, table stays dropped): a no-op DROP IF EXISTS on fresh databases, still drops the leftover table/index on pre-purge databases. - No other entries touched: audit found no additional backfill or no_tenancy-era migrations whose sole purpose dies with the dropped table (the only tenancy references in the chain were 0005/0006/0018/ 0031). Ledger names are stable identifiers, so later entries keep their numbers - the chain now has gaps at 0005/0006 by design and must never be renumbered. - Update test/migrations.test.ts ledger assertions to the 29-entry purged chain. No allowlist change: no-product-tenancy still passes at 16 tables (workbench_tenancy was already removed there), and its 0018 comment stays accurate. Verification: - bun test test/migrations.test.ts (isolated scratch DBs, never the shared DATABASE_URL): 4 pass, 0 fail - fresh replay applies the purged chain idempotently, tenancy tables/indexes absent - bun test (packages/chat): 931 pass, 0 fail - bun run typecheck (packages/chat): exit 0 - bunx prettier --check on changed files: pass; bunx eslint packages/chat: exit 0 - bun run check:structural: 17 ok; check:report-error FAILs on 4 stale baseline entries in routes.ts/workbench-service.ts left by the earlier cutover commits (pre-existing, unrelated to this change)
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.
Intent
There is no parent bench: the client drives stock Interchange, and chat follows. This branch hard-cuts chat tenancy to client-minted Interchange tenants — deleting the bespoke workbench tenancy layer (
workbench-tenancy.ts, tenancy routes, dead migrations) without replacement rather than shimming it.Key commits
5894a024feat(chat)!: hard-cut chat tenancy to client-minted Interchange tenantsfb50cd99fix(chat): reuse validated person-DM counterpart instead of re-fetching1fadffa8feat(chat)!: purge dead tenancy migrations for hard-refresh cutoverc6b1c802chore(chat): drop stale report-error baseline entries for deleted tenancy surfaceVerification
packages/chat/test/routes.test.tsrewritten against the cut surface;workbench-tenancy/workbench-tenancy-routes/provision-space-workbench/agent-dm-warm-mailboxsuites deleted with the code;migrations,room-access,workbench-service,agent-turnssuites updated;report-errorbaseline pruned.bun run checkgate runs in CI on this PR.Notes
cl-<id>-<slug>once filed.