08-tooling

semantic layer validation controls rdco

2026-06-03·tooling·status: exploration
semantic-layerdata-analyticsvalidationoffline-evalsadversarial-reviewprovenancemacphdataclauderdco-infra

Semantic layer + validation controls — Anthropic's approach, RDCO's status, and a portable provenance-footer spec

Founder follow-up (2026-06-03) to [[2026-06-03-anthropic-self-service-data-analytics-with-claude]]: how did they structure the semantic layer / how would we; do we have the three controls (offline evals, adversarial-review subagent, provenance footers); and the provenance footer for his phData copilot. Anthropic specifics are grounded in the blog note; the build-guidance + RDCO audit are my synthesis. Anthropic named NO warehouse/BI vendor — the named tools below ("how you'd build one") are mine, not theirs.

Q1 — The semantic layer: how Anthropic structured it, and how you'd build one

What a semantic layer is (general): a governed mapping from raw tables to business concepts — canonical metric definitions, the entities/dimensions you can slice by, and the approved join paths to compute them. The point: a query becomes "net revenue by acquisition cohort, last quarter" instead of a fragile 6-table join with someone's private definition of "revenue." Established implementations: dbt Semantic Layer / MetricFlow, Cube, LookML, or Snowflake semantic views / Cortex Analyst semantic model.

How Anthropic structured it (4 layers, per the blog):

  1. Data Foundations — dimensional modeling, canonical datasets, metadata, freshness checks.
  2. Sources of Truththe semantic layer itself: metric definitions + lineage/transformation graph + a query corpus (known-good example queries) + business context.
  3. Skills — Markdown procedural-knowledge files the agent reads on demand. These act as a router: the agent is structurally required (by skill instruction) to consult the semantic layer FIRST, falling back to reference docs. That narrows the search space from "a million-field warehouse" to "a few dozen curated files." This is the load-bearing trick — not a smarter model, a required reading order.
  4. Validation — offline evals + online controls (see Q2).

The discipline that makes it hold: skills live in the same repo as the transformation code, and CI flags any data-model change that doesn't also touch a skill file → ~90% of data PRs now carry a skill change. The semantic layer doesn't rot because changing the model without updating its procedural doc fails CI.

How you'd build one (RDCO or phData):

Q2 — Does RDCO have the three controls?

Control RDCO status Detail
Adversarial-review subagent Yes — strong This IS RDCO's existing fresh-eyes/verify pattern: /verify-vault-write, /verify-strategic-output, /verify-dispatch, /design-critic, /video-critic, /verify-pdf-output, plus the dynamic-workflows adversarial-verify pattern. Used twice on 2026-06-03 alone (verifying the ant CLI commands + the Opus-4.8 fabrication claim against primary sources). Anthropic's "adversarial-review subagent" = a thing RDCO already does by default. Note their cost data: +~6% accuracy for +32% tokens / +72% latency — so reserve it for high-stakes outputs, which is already RDCO's posture.
Offline evals 🟡 Partial RDCO has the deterministic newsletter invariant audit (audit-newsletter-outputs.py, zero LLM calls) — a genuine offline eval over outputs, gated post-condition. But it's domain-specific (newsletter shape), not a general "did the agent answer correctly" eval suite. Building blocks present; a broad offline-eval harness is not.
Provenance footers 🟡 Building blocks, not formalized RDCO vault notes already carry provenance in frontmatter: source, source_url, source_fidelity (incl. the reconstructed-from-web marker), date. That IS provenance metadata — but it's per-document, not a per-answer output footer with source-tier + freshness + owner. The convention exists; formalizing it as an output footer is the gap.

Honest read: RDCO is strongest exactly where Anthropic spent the most (adversarial review). The two partials (offline evals, provenance footers) are where RDCO has the raw materials but not the formalized system. Neither is a heavy lift to close.

Q3 — A portable provenance-footer spec (for the phData copilot AND RDCO outputs)

The key insight from Anthropic: a provenance footer does not fix silent failure (plausible-but-wrong answers). What it does is give the human the metadata to catch it — it converts an opaque answer into one a person can sanity-check in five seconds. Even a minimal version materially raises trust.

Minimal spec (drop-in):

— Provenance —
Source:   <semantic-layer metric `revenue_net` | table `fct_orders` | doc `pricing.md`>
Tier:     certified | derived | ad-hoc        ← how trustworthy the source is
Freshness: data as of <timestamp>; pipeline last ran <time>
Owner:    <team / person who owns the source>
Confidence: high | medium | low — <one caveat, e.g. "excludes refunds" / "long-tail question, not eval-covered">

Design notes:

Related