Repository navigation
[70_TD] Portable client driver for stock Interchange bootstrap - #739
Merged
Merged
Conversation
The client holds a needs-list manifest and converges it against stock Interchange routes only: manifest with arktype boundary, StockHub port, DM derivation (one chat child per owned top-level workflow refId), typed upstream-gap errors, and a hub/account-scoped client-side store for created child tenant ids.
Converges the client needs-list beside server provisioning at both entry points. Non-gating: a stock capability gap is logged, never shown, and a thrown failure is caught so it can never surface as an unhandled rejection.
Pagination follows nextCursor on both stock listings, bootstrap log branches share one helper, the child-tenant store filters per row, the dead tenant-kind capability and unreachable primary-tenant guard are removed, and the workbench write path gains create+invite and idempotent reclaim coverage.
DMs derive from participant-filtered threads; workbenches converge as child tenant plus primary thread plus In-Reply-To sub-thread forks. Creation idempotency rides native Message-IDs; stock routes only.
Summary: - deriveThreads subject fallback merges only within one participant set, so distinct 1:1 pairs sharing a subject keep separate threads and both DMs survive. - forkSubThread replay key covers parent plus subject plus recipients plus body; edited bodies and retargeted forks send anew while pre-upgrade rows keep parent-plus-subject replay. - convergeNeedsList documents the mail[0] oldest-first ordering assumption beside the fallback; isDuplicateMessageId keeps its shared-helper role by comment. - DM-tenancy deletion completed: client-bootstrap exposes primaryThreads with no DesiredDirectMessage/directMessages, and the stale DM-children comment in main.tsx now reads child rooms. Verification: - bun test ./src in apps/web: 375 pass, 0 fail across 48 files. - tsc --noEmit in apps/web: exit 0. - prettier --check and eslint on touched files: clean, exit 0. - bun run check:structural including no-product-tenancy: all ok, exit 0. - New keeper tests failed before the fix (subject merge collapsed both DMs to [], fork replay dropped edited bodies) and pass after.
Summary: bench selection, routines roster, and command palette filter benches by human-assigned name (isBenchMembership over isRawIdentifier) with no kinds lookup; meKeys.workbenchTenancyKinds removed; bench-ui drops tenancy-kind/api surface and keeps raw-id guard plus tenancy contracts; test fetch stubs for POST /kinds removed; docs carry a cutover note. Verification: bun run scripts/typecheck.ts exit 0; tsc --noEmit in apps/web and packages/bench-ui exit 0; prettier check on touched files exit 0; eslint on touched sources/tests exit 0; 79 pass across 9 affected web test files; 22 pass in packages/bench-ui; bun run check:structural exit 0.
The thread-native client-driver branch cut web/bench-ui client usage only (classifyBenchMembership/filterBenchMemberships/TenancyKind, kinds client); the server WorkbenchTenancyStore/workbench_tenancy table/POST /api/workbench-tenancies/kinds surface is untouched here and its removal lands separately. TENANCY.md tenancy-kind passages go past tense with a pointer to isBenchMembership; bench-context selector comment drops the deleted TenancyKind wording; the named-child-tenant open question is recorded as docs-only.
This was referenced Sep 16, 2026
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 web client drives stock Interchange directly. This branch introduces the portable, thread-native client driver (bootstrap on first open and signup, convergence of remaining importers) and deletes the bench-mediated tenancy-kind abstraction without replacement — a hard cutover to the client-owned model.
Key commits
1ba09afbtest(web): define portable client convergence97718206feat(web): portable client-driven Interchange bootstrap91525144feat(web): run portable client bootstrap on first open and signupd2824a01fix(web): resolve critic findings on portable client driver369eb755feat(web): thread-native portable client convergenceb75cd51efix(web): participant-scope thread fallback and fork replay key226864cafeat(web): cut remaining importers to thread-native client modelac003b8bdocs(web): scope cutover note to client-only tenancy-kind removalVerification
apps/web/src/threads.test.ts(new convergence coverage),needs-converge/needs-listtests, updated overlay/palette/page test expectations,bench-uitenancy-kind removal.d2824a01.bun run checkgate runs in CI on this PR.Notes
cl-<id>-<slug>once filed.