Skip to content
MSO CloudDocumentation

ADR 0048 — Verticals: one registry over plane, ingest family and resolver pillar

On this page
  • Status: Accepted. Batch 2 (2026-09-10), Track A-1.
  • Owners: Platform (site programme).
  • Extends: ADR 0012 D8 (an org type is a blueprint), ADR 0019 (default-snapshot law — no per-tenant column for a derivable fact), ADR 0020 D9 (two metric planes), ADR 0038 (tenant dataset semantic layer), ADR 0042 (dashboard packs as data).
  • Related: ADR 0049 (dataset connector contract, forthcoming, Batch 3), ADR 0050 (AI metric authoring + /admin/metrics, forthcoming, Batch 4).

Context#

"Pillar" names three different things in this codebase, and none of the three is what the operator means by "vertical" (eCom, marketing, HR, finance…):

Axis What it decides Values in code today
Data plane trust + gate: the org's own data (DATA gate, chat) vs. a 3rd-party estimate 1st-party eCom, 1st-party marketing, 3rd-party market-intel (§57/§58/§60d)
Ingest family which queue/promoter/picker group a connector rides (connectorFamily) marketplace, marketing, market_intel, content_intel
Resolver dispatch which explore.query resolver answers a catalog slug (MetricPillar) ecom, marketing, social, crm, market, audience

YouNet HR fits none of the three: no catalog slug (its metrics are DATA per ADR 0020 D9 / ADR 0038), no eCom-shaped connector output, plane "1st-party tenant dataset". It landed in dataset-workspace, whose own comment says "owns no pillar" — true for resolver dispatch, false for the product. A fourth, product-level axis was missing.

Decisions#

D1 — Vertical: one compiled registry indexing the other three axes

packages/plugin-host/src/verticals.ts (plugin-host is the one package both apps/web and apps/worker already import for taxonomy; it stays free of DB/AI deps). Seven values, each a row only where at least one of plane, ingest family, metric mechanism or blueprint differs from every other row:

vertical plane ingest families metric mechanism blueprint(s)
ecom 1p marketplace catalog (pillar ecom) standard-commerce, standard-dashboard-pack
marketing 1p marketing catalog (marketing, social) marketing-analytics
crm 1p marketing (Bitrix24/sheet) catalog (pillar crm) marketing-analytics (shared today)
audience 1p content_intel catalog (pillar audience) content-intelligence
market 3p ESTIMATE market_intel catalog (pillar market) market-intelligence-only
hr 1p dataset (new, ADR 0049) dataset packs (ADR 0042) hr-workspace (new, D3)
finance 1p dataset (new, ADR 0049) dataset packs finance-workspace (sketch, no org)

Why seven, not five or nine:

  • social stays a resolver pillar under the marketing vertical — six catalog slugs, one nav plugin (social-intelligence), no org has ever been provisioned "social only"; folding it in is a registry mapping, not a rename.
  • crm stays its own vertical even though it ships inside marketing-analytics today: it has its own resolver pillar (8 slugs), its own silver (crm_leads/deals/stage_events), and a CRM-only tenant is plausible. Keeping it separate costs one registry row.
  • audience and market are separate verticals because they are already separate planes with separate gates — merging either into marketing would misstate what gate its numbers answer to (ADR 0022 D1's own argument).
  • hr and finance are the two the operator asked for, and ADR 0038's context line already names them ("HR first, finance next").
  • No inventory/creator/settlement vertical: those are ownedBy sub-domains of ecom and share its plane, connectors and blueprint.

D2 — Where a vertical is DECLARED, and where it is DERIVED

Declared (all additive, all optional, so every existing row parses byte-identically — the contract every ADR 0019/0020/0038 field already follows):

  • orgBlueprintSchema.verticals?: Vertical[] — the org type's verticals (ADR 0012 D8: an org type is a blueprint). org-blueprint-validity.ts requires every plugin the blueprint enables whose manifest declares a vertical to be a member of this list — a blueprint may not enable an HR connector while claiming to be eCom-only.
  • pluginManifestSchema.vertical?: Vertical on kind:'connector' plugins — groups the /connectors catalog ("HRM: Odoo" under HR) and feeds the blueprint check above.
  • org_datasets.vertical (nullable text, CHECK over the registry values; no index — the table is small and org-scoped) — distinguishes an HR dataset from a finance dataset in one org, tells the AI metric-authoring flow (ADR 0050) which standard-field vocabulary to propose from, and a pack install stamps it.
  • org_dataset_packs.content.vertical (pack schema field, required for a pack in the repo, audited by dataset-pack-registry-validity.ts).

Derived, never a second hand-written field:

  • MetricDefinition — DERIVED from pillar through the registry (verticalOfPillar).
  • An ORG's verticals — the union over its applied blueprints (verticalsForOrg, read from org_blueprint_applications), never an organizations.vertical column. A per-org column here would be a second snapshot of a fact the applied-blueprints join already answers — exactly what ADR 0019's default-snapshot law forbids: a value re-derivable from an existing source of truth does not get its own stored column.

What is NOT done: no rename of MetricPillar, connectorFamily or ownedBy (240+ citations across resolver dispatch keys and the generated surface registry); no organizations.vertical/org_type column (see above).

D3 — hr-workspace blueprint; dataset-workspace stays the vertical-less generic

New blueprint hr-workspace v1 (verticals: ['hr']) in apps/web/src/server/org-blueprints/registry.ts: plugins chat-with-data + connector-google-sheets (+ connector-odoo-hr once ADR 0049 ships, defaultEnabled:false, listed but not required), disablePlugins = the marketplace set, role grants identical to dataset-workspace v3 (verified by a blueprint-diff unit test — the menu a YouNet HR editor/viewer sees does not change), precondition no_active_commerce_connectors, plus a NEW blueprint step datasetPacks: ['hr-people-analytics']: applyOrgBlueprint declares the pack's datasets through declarePackDatasets and installs its pages through installDatasetPack for every brand the org has at apply time (both already idempotent per ADR 0042 D2 / ADR 0038 amendment (d)), skipping a pack version already installed.

Amended in Batch 5 (D6): hr-workspace is at v2, and its hiddenMenuItems is dataset-workspace's MINUS briefing — the one deliberate divergence, because the vertical now has a brief persona. The blueprint-diff test asserts that difference in both directions rather than byte equality.

dataset-workspace remains as the vertical-less generic ("an org whose data is its own datasets, vertical unknown yet") — it owns the tenant-dataset PLANE and no resolver pillar; it is the base a vertical workspace specialises.

younet-hr moves from dataset-workspace v2 to hr-workspace v1 by one applyOrgBlueprint on production (operator-run; additive: same plugins, same grants, pack already at its current version → the apply writes the org_blueprint_applications row, stamps org_datasets.vertical='hr' on the 12 existing rows, and nothing else — dry-run output must show exactly that before the real apply).

D4 — Two metric mechanisms stay; the registry is the one index; the read surface ships later

ADR 0020 D9 is right and this program keeps it: platform metrics (shared semantics, versioned, §49 one definition) are code; tenant metrics are data. What was missing was not a merge but an INDEX: the vertical registry (D1) maps each vertical to its metric mechanism, and one super-admin read surface, /admin/metrics, will list both sides per vertical (catalog slugs by pillar; dataset packs and, per org, confirmed dataset fields) — planned for Batch 4 (ADR 0050), not built in this batch. Widgets already read both through WidgetSpec.dataSources (ADR 0041) — no renderer change here.

D5 — L3-L5 doors kept open; honest mso-17 status

Three doors this program keeps open without building, none claiming a level (mso-17 addendum, same date):

  1. A signal may one day point at a tenant-dataset measure — the binding key (org, brand, datasetVersion, bindingHash) plus a field's schema_version already make org_dataset:<key>.<measure>@v<N> an unambiguous, replayable address; the vertical registry records which verticals are 1st-party (signal-eligible) vs. estimate (never a lever input, §60d). Not built: a SignalRef source kind for datasets.
  2. Levers are per vertical — OFFTAKE_LEVERS is eCom's; the registry row is where a future hr/finance lever vocabulary would hang. Not built.
  3. Self-proving needs provenance on every number — dataset cells carry dataset key + schema_version + source binding, catalog metrics carry slug + version + provenance; /admin/metrics (D4) is the first place both provenances would be visible side by side.

D6 — Every vertical states its Morning Brief persona, or states that it has none

The brief is written for a READER (PERSONAS in @yng/agent), and until Batch 5 the reader set was owner/ops (commerce) and marketing (media). A vertical with no persona did not fail: it fell through selectBriefPersonas' commerce default, so an HR org received two commerce documents whose most prominent sentence was a permanent absence. The stop-gap (BRIEFING_INELIGIBLE_BLUEPRINT_KEYS, apps/worker/src/briefing-eligibility.ts) suppressed the job instead, which is silence rather than a wrong answer, and neither state could be caught by a test because the rule was nowhere written down.

The rule: a vertical's row here states which brief persona reads it. A vertical with a persona is enqueued and its blueprint does not hide briefing; a vertical with none is skipped by the fan-out and its blueprint hides the item. The two halves move together, in one change.

vertical brief persona enqueued briefing in nav
ecom owner, ops yes shown
marketing marketing yes shown
crm marketing (shared blueprint) yes shown
audience none — excluded by design (a corpus deck is not an operational plane, ADR 0035 D1) yes, but the surface gates itself out hidden by its own requiresAnyPillar
market owner (estimate bullets only) yes shown
hr hr yes shown
finance none yet no hidden

hr (Batch 5): the persona reads the org's own HR rollup — headcount, hires, leavers, turnover rate and staff-cost variance for the latest month agg_org_dataset_period holds, through the same cells the HR dashboards render (§49), plus whatever the pack's own alertRules fired. No money figure appears: salary, staff cost and budget carry sensitivity: 'compensation' and a brief reaches every member of the org, so the collector drops them at read time.

finance: declared, applied to no org, no persona written. finance-workspace therefore stays on the ineligible list and keeps briefing hidden — the entry comes off both in the same change that adds the persona.

WHICH personas an org gets is decided by selectBriefPersonas over BriefOrgShape, whose hr leg is the org's VERTICAL (this registry, over org_blueprint_applications) and not a probe of whether HR rows exist this morning: an HR org whose monthly sheet has not synced is still an HR org. The vertical answers before the pillar set, because metricPillarsIn hands an org matching no pillar the commerce default, so every HR org reaches the selector looking like a commerce one.

Alternatives considered#

  • MetricPillar.hr. Rejected: there is no HR resolver, HR numbers are dataset cells; a pillar with zero catalog slugs is a lie the metric-semantics-coverage.py audit would have to special-case.
  • organizations.org_type column. Rejected: ADR 0012 D8 already made the blueprint the org type; a column would be a second source of truth for a fact the applied blueprint already states.
  • Renaming MetricPillar/connectorFamily/ownedBy to "vertical". Rejected: each already names a real, narrower axis (resolver dispatch, ingest routing, ownership sub-domain respectively) with 240+ citations; collapsing three names into one would erase a distinction the code depends on, not simplify it. The registry indexes them instead of replacing them.

Consequences#

  • A department-shaped org (HR today, finance next) gets a product-level identity distinct from its resolver pillar, ingest family, and plane — without widening any of those three enums.
  • An org's verticals are always a live derivation from its applied blueprints, never a value that can drift from what was actually provisioned.
  • A future vertical (a fifth department shape) is a registry row plus a blueprint, not a rename or a new column.

Implementation status (declared 2026-09-10)#

Decision Status Evidence
D1 Vertical enum + compiled registry Landed (batch 2) packages/plugin-host/src/verticals.ts
D2 declared fields + derived reads Landed (batch 2) orgBlueprintSchema.verticals, pluginManifestSchema.vertical, migration adding org_datasets.vertical, org_dataset_packs.content.vertical, org-blueprint-validity.ts
D3 hr-workspace blueprint + pack apply step Landed (batch 2) hr-workspace in apps/web/src/server/org-blueprints/registry.ts; datasetPacks step in applyOrgBlueprint
D4 metric-mechanism index Planned (batch 4) /admin/metrics — forthcoming ADR 0050
D6 per-vertical brief persona coverage Landed (batch 5) PERSONAS/selectBriefPersonas/hrFactsToBullets (packages/agent/src/index.ts), collectHrBriefFacts (packages/metrics/src/hr-brief-facts.ts), apps/worker/src/briefing-eligibility.ts, hr-workspace v2 (briefing un-hidden)
Connector contract (DatasetConnector) Landed (batch 3) ADR 0049 — dataset-connector.ts/dataset-connectors.ts, sync-dataset.ts, packages/connectors/odoo/
AI metric authoring Planned (batch 4) forthcoming ADR 0050
D5 L3-L5 doors Landed (batch 2) mso-17-l0-l5-status.md addendum — no level claimed