Files
dingoandClaude Opus 5.5 dd7e8028b0 Complete M7.5 durable batch outcomes and commit resolution
ADR-0063: manifest v2 (360 bytes) binds a per-tick validation trace
object and a canonical decision block by SHA-256. Publication replays the
trace from the committed predecessor's verified payload and requires
every report and the candidate bytes, derives deaths deterministically,
uploads payload and trace with verified read-back, then sends manifest
and decisions to one fenced statement. RegionBatch seals at a terminal
transition or 64 ticks and refuses ticks until durable confirmation.

Schema v5 records the checkpoint, its decisions and outbox rows
atomically; a unique index keeps one terminal outcome per actor
(EVL08), triggers make commits/decisions immutable (EVL09), an exact
retry of a committed ID returns the original receipt, changed bytes
conflict, and read-only resolve_region_commit answers committed/absent/
conflict. Outbox pending/acknowledge give idempotent at-least-once
delivery. Recovery reconciles durable deaths with restored lifecycle
(and archive deaths for the lineage profile).

Validated: Windows CTest 58/58; Linux GCC Debug/Release, clang-tidy and
ASan/UBSan CTest 58/58 each; PostgreSQL suites Release, analysis, ASan
(lost response, committed-after-timeout, terminated orphan retry,
changed bytes, repeated/partial/reordered decisions, gap, outbox
redelivery, history quarantine); five mutations each caught. No
Docker/Gitea CI, process kill, broker or deployment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 17:30:30 -04:00

44 lines
1.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Region batch evidence v1 (M7.5)
Authority: ADR-0063. The codecs are in `src/persistence/region_batch.cpp`. All
integers are little-endian.
## Validation trace object
| Offset | Size | Field |
|---|---|---|
| 0 | 8 | magic `AEVOTRC1` |
| 8 | 4 | trace format = 1 |
| 12 | 4 | checkpoint profile (1 or 2) |
| 16 | 16 | world, region |
| 32 | 16 | predecessor commit ID |
| 48 | 32 | predecessor manifest SHA-256 |
| 80 | 16 | begin_tick, end_tick (1..64 ticks) |
| 96 | 304·(end−begin) | one step per tick, in tick order |
Each 304-byte step is 38 little-endian u64 values in this order:
- **Input:** temperature_mK, source_enabled, bite[5], terminal[2].
- **Report:** tick, captured, retained, capture_heat, grown, unmet, source_status,
assimilated[5], waste[5], terminal_transition, consumer_transition,
decomposed[10].
Report ticks must be exactly begin+1 through end. The object is content-addressed
beside the payload. Manifest v2 carries its length (96 + 304·ticks, which must
match the tick range) and SHA-256. There is no trailing checksum: the manifest
digest is the integrity check.
## Decision block
A decision block is 0 to 8 records, 24 bytes each: tick u64, actor u32
(0 producer, 1 consumer), outcome u32 (1 = death), organism u64. The rules are:
- Records are strictly ordered by (tick, actor), with at most one per actor.
- Each tick lies in (begin_tick, end_tick].
- organism is 0 for profile 1, and the bound archived organism (nonzero) for
profile 2.
- Unknown actor or outcome values are refused, never truncated.
Manifest v2 carries the count and the block's SHA-256; the digest is all zero
exactly when the block is empty. Decisions are derived from the trace: every
terminal transition yields exactly one decision. A durable decision's identity is
(world, region, outcome, actor, tick).