On this page
- Status: Accepted (2026-07-31) — operator directive, after Fable review of the filled Implementation-status ledger (D1–D5 all Landed; cross-org gate + Tier-A set green on a fresh-migrated DB). Originally the Phase 0 merge gate of the MSO Audience Intelligence programme,
approved by Fable review 2026-07-30 after a 15-agent chaired debate whose chair verified its
findings against a live PostgreSQL 16.13, the repo, and the five real client files
(
private/mso-content-intelligence/mso-audience-intelligence-architecture.md§2). Awaiting operator acceptance. No schema PR may merge before acceptance — table work is ADR 0023's scope and ADR 0023 is its own merge gate. - Date: 2026-07-30
- Context owner: Platform
- Related: ADR 0008 (connector family = pillar map),
ADR 0014 (D3 — vendor fixed-header maps, family
market_intel), ADR 0017 (one mapping contract, two transports), ADR 0019 (D4 — pillarmarketlanded through this same seam), ADR 0023 (taxonomy catalog — companion merge gate, drafted the same day), ADR 0024 + ADR 0025 (companions — tabs/widgets and the narrative gates). CLAUDE.md §32, §35, §47, §53, §57, §58, §62. The evidence bundleprivate/mso-content-intelligence/**is operator-local (gitignored); the quotations in this ADR are the durable record. Clients are named only by industry codename (Client A–E) in this repo; the real codename→identity map lives inprivate/mso-content-intelligence/CLIENT-CODENAMES.md(gitignored) — client vocabulary AND identity are operator data, not repo content (§44 / ADR 0023 D3).
Implementation status (declared 2026-07-30)#
This section is the ledger the implementing PRs fill, following ADR 0017's convention of auditing a decision at a time rather than declaring the ADR "shipped" wholesale. First filled 2026-07-30 (WP1 schema, WP2 stream, WP4 metric layer landed; WP3 promoters, WP5 reconciliation, WP6 surface in flight).
| Decision | Status | Evidence that will count when it lands |
|---|---|---|
D1 — pillar audience, not a plane |
Landed (2026-07-30) | 'audience' in MetricPillar (packages/); the audience arm (pillar-); PILLAR_ (shape.); first audience page ships gated — content- calls require + require (§47), plugin- green over 39 pages. |
D2 — 1st-party, brand-scoped, inside verify:data |
Landed (2026-07-30) | 14 content_/agg_ tables with org_ + brand_ NOT NULL (migration 0129); RLS + inventory coverage (verify:rls 145 PASS on a fresh-migrated DB); Tier-A audience set #A1–#A11 + #A- + #A- (102 assertions over the synthetic 10-kind fixture scripts/, promoted through the REAL WP3 chain) green under pnpm run verify:data — 124 passed / 0 failed; R7 filter-sensitivity included. Chat (V3, 2026-07-31): AUDIENCE_ (6 read-only tools over the §49 @yng/ readers) composed into the ToolSet ONLY behind ctx. (chat/ buildChatTools), prompt swapped by audience (AUDIENCE_ / AUDIENCE_), fail-closed assertion over the COMPOSED ToolSet in api/, classify opens EXACTLY the audience pillar behind the same flag (market stays blocked under every gate), MCP import-time leak guard; §44 posture: counts + client-approved catalog labels only — no mention bodies, author names, links or PII spans. Guards: scripts/ in audit:all + chat- (15 assertions). |
D3 — the social pillar is not reused |
Landed (2026-07-30) | pillar- untouched by the audience commit (git show 9b58033f - — no social.ts entry); pillar- + packages/ read only content_ tables, enforced continuously by scripts/ in audit:all. |
| D4 — trust grade declared | Partial (2026-07-30) | LANDED: required coverage on the share-style return types in packages/ (33 tests green). OWED: the widget that cannot render without a base label (WP6 base bands) and the denominator ban check (WP6). |
| D5 — separation from ADR 0014 D3 | Landed (2026-07-30) | content_ in connector (packages/); zero diff in packages/ + packages/ (9b58033f stat); audience- registered in audit:all (package.), negative-control verified (planted crossing detected, clean tree green). |
Context#
The Content Intelligence team's delivered product today is a file. Five client cases were
reverse-engineered file by file — Client A (banking campaign), Client B (healthcare), Client C
(FMCG), Client D (pharma customer journey), Client E (sponsorship weekly tracking) —
and every one is the same shape: a vendor social-listening export preprocessed in Python, an
agent skill that enriches it, and a multi-tab static HTML deck with a client-side password
(private/mso-content-intelligence/mso-audience-intelligence-architecture.md §1). The client
signs off on the numbers in that deck. This is a paid deliverable, not an estimate feed —
which is the single fact that decides everything below.
The data is more uniform than the decks suggest. One row is one mention, with a fixed envelope (content, context, source_name, created_date, link, sentiment, platform, mention_type, id) plus per-client taxonomy columns — stages, intents, barriers, topics, open-vocabulary entity lists, eligibility flags, confidence ladders, evidence quotes, hierarchy roll-ups (architecture doc §1). What varies between clients is vocabulary, not structure. That is the shape ADR 0017 D1 already sanctions: one new stream registered once, customer variability absorbed by mapping templates, client #6 adding zero fields and zero code.
Phase 0 therefore decides one thing only: where this data lives in the platform's plane and
pillar model. The wrong answer is expensive in a way that is invisible at review time — filing
it on the 3rd-party plane silently exempts a signed-off number from the DATA gate (§53/§57) and
locks the dataset out of the Data Assistant (§58); reusing the social pillar inherits an
org-scoped, monthly-grained, self-row-only contract that the CI product contradicts on every
axis. Both costs are argued from verified code below, not from preference.
| Fact | Evidence |
|---|---|
The non-eCom pillar switch is exhaustive with no default branch — a missing arm narrows pillar to never, so a new pillar is a compile-time obligation, not a silent gap |
apps/ (four arms: marketing, crm, social, market) |
MetricPillar is a five-member enum — pillars (5) already outnumber data planes (3) |
packages/ — z. |
| Every pillar is gated fail-closed on one plugin id before any resolver runs | pillar- (PILLAR_) consumed at index. |
Pillar market was added through exactly this seam by ADR 0019 D4 |
docs/; the plane boundary is restated in packages/ |
The social resolver is org-scoped: zero brandId/brand_ occurrences in the whole 159-line file |
grep - → no match |
| Its social-listening read path is monthly-grained — a sub-month window reads the containing month | social. (monthOf(dayLabel) → ${dayLabel.), applied at :44 and :85; the limitation is stated in the header comment social. |
| It renders only the org's own row, and abstains otherwise | social. (selfRow → brandTotals.), :51-, :61-, :92- |
| Its third slug is a daily topic-trend read with no brand dimension | social. (compute over win./win.) |
| The pillar reads rollups only — never mention-grain rows | readers import social (packages/) and social (social-); grep social_ → no match |
| A mention-grain table does exist — org-scoped, vendor-sourced, feeding the §46 rollup | packages/ (social, orgId() with no brand column, source default 'socialheat') |
| Market chat tools are gated twice: build-time inclusion plus a post-composition assertion that throws | apps/ (if (ctx.), apps/ (fails closed on the ACTUAL ToolSet) |
§57 — the market_ ESTIMATE plane "stays out of verify:data by design" |
CLAUDE. |
§58 — market tools reach chat ONLY via MARKET_ gated on ctx.; / asserts zero market keys when disabled |
CLAUDE. |
| The connector family enum has three members and a docstring saying new families slot in without plumbing | packages/ (connector) |
ADR 0014's SocialHeat/SocialTrend connectors are family market_, thirdPartyData: true |
docs/ |
| ADR 0014's own status line marks D3 superseded-as-history by ADR 0017; the fixed maps remain correct and in use for genuine fixed vendor exports | docs/; D3 text at :59- |
A vendor export arrives pre-filtered: Client E's workbook's own meta sheet declares default_ |
Chair verification against the client file, recorded at private/. Not independently re-verified by this ADR's author — the workbook is a client artifact outside the repo. |
Decision#
D1 — A new PILLAR audience, not a fourth data plane
Content Intelligence joins the platform as pillar audience on the existing 1st-party
plane: one member added to MetricPillar (packages/metrics/src/types.ts:44), one arm added to
the exhaustive resolvePlaneCore switch (pillar-resolvers/index.ts:155-165), one entry added
to PILLAR_PLUGIN (shape.ts:188-193) binding it to plugin id content-intelligence, and
requirePlugin('content-intelligence') on every page (§47 — nav hiding is not enforcement).
The user-facing label is "Thảo luận khách hàng". The slug audience is a code identifier and
is never rendered (§62 — no internal jargon, no vendor names in user copy).
The "fourth data plane" framing is explicitly dropped. The switch already carries four
non-eCom pillars while the platform has three planes, so pillars already outnumber planes
(types.ts:44 vs §57's three-plane rule) — adding a pillar is a routine, compile-time-checked
extension, exactly how ADR 0019 D4 landed market
(0019-universal-report-surface.md:42). It does not weaken §57's plane-mixing prohibition,
because it does not create a plane to mix: audience data is 1st-party client data, governed by
the same rules as the other 1st-party pillars. Inventing a plane would have inflated the very
vocabulary §57 depends on being small.
The seam also makes the extension safe rather than trusting review: a new pillar that forgets its
resolver arm fails to compile (index.ts:141-142 — TS narrows to never in the absent
default branch), and one that forgets its plugin gate fails at the PILLAR_PLUGIN lookup, not at
runtime on a customer's URL.
D2 — 1st-party, brand-scoped, INSIDE verify:data; chat-eligible only behind a future AUDIENCE_CHAT_TOOLS gate
Three properties, each with its enforcement:
- Brand-scoped from row one. Every new fact table carries
org_idandbrand_idNOT NULL (root invariant 1: tenancy isorg → brand; fact tables carry both), with an RLS policy and inventory coverage. This holds even while the programme provisions CI clients as dedicated orgs, so lifting that restriction later is configuration, not a migration. - Inside
verify:data. Every metric-bearing audience surface owes a reconciliation assertion inscripts/audit/data-reconciliation.ts(§53). This is the load-bearing consequence of the deliverable being paid for: §57 keeps the estimate plane out ofverify:databy design (CLAUDE.md:138) — correct for third-party estimates, and disqualifying for a number a client signs off on. Filing this feature undermarket_intelwould not merely mis-label it; it would exempt the deliverable's numbers from the DATA gate. - Chat-eligible, but closed until V3. When audience data reaches the Data Assistant it does
so through a dedicated
AUDIENCE_CHAT_TOOLSlist mirroring the shipped two-layer market pattern verbatim: build-time inclusion conditioned on the org's plugin state (chat/tools.ts:1486-1493) plus a fail-closed post-composition assertion over the ACTUAL ToolSet handed to the model (api/chat/route.ts:294-305), guarded by achat-audience-isolation.pyaudit registered inaudit:allwhen it ships (mirroringchat-market-isolation.py). Until then, zero audience tools exist — an absence, not a disabled flag.
The second cost of the market_intel alternative is the mirror of the first: §58 blocks
third-party market data from chat whenever Market Intelligence is off (CLAUDE.md:139). A CI
client has no reason to enable Market Intelligence, so filing the dataset there would lock the
product out of the Data Assistant — the feature that sells it — for exactly the tenants who
bought it.
D3 — The existing social pillar is NOT reused
Reusing social looks free and is not. The shipped resolver's contract, read from the file:
- Org-scoped.
brandId/brand_idappear nowhere in its 159 lines — no query predicate can be brand-partitioned without changing the readers underneath it. - Monthly-grained on the social-listening path:
monthOf()(social.ts:30-32) collapses the window's start day to the first of its month and bothsocial_buzz_volume(:44) andsocial_sov(:85) read that month. A sub-month window reads the containing month — stated as a documented limitation in the file's own header (social.ts:25-28). - Self-row only.
selfRow()(social.ts:34-36) keeps the row whereisSelf, series and platform breakdowns filter to that brand (:61-70), and anything else abstains withemptyCore()(:51-58,:92-93). - Rollup-only reads. Its two readers touch
social_listening_{brand,platform}_daily,social_listening_top_items(social-listening-read.ts:5-7) andsocial_trend_{posts,rankings}(social-trend-read.ts:3). The mention-grain tablesocial_mentionsexists (tables/social-market-intel.ts:152-157) and this pillar never reads it — that table is org-scoped,sourcedefaults to'socialheat', and it feeds the §46 rollup rather than a reader. Its third slugsocial_trend_buzz(social.ts:115-127) is daily but carries no brand dimension at all.
Audience Intelligence needs the opposite on every one of those axes: brand-scoped,
ICT-day-grained (§34/§41), mention-level facts carrying per-client taxonomy. Retrofitting
social would change the org-scoped monthly contract under tenants already reading it — a
numbers change disguised as a refactor, which is the §55a failure mode. A new resolver behind the
same seam costs one switch arm and leaves the shipped contract untouched.
D4 — Trust grade declared: within-file counts are EXACT, coverage is UNKNOWABLE
A vendor social-listening export is a crawl sample, and Client E's workbook says so itself:
its first sheet is a meta sheet declaring default_filters including is_relevant:1, a
language and a week (chair verification, debate/judge-decisions.md:28) — the file arrives three
filters deep. Exactness against the delivered file is defensible and is what a client
disputes; completeness is not ours to claim. Three binding consequences:
- Every share-style metric carries a required
coverageBasis: 'declared_universe' | 'unknown'discriminator — not an optional field, so a widget cannot render a share without saying what it is a share of. - Whole-market denominators are FORBIDDEN on this pillar (§32/§35 applied): no denominator
that implies a market total, no fabricated multiplier. Missing basis renders
—plus the base, never a number. - A share-of-voice-style metric takes an explicit universe dimension key and always renders its base label. The base is part of the number, not a caption.
The programme's own review flagged that all three candidate architectures drifted the same way here ("verbatim, not an estimate" / "counts are exact"), which is why the grade is written into an ADR rather than a code comment: this is a claim the product makes to a client.
D5 — Separation rule versus ADR 0014 D3 — so nobody "unifies" them later
The vendor fixed-header path stays exactly where it is. socialheat and socialtrend remain
their own connector types on family market_intel with thirdPartyData: true
(0014-…-social-crm.md:44-49); this ADR touches neither package.
audience datasets arrive only through org-authored ADR 0017
mapping templates, under a new connector family content_intel added to
connectorFamilySchema (packages/plugin-host/src/manifest.ts:54, whose docstring already
anticipates that "new families slot in without plumbing").
The two paths must never merge, because they differ on every governing axis:
| Axis | ADR 0014 D3 fixed maps | content_ (this ADR) |
|---|---|---|
| Source format | fixed vendor product export | per-client authored contract |
| Plane | 3rd-party estimate | 1st-party deliverable |
| Tenancy | org-scoped | brand-scoped |
| §53 DATA gate | outside verify:data (§57) |
inside verify:data |
Stated honestly: ADR 0014's own status line already marks D3 superseded-as-history by ADR
0017 (0014-…-social-crm.md:3) — per-org column mapping for a sheet binding exists now, and the
fixed maps remain correct, tested code for genuine fixed vendor exports. That supersession is
about mapping mechanics. This separation rule binds the plane and family assignment, which
ADR 0017 never changed and this ADR does not relax: a content_intel template may not be pointed
at a market_intel stream, and a market_intel connector may not emit an audience stream.
D6 — The name audience
Chosen over two rejected candidates, both for reasons that are rules rather than taste: voc
is untranslatable jargon and would surface as an acronym no Vietnamese user can read (§62a), and
content collides with §48's TikTok content analytics (shop_videos/shop_lives per-day
attribution) — two unrelated "content" domains in one codebase is a naming defect waiting to be
mis-grepped. The user-facing label carries the meaning ("Thảo luận khách hàng"); the slug only has
to be unambiguous in code.
Non-goals
- No tables, columns, or schema here. The taxonomy catalog, the mention fact table and the bridge sit behind ADR 0023's merge gate — their DDL is owned by the programme handoff's WP1, and ADR 0023 fixes only the boundary WP1 must respect, including its cross-org read test. No schema PR merges against this ADR alone.
- No change to the
socialpillar or its readers, and no change to the ADR 0014socialheat/socialtrendconnectors. A diff touching either is out of scope by construction (D3, D5). - No chat exposure before V3.
AUDIENCE_CHAT_TOOLSis named here so the pattern is fixed in advance; it is not built. (Shipped 2026-07-31 — see the D2 ledger row.) - No Cube binding until
brand_idlands in the generated Cube schema — a brand-scoped pillar cannot bind to org-wide generated cubes without returning the wrong number (0019-universal-report-surface.md:101, recorded there as known debt). - No pillar-wide metric slugs, widget kinds, or dashboard surfaces decided here; those follow the shipped registries (ADR 0019 D6) in later ADRs.
Consequences#
- A new client is configuration, not code for the positioning layer: the pillar, the plugin gate and the family exist once, and client #6 arrives as templates plus vocabulary. That is the whole reason to prefer a pillar over per-client anything.
- A fifth pillar obligates every exhaustive consumer.
resolvePlaneCoreis the one that fails loudly (index.ts:141-165); any other switch overMetricPillarthat is not exhaustive will simply not handleaudienceand will do so quietly. The implementing PR owes a sweep ofMetricPillarconsumers, not just the resolver. coverageBasisis permanent API surface. Every share-style return type, every widget config that renders one, and every dataset row carries it. It will feel like ceremony on the first widget; it is the only thing standing between a crawl sample and a whole-market claim (D4). Accepted deliberately.- Being inside
verify:datais a recurring cost, not a one-off. Every new audience surface owes an assertion (§53), and unlike the estimate plane there is no §57 exemption to fall back on. That cost is the point. - Chat stays closed until V3, and that is a product limitation — an operator asking the Data
Assistant about audience data before V3 gets nothing, by design. Stated rather than hidden: the
alternative (an ungated tool) would ship the exact leak §58 exists to prevent. (V3 shipped
2026-07-31: the same absence now holds for any org whose
content-intelligenceplugin is off — it is a disabled flag rather than a missing feature, enforced at four layers: build-time tool composition, prompt swap, the post-composition ToolSet assertion, andclassifyChatMetric.) - Two ingest paths for social-listening-shaped data coexist, deliberately (D5). The risk is a
future reader "unifying" them; the mitigation is this ADR plus
audience-plane-isolation.pyregistered inaudit:allwhen the family lands.
Alternatives considered#
- File it under
market_intel(the existing 3rd-party plane). Rejected on consequences, not taxonomy. §57 keeps that plane out ofverify:databy design (CLAUDE.md:138), so a signed-off client number would carry no DATA gate; §58 blocks it from chat whenever Market Intelligence is off (CLAUDE.md:139), so the dataset would be invisible to the Data Assistant for every CI tenant. The superficial fit (the raw file comes from a listening vendor) is outweighed by what the plane means: estimate, not deliverable. - Reuse the
socialpillar. Rejected on the verified contract: org-scoped (zerobrandIdinsocial.ts), monthly-grained (monthOf,social.ts:30-32), self-row-only (selfRow,:34-36), and rollup-only (never readssocial_mentions). CI needs brand-scoped, ICT-day, mention-level facts — the opposite on every axis — so "reuse" means rewriting the resolver and its readers under tenants who currently depend on them. - Declare a fourth data plane. Rejected: pillars already outnumber planes 5 to 3
(
types.ts:44vs §57), so the extension the code is built for is a pillar, not a plane. Plane inflation would weaken §57 — a rule whose force comes from there being few, clearly-different planes that must never mix. - Name it
vocorcontent. Rejected:vocis untranslatable jargon (§62a) andcontentcollides with §48 TikTok content analytics (D6). - Compiled per-client modules instead of a shared pillar. Rejected as a dead end for the programme (architecture doc §5 F1): it re-inserts an engineer into every onboarding, which is the cost this feature exists to remove. Documented as a fallback if ADR 0023 is rejected — never as a target.