---
title: "Governed metric definition: JSON Schema and SQL — Ariesnet"
description: "A worked example: one definition in the Core Model, the change that moved it, its JSON Schema and SQL renders, and the CI gate that refuses a wrong grain."
canonical: "https://ariesnet.com/resources/governed-definition-end-to-end"
last_updated: "2026-09-25T07:58:17.005Z"
---

Brief

# One governed definition, end to end

One definition followed from the model to the places it is rendered and the checks that keep them honest — the entry, its change log, the JSON Schema export, the warehouse view, the graph projection, and the gate. Every company, system, person, figure and date in it is fictional.

Published September 5, 2026

Worked example — fictional mid-size insurer. Every company, system, person, figure and date in this document is fictional. It shows what one governed definition looks like from the model to the renders and the checks; it is not a client's model.

NetWrittenPremium is one definition held in three places. The policy admin system computes it as policies are written, the finance warehouse recomputes it for the monthly close, and the broker portal shows a third figure to producers. They disagree on one thing: whether a cancellation nets out in the month it is recorded or at period close. Last quarter that disagreement produced 31 wrong-total tickets — 19 raised by producers, 12 by finance — a fictional count from a fictional incident log, here to show the shape of the cost rather than to promise one.

## 1. The definition in the Core Model

| Field | Value |
| --- | --- |
| Name | NetWrittenPremium |
| Definition | Gross written premium for the period, less cancellations and endorsement reductions, before reinsurance ceded. |
| Grain | One row per policy per accounting month. |
| Owner | Finance Data — the team that can change this sentence. |
| meaningNote | Premium is booked on the policy effective date, not the bind date: a policy bound in March with an April effective date belongs to April. |
| commonMistake | Summing the warehouse column premium_amt, which still carries reinstatement rows and counts a reinstated policy twice. |
| doNotUseFor | Earned premium, commission bases, or any reinsurance-ceded view. Those are separate elements with their own grain. |

## 2. The change

| When | Who | What changed | Why |
| --- | --- | --- | --- |
| 2025-11-04 | Finance Data | First entry. The definition and its grain are written down: one row per policy per accounting month. | Three systems each held a version of this number and none of them was written anywhere. |
| 2026-02-17 | Finance Data, reviewed by Policy Ops | Cancellations net at period close, not in the month the cancellation is recorded. | Mid-month cancellations moved premium between months, so the close never matched the portal. Period close is the basis the statutory filing already uses. |

## 3. Rendered three times

| Keyword | Value |
| --- | --- |
| title | NetWrittenPremium |
| type | object |
| description | Gross written premium less cancellations and endorsement reductions, before reinsurance ceded. One row per policy per accounting month; cancellations net at period close. |
| required | policyId, accountingMonth, netWrittenPremium |
| properties | policyId (string), accountingMonth (string, pattern YYYY-MM), netWrittenPremium (number) |

| Clause | SQL |
| --- | --- |
| select (grain) | policy_id, case when txn_type = 'cancellation' then period_close_month else date_trunc('month', accounting_date) end as accounting_month |
| select (measure) | sum(signed_amount) as net_written_premium |
| from | {{ ref('fct_premium_txn') }} |
| where | txn_type in ('written', 'endorsement', 'cancellation') |
| group by | 1, 2 |

| Clause | Cypher |
| --- | --- |
| MATCH | (p:Policy)-[:HAS_TXN]->(t:PremiumTxn) |
| WHERE | t.txnType IN ['written', 'endorsement', 'cancellation'] |
| WITH (grain) | CASE WHEN t.txnType = 'cancellation' THEN t.periodCloseMonth ELSE date.truncate('month', t.accountingDate) END AS accountingMonth |
| RETURN (grain and measure) | p.policyId, accountingMonth, sum(t.signedAmount) AS netWrittenPremium |

All three are renders of the one entry above, produced from it rather than maintained beside it. We author a Core Model three systems at a time, validate mappings at the boundary, and you leave owning the model in open formats — SQL, Cypher and vector indexes are render targets, not the product.

Four render files — the JSON Schema, a ShEx shape, the SQL view and the Cypher projection — plus the sample engagement clause, the boundary-check skeleton and a sample refuse record are here to download and diff. They are hand-authored illustrations in the formats CoreModels exports and the formats an engagement renders to; they are not a CoreModels export. On 2026-09-05 the SQL view and the Cypher projection were run against PostgreSQL 16 and Neo4j 5 on the same six-row fixture and returned the same three rows, with the cancellation netted in its period-close month; the ShEx shape parses in the reference parser and the JSON Schema compiles under draft 2020-12 and rejects a malformed month. Beside the record sit its schema and an eval fixture that replays the same answer against a frozen contract version and asserts the decision — the check your CI runs from conformance.example.yml is the one your evals assert.

- [net-written-premium.schema.json](https://ariesnet.com/downloads/governed-definition/net-written-premium.schema.json) — JSON Schema (draft 2020-12)
- [net-written-premium.shex](https://ariesnet.com/downloads/governed-definition/net-written-premium.shex) — ShEx shape
- [net_written_premium.sql](https://ariesnet.com/downloads/governed-definition/net_written_premium.sql) — dbt-style SQL view
- [net-written-premium.cypher](https://ariesnet.com/downloads/governed-definition/net-written-premium.cypher) — Cypher projection
- [sample-conformance-clause.md](https://ariesnet.com/downloads/governed-definition/sample-conformance-clause.md) — Sample engagement clause — illustrative
- [conformance.example.yml](https://ariesnet.com/downloads/governed-definition/conformance.example.yml) — Boundary-check configuration skeleton
- [sample-refuse-record.json](https://ariesnet.com/downloads/governed-definition/sample-refuse-record.json) — Sample refuse record — illustrative, fields as the FAQ names them
- [refuse-record.schema.json](https://ariesnet.com/downloads/governed-definition/refuse-record.schema.json) — JSON Schema for the refuse record — illustrative
- [eval-fixture.example.json](https://ariesnet.com/downloads/governed-definition/eval-fixture.example.json) — Eval replay fixture — illustrative

## 4. The gate

The renders are checked on every pull request that touches either of them, and the third check reads the agent tool schema, because agents read the governed model through the MCP endpoint under the permissions of the account they run under. The gate is Ariesnet's engagement practice, run in your own continuous integration. It is not a coremodels.io feature; nothing on the platform switches it on. That is the point: the gate is written into your engagement's conformance contract and your own CI, where your auditor can read it, rather than into a vendor setting nobody outside the vendor can inspect. The clause and the configuration skeleton the engagement leaves behind are in the downloads above, so what 'set in the engagement' means is something you can paste into a Monday deck. Illustration: the grain check below would map to BCBS 239's accuracy-and-integrity principle in a bank's reporting framework; the mapping is written into the engagement, not assumed.

| Check | Passes when | Fails when |
| --- | --- | --- |
| Grain | The view's GROUP BY is exactly the grain in the definition: policy and accounting month. | A change adds coverage_id to the GROUP BY, or drops policy_id. The view now returns a different grain than the definition states, and the total moves. |
| Netting | Cancellation rows are attributed to the period close. | A change routes cancellations back to the month recorded, restoring the old behaviour without touching the definition anyone approved. |
| Agent tool schema | The tool that answers 'net written premium' cites the governed element. | The tool cites a warehouse column instead, so the answer stops following the definition the next time the definition changes. |

Do this for one definition this week

- Pick the definition two teams argue about — the one behind your wrong-total tickets.
- Write its grain in one sentence: one row per what, per what period.
- Find every place it is computed: the transformation project, the reporting layer, the app that shows it to a customer.
- Note which one of those an agent reads, and whether the agent cites the definition or a column.

Questions

## Answered directly

**When two systems disagree on the same metric, how is it resolved and can I reproduce yesterday's answer?**

The disagreement is resolved as a mapping in the Core Model, approved by the owner of each schema, and recorded in the change log with who changed what and when. Agents read the model through the MCP endpoint, so an answer traces to the model version it was read from. Version history is a Team and Enterprise feature on coremodels.io; with it in place, yesterday's version is read back, and the answer with it.

**When two systems disagree on a definition an agent needs, who freezes the mapping, and what does the MCP endpoint do until then?**

The owner of each schema agrees the mapping in the Core Model; that agreement is the freeze, and the change log records who changed what and when. Until it exists, the behaviour at the boundary — whether an agent refuses the answer or returns it with a warning — is set by the conformance contract written into your engagement, not by the platform. The platform publishes no refuse-or-warn default; the engagement sets it. On Managed Operations, every refusal is logged and carried into the incident attribution an auditor receives. Refuse is the default; warn is enabled only for non-binding internal use, every warned answer is labelled non-authoritative, and that configuration is signed off by your named control owner — never by a vendor default and never by a merge.

Terms used

## Definitions

**Conformance gateway**

The control point where context is checked against conformance and efficiency protocols before it is allowed into retrieval or agent use. See also: Context supply chain

**Semantic layer**

The shared meaning layer that aligns terms, entities, and relationships across systems so agents and people interpret the same business facts the same way. See also: Context supply chain

Related engagement

## Want this assessed against your own estate?

The Core Model Blueprint takes one named agent workflow through all seven stages with your systems and your content, and ends in a sequenced Core Model your team could execute without us.

[See the Blueprint](https://ariesnet.com/products/context-supply-chain-assessment)

Next step

## Find out what your context is actually costing you.

We work with enterprise AI and data leadership teams. Thirty minutes, and you keep the map whether or not you go further. Not ready to talk? Read the field guide instead.

[Request an interview](https://ariesnet.com/interview) [Get the field guide](https://ariesnet.com/field-guide)

What happens next

1. The interview. Thirty minutes on your schema landscape — optional parts can extend it to forty-five. You leave with a map of the connectors you need and the wiring it will take to reach one governed Core Model — yours either way.
2. A written scope. Fixed price, fixed dates, named deliverables. Published bands; your fee is fixed in the written scope before we start.
3. A rung on the ladder. We recommend starting at the two-week audit.

Ariesnet Inc

Incorporated 1997 · Texas, United States

ARAMAI is the product group of Ariesnet, Inc., a Texas corporation. CoreModels is its platform, as part of the Schematica suite of solutions. Ariesnet contracts, builds and integrates for clients, and operates; ARAMAI does the research and makes the software.

Contact

- [info@ariesnet.com](mailto:info@ariesnet.com)
- [+1 214-932-3900](tel:+12149323900)
- Texas, United States

Elsewhere

- [CoreModels ↗](https://coremodels.io/)
- [ARAMAI ↗](https://aramai.net/)

© 2026 Ariesnet Inc. All rights reserved. · CoreModels® is a registered trademark. ARAMAI™ and Schematica™ are trademarks. · Elements of CoreModels are patent pending.

## Sitemap

- [Sitemap in markdown](https://ariesnet.com/sitemap.md)
