@davoodmehraban89 / Factor-easy / commits / 15ef220
Fork 0

سامانه صدور فاکتور و حسابداری

Specify enterprise licensing and organization identity

davoodmehraban89 committed Sep 30, 2026 at 08:13 UTC 15ef220c41ccb4b9dec10c1e33136d75345ec3be
2 files changed +242 -8
PROJECT_STATE.md
+11 -8
@@ -12,6 +12,7 @@ Verify live GitHub+Supabase before acting; record material requests before imple
12 ## Current change ledger
13 | Date | Request / decision | Status | Evidence / next action |
14 |---|---|---|---|
15 +| 2026-09-30 | Implement the approved enterprise licensing/organization model so a sold license can carry named-user seat capacity, company capacity and module entitlements; customer can delegate organization/system administration, model regions/units/positions, invite/manage users, and assign reusable roles/permissions. Keep the design evolvable for future commercial packaging changes. | **DISCOVERY APPROVED / ARCHITECTURAL SPEC WRITTEN — IMPLEMENTATION NOT STARTED** | Live production schema confirms organization tenant, organization units, memberships, per-member module permissions, `max_companies`, module entitlements and organization-linked licenses already exist; no `max_users`/seat limit exists, `core` is not yet delegable through member permissions, member onboarding still requires a pre-existing Finora account, and reusable role templates are absent. Design: `docs/superpowers/specs/2026-09-30-enterprise-licensing-organization-identity-design.md`. Per mandatory design gate, implementation begins only after owner reviews this written spec; then create the implementation plan and execute it in vertical slices. |
16 | 2026-09-30 | Continue closing the current-stage gap register autonomously, prioritizing production safety and real evidence. | **IN PROGRESS — SECURITY HARDENING APPLIED / CUTOVER RECONCILED / REAL-USER E2E BLOCKED BY TEST PRINCIPALS** | Live Supabase rechecked `ACTIVE_HEALTHY`. Migration `20260930041735_harden_public_security_definer_rpc_grants_search_path` applied and archived: all 7 public SECURITY DEFINER helpers now use empty `search_path`; `PUBLIC`/`anon` execute revoked; `authenticated`/`service_role` explicit. Transactional impersonation of a real non-admin principal proved all 5 admin mutators reject with SQLSTATE `42501`; advisor still reports 7 exposure warnings by design because authenticated RPC access remains intentional. Evidence: `docs/SECURITY_DEFINER_HARDENING_2026-09-30.md`. Production accounting source population re-read without mutation: 7 invoices = 4 formal + 1 non-formal eligible total `3,371,160,000`, plus 2 `pre_invoice` total `3,570,000,000`; both invoice-holding orgs have fiscal-year records but zero account masters and unset company sector, so automatic historical posting remains prohibited until owner mapping/chart approval. Evidence: `docs/PRODUCTION_ACCOUNTING_CUTOVER_READINESS_2026-09-30.md`; Phase-6 manifest wording corrected. Two-real-user E2E cannot yet be truthfully executed because all 4 organizations currently have only their owner member and zero active non-owner members; do not fabricate a second production user or grant cross-org access silently. |
17 | 2026-09-30 | Audit Gmail GitHub `Run failed` notifications, verify/fix any still-live CI defects, and produce a severity-ranked list of remaining gaps needed to make the current Finora stage complete. | **AUDITED / HISTORICAL FAILURES TRIAGED / CI MAINTENANCE VERIFIED / GAP REGISTERED** | Gmail failures mapped to intermediate commits: old Real-DOM/request-builder failures were fixed by later browser hardening; Slice-B migration-count invariant was fixed by later archived migrations; Security failures were Dependency Review failing because GitHub Dependency graph is disabled while CodeQL passed. During this audit a CodeQL v4 modernization attempt exposed a repository invariant still pinned to v3 and generated transient main failure emails (`31ef607`, `42d2476`, `7e8e43e`); rather than weaken the gate, CodeQL was restored to supported v3. Final audit-closeout commit `5182b786dc7488146eaaa68d87dcc2f1d2c9a725` passed Quality run `36666677736`, Security run `36666677677`, and Pages run `36666676797`. Quality uses `checkout@v7` + `setup-node@v7`; security uses `checkout@v7` and CodeQL v3 until invariant+action migrate together. Prioritized register: `docs/CURRENT_STAGE_GAP_REGISTER_2026-09-30.md`. |
18 | 2026-09-30 | Continue from verified Slice A into Slice B: organization tenant, multi-user memberships, module roles/capabilities, row scopes, confidentiality, shared office access/referral foundation and immutable permission/referral audit. | **IMPLEMENTED / MERGED / VERIFIED** | PR #7 merged as `d212c6aeef5b49f33351166771a0899f307a9067`. PR Quality `36664844247` PASS and Security `36664844234` CodeQL PASS. Final main checkpoint `99a23edcaddf542f9080bbe70bb0b450af14913f` also passed Quality `36664994360`, Security/CodeQL `36664994384`, and Pages `36664994039`. Production migrations `20260930031853`, `20260930031942`, `20260930032615`, `20260930032654`, `20260930033010` applied+archived. Production transactional tests PASS for own/org scope, confidentiality, read-only capability, member core read-only context, expired-license read-only, referral/audit immutability and member Storage-path isolation. GitHub Dependency graph remains disabled, so dependency review is not claimed. Evidence: `docs/SLICE_B_TENANT_RBAC_VERIFICATION.md`. |
@@ -19,9 +20,10 @@ Verify live GitHub+Supabase before acting; record material requests before imple
20 | 2026-09-30 | Iran-first high-assurance ERP expansion. | IN PROGRESS — broader roadmap | `docs/IRAN_COMPLIANCE_MATRIX_V1.md`; do not claim statutory consolidation/full tax submission/full HR/CRM until complete lifecycle/accounting/permissions/tests exist. |
21
22 ## Current production state — 2026-09-30
22 -- Last fully green CI checkpoint explicitly verified across Quality/Security/Pages: `5182b786dc7488146eaaa68d87dcc2f1d2c9a725`; subsequent documentation/migration archive commits require their normal applicable gates before being called a new release checkpoint.
23 +- Current main head before enterprise-licensing design commit: `ab1104ff185295928f366dfad78de61032994be8`; its Pages run `36668318530` passed. The prior fully green checkpoint across Quality/Security/Pages remains `5182b786dc7488146eaaa68d87dcc2f1d2c9a725` until all applicable gates for a newer implementation head are explicitly observed.
24 - Supabase `hcsixhqbyuhpshfwqpjx`: `ACTIVE_HEALTHY`, PostgreSQL `17.6.1.166`, 30 migrations through `20260930041735`.
25 - 4 existing licenses remain `full_suite`; each license belongs to a backfilled organization whose original account is owner. Current membership check: each of the 4 organizations has exactly 1 active owner and 0 active non-owner members.
26 +- Live schema verification for the enterprise-licensing discovery: `licenses` currently has `max_companies`, `modules`, and `organization_id` but no user-seat limit; `organization_members` has unit, position, status and owner flag; `member_module_permissions` has capability/scope/confidentiality but its module-key constraint does not include `core`; `organization_units` is hierarchical.
27 - `records` primary identity is `(organization_id, collection, id)`; RLS enforces membership/entitlement/capability/scope/confidentiality. Writes require active organization license; expired/cancelled organizations retain authorized historical reads.
28 - Active non-owner members receive read-only `core` context for workspace initialization; core writes remain owner-only in Slice B.
29 - Organization security metadata: `organizations`, `organization_units`, `organization_members`, `member_module_permissions`, immutable `organization_audit`.
@@ -50,14 +52,15 @@ Verify live GitHub+Supabase before acting; record material requests before imple
52 Posted accounting history is immutable and balanced; tenant isolation is data-boundary enforced; commercial module entitlement and member authorization are independent; UI hiding is never security; expired licenses are read-only; office numbers are server-atomic; binary scans stay in private Storage; roadmap-only modules are not presented as operational.
53
54 ## Required evidence
53 -`docs/PHASE_1_REDESIGN_VERIFICATION.md` · `docs/PHASE_2_REDESIGN_VERIFICATION.md` · `docs/PHASE_3_REDESIGN_VERIFICATION.md` · `docs/PHASE_4_REDESIGN_VERIFICATION.md` · `docs/PHASE_5_VERIFICATION.md` · `docs/PHASE_6_VERIFICATION.md` · `docs/PHASE_6_CUTOVER_MANIFEST.md` · `docs/PRODUCTION_ACCOUNTING_CUTOVER_READINESS_2026-09-30.md` · `docs/IRAN_COMPLIANCE_MATRIX_V1.md` · `docs/FINORA_ERP_EXPANSION_ROADMAP_V4.md` · `docs/FINORA_UX_ACCOUNTING_BENCHMARK_V3.md` · `docs/FINORA_MODULAR_ERP_OFFICE_AUTOMATION_V1.md` · `docs/SLICE_B_TENANT_RBAC_VERIFICATION.md` · `docs/SECURITY_DEFINER_HARDENING_2026-09-30.md` · `docs/CURRENT_STAGE_GAP_REGISTER_2026-09-30.md` · `docs/PRODUCTION_RUNBOOK.md` · `supabase/migrations/`.
55 +`docs/PHASE_1_REDESIGN_VERIFICATION.md` · `docs/PHASE_2_REDESIGN_VERIFICATION.md` · `docs/PHASE_3_REDESIGN_VERIFICATION.md` · `docs/PHASE_4_REDESIGN_VERIFICATION.md` · `docs/PHASE_5_VERIFICATION.md` · `docs/PHASE_6_VERIFICATION.md` · `docs/PHASE_6_CUTOVER_MANIFEST.md` · `docs/PRODUCTION_ACCOUNTING_CUTOVER_READINESS_2026-09-30.md` · `docs/IRAN_COMPLIANCE_MATRIX_V1.md` · `docs/FINORA_ERP_EXPANSION_ROADMAP_V4.md` · `docs/FINORA_UX_ACCOUNTING_BENCHMARK_V3.md` · `docs/FINORA_MODULAR_ERP_OFFICE_AUTOMATION_V1.md` · `docs/SLICE_B_TENANT_RBAC_VERIFICATION.md` · `docs/SECURITY_DEFINER_HARDENING_2026-09-30.md` · `docs/CURRENT_STAGE_GAP_REGISTER_2026-09-30.md` · `docs/superpowers/specs/2026-09-30-enterprise-licensing-organization-identity-design.md` · `docs/PRODUCTION_RUNBOOK.md` · `supabase/migrations/`.
56
57 ## NOT VERIFIED / external boundary
56 -Authenticated two-real-user production browser E2E (no active non-owner member exists yet); member invitation without a pre-existing account; owner-approved chart/mapping and controlled posting/reconciliation of existing production invoices; real Persian OCR accuracy; qualified digital signature; physical printer; third-party webhook/ECE/email gateways; GitHub Dependency graph/dependency-review availability; Supabase leaked-password protection; zero-warning architectural replacement for public authenticated SECURITY DEFINER RPC exposure; PostgreSQL 17.11 platform upgrade; CodeQL v4 migration.
58 +Authenticated two-real-user production browser E2E (no active non-owner member exists yet); member invitation without a pre-existing account; named-user seat enforcement and delegated organization administration (design only, not implemented yet); owner-approved chart/mapping and controlled posting/reconciliation of existing production invoices; real Persian OCR accuracy; qualified digital signature; physical printer; third-party webhook/ECE/email gateways; GitHub Dependency graph/dependency-review availability; Supabase leaked-password protection; zero-warning architectural replacement for public authenticated SECURITY DEFINER RPC exposure; PostgreSQL 17.11 platform upgrade; CodeQL v4 migration.
59
60 ## Exact next executable work
59 -1. Do not fabricate P0 closure: two-real-user browser E2E needs a legitimate second test/member principal; accounting cutover needs owner chart/company-type approval because sector is unset and account masters are absent.
60 -2. Continue independent P1/P2 hardening that does not require those decisions: member invitation foundation, leaked-password platform configuration when the platform exposes a controllable setting, dependency graph when repository administration is available, and CodeQL v4 invariant+action migration as one tested PR.
61 -3. Slice C: mature office lifecycle — templates/editor, signatures/approval, referral chains/read receipts, SLA/reminders, reply/related-letter graph, archive classification, OCR/full-text and integration adapters.
62 -4. Slice D: versioned workflow engine for configurable requests — steps, conditions, parallel/sequential approval, delegation/substitution, SLA/escalation and immutable action history.
63 -5. Slice E: transport/procurement/service/CRM/manufacturing/maintenance only as complete tested vertical modules with accounting/permissions/reporting integration.
61 +1. Review/approve `docs/superpowers/specs/2026-09-30-enterprise-licensing-organization-identity-design.md`; then write the implementation plan and execute the enterprise licensing/organization identity slice before Slice C so office automation inherits the final user/admin/seat model.
62 +2. Do not fabricate P0 closure: two-real-user browser E2E needs a legitimate second test/member principal; accounting cutover needs owner chart/company-type approval because sector is unset and account masters are absent.
63 +3. Continue independent P1/P2 hardening that does not require those decisions: leaked-password platform configuration when the platform exposes a controllable setting, dependency graph when repository administration is available, and CodeQL v4 invariant+action migration as one tested PR.
64 +4. Slice C: mature office lifecycle — templates/editor, signatures/approval, referral chains/read receipts, SLA/reminders, reply/related-letter graph, archive classification, OCR/full-text and integration adapters.
65 +5. Slice D: versioned workflow engine for configurable requests — steps, conditions, parallel/sequential approval, delegation/substitution, SLA/escalation and immutable action history.
66 +6. Slice E: transport/procurement/service/CRM/manufacturing/maintenance only as complete tested vertical modules with accounting/permissions/reporting integration.
docs/superpowers/specs/2026-09-30-enterprise-licensing-organization-identity-design.md new
+231
@@ -0,0 +1,231 @@
1 +# Enterprise Licensing & Organization Identity — Design
2 +
3 +Date: 2026-09-30
4 +Status: OWNER CONCEPT APPROVED / WRITTEN SPEC AWAITING REVIEW
5 +Repository: `davoodmehraban89/Factor-easy`
6 +
7 +## 1. Purpose
8 +
9 +Finora must support enterprise customers in which one commercial customer can have one or more legal companies, many regions/branches/units, and tens or hundreds of named users. The seller must be able to sell a license by duration, enabled modules, company capacity and named-user capacity. The customer must then be able to delegate day-to-day system administration inside its own tenant without receiving Finora platform-admin privileges.
10 +
11 +The design must remain evolvable: future packaging may add storage, AI, branch, API or other quotas without redesigning tenant identity/RBAC.
12 +
13 +## 2. Existing foundation to preserve
14 +
15 +Production already has:
16 +
17 +- one `organization_id` on each license;
18 +- hierarchical `organization_units`;
19 +- `organization_members` with user, unit, position, status and owner flag;
20 +- per-member module permissions with capabilities `read/create/edit/delete/approve/register/refer/archive/configure`;
21 +- row scopes `own/unit/branch/company/organization`;
22 +- confidentiality clearance;
23 +- commercial `modules[]` and `max_companies` on licenses;
24 +- organization-aware RLS, office registration/referral and audit.
25 +
26 +The new slice extends this model. It must not replace tenant IDs, rewrite posted accounting history, or collapse commercial entitlement and member authorization into one concept.
27 +
28 +## 3. Core model
29 +
30 +Effective access remains:
31 +
32 +`tenant membership ∩ active commercial entitlement ∩ assigned role/permission ∩ row scope ∩ confidentiality`
33 +
34 +Commercial packaging and customer authorization stay independent.
35 +
36 +### 3.1 Commercial license
37 +
38 +A license belongs to exactly one Finora organization/tenant and defines at least:
39 +
40 +- duration/plan/status;
41 +- enabled modules or `full_suite`;
42 +- `max_companies`;
43 +- `max_users` (named active-user seats);
44 +- extensible `limits` metadata for future quota types that are not yet enforcement-critical.
45 +
46 +`max_users` is a hard server-side entitlement. UI counters are informational only.
47 +
48 +Named-user licensing is the default. Shared logins are not a supported licensing or audit model.
49 +
50 +### 3.2 Seat consumption
51 +
52 +A seat is consumed by an active organization member who can sign in and use the tenant. The organization owner also consumes a seat. Suspended/left members do not consume seats. Pending invitations do not consume seats until accepted, but acceptance must fail atomically if no seat is available at that moment.
53 +
54 +Existing organizations are grandfathered safely: initial `max_users` must never be lower than the current active-member count. No existing user is silently deactivated by migration.
55 +
56 +Seat enforcement must occur on every path that can activate membership, including invitation acceptance and owner/admin reactivation.
57 +
58 +### 3.3 Companies versus organizational structure
59 +
60 +A legal/accounting company is not the same thing as a region or unit.
61 +
62 +Recommended hierarchy:
63 +
64 +`Organization/Tenant → Legal Company → Region/Branch → Unit → Subunit`
65 +
66 +A customer with one legal company and ten operating regions consumes one company seat, not ten. A holding/customer with seven independent legal companies consumes seven company seats.
67 +
68 +The current hierarchical `organization_units` remains the flexible operational tree. Unit metadata will gain an explicit kind such as `region`, `branch`, `department`, `unit`, `subunit` rather than creating separate tables for every organizational vocabulary.
69 +
70 +### 3.4 Customer administrators
71 +
72 +Platform admin and customer admin are distinct identities.
73 +
74 +- **Finora platform admin:** sells/changes commercial licenses and platform-level settings.
75 +- **Organization owner:** original tenant owner; break-glass/full tenant authority.
76 +- **Organization system admin:** delegated customer administrator. Can manage members, invitations, organizational structure, reusable roles and permissions within that tenant, but cannot change commercial entitlements, license dates, module purchases or platform-admin data.
77 +- **Module admin:** can configure and delegate permissions only for authorized module(s), never enable an unlicensed module.
78 +- **Operational roles:** manager, accountant, petty-cash operator, secretariat operator, viewer, etc.
79 +
80 +`core` becomes an explicit authorization domain for delegated organization administration. Commercially, core remains always present; authorization to configure core is not implicit for ordinary members.
81 +
82 +## 4. Reusable roles with safe overrides
83 +
84 +Direct `member_module_permissions` remain supported for backward compatibility and exceptional overrides, but enterprise administration needs reusable role templates.
85 +
86 +Introduce:
87 +
88 +- `organization_roles`: tenant-scoped role catalog (`system_admin`, `finance_manager`, `accountant`, `petty_cash`, `secretariat`, custom roles, etc.);
89 +- `organization_role_permissions`: module capability/scope/confidentiality grants belonging to a role;
90 +- `organization_member_roles`: assignments of one or more roles to a member.
91 +
92 +Effective member authorization is the union of active role grants plus explicit member grants, constrained by commercial module entitlement. No grant can activate a commercially unlicensed module.
93 +
94 +System roles are seeded per organization but remain tenant-owned configuration. The schema must allow adding future role attributes without changing the effective-permission contract.
95 +
96 +A user may hold multiple roles, for example `accountant` + `secretariat_viewer`.
97 +
98 +## 5. Invitation and onboarding
99 +
100 +Customer administrators must be able to invite a person who does not yet have a Finora account.
101 +
102 +Introduce tenant-scoped invitations containing:
103 +
104 +- normalized email;
105 +- target organization;
106 +- optional target unit and position;
107 +- intended role assignments;
108 +- inviter;
109 +- status (`pending/accepted/revoked/expired`);
110 +- expiry;
111 +- single-use opaque token stored only as a hash server-side;
112 +- immutable audit events.
113 +
114 +Acceptance rules:
115 +
116 +1. token is valid, pending and unexpired;
117 +2. authenticated email matches invitation email unless a future explicit identity-provider policy says otherwise;
118 +3. organization/license is active for new writes;
119 +4. a named-user seat is available;
120 +5. membership creation/reactivation, role assignment, invitation acceptance and seat check happen atomically;
121 +6. duplicate acceptance is idempotent and cannot create duplicate membership/roles.
122 +
123 +Email delivery is an adapter boundary. The first vertical slice may generate/manage invitations without claiming external email delivery until a real provider is connected and verified.
124 +
125 +## 6. License administration
126 +
127 +Finora platform admin must be able to set, independently:
128 +
129 +- plan/duration/status;
130 +- modules;
131 +- maximum legal companies;
132 +- maximum named users.
133 +
134 +Changing a limit below current usage must be rejected server-side. Reducing modules must preserve historical authorized reads according to existing expiry/history rules and must not destructively delete tenant data.
135 +
136 +Future quota dimensions should be addable without changing the membership/RBAC tables. Enforcement-critical quotas should graduate from generic metadata to typed columns/functions when introduced.
137 +
138 +## 7. Organization administration UX
139 +
140 +The customer-facing administration area should show:
141 +
142 +- license summary: modules, expiry, company usage/capacity, user usage/capacity;
143 +- organization tree with unit type, parent and active state;
144 +- members with status, unit, position, roles and effective modules;
145 +- invitations with pending/expired/revoked states;
146 +- reusable role catalog and role permission editor;
147 +- direct per-user overrides as an advanced action;
148 +- audit trail for membership, role, permission and invitation changes.
149 +
150 +The UI must never imply that a permission is effective when the corresponding commercial module is not licensed.
151 +
152 +## 8. Server-side enforcement and security
153 +
154 +Mandatory invariants:
155 +
156 +1. Seat and company limits are enforced in Postgres/RPC, never only in JavaScript.
157 +2. A customer administrator cannot alter `licenses.modules`, duration, status, `max_companies` or `max_users`.
158 +3. An organization administrator can act only inside organizations in which they hold active delegated core administration.
159 +4. A module admin cannot grant capabilities outside their module or beyond commercial entitlement.
160 +5. Invitations cannot cross tenants and cannot be replayed.
161 +6. Role assignment cannot create access to an unlicensed module.
162 +7. Suspending a member removes effective tenant access without deleting historical actor identity/audit references.
163 +8. Posted accounting history remains immutable; role/license changes never rewrite financial history.
164 +9. Every membership, role, permission, invitation and delegated-admin mutation is auditable.
165 +10. Existing owner-only organizations continue working after migration.
166 +
167 +## 9. Backward compatibility and migration strategy
168 +
169 +The migration is additive and reversible at the application level:
170 +
171 +- add `max_users` with a conservative grandfather value at or above current active members;
172 +- add extensible license-limit metadata without moving existing `modules`/`max_companies` immediately;
173 +- add unit kind with a neutral default;
174 +- add role/invitation tables;
175 +- seed an organization-admin role and useful starter roles without assigning them automatically except where explicitly safe;
176 +- preserve direct member permissions and include them in effective authorization;
177 +- expand the module permission constraint to include `core`;
178 +- replace owner-only organization-management policies with owner OR delegated `core/configure` checks;
179 +- fix any company-limit enforcement that is still owner-user scoped so it is organization/license scoped.
180 +
181 +No production membership is deleted or silently broadened.
182 +
183 +## 10. Vertical delivery slices
184 +
185 +### ELI-1 — License seats + delegated organization admin
186 +
187 +Deliver `max_users`, server seat enforcement, `core/configure`, organization-admin delegation, organization-scoped company-limit enforcement, admin license UI for user capacity, usage counters, RLS/negative tests and migration archive.
188 +
189 +This is the first implementation slice because all later onboarding depends on it.
190 +
191 +### ELI-2 — Reusable role catalog
192 +
193 +Deliver role tables, role permission editor, member role assignment, effective-permission union and starter role templates. Preserve direct member grants as overrides.
194 +
195 +### ELI-3 — Invitations
196 +
197 +Deliver secure invitation lifecycle, acceptance RPC, seat-safe atomic acceptance, revoke/expire/idempotency behavior and customer UI. External email sending remains NOT VERIFIED until a real provider is connected.
198 +
199 +### ELI-4 — Enterprise organization UX + real-user verification
200 +
201 +Deliver organization-tree unit kinds, consolidated administration screens, seat/company/module usage dashboard, and authenticated two-real-user browser E2E using legitimate test principals. This slice closes the current real-user E2E blocker if suitable principals exist.
202 +
203 +## 11. Acceptance criteria
204 +
205 +The feature is not complete until all of the following are proven:
206 +
207 +- a platform admin can sell a license such as `Annual / 5 companies / 300 named users / Accounting + Treasury + Office`;
208 +- the 301st active member is rejected atomically;
209 +- suspended/left members free seats without deleting audit identity;
210 +- invitation acceptance cannot exceed seat capacity;
211 +- a delegated organization admin can manage users/units/roles but cannot alter the commercial license;
212 +- a module admin cannot grant or use an unlicensed module;
213 +- one legal company with ten regions consumes one company capacity;
214 +- multi-company tenants remain isolated by tenant and company scope;
215 +- existing owner-only tenants continue to work without manual repair;
216 +- production migration SQL is archived under `supabase/migrations/`;
217 +- accounting invariants and existing Phase/Golden tests remain green;
218 +- Real-DOM tests cover the new admin/license flows;
219 +- any real-user or external-email test not actually run is explicitly reported as NOT VERIFIED.
220 +
221 +## 12. Explicit non-goals for this slice
222 +
223 +- concurrent-session licensing;
224 +- SSO/SCIM enterprise provisioning;
225 +- billing/payment collection;
226 +- automatic email provider integration without a verified provider;
227 +- per-device licensing;
228 +- rewriting the existing tenant model;
229 +- destructive conversion of historical accounting data.
230 +
231 +These can be added later without changing the core contract: organization owns the license; license defines commercial capacity; named people join the organization; roles/permissions define what each person can do.