A context that an agent depends on is an interface. If it changes shape on a Tuesday afternoon, the agent that relied on it does not throw an error; it quietly starts saying something different. That is why contexts in InsightCompose are versioned, reviewed and audited the way teams already treat code.
Software teams solved this problem a long time ago. Interfaces have stable names, changes are proposed, reviewed and merged, versions can be pinned, and the history says who changed what and why. None of that is exotic. It is simply rarely applied to the queries and definitions that business numbers come from. This post covers how each of those habits applies to a context.
A key is an address, and it is never reused
Every context has a key: dotted lower-case words such as uw.book.open_submissions or claims.ops.open_by_line. The key is how every consumer refers to it: the REST path, the MCP tool, the dashboard tile, the audit row. The rule is simple and strict: a key is never reused for a different answer. If the meaning changes enough that the old name would mislead, it gets a new key, and the old one is retired.
That matters most for agents. An assistant that learned last month that broker.book.kpis returns premium, hit ratio and retention by broker must be able to rely on that being true next month, or be told clearly that it is not.
Versions callers can pin
Within a key, the version is bumped whenever the answer's meaning or shape changes: a new column, a different filter, a changed definition of retention. Callers may pin a version. A dashboard that was built and checked against version 3 can stay on version 3 while version 4 is evaluated, and an application can move on its own release schedule rather than the context owner's.
POST /api/dataapi/broker.book.kpis/query
{ "params": { "period": "2026-Q3", "line": ["GL", "WC"] }, "version": 3 }
Responses always state the key and version that answered, so a pinned caller and an unpinned one can tell from the result itself which definition they got.
A fingerprint of what the answer depends on
Version numbers are chosen by people. To make sure nothing slips through, every contract also carries a fingerprint: a hash of the SQL, the parameter contract and the row scope, the three things the rows actually depend on. Two contracts with the same fingerprint return the same rows for the same caller; a change to any of the three changes the fingerprint.
The fingerprint is what a reviewer looks at first. If someone edited a description and the fingerprint is unchanged, the review is quick. If the fingerprint moved, the reviewer reads the diff of the SQL, the parameters and the scope, and decides whether the version should be bumped.
| Change | Fingerprint | What it usually means |
|---|---|---|
| Title, description, example phrasings | Unchanged | Same version; quick review |
| A new optional parameter with a default | Changes | Same answer for old callers; new version, not breaking |
| A new output column | Changes | New version; consumers can adopt it |
| A removed or renamed column, a changed filter | Changes | Breaking; refused unless declared |
| A changed row scope | Changes | Always reviewed closely: it decides whose rows |
Breaking changes are refused unless declared
The response shape of a published context is pinned. A new version that drops a column consumers rely on, renames one or changes its type is a breaking change, and the platform refuses to publish it unless the author declares it as breaking. The declaration is the point: it forces the conversation with the consumers before the change, not after an agent starts quoting the wrong figure.
The catalog's usage numbers make that conversation concrete. The owner can see how many callers, of which kind, called the current version in the last week, and whether they pin it.
Drafts, publish requests and a curator
Authors work in drafts. A draft can be run, checked and changed as often as needed, and nothing a consumer calls is affected. When it is ready, the author raises a publish request. The request carries what a reviewer needs: the diff, the fingerprint, the declared parameters and columns, the scope and masking rules, and who depends on the current version.
A curator approves or sends it back with a reason. Roles keep it that way: members can draft and request, curators approve, administrators manage keys and grants, and auditors can read everything but change nothing. A person who wants something published gets a clear path; nobody gets a quiet one.
Contracts as files next to code
A contract is data, not code. Products keep them as JSON or YAML next to the code that uses them and load them into a registry at start. That means they can live in the same repository, go through the same pull-request review and ship with the same release as the application that calls them.
contracts/ broker.book.kpis.json claims.ops.open_by_line.json uw.book.open_submissions.json # reviewed in the same pull request as the screen that calls it git diff contracts/broker.book.kpis.json
Teams that prefer to author in the product can; teams that prefer files can; existing named queries convert into contracts one for one. Either way the result is the same contract with the same key, version and fingerprint.
Drift caught before a consumer finds it
Warehouses change underneath contexts. A column is renamed in a refactor, a table is replaced by a view, a schema is reorganised. Each time a source is re-indexed, InsightCompose checks every data API, context, insight, metric and dashboard against the schema the warehouse has now, and lists anything that reads a column that is gone. The list can be posted to the team's channel.
An audit trail for definitions, a ledger for calls
Two records answer the two questions an auditor asks. The definition audit trail records every change to a context, metric or glossary term with its author and time: who changed the definition of retention, and when. The call ledger records every call: who asked which version of which context, with what parameters (hashed), and what came back. Together they let you answer, for any figure an agent quoted, which definition produced it and whether that definition had been reviewed.
A practical rule. Treat a context's row scope and masking rules as the most sensitive lines in its file. A change to either should always get a second reviewer, even when the SQL is untouched.
Read more on the governance and security page, or see how a context is laid out in the docs.
Where people stay in charge
- Authors propose; curators publish. No context reaches a consumer without a person approving it.
- Breaking changes need a human declaration. The platform refuses them otherwise.
- Consumers choose when to move. Pinned versions keep working until their owners are ready.
- Owners fix drift. The platform finds it; the person accountable for the context decides the fix.