Design note — Governed system-of-record door (system_of_record)
Target registry item: C2 (OB-GAP-3; docs/OPEN_ITEMS.md SO-1 — no non-Shopify system-of-record connector for booking / CRM / POS / call tracking; first tenant 203K9 books through Koalendar). Status: design note only — NOT built. Measured on 2026-10-12: CONNECTOR_CATALOG carries no booking, CRM, POS or call-tracking provider; Cell 37 exposes POST /inject/canonical/batch and /inject/canonical/gcs (src/cells/cell37/market_cell/main.py:7–11, "canonical injection (role a)") behind verify_caller, with label ∈ ("backfill", "partner_file") (orchestrator.py:385), synthetic refused 422 synthetic_never_canonical, and the leg dark until CANONICAL_INGESTION_URL is set (503 canonical_injection_unconfigured); tenant resolves against the verified caller (_tenant, main.py:150). SO-2 (Shopify-only install acceptance) and SO-3 (universal cost gate) are related owner rows and are NOT resolved here. CDoD points are tracked in docs/reports/ONBOARDING_CONNECTORS_STATE.md.
What the door is
One governed path by which a tenant without Shopify gets its system-of-record events into the canonical stream, with three load mechanisms that all converge on the same mapper and the same ingest gate:
| mechanism | when | transport |
|---|---|---|
| M1 — CSV upload in the authenticated onboarding UI | any vendor; the first-tenant path | file → server-side parser → mapper → canonical ingest gate |
| M2 — Cell 37 canonical injection door | operator-run backfills and partner files | POST /inject/canonical/batch with label: partner_file (existing, dark) → canonical ingestion |
M3 — vendor adapters (C2a: koalendar, calendly, acuity) |
where the vendor exposes an API or webhook | adapter → mapper → canonical ingest gate |
No new store: every row ends in mizoki_unified_data through the ingest gate, as a JourneyEvent (person- or session-level operational events) or a MarketSignal (aggregate counts), never in a side table.
Auth
- M1: the authenticated tenant session (TENANT-001); the upload is tenant-bound by the session, never by a field in the file.
- M2:
verify_calleron Cell 37 plus the caller-SA allowlist grant on service-canonical-ingestion (both exist);tenant_idresolves against the verified caller; a mismatch is refused there, not here. - M3: per-vendor, in each adapter note; vault-only per (tenant, provider), no env fallback, vault error → 503, absent →
merchant_credentials_not_configured.
Schema — the declaration the tenant makes first
A new onboarding section system_of_record (one entry per source; readiness gap system_of_record:not-declared only for a tenant that declared a rail needing it):
| key | required | notes |
|---|---|---|
kind |
yes | closed vocabulary: booking, crm, pos, call_tracking |
vendor |
yes | closed vocabulary per kind (koalendar, calendly, acuity, csv …); unknown → 422 |
topics |
yes | subset of the topic table below; each topic the tenant turns on needs its posture row |
person_level |
yes | true only when the tenant's consent declaration (economics_declared.consent) names a basis that covers these subjects; otherwise the mapper emits aggregates only |
subject_id_source |
when person_level |
which column/field is the subject key (hashed under the tenant salt at the gate; never stored raw) |
column_map (M1) |
M1 only | declared header → canonical field; unknown header → 422 unknown_column, never guessed |
Declaring arms nothing (.claude/rules/tenant-onboarding.md "Collected is not armed").
Data topics
| topic | event | level |
|---|---|---|
appointment_booked |
a booking created | person-level (subject = client) when person_level; else daily count by service |
appointment_completed / appointment_cancelled / no_show |
status change | same |
lead_created (crm) |
a new contact/lead | person-level or count |
order_pos (pos) |
an order at the register | order-level: amount, items, tender TYPE; never card data |
call_received (call tracking) |
a call on a tracked line | count per line per day; the caller number is never ingested |
Consent posture
| topic | posture |
|---|---|
| any person-level topic | evaluate_consent (src/shared/mizoki_intent/signal.py:412) runs fail-closed per event at the gate: a per-subject basis from the file/vendor, else the tenant's declared default basis, else DROP and count (dropped_no_consent). The declaration never grants consent. |
| aggregate counts | de-personalised remainder; no subject key is emitted |
| deny-list categories (health, sexuality, religion, financial distress, minors) | schema-rejected at ingest and at hypothesis creation; a booking "notes" free-text column is NEVER mapped (no free-text column may enter the map) |
| O-1 lock | no keystroke / audio / gaze / fine-geo fields exist in the column vocabulary; a header naming one is 422 |
A posture test in the TestD3ProcessingPosture style pins every topic to a row in both directions.
Mapper target
MAPPERS["system_of_record:<vendor>"] in src/shared/virtuoso_models/transforms/mappers.py for JourneyEvent topics; MARKET_MAPPERS for count topics; both → ingest_gate → mizoki_unified_data. The CSV parser produces the same intermediate dict the vendor adapters produce, so one mapper per vendor serves M1 and M3. M2 carries already-canonical envelopes and is used only for backfills that were mapped by this same code offline.
Failure modes → verdicts
| Failure | Verdict |
|---|---|
| Undeclared source | 422 system_of_record_not_declared — nothing is loaded until the declaration exists |
| Unknown header / unknown vendor / unknown topic | 422 with the offending name; no partial load |
Free-text or deny-listed column in column_map |
422 column_not_mappable |
| Row without a consent basis (person-level) | dropped and counted; the load report shows accepted / dropped_no_consent / rejected |
| Canonical leg unconfigured (M2) | 503 canonical_injection_unconfigured (existing) |
label: synthetic (M2) |
422 synthetic_never_canonical (existing) |
| Duplicate upload (same file digest, same tenant) | 409 duplicate_load with the prior load id |
Flag
SYSTEM_OF_RECORD_DOOR default OFF. Flag OFF: the declaration section can be saved (collected is not armed) but M1 upload and M3 adapters answer 404; M2 stays governed by its own existing leg flag. Every vendor adapter has its own flag in its note, also default OFF.
Owner / operator gates
- Owner scopes the build (SO-1: "build (owner scopes; not covered by the ruling's merge approval)"). The question to put once: approve M1 + the declaration section as the first increment, with M3 vendor adapters following per vendor? Until answered: BLOCKED(owner).
- Owner rows left open on purpose: SO-2 (non-Shopify acceptance path) and SO-3 (cost gate universality). This door makes a non-Shopify tenant's data real, which changes the SO-3 trade-off; the row is for the owner, not this note.
- Operator: arm the Cell 37 canonical leg (
CANONICAL_INGESTION_URL+ caller-SA allowlist) only when an M2 backfill is actually scheduled; it stays dark otherwise.
Vendor references
None vendor-specific here (see the three adapter notes). The in-repo facts cited above were measured in the worktree on 2026-10-12.