ADR 0002 — Belt profile and claim desk¶
- Status: proposed
- Date: 2026-10-26
- Deciders: maintainer (to ratify by merging); drafted by an AI agent
- Related: the Outbox-Lifehack platform plan (phases 2 and 3),
e2e/run.py
Context¶
The platform plan joins outbox, zer0-cms, lifehacker.dev, gitorio and scripts into one content pipeline: Sense, Plan, Produce, Verify, Publish, Learn. In lifehacker.dev today those stages coordinate through one shared file (_data/backlog.yml), staggered crons and labels. Two scout runs branched off the same main both mint the next SRC-### id; the repo's merge driver then reports a conflict, and under the older union strategy the file silently gained a duplicate id and doubled keys. The repo's own lint (duplicate-backlog-id) keeps catching it.
outbox already has the missing mechanism: a sender writes an immutable file into its own outbox, and only a relay copies it into inboxes and the ledger. It also has a scorer that judges a confidence race under lag, which matches the Wire desk's main risk, publishing a fact its source no longer supports. Both uses need small protocol and scoring changes, and AGENTS.md requires an ADR for those.
Decision¶
- A second message profile,
belt.protocol/belt.schema.jsondefines ahandoffmessage with akind(idea,assignment,draft,verdict,approval,published,signal), asubject(the stable key of a piece of work), atrace(32 hex digits, shared by every message about that piece), aparent_id(required for kinds that answer another message) and an optionalrefpointing at an artifact instead of carrying its body.src/outbox/belt.pyimplements stations, a relay and the validator. Arena messages keepprotocol/schema.jsonunchanged; v1 messages stay valid. - The relay is the single writer.
BeltRelaytakes an exclusive lock, delivers pending outbox files in one total order, and mints a gaplessseqfor each. It rebuilds what it has delivered fromledger.jsonlon every run, so a crash between an inbox copy and the ledger append is repaired by running it again. A file whosefromdoes not match the station it sits in, names an unknown recipient, or fails validation goes todead_letter.jsonl. - A CloudEvents binding.
to_cloudeventmaps a belt message onto a CloudEvents 1.0 envelope, with the trace as the W3C trace id, so belt traffic can join zer0-cms's event stream later. - Late-resolved truth. A task may open with
expected_answerunset.score_trialthen reportsresolved: falseand leavescorrectandconfidence_inversionasnullinstead of scoring every claim wrong. A resolver re-scores the same ledger once the truth is known. - The claim desk.
src/outbox/claimdesk.pyturns each factual claim in a draft into asource_claimarena task. The scout replays what the claim's sources said over time, the two claimants race as they do today, and the existing winner rule decides at close. A claim passes only if the winner agrees with the draft, is current, and is at least 0.6 confident. Resolution produces Brier scores per verifier and per draft author.
Consequences¶
Positive
- Stages never write shared state, so the id race cannot happen on the belt;
e2e/run.pyreproduces the race with lifehacker.dev's own code and shows the belt path passing its lint. - One ledger traces a piece from idea to correction.
- Factual pieces get a pre-merge check against their sources and a calibration record after the fact.
Negative
- Two schemas to maintain instead of one.
- The relay's lock is
fcntl.flock, so it is POSIX-only (macOS and Linux runners). - A source that is wrong at close still passes the desk; only resolution and a post-publication recheck catch it.
Alternatives considered¶
- Extend
protocol/schema.jsonwith aprofilefield. Rejected: the arena's invariants (no synthesis during a trial, frozen task cards) would have to carve out exceptions inside one schema. - Lock
_data/backlog.ymlinstead. Rejected: a lock serializes one workflow, not every writer across branches; the collision happens at merge time, not write time. - Score unresolved tasks as wrong. Rejected: it reports false confidence inversions for every claim whose truth is not yet known.
Supersedes / Superseded by¶
- Supersedes: none
- Superseded by: none