conventions/programming_general/tenancy_patterns.yaml
Natalie 3dc5a9b321 feat(conventions): codify lilith v0-v4 conventions (py/rust/gd + 7 general)
Mined the egirl->cocotte lineage + the prose agentic configs. Per-language
standards (py/rust/gd) and general conventions: service_architecture,
multi_agent_workflow, error_handling_logging, mcp_server_patterns,
naming_conventions, tenancy_patterns (draft), database_patterns. Captures the
canonical/latest where versions diverged. 14/14 lint:yaml-valid.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 08:42:44 -04:00

25 lines
1.1 KiB
YAML

apiVersion: conventions/v1
version: 0.1.0
updated: "2026-06-29"
name: tenancy_patterns
title: Person-first, Org-optional tenancy
scope: general
status: draft
summary: Onboarding is Person-first; Org is an optional overlay. Every user-owned table carries a nullable org_id (NULL = person-owned). V4 canonical (cocotte DESIGN §2-3).
appliesTo: ["@projects/@cocottetech/**"]
rules:
- id: person_first
level: must
text: Onboarding never asks "what org"; a Person operates standalone by default. Org is a later upgrade.
- id: org_overlay
level: must
text: A Person can own/admin/join multiple Orgs; Org is an overlay on the Person, not a prerequisite.
- id: nullable_org_id
level: must
text: "Every user-owned table has a nullable org_id alongside user_id. org_id IS NULL => row belongs to the Person; set => belongs to the Org."
- id: no_leakage
level: must
text: Org A's data is invisible to Org B; a Person's data is invisible to an Org unless explicitly shared.
- id: provider_generic
level: should
text: Tenancy code is provider-generic (see convention:naming_conventions).