Skip to content

Concepts and policy

Assertions

An assertion is one source's claim: subject customer:acme, predicate price.enterprise.monthly_inr, value 89000. It carries:

Field Meaning
source a registered source (signed_contracts, hubspot_crm, …). Authority comes from this, never from content
source_ref, evidence where exactly: "contract #928", a quote with its character span, a page, a URL
effective_from / effective_to valid time: when the fact holds in the world, as a half-open range
observed_at when the source said it (freshness is measured from here)
recorded_at transaction time: when the ledger learned it
supersedes_id an explicit "this replaces assertion X"
asserted_by mapper:…, extractor:<model>:<prompt>, agent:…, human:…

The ledger is append-only. A correction is a retraction record; nothing is updated in place.

Two time axes

  • as_of asks "what was true on 1 October?" (valid time).
  • known_at asks "what did we believe on 18 November?" (transaction time).

A replay with known_at uses the policy that was active then. It ignores everything recorded later and doesn't touch the conflict inbox. The answer is exactly what an agent was told at the time.

The eight gates

resolve() is a pure function. It applies these gates in order and writes one trace line per gate:

  1. Identity. Map the name to one subject by canonical id, alias or display name. An ambiguous name returns UNKNOWN.
  2. Applicability. Keep candidates that are valid at as_of, were recorded by known_at, and aren't retracted.
  3. Freshness. Drop candidates older than their source's max_age (measured as as_of − observed_at). If only stale ones remain, the status is STALE.
  4. Authority. Look up each candidate's tier in the policy by (source, predicate). Only the top tier competes. A source missing from the rule's authority map can't win.
  5. Agreement. One value means a winner. Otherwise apply the rule's tie_break; with none, the result is CONFLICT.
  6. Approval. If the rule has require_approval, the winner needs a human approval, or the status is PENDING_APPROVAL.
  7. Consequence. High stakes never guess. Low stakes may return a flagged best guess (best_guess_from).
  8. Drift findings. List lower-tier sources that disagree with the winner, for example "the CRM disagrees with 37 signed contracts".

A supersession is honoured only if the superseding assertion is live and its source has a tier at least as high as the one it replaces. A Slack message can claim to replace a contract; it doesn't.

The policy file

policy_version: 2                 # must increase with every activation
sources:
  signed_contracts:   {tier: 100}
  human_approval:     {tier: 95}
  stripe_billing:     {tier: 80}
  hubspot_crm:        {tier: 50}
  slack:              {tier: 10, max_age: 14d}
  agents:             {tier: 0, propose_only: true}
predicates:
  "price.*":
    stakes: high
    tie_break: none
    equivalence: {money_tolerance: 0}
    drift_findings: true
    authority: {signed_contracts: 100, human_approval: 95, stripe_billing: 80, hubspot_crm: 50, slack: 10}
  "approval_limit.*":
    stakes: high
    require_approval: true
defaults:
  stakes: high
Key Values Meaning
sources.<name>.tier integer ≥ 0 default tier, used when a rule has no authority map
sources.<name>.max_age 14d, 12h, 2w older claims from this source are stale
sources.<name>.propose_only bool may propose, never wins (agents)
predicates.<pattern> price.*, deal.stage the most specific pattern wins; wildcards only as the last segment
stakes high | low high never guesses
tie_break none | latest_observed | latest_effective what happens when the top tier disagrees
equivalence.money_tolerance number values within this count as equal
require_approval bool the winner needs a human approval
authority {source: tier} replaces the default tiers for this pattern; unlisted sources are ineligible
defaults.stakes high for predicates no pattern matches

Duplicate keys in the YAML are rejected, so a pasted second "price.*": can't silently replace the first.

Governance

  • Conflict inbox. A live CONFLICT opens an item (ledger.conflicts()). ledger.approve(conflict_id, assertion_id, approved_by=…, rationale=…) settles it. An approval covers the candidates the human saw; a new top-tier candidate reopens the conflict.
  • Drift report. ledger.drift_report() lists every system that disagrees with a resolved winner.
  • Audit log. Every live resolve logs the query, policy version and a hash of the result.