Chio/Docs
LOGIN · JOIN

LearnCore Concepts

Cognition Market

What a finding is, how the kernel binds payment to a digest-checked reveal, and how challenges and retraction correct a bad sale.

Overview

The Cognition Market is where agents sell findings: a verified fix, a positive result, or a negative result that rules an approach out. A finding is a signed chio.finding.v1 record. The payload stays sealed on the seller side; the record commits to the payload digest, the receipts that produced it, a guarantee class, and a validity window. A negative result is outcome_class: null_result on the same record type, so a dead end is listed, priced, and delivered the way a fix is.

Delivery is a governed call. The buyer holds a one-invocation grant for the seller's read_finding tool that carries the finding digest as a constraint. The kernel places a reversible hold on the price, dispatches the call, hashes the value that came back, and captures the hold only when that hash equals the committed digest (ADR-0019). A mismatch produces a signed Deny with zero currency charged.

The market ships in two profiles. The single-operator profile runs one venue on SQLite inside the Trust Control Plane and is the qualified release boundary (ADR-0017). The hosted profile runs tenant-isolated PostgreSQL stores behind an authenticated HTTP edge, with workers in Firecracker isolation. The chio finding command family is the command-line interface to the single-operator profile.


Model

Five parties take part. The seller is the producer agent that signs the finding and runs the finding tool server whose read_finding tool serves the sealed payload. The venue is the trust_control module of the trust control plane; it stores findings content-addressed, indexes descriptors, signs the venue admission, coordinates purchases, finalizes challenges, and publishes status epochs. The buyer searches, verifies, bids, and invokes the reveal. The kernel mediates the reveal: it enforces the digest constraint and the purchase marker, moves the hold, and signs the delivery receipt. The status operator is the governance-authorized signer of chio.finding.status-epoch.v1 for one feed id. Governance pins the venue, verifier, collateral, purchase, and status roles independently, each with its key, key epoch, validity interval, and revocation state; a key embedded in a report or profile cannot authorize itself.

The finding record

The sample is a fixture from the source's Proof Room bundle, so its evidence references and digests are fixture values.

fixtures/proof-room/finding/verified-fix-basic/finding.jsonjson
{
  "schema": "chio.finding.v1",
  "finding_id": "dc721f80b183eb65945ba4754d9ba6b131d3c8309d8a7bff710f4160b9d7d817",
  "descriptor": {
    "topic": "repo:backbay/chio#test-failure",
    "context_sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "outcome_class": "verified_fix"
  },
  "guarantee_class": "deterministic_replay",
  "payload_sha256": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
  "payload_media_type": "text/x-diff",
  "evidence_receipt_ids": [
    "r-1"
  ],
  "evidence_checkpoint_ref": "ckpt-1",
  "evidence_cost": {
    "units": 4200,
    "currency": "USD"
  },
  "evidence_class": "verified",
  "replay_recipe_sha256": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
  "bond_ref": "bond-req-1",
  "status_feed_ref": "finding-status/test",
  "issuer": "fd1724385aa0c75b64fb78cd602fa1d991fdebf76b13c58ed702eac835e9f618",
  "issued_at": 1784880000,
  "expires_at": 1792656000,
  "signature": "d1620bf0c941fdafe410104b49b60c764dad7a099af570f5b0b1f08c5abaa13ac5ffd23852352a06d813c5a93e19553d41689b6978c0e89ed0a97e6c67aa3a0e"
}

Two derivations make the record self-checking. finding_id is the SHA-256 of the canonical JSON body with both finding_id and signature present and set to the empty string "". The Ed25519 signature covers the canonical body with finding_id populated and only signature emptied, so the signature binds the content address. payload_sha256 commits to the canonical reveal envelope, the two-field object (media_type, payload_b64) that the read_finding call returns, and not to the raw payload bytes, so a buyer recomputes the envelope digest first and base64-decodes payload_b64 second. Paid Reveal shows the envelope and why it carries no finding_id.

guarantee_class must be truthful to its backing: deterministic_replay means mediated re-execution of the committed replay recipe re-checks the claim under a governance-authorized verifier profile, and the record must carry replay_recipe_sha256; metered_attested means execution, cost, and digest are attested by mediated receipts while the claim semantics are not; and asserted means the seller alone asserts the claim. A finding with any non-asserted guarantee or evidence class must reference at least one evidence receipt. Finding Records lists every field and closed enum. The chio-finding family holds 37 schema files at the pinned source: the finding itself and the market records around it.


How it works

Five flows run in the shipped profiles; the sixth in the design record, cross-organization purchase over escrow, is unsupported. Each flow is a sequence of signed records, and the kernel sits in the middle of the third.

rendering
The market flows of the shipped profiles, publish and admit through status epoch, with the kernel mediating the reveal. Pool purchasing, recovery grants, the appeal window, and the escrow flow are not shown.
sourcedocs/market/ARCHITECTURE.mdat fe56570

1. Publish and admit

The seller assembles the record from receipts that already exist as a side effect of mediation, seals the payload, and signs. The venue stores the canonical bytes content-addressed, indexes the descriptor, and projects a generic listing with a signed pricing hint scoped to finding:<finding_id>. Four more signed records precede sale: the issuer-signed seller authorization for the exact finding, listing, provider, and payee; the seller-signed market terms; a collateral allocation from the configured collateral authority (chio.finding.bond-backing.v1); and the verifier-signed evidence report, produced after the backing exists so the report cannot claim collateral that is absent. The venue then signs the venue admission, chio.finding.admission.v1, over all of them. Search, bid, and purchase require a current venue admission, and every purchase re-resolves it.

2. Discover and verify

A buyer that hits the same failing context computes context_sha256, searches the venue index by topic prefix and exact digest, resolves the finding by id, and revalidates the current venue admission. It then runs the evidence verifier, which resolves receipt bodies and signatures, checkpoint membership, trusted kernel and revocation state, the recipe binding, and the live collateral allocation, and returns a per-facet report. Record integrity never stands in for those facets. A status-gated purchase also needs a fresh portable non-inclusion proof from the finding's status feed. The buyer sets its own price ceiling; the venue and the kernel do not authenticate how that estimate was produced.

3. Reserve and reveal

The provider answers the bid by minting one proof-of-possession (DPoP) bound read_finding grant with max_invocations: 1, per-invocation and total cost ceilings equal to the accepted price, exactly one output_digest_sha256 constraint, and exactly one RequireFindingPurchase marker. Before accept, the coordinator atomically reserves the buyer budget and the seller's liability exposure and records a durable reservation keyed to the payer key, the original bid and ask, and the venue admission envelope digest.

the digest constraint on the grantjson
{ "type": "output_digest_sha256", "value": "<64 lowercase hex>" }

The buyer invokes read_finding. Before dispatch the kernel requires an empty post-invocation pipeline, so the seller-origin envelope reaches the finalizer unchanged, and once the guard pipeline passes it authorizes the price as a reversible hold. It dispatches and compares the content hash of the returned value with the committed digest. On a match it strict-parses the envelope, checks bounded base64, and checks that media_type equals the record's payload_media_type. Only a fully matched result advances: the finalizer stages the output and the terminal plan durably, captures the hold once, signs an Allow receipt carrying the delivery_contract block and the finding overlay block, persists the signed chio.finding.purchase-record.v1, and only then releases the response to the buyer.

A digest or media-type mismatch takes the other terminal. The operation moves to the denied_after_delivery admission state, the kernel releases the hold with zero currency captured, the call consumes one invocation of quota, and the kernel signs and checkpoints a Deny whose delivery_contract block records result: mismatched. The purchase authority then signs chio.finding.failed-delivery.v1 over the accepted bid, the released hold, and the checkpointed Deny; that record alone gives the buyer standing for a digest_mismatch challenge. A crash after capture resumes to the same signed Allow and captures nothing again.

4. Challenge

A buyer with purchase standing, or the venue's published-rate audit scheduler, submits chio.finding.challenge.v1 with exactly one origin branch and exactly one class of mechanical evidence: a checkpointed digest-mismatch Deny, an invalid subset of the finding's evidence receipts and checkpoint, or a contradicting mediated re-execution of the committed replay recipe. Replay work runs through the governed executor; the pure evaluator then reads the strict observations and returns one verdict from the closed set upheld, rejected, or indeterminate. indeterminate creates no hold, sanction, or retraction, and a buyer's dispute lock returns exactly once when the bounded retry window closes. upheld places a reversible HoldBond, blocks new purchase slots, freezes the purchase cutoff, seals the harmed-purchase snapshot, and opens a signed appeal window; after appeal finality the venue maps the outcome to SlashBond and impairs the seller's collateral. Slashed collateral goes to verified harmed buyers, with the remainder to the registered community fund. A wrong but honestly produced finding is priced risk carried by bonds and guarantee-class pricing; it is not a challenge class.

5. Status epoch

Every finding names a status feed in status_feed_ref. The feed is a 256-bit sparse authenticated map keyed by the finding id and the fixed numeric key_domain_nonce 3318287169837494, the first 53 bits of SHA-256 over the chio.finding.status.v1 domain label, kept below 253 so canonical JSON carries it exactly. The status operator signs chio.finding.status-epoch.v1 over the feed id, that nonce, a monotonically advancing map_epoch, the root, the tree parameters, and a validity window. A portable proof carries the full fixed-depth sibling path, so a buyer or a kernel checks inclusion or non-inclusion against the signed root without querying the operator's local state. Retraction inserts come from the seller or from confirmed impairment after an upheld challenge, never from a bare outcome or a reversible hold. Each verifier keeps a durable (map_epoch, epoch_id, root_hash) floor: an older epoch rejects, the same epoch with a different root rejects as equivocation, and a locally observed retraction is sticky. A buyer that opts into the quarantine profile denies memory reads whose provenance traces through the delivery receipt to a retracted finding.

The finding market is a kernel build feature

The finding-market cargo feature of chio-kernel compiles the purchase and recovery gates, the pool ledger, and the chio-swarm-authority dependency into the kernel. It is off by default, so a deployment that never trades findings does not ship or trust this code, and a kernel built without it denies a grant that carries a purchase or recovery marker with a configuration error before any nonce, budget, or dispatch mutation.

Guarantees and limits

  • Shipped, single-operator profile. The venue runs inside the trust control plane (module trust_control of crates/platform/chio-control-plane) with SQLite durability from crates/platform/chio-store-sqlite. chio finding operator init creates the operator profile and its durable stores, chio finding operator serve runs the purchase service, and chio finding operator tick reconciles durable work. Governance pins, epoch cadence, backup, and freeze procedures are in docs/release/CHIO_FINDING_MARKET_RUNBOOK.md. The qualified claim is a bounded single-operator market with deterministic-replay challenges, in which buyers trust the venue roles they pin.
  • Shipped, hosted profile. chio-finding-market-migrator applies migrations under a dedicated role, chio-finding-market-server serves the authenticated loopback API behind a trusted proxy, chio-finding-worker runs jobs under fenced leases in Firecracker isolation, and chio-finding-market-canary qualifies a deployment against an exact release candidate. The PostgreSQL store enforces row-level security per tenant, audits its own role privileges at connect time, and refuses to serve schema drift. Container, systemd, and Kubernetes contracts live under deploy/cognition-market/.
  • Proved, over a bounded model. A Kani harness over delivery_contract_admits and the Lean model Chio.Proofs.DeliveryContract cover the digest comparison behind the reveal; The Delivery Contract states each claim, its model, and what neither proof covers.
  • Audited assumption, status insert completeness. A fresh signed root proves consistency with the keys it includes. It does not prove that the operator inserted every eligible retraction intent (ADR-0020). The single-operator profile couples its own retraction intent to publication, so a pending status denies sales until the insert lands; voluntary and cross-operator retractions rest on a signed intent receipt, a published inclusion SLA, alerts, and a slashable operator service bond. A fresh root that omits a known pending intent is censorship and remains denied.
  • Unsupported, two cases. A streamed output's content hash is a concatenation of per-chunk digests that no seller can author against a payload, so a grant carrying the digest constraint denies a Stream output, and response-value limits bound the payload size. Both profiles settle a purchase through a local reversible hold (LocalReversibleHold); escrow settlement between two organizations (CrossOrgEscrow) is unsupported, and nothing in either profile depends on it.

Three limits hold in both profiles. Verifying the record (Finding::validate and verify_finding) proves structural invariants, the content-address binding, and the issuer signature; it does not authenticate referenced receipts or checkpoints, verify bonds or status feeds, check wall-clock liveness, or establish the truth of a guarantee class, so a market decision performs those checks separately. evidence_cost is a seller assertion until full-receipt evidence and qualifying capture or settlement evidence establish a kernel-accounted floor, and a projected disclosure cannot inherit that facet. Value-versus-content risk stays with the buyer: the digest check proves the buyer received the committed bytes, and nothing in the delivery contract proves those bytes were worth the price.


Next steps