diff --git a/CLAUDE.md b/CLAUDE.md index 41046c7..99de46f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -47,7 +47,7 @@ it can't parse (e.g. a currency-code wrapper no deterministic fallback recognize by correcting one example row, with no region-drawing at all; reuses the L.1-L.8 fingerprint/exact-match/near-match/versioning/sharing infrastructure outright. See its own two entries under Key decisions & lessons. | -| 4 | Multi-tenant practice/client accounts, Frappe data model | Not started | +| 4 | ~~Multi-tenant practice/client accounts, Frappe data model~~ | **Dropped 2026-11-24, by explicit user decision - see "Phase 4 dropped" under Key decisions & lessons.** A `users` account stays the permanent unit of isolation; a bookkeeper handling several clients uses one account's own `projects` (already built, Stage B.1-B.3) to separate them, not a new tenant/practice entity. | | 5 | Free front door, public accuracy page | Not started | | 6 | Append mode, credit cards, multi-account statements | Not started | | 7 | Reconciliation against the ledger | Not started | @@ -2458,13 +2458,16 @@ approve it straight to shared, instead of only ever waiting for a second indepen confirmation. Full staged plan (L.1-L.8) at `/Users/jason/.claude/plans/witty-inventing-walrus.md`. -**A real gap flagged explicitly, not papered over:** the spec's own data model (§9) -ties a Layout Mapping to a Practice/Client (the Frappe multi-tenant model - Phase 4, -"not started"). That model doesn't exist here - every PocketBase `users` record is -already its own fully isolated account, no team/org grouping at all. Everywhere the -plan says "confirmed by a second practice," it actually means **confirmed by a -second, different `users` account** - the closest honest stand-in available today; -revisit only if/when Phase 4's real multi-tenant model is ever built. +**A real gap flagged explicitly at the time, since resolved by a deliberate scope +decision (2026-11-24 - see "Phase 4 dropped" under Key decisions & lessons):** the +spec's own data model (§9) ties a Layout Mapping to a Practice/Client (the Frappe +multi-tenant model - originally "Phase 4, not started"). That model doesn't exist +here - every PocketBase `users` record is its own fully isolated account, no team/org +grouping at all. Everywhere the plan says "confirmed by a second practice," it +actually means **confirmed by a second, different `users` account** - this is no +longer a stand-in awaiting a future multi-tenant model; Phase 4 itself was dropped, +and a `users` account is the permanent unit of isolation. A "client" is a `project` +within one user's own account, not a separate tenant. A smaller idea discussed first - a code-based "layout quirks" module that mechanically fixes geometric oddities with zero human involvement - was kept as an @@ -2614,9 +2617,10 @@ pattern: `layoutMappings`' `listRule`/`viewRule` also allow `status = "shared"`, since the entire point of a shared mapping is that OTHER users' uploads can find and apply it. The hook (`onRecordAfterCreateSuccess` on `layoutMappings`, same pattern as `ensure_default_project.pb.js`): when a new mapping is created, it looks -for another mapping with the same `fingerprintHash` and a DIFFERENT `owner` (the -honest stand-in for "a different practice" - no Practice/Client entity exists in -this schema, Phase 4 not started) via `e.app` (bypasses every rule); if found, both +for another mapping with the same `fingerprintHash` and a DIFFERENT `owner` (this +app's own permanent unit of isolation, by the decision recorded under "Phase 4 +dropped" - a `users` account stands in for "a different practice" for good, not a +placeholder awaiting a multi-tenant model) via `e.app` (bypasses every rule); if found, both records flip to `status: "shared"` immediately - kept as two separate records rather than merged, avoiding a dangling relation from any `documents .layoutMappingUsed` already pointing at either one. @@ -5271,6 +5275,45 @@ be set explicitly (`/usr/share/tesseract-ocr/5/tessdata`); tesserocr does not re auto-discover Debian's tessdata location on its own (confirmed for real: failed with "invalid tessdata path: ./" without it). +**Phase 4 dropped, 2026-11-24 - explicit user decision, not a Claude judgment call.** +Phase 4 (the spec's own multi-tenant practice/client model, a real Frappe-style +tenant entity sitting above a plain user account) is no longer "not started" - it's +removed from this product's roadmap entirely. The user's own framing: "a user would +be able to use the projects feature as a way of handling different clients [on] +their account." A bookkeeper or accountant with several clients creates one project +per client inside their own single account - already fully built (PocketBase Stage +B.1-B.3, 2026-10-13) - rather than this product ever growing a second, separate +tenant/organization layer above the account itself. + +This resolves, permanently rather than provisionally, a gap this file already +flagged honestly at the time the layout mapper was built (see "A real gap flagged +explicitly" under the Layout mapper entry above): the spec's own data model (§9) +ties a Layout Mapping to a Practice/Client, and several already-shipped features - +the layout mapper's own cross-user sharing/promotion hook, the admin review screen, +categorization rules, bank account profiles - were all built using "a different +`users` account" as the honest stand-in for "a different practice," with this file's +own language explicitly saying to revisit that once Phase 4's real model existed. +That revisit will not happen - a `users` account is now this product's permanent, +final unit of isolation, and "client" maps onto `project`, not onto any account/ +tenant boundary. Nothing in the already-built schema or code needed to change for +this decision itself (every one of those features already used exactly this model); +this entry exists so the "stand-in, revisit later" framing scattered through this +file's own history reads correctly going forward - a few of the more load-bearing +mentions were updated in place to point here, but older verification notes +describing a specific past test (e.g. "a second, different `users` account" in a +layout-mapper verification paragraph) were left as the accurate historical record of +what was tested, not rewritten. + +**One real, concrete consequence worth naming, not just a renaming of the status +column:** this means a layout mapping, a categorization rule set, or a bank account +profile can never be shared automatically across two of one bookkeeper's own +DIFFERENT clients (two projects under the same account) the way they already are +shared automatically across two independent USERS who happen to upload the same +statement layout - project-level sharing was never built and isn't implied by this +decision. If that turns out to matter in practice (e.g. the same new bank layout +showing up for two of one bookkeeper's own clients), it's a new, separate feature +request to design later, not something this decision already covers. + ## Frontend / UI state (as of 2026-10-13) **Theme is enterprise-light, not the Bettersight brand default.** `UI_DESIGN_THEME.md`