Create a judgment on a prefix
A template is a namespace path ending in/*. Create a judgment there exactly as you would on a namespace:
* as it is and each / as %2F. The SDKs do this for you. The judgment routes work on the prefix path as on a namespace: create, list, get, PATCH, delete, activate, backfill, calibration and threshold recommendations.
Every namespace under acme/prod/ now has needs_escalation. A tenant’s judgment list and get include it, marked with the template it comes from:
Which template a namespace follows
- The most specific prefix wins. Templates do not nest. With templates on
acme/*andacme/prod/*, the namespaceacme/prod/tenant_123inherits only the judgments ofacme/prod/*. That stays true even if every judgment onacme/prod/*is deactivated. - A namespace’s own judgment wins. If a namespace already has a judgment with the template judgment’s name, it keeps its own, and does not inherit that one.
GET /templates lists your organization’s templates, 100 per page, with an optional prefix. It is db.templates.list() in both SDKs. A template stays listed after its judgments are deactivated. GET /namespaces does not list templates. To list the namespaces a template reaches, use GET /namespaces?prefix=acme/prod/.
New and existing tenants
A namespace created after the template’s first version is judged in full, from its first write. A namespace that already existed when you added the template judgment is treated as if you had just created the judgment there. For anon_change judgment, documents written from then on are judged, and existing documents wait for a backfill you confirm, because nothing is backfilled without an estimate.
A backfill on the prefix path covers every tenant:
- Without
confirm, the estimate covers every namespace that follows the template’s judgment. It counts up to 100 of them, spread evenly by name, and scales that to all of them, so it can be off when tenant sizes vary a lot. Each namespace’s counts are reused for 5 minutes, so an estimate can miss the last few minutes of writes. - With
"confirm": true, one job runs the namespaces one at a time. Each stays within its own budget. A namespace whose budget is paused is skipped and its answers staystale, so it does not hold up the rest.
Change the question for every tenant
Create a new version on the prefix path, then activate it there. You get one shadow report, sampled across the tenants, and the job’snamespace is the prefix. Confirming it switches every tenant. force: true skips the report, as on a namespace.
Tenants always follow the template’s active version.
Tenant overrides
A tenant may override two settings of an inherited judgment: its thresholds and its freshness policy. Use the usualPATCH on the tenant’s own path:
- An override replaces the whole object. A thresholds override replaces the template’s whole set, as any threshold
PATCHdoes. A freshness override is the whole freshness setting: once a tenant overrides freshness, a later template change to its debounce does not reach that tenant. - A
PATCHon the prefix path changes the settings of every tenant that has no override of them.
Detach
A tenant that needs more than an override can detach the judgment:ns.judgments.detach(name) in both SDKs. The judgment becomes the tenant’s own copy, and it stops following the template.
- It keeps the template’s version numbers, up to and including the active version, which stays active.
- It keeps the tenant’s effective thresholds and freshness, override or inherited.
- It keeps its answers and evaluations. Nothing is judged again.
- It drops the template’s pooled calibration. Its answers have no
calibratedobject until its own nightly fit on the tenant’s outcomes.
What a tenant cannot do
On an inherited judgment, these return409 conflict:
- Creating a judgment with the inherited name.
- Activating a version. The tenant follows the template’s active version.
- Deleting it. Detach it first.
Calibration across tenants
Tenants post outcomes on their own namespace paths. Calibration on the prefix pools every tenant’s outcomes into one fit per template version and engine epoch, refitted nightly. Every inherited answer uses that pooled fit. The calibration report and threshold recommendations on the prefix path use the pooled outcomes. On a tenant’s path they use that tenant’s outcomes.What stays per tenant
Answers, evaluations, budgets and billing stay with each tenant’s namespace. The limit of 100 active judgments counts a namespace’s own judgments only. A template has its own limit of 100.In the dashboard
- The Templates page lists your templates and each template’s tenants.
- A tenant’s judgment shows the template it comes from, and marks the settings the tenant overrides.
- Detach asks you to confirm before it runs.