Request a demo
← All articles
Discovery

Outside facts and drift: keeping discovered insights current

Public figures come in under a column contract with citations, or not at all. Each re-index checks every definition for tables and columns that are gone.

· 6 min read · For heads of data, insight owners and platform engineers

An insight that was right in March can be quietly wrong by June. Sometimes the world moved: the public benchmark it compared against has a newer figure. Sometimes the warehouse moved: a column was renamed in a release and the query behind a card now fails, or worse, a dashboard that depends on it shows nothing and nobody notices. Discovery is only useful if what it proposes stays honest after it is published. This last post in the series covers the two mechanisms that keep it that way: outside facts with contracts, and drift checks on every index.

The earlier parts covered where proposals come from, the domain knowledge underneath, guided discovery, content packs and reviewing and publishing.

Part one: outside facts

Where public data is allowed

Many of the most useful insights put an internal figure beside an outside one: your rate change against a published market rate survey, weather losses against a public storm series, growth by state against economic data. Discovery is told to use public data only where an external benchmark genuinely changes the interpretation, not as decoration. A guided brief can turn it off entirely, and each guided proposal says whether it wants public data at all.

When a plan does include a public part, it is held to a contract. The part carries a standalone question that names the series, the period and the geography, and an expect block: the exact columns its rows must come back in (three to six names), and where it matters the grain and the units. A public part proposed without that contract is removed by discovery and refused by the planner, because it could never be checked.

Cited, or refused

Public parts are answered by a public-data search service, under instructions to return only figures it can cite to a named public source, and never to estimate, interpolate or carry a figure from memory. Partial coverage is expected and useful: a handful of cited rows beats none, and a coarser published grain beats an invented finer one.

How an outside fact enters an insightA public part names the columns its rows must come back in. A reply without a citation, or with rows that do not fit, is refused and the part is left open; nothing is estimated to fill the gap.In the planPublic parta standalone questionexpect: columns,grain, unitsCachefresh: servedrefused < 6h:not asked againdueAsk the providercited figures only90 s, one retryOKcitations and rows that matchthe columns: kept for its TTLRefusedno citation or no matching rows:the part is left openErrorprovider could not be asked:recorded, never cached
A public part names the columns its rows must come back in. A reply without a citation, or with rows that do not fit, is refused and the part is left open; nothing is estimated to fill the gap.

What comes back is checked before it is used. Rows whose length does not match the declared columns are dropped. A reply with no citation, or no usable rows, is refused. The part then says, in its narrative, that no citable public figures were available, so it is left open rather than estimated. The rest of the insight still runs and is written up from what was found.

Each public part's section carries its provider, the citations (title, publisher, link and as-of date), the units and any coverage notes. A chart drawn from public rows leaves out a column the source left entirely blank, while the stored rows keep every column the contract asked for. The cost of each call is recorded with the series.

How outside facts stay fresh

Public answers are cached by provider and question, so the same question is not paid for on every run:

OutcomeKept forWhy
OK, with citationsIts time to live, 30 days by default, less a tenthSo last night's warm-up counts as due by tonight's
Refused6 hoursThe web may know more tomorrow, but not in the next minute
Provider errorNot cachedA bad key or a timeout is not an answer; the next run asks again

An author can set a part's time to live in its contract. For home pages, results with a web part are recomputed once they are older than that part's time to live; results that read only the warehouse are recomputed when the warehouse is re-indexed. Either way the answer says when it was computed.

Part two: drift

Every index compares itself with the last one

Each time a source is indexed, InsightCompose keeps a snapshot of its tables, columns and column types. The next index compares with it and records what changed: tables and columns added, removed and retyped. A partial index, of a few chosen tables, compares only the tables it re-read, so choosing different tables is never mistaken for columns disappearing.

Then it checks what that breaks

Knowing that a column went away is half the answer. The other half is which definitions read it. After every index, every definition on the source that carries SQL is parsed and its tables and columns are looked up in the current index:

What each index checksThe comparison says what changed; the reference check says what that breaks. A name that is only an alias or a CTE's output is never reported as missing.Index nsnapshot of tables,columns and typesIndex n+1snapshot againChangestables, columns added,removed, retypedEvery definition with SQLdata APIsinsight parts and saved SQLmetricsgolden questionsdashboards on a broken APIparsed without a modelSchema drifteach broken objectand what is missingAlertone POST when newbreakage appears
The comparison says what changed; the reference check says what that breaks. A name that is only an alias or a CTE's output is never reported as missing.
  • data APIs, by their query;
  • insights, by each part's SQL and any saved or scoped SQL, skipping archived ones;
  • metrics, by their expression, unless rejected;
  • golden questions people trusted or wrote by hand;
  • dashboards built on a data API that is broken.

The parsing uses sqlglot and no model. It resolves one SELECT at a time, so a name that is only an alias or the output of a CTE or subquery is never reported. A column written without its table is looked up in every table the statement reads, and reported only if none of them has it.

Prepare: schema drift on a sourceDemo data
Schema drift: each definition whose SQL reads a table or column the current index does not have, listed with what is missing

The result appears on the source's Prepare page as Schema drift: each broken object, with a link to the page that owns it and exactly what it reads that the index no longer has. A Check now button reruns the check without re-indexing. When a check finds breakage that was not there before and an alert webhook is configured, one JSON message says so, listing what broke.

Drift is found before a caller finds it. Because the check runs at the end of every index, a renamed column shows up as a list of affected data APIs, insights and dashboards the same day, not as an error in someone's application next week.

What a re-index keeps

Re-indexing rebuilds what a machine can derive, so it must not discard what people decided. Column descriptions, roles and additivity a person curated are kept by column name. Join verdicts people gave are kept. A table someone excluded, or whose grain or kind they set, keeps that. The domain pack is mapped again once the index queue has drained, and that leaves your own metrics alone. And the discovery agent's cold read replaces only proposals nobody has acted on.

Keeping discovered insights current, in practice

  1. Re-index on a schedule that matches how often the warehouse changes, and after any schema release.
  2. Configure the alert webhook so new breakage reaches the channel your data team watches.
  3. Read Schema drift after each release, starting with dashboards and data APIs, since those have callers waiting.
  4. Set a public part's time to live to match how often its source publishes: monthly series need less than daily ones.
  5. Treat a refused public part as information. If a benchmark is refused run after run, rephrase its question, widen its grain, or remove the part.

Where people stay in charge

People decide whether discovery may use outside data at all, and every outside figure that enters an insight is cited or the part is left open; nothing is estimated to fill a gap. Drift checks find and report, they do not fix: a person opens each broken data API, insight or dashboard and decides whether to change the SQL, retire the object or restore the column. Re-indexing keeps what people curated, and the alert goes to the people who own the definitions, not to an automated repair.

See your own context layer, on your data

Bring one source and three questions your agents or apps need answered. We will stand up governed contexts over them in your environment and connect an agent to them in a working session.

We reply within one business day. Next comes a 45-minute executive briefing for your CIO or CDO, then, if it fits, a 12-week Innovation POD in your environment.