Repository navigation
docs(design): the E0 receipt, design and ruling packet (E0-08) - #1149
Conversation
PROPOSED design of the E0 receipt: the 13 fields of issue 984 step 10 in one table, the identity of an event under ADR-008 (profile T), the 3 entry points, the start record, the storage and canonical form, the failure rule, the revision rule, and the 5 properties for the Idris2 model. The 8 decisions for the owner are in the pull request body. No code changes. Co-Authored-By: Claude <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b7c443203d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Two rules apply to every row. First, a receipt has no JSON numbers: a count or a | ||
| hit number is a decimal string. That keeps the profile of the proof ledger, in | ||
| which `jq -cS` is canonical. Second, a field that E0 cannot fill is not omitted | ||
| and is not guessed: its name goes into `missing_evidence`. |
There was a problem hiding this comment.
Define how unavailable fields are represented
For every fleet receipt, head_sha is explicitly unavailable, but these lines require the field to be neither omitted nor guessed while its declared type only permits a 40-character hash. Adding its name to missing_evidence does not provide a valid value, and P5 later assumes missing fields are actually absent, so E0-09 cannot build a schema or receipt satisfying all of these rules. Permit omission or a defined null/option representation when the field is listed in missing_evidence.
Useful? React with 👍 / 👎.
| |`assertion` | ||
| |object `{claimed_outcome, file, recipe_id, repo}` | ||
| |The row. `claimed_outcome` is what the producer said (`success` or `failure`). The legacy fleet outcome `success` means only that the fixer exited zero. |
There was a problem hiding this comment.
Include false positives in claimed outcomes
When a qualified row has outcome: "false_positive", OutcomeTracker.qualified_outcome_counts/1 credits it and the receipt vocabulary even provides credited_false_positive, but this assertion definition permits only success or failure. Such a learning update therefore cannot be represented without lying or violating the eventual schema; add false_positive to claimed_outcome.
Useful? React with 👍 / 👎.
| * *Repair.* At the start of a learning cycle, for each recipe that the cycle | ||
| recomputes, every qualified row that has an `event_id` and no receipt gets one | ||
| (a lookup by `event_id`, so it cannot write twice). A receipt whose `event_id` |
There was a problem hiding this comment.
Make receipt deduplication atomic
When two writers or a writer and repair pass handle the same event concurrently, both can observe that no receipt exists and then append it, because the described lookup and File.write(..., [:append]) are separate operations. Append mode only protects an individual write; it does not make the check-and-append atomic, so the design's exactly-one receipt guarantee and P1 can be violated. Specify locking, a single writer, or another atomic uniqueness mechanism.
Useful? React with 👍 / 👎.
| |B. In `persist_outcome/6` (covers the local rows and the imported rows) and at the neural call. The caller passes the context that only it has. | ||
| |2 call sites. One row, one receipt. `E0-09` says "one place for each of the 3 learning paths", so its text changes to 2 places. |
There was a problem hiding this comment.
Emit only one receipt across the neural and import paths
FleetDispatcher.ingest_fix_outcome/1 both sends the qualified event to the neural coordinator and appends its outcome to fix-outcomes.jsonl, which LearningScheduler later imports through persist_outcome/6. Emitting at both call sites therefore handles the same event twice: with the shared producer event_id, the second receipt either violates P1 or is refused after the outcome row has already committed. Define one call site as the owner of the event receipt, or explicitly coordinate the two learner updates under one receipt.
Useful? React with 👍 / 👎.
| * If (2) fails, the event is committed and the derived updates do not run. The | ||
| caller gets an error. For the import it is `{:error, {:receipt_failed, line, reason}}`, | ||
| and the source signature does not advance, as for `write_failed`. The next run | ||
| finds a qualified row with no receipt (see below) and writes it. |
There was a problem hiding this comment.
Preserve import context needed to repair a receipt
If a fleet receipt write fails after the destination outcome row is committed, the next run only has that stored row, while the design says the source line, source-row digest, and producer are context available only during import. E0-11 stores event_id, but the existing destination record does not retain those other required values, so the repair pass cannot reconstruct the promised source, provenance, and row_sha256 fields. Persist the repair inputs with the event row or define a durable lookup of the original source before claiming the next run can write an equivalent receipt.
Useful? React with 👍 / 👎.
| |`event_id` | ||
| |string, ADR-008 v8, *profile T* | ||
| |Minted by the producer before the fix runs (`E0-12`). For a local row, minted by Hypatia when it writes the row (<<d3>>). | ||
| |Yes for a row that has one. A legacy row has none. |
There was a problem hiding this comment.
Mint local event IDs before the fix starts
For local attempts this says Hypatia mints the ID when it writes the outcome row, but the identity rule later requires the producer to mint it before the fix runs. Outcome writing happens after the attempt, so an interrupted local attempt has no durable ID and the local path does not meet the provenance-before-execution guarantee that motivates the start record. Introduce the ID at local attempt creation and carry it into the outcome row instead of generating it during persistence.
Useful? React with 👍 / 👎.
| |`qualification` | ||
| |string, one of `verified`, `failed`, `incomplete`, `still_present`, `rollback_requested`, `unqualified` | ||
| |The `verification` value of the row, as `OutcomeTracker.qualified_outcome_counts/1` reads it. | ||
| |Yes. | ||
| |(never missing) | ||
|
|
||
| |`verdict` | ||
| |string, one of `credited_success`, `credited_failure`, `credited_false_positive`, `audit_only`, `withdrawn` | ||
| |What the single gate did with the event. The receipt records the gate's answer and does not compute its own (see property P2). |
There was a problem hiding this comment.
Retain the evidence required for rollback qualification
qualified_outcome_counts/1 accepts rollback_requested only for a false_positive row whose caused_by is batch_rollback and whose batch_id is nonempty, but neither of those values appears in the receipt fields. Consequently a receipt cannot demonstrate why that event qualified, and P2's verdict function over only qualification and claimed_outcome would treat an otherwise unqualified rollback row identically. Include these gate inputs in the assertion or observations so the receipt can reproduce the actual qualification decision.
Useful? React with 👍 / 👎.
| |`source` | ||
| |object `{kind, log, line}`. `kind` is one of `fleet_import`, `local_rescan`, `local_caller`, `neural_path`. `log` is a path relative to the data root. `line` is a decimal string. | ||
| |The reader that credited the event. | ||
| |Yes. |
There was a problem hiding this comment.
Define the root used by fleet source paths
For a fleet import, the evidence log is under the separately configured Paths.fleet() tree, not under the verisim-data root where receipts and outcomes live. Requiring source.log to be relative to an unspecified singular data root therefore cannot identify the fleet source without an absolute path or .. traversal, despite this field being mandatory. Add a root discriminator or define log relative to the root selected by source.kind.
Useful? React with 👍 / 👎.
| * One receipt on each line. Canonical form: keys sorted, no insignificant | ||
| whitespace, one final LF, ASCII only, no JSON numbers. This is the profile of | ||
| `scripts/proof-ledger.sh`, in which `jq -cS` output is JCS. An encoder that | ||
| meets it is a sort of the keys and a refusal of any non-ASCII byte or number. |
There was a problem hiding this comment.
Support non-ASCII evidence identifiers
A qualified outcome can legitimately contain a non-ASCII repository, file path, or producer name, but the mandated encoder refuses every non-ASCII byte. In that case the outcome row commits, every receipt attempt fails, and the failure rule prevents derived learning indefinitely; the repair pass cannot change the input. Use a canonical encoder that supports Unicode rather than restricting receipt data to ASCII.
Useful? React with 👍 / 👎.
| |P1 |*No two receipts share an `event_id`.* Appending to a ledger that already holds an `event_id` is refused. | ||
| |P2 |*A receipt cannot claim more than its evidence.* A receipt with `qualification` `verified` cannot be built unless `proof_or_test_ref` and `observations` are present, and its `verdict` is a function of `qualification` and `claimed_outcome`, as `qualified_outcome_counts/1` computes it. |
There was a problem hiding this comment.
Define a verdict rule for withdrawal receipts
D7 requires a revision receipt with verdict: "withdrawn", but P2 requires every verdict to be a function of qualification and claimed_outcome exactly as qualified_outcome_counts/1 computes it. That gate has no withdrawal input or result, so no withdrawal receipt can satisfy the stated property and E0-10 cannot prove it. Model withdrawal as an explicit receipt variant or define a separate verdict transition for it.
Useful? React with 👍 / 👎.



What
Work order E0-08.
docs/design/e0-receipt.adoc(statusPROPOSED) defines the E0 receipt: its 13 fields in one table, the identity of an event, the 3 entry points, the start record, the storage, the failure rule and the revision rule, plus the 5 properties for the Idris2 model of E0-10. This pull request changes no code, schema or test.Why
Issue 984, step 10 ("Receipt") and acceptance A7 (#984). The issue's limit: "Do not create a grand new data model before fixing the actual false-learning path", so the receipt is an index into the logs that exist.
Ruling packet: 8 decisions for the owner
Each has a recommended option, labelled as the most correct in the long term. The document gives the consequence of each option and the reason for each rejection (section 7).
persist_outcome/6(local and imported rows) and at the neural call; C. a repair sweep onlypersist_outcome/6. E0-09's text then reads "2 places", not "3".uuid-v8 t), by Hypatia for a local row; B. profile C from the row content; C. keep the(file, line)identityfix-attempts.jsonl, never imported as outcomes; B. a"kind":"start"line infix-outcomes.jsonl; C. nonereceipts/YYYY-MM.jsonlin the profile of the proof ledger (sorted keys, ASCII, no JSON numbers) withreceipt_sha256over all other fields; B. in the outcome log; C. VeriSimDBevent_idand reports a receipt with no row as corrupt; no back-fill; B. receipt first; C. one transaction; D. derived update firstparent_event_ids; a fill never overwrites a present field; a withdrawal hasverdictwithdrawn; B. edit in place; C. only the withdrawal store of E0-07head_shaandsubject_idbefore a stable finding identity existsmissing_evidence; B. fillhead_shafromgit rev-parsein the local rescan only; C. fillsubject_idwith no registered domainQuestions inside the packet that only the owner can answer:
uuid-v8(the Rust command fromtools/uuid-v8inmetadatastician/standards) or Bun forscripts/uuid-v8.js? If neither, E0-12 stops. This is not a gap in ADR-008: the format and the profile are given.subject_id? That is an edit ofdocs/decisions/ADR-008-profile-c-domains.jsoninmetadatastician/standards, which this repository cannot do.Evidence
ea42e423c419379546dbb511edfd7b9fdbeefdf5main(c3e0f283):grep -rn 'chain_version\|parent_event_ids\|subject_id\|missing_evidence' lib schema srcfinds nothing;head_shaoccurs only inlib/merge_orchestration/and 3 rule modules (baseline_health,pr_automerge,research_extensions); the identity comments are atLearningScheduler.local_source_id/2andfleet_source_id/2; the conventionsschema/findings.ncl,Verdict.idr,Retraction.idr,ci_changed.exandverification/proof-ledger.jsonlexist and are read in the document. ADR-008 andtools/uuid-v8/README.adocwere read frommetadatastician/standards(fca1289e) and issue 984 from GitHub.asciidoctor -o /tmp/e0-receipt.html --failure-level=INFO docs/design/e0-receipt.adoc: exit 0, no output (no warning, no info).head_sha,subject_id,event_id,parent_event_ids,source,provenance,assertion,observations,proof_or_test_ref,qualification,verdict,missing_evidence,chain_version) are rows of one table (section 3). The 2 fields added by the owner ruling of 2026-11-14 (pattern_id,match_kind) are in a second, short table.git diff --stat origin/main: 1 file,docs/design/e0-receipt.adoc; nothing underlib/,schema/,src/ortest/.bash scripts/check-readme-claims.sh: exit 0.Not done
PROPOSED. E0-09, E0-10, E0-11 and E0-12 wait for your rulings.FleetDispatcher.ingest_fix_outcome/1writes to a fixed path under~/Documents/hyperpolymath-repos/gitbot-fleet/, and its row has norecipe_idand noverification. E0-05 covers the qualification; neither it nor this document changes the path.e0-supervisorwith Opus at high effort. I could not switch models inside the session that I ran in, so it was written in that session and not at the model that the work order names. Please read the decisions with that in mind.estate-gateschecklist read in part only.mix deps.getneededHEX_CACERTS_PATH=/etc/ssl/certs/ca-certificates.crtin this container.Cost
E0-08, cap $10. Cost unknown: the launch script was not run for real, so there is no ledger line and the agent cannot see its own spend. Check the Console.