# Contract v3.12: changes from v3.11

*W-contract-v312-held-conversion-for-flow, 2026-09-29 15:23 Beirut onward. Brief: `briefs/W-contract-v312-held-conversion-for-flow.md` (Sprint V30 of `SPRINT-CHAIN-2026-09-27.md`). §7.7 said "USD is the tape's own conversion: `priceUsd` comes from the tape writer, never from a provider figure", and the BSC tapes quote WBNB with no `priceUsd`, so a real document's Money in/out strip could not carry a number. v3.8's held conversion (one provider point, held before `asOf`, within 60 minutes, nearest, earlier on a tie) now applies, unchanged, to the swaps inside a flow interval, and a swap whose quote is a USD stable prices at one through a table keyed by chain and address, never by symbol (build-10b's §13 candidate). One optional key (`conversion` on a flow interval), one new callable (`flow_display_at`, mirrored in JavaScript), five vectors, `legacy-v311/` frozen, no refusal string changed, no stamp move. Nothing under `build-*` was edited. This is not a release.*

## How to check this

```
cd /home/botbox/.openclaw/workspace/projects/caverio/companion-2026-09-26
python3 contract/validate.py                     # exit 0: 199 passed, 0 failed (contract/VALIDATE.out; v3.11: 192)
python3 contract/validate.py --v311-compat       # exit 1 by design: V109, V110 and V113 fail on v3.11 (V113: no callable); the pins V111, V112 pass on both
python3 contract/validate.py --v310-compat       # exit 1 by design, byte-identical to v3.11's output (and --v39, --v38, --v37, --v36, --v34, --v33, --v32, --v31, --v3)
python3 contract/validate.py --doc build-11/data/real/bsc-live-now.json      # exit 0, output byte-identical to v3.11's
python3 contract/validate.py --doc build-10/data/real/bsc-now.json           # the same
python3 contract/validate.py --doc build-10b/data/real/bsc-genius-now.json   # the same (and bsc-tvs-now.json, bsc-hpa-now.json)
python3 contract/validate.py --doc build-9/data/real/solana-now.json         # the same
node contract/js/parity-v312.mjs                 # exit 0: 37 of 37, 12 of 12, 4 of 4, rail 61 of 61 twice, entry cap 11 of 11, flow display 10 of 10; writes contract/PARITY-v312.out
node contract/js/parity-v311.mjs                 # exit 0, PARITY-v311.out byte-identical after the rerun (and parity-v310.mjs, parity-v38.mjs)
node contract/js/parity-v39.mjs                  # exit 0 (rewrites PARITY-v39.out in the same two lines as at v3.10 and v3.11; restored, see Verification)
python3 contract/scripts/count-v312-flow.py      # item 5, read only; its output is contract/scripts/count-v312-flow.out
(cd contract/legacy-v310 && sha256sum -c SHA256) # 16 of 16 OK
(cd contract/legacy-v311 && sha256sum -c SHA256) # 16 of 16 OK
find build-9 build-10 build-10b build-11 -newer contract/legacy-v311/SHA256 -type f   # no output
```

## Freeze and hashes

"Before" means v3.11 exactly as it stood at 15:23 (`legacy-v311/SHA256` written 15:23:29), after the precondition check (`CHANGES-v3.12.md` absent; `pgrep -af 'run-worker[.]sh' | grep -c -E 'build1[0-9]|build[0-9]b?-|contract-v31[3-9]'` printed 0; the runners alive were the launch-agency and cursor-expiry ones, which do not touch this tree) and before the first edit. `legacy-v311/` holds the files `legacy-v310/` holds, in the same naming: `nowat_v311.py`, `clocks_v311.py`, `adapter_v311.py`, `schemas_v311.py`, `projection_v311.py`, `coverage_v311.py`, `board_v311.py`, `validate_v311.py`, `vectors_v311.py`, `companion-v311.schema.json`, `now-v311.schema.json`, `COMPANION-CONTRACT-v311.md`, `state-vectors-v311.json`, `now-v311.json` (the v3.11 `fixtures/now.json`), `VALIDATE-v311.out` (the v3.11 `VALIDATE.out`) and `nowat-v311.js` (the v3.11 `js/nowat.js`). `legacy-v311/SHA256` lists all 16, relative to that folder. Every hash equals the one `CHANGES-v3.11.md` states for the file it landed: nowat `430a65b1…`, board `acbee7e1…`, validate `6f06dd78…`, vectors.py `50a68d95…`, vectors `542e66de…`, contract `3940811e…`, VALIDATE `1f2e6b25…`, JS reader `107e6e7b…`; schemas `aeefae9c…` and `7ebe24dd…` (v3.7's). `js/board.js` (`44102214…`) is not in the list, as `legacy-v310/` has no Board mirror either; v3.12 does not touch it (checked in `check_v312`). `legacy-v310/` is byte for byte as it was (16 of 16 OK).

A v3.12 vector counts only if it passes on v3.12 **and** fails on v3.11, except a pin, which must pass on both. To run the new vectors on v3.11, `validate.py` loads `legacy-v311/nowat_v311.py` bound to `clocks_v311.py` (`N311`). v3.11's `flow_from_swaps` takes no `quote` or `reading`, so the runner passes those only to a writer whose signature takes them (`inspect.signature`), and v3.11 prices the swaps as it always did; v3.11 has no `flow_display_at`, and V113 on it reports `LookupError: v3.11 defines no flow display callable`, counted as a failure as V103's raise was. V01 to V108 are byte-equal to v3.11 (`v311-vectors-unchanged`).

## Item 1. A swap's USD, three ways, in this order

| | Before (v3.11) | After (v3.12) |
|---|---|---|
| **(a) the tape's own price** | the swap's `priceUsd`, `quoteAmount x priceUsd` under `_EXACT` | unchanged; an interval of such swaps carries no `conversion` (V106's output is byte-equal) |
| **(b) the stable rule** | none for a swap: a swap without `priceUsd` nulled its interval. (build-10b wrote `priceUsd: "1"` itself, after binding each quote by address, `CHECKS.md` §13) | the pool's quote (`quote: {chain, address}`) is looked up in `nowat.USD_STABLE_ADDRESSES`, keyed by chain and address, never by symbol; a match prices the swap at one and the interval records `conversion: {basis: tape_usd, quote: <the table's address>, stable: <the table's symbol>}` (V110). A look-alike address, USDT's address with a failed EIP-55 checksum, or USDT's address named on another chain: no USD (V111) |
| **(c) one held point** | none for a swap | the quote is a wrapped native by address (`nowat.WRAPPED_NATIVE`: WBNB is `BNB@bsc`, wrapped SOL is `SOL@sol`), the writer holds a reading of that asset (`reading: {source, asset, availableAt, points: [{at, value}]}`), the reading was held at or before `asOf` (`held_points`), and its point nearest the swap's `at` is within 60 minutes, the earlier on a tie (`nearest_point`, v3.8's rule for a read, written once for the swap): USD `quoteAmount x point` under `_EXACT` (V109). Farther than 60 minutes: no USD (V112) |
| **otherwise** | `usd conversion unavailable` | the same, and the same string: one swap without USD nulls its whole interval, never a half-read total and never 0 (V112) |

**Files.** `nowat.py`: `USD_STABLE_ADDRESSES`, `WRAPPED_NATIVE`, `EVM_ADDRESS_RX` beside `CONVERSION_COVER_MINUTES`; `quote_entry`, `held_points`, `nearest_point` before `flow_from_swaps`; `flow_from_swaps(swaps, intervals, as_of, gaps=(), tape=True, quote=None, reading=None)` with the pricing inside the interval loop. Against `legacy-v311/nowat_v311.py` the body loses 5 lines (the signature, the docstring's last line, the priceUsd test, the product line and the append) and gains the rest (`check_v312`). Called without `quote` and `reading`, it returns what v3.11 returned, so every assembler that imports `contract/nowat.py` today (build-10b's `assemble.py` and `bind-quote.py` do) writes the same bytes.

**Why the symbol set keeps its name.** The brief asked for `USD_STABLES` keyed by chain and address. `nowat.USD_STABLES` is also the price read's check (`admit_price_read`: `native.asset` is `USDT@bsc`, with no address), and build-10b's `assemble.py:197` and `scripts/bind-quote.py` import it as a symbol set from `contract/`, so replacing it would break both on their next run. The address table is therefore `USD_STABLE_ADDRESSES`, and §7.2 says that the stable rule is keyed by chain and address and that `USD_STABLES` is only the price read's symbol check. Keying that check by address too needs the address on the price read, which is still open.

**The table's entries.** BSC only: USDT `0x55d398326f99059fF775485246999027B3197955` and USD1 `0x8d0D000Ee44948FC98c9B98A4FA4921476f08B0d`, the two quotes build-10b bound over RPC (`symbol()` and the pool's `token0()`/`token1()`) and found in the tape's `_pools.json` (14 USDT pools there). The EIP-55 forms were computed offline with ethers' `getAddress`; `check_v312` checks that the table's addresses, lower-cased, are exactly the three build-10b provenance quotes and that `WRAPPED_NATIVE[bsc]` is build-10's WBNB. No other stable is listed: USDC, FDUSD and the Base or Solana stables have no bound address in this workspace, and adding one is a contract edit with its address read. **Matching:** on EVM a swap's quote matches in lower case (as the tape writes it) or exactly in the table's checksummed form; any other mixed case is a failed checksum and matches nothing (no keccak is needed to refuse it). On Solana the base58 string must be equal.

## Item 2. The interval's conversion record and clocks

| | Before (v3.11) | After (v3.12) |
|---|---|---|
| **Record** | none | through (b): `{basis: tape_usd, quote, stable}`. Through (c): `{basis: native_x_provider, source: "provider:coingecko", quote: "BNB@bsc", points: [{at, value}], heldAt}`: the distinct points the interval's swaps used, by clock (V109 uses two, 10:00Z and 10:05Z), each `value` the provider's literal, `heldAt` the reading's `availableAt`. An interval mixing (a) with (c) records (c); mixing (a) with (b) records (b); (b) and (c) cannot meet in one pool. An unread interval carries none (the schema refuses one there) |
| **`availableAt`** | the later of `end` and the last counted swap's `availableAt`, "always `end`" | **the later of `end`, the last counted swap's `availableAt` and `conversion.heldAt`**. A held reading can make an interval available after its end: V109 ends 10:05Z and is available at 10:05:30.500Z; at 10:05:10Z it is not on the page (V113 `before-held`). §7.7's sentence is rewritten; `admit_flow` still refuses only an interval available before its end |
| **Unchanged** | | the grid, completed intervals only, the net derived and never stored, the tape gap first, every refusal string |

## Item 3. The mark on the surface

`nowat.flow_display_at(row, t)` returns `{intervals, reason}` as `flow_at` does, each available interval as `{buyUsd, sellUsd, net, swaps, basis, clock, mark}`: `basis` `native_x_provider` when the interval carries that conversion, else `tape_usd`; `clock` the oldest clock that made the totals, as written (the `end`, and for `native_x_provider` also `heldAt` and every point's `at`, so the earliest point: V113's is `2026-09-28T10:00:00Z`); `mark` `coingecko` for `native_x_provider`, else null; an unread interval has every key null. §7.7 says a surface prints the mark the way the cap does (`· coingecko` in the readout, the point clock in the title, the `rights/ATTRIBUTION-MARKS.md` attribution) and carries the About this data sentence: `Money in and out per interval: tape swaps, USD at each swap's price; where the tape carries no USD, at one held CoinGecko point within the hour, named on the figure.`

## Item 4. Vectors (V109 to V113)

`vectors.py` `neg312` (after `neg311`; constants `_WBNB`, `_USDT`, `_G312`, `_H312`, `_R312`, `_W312`, `_C109`, `_W110`, `_C110`, `_X110`, `_X111`, `_I109`, `_I110`, `_D109`), `state-vectors.json` (113 vectors; its `contract` field stays `companion-v3.7`), `validate.py`: `N311`, `NEG312`, `--v311-compat`, `negative-set-v312`, `v311-vectors-unchanged`, the `flow_from_swaps` op passing `quote` and `reading` and reporting `conversions`, the `flow_display_at` op, and `check_v312` (`held-conversion-flow-v312`). Each carries `briefId` and `since: v3.12`; V111 and V112 also `pin: true`. The reading's two values are build-10's 21:25Z and 21:30Z BNB/USD literals at constructed clocks.

| Id | briefId | What it pins | v3.12 | v3.11 (legacy-v311/) |
|---|---|---|---|---|
| V109 | I1-held-point | One interval 28 Sep 10:00 to 10:05Z, asOf 10:10Z, WBNB quote by address, BNB/USD reading held 10:05:30.500Z with points 10:00Z `762.9555721478321` and 10:05Z `762.5013059392626`. Buy 0.5 WBNB at 10:02Z takes the 10:00Z point: 381.47778607391605, **381.48**; sell 0.25 WBNB at 10:04Z takes the 10:05Z point: 190.62532648481565, **190.63**; `conversion.points` two entries; `availableAt` = `heldAt`; schema-valid (`Flow`) | pass | **fails**: `buyUsd [None] != [381.48]` (`usd conversion unavailable`) |
| V110 | I1-stable-by-address | Buy 125.5 and sell 40.25 USDT on BSC, no `priceUsd`, quote `0x55d3…7955` in lower case and in EIP-55 form: 125.5 and 40.25, `conversion {basis: tape_usd, quote: 0x55d398326f99059fF775485246999027B3197955, stable: USDT}`, `availableAt` the end, no mark; schema-valid | pass | **fails**: both cases `usd conversion unavailable` |
| V111 | I1-stable-not-by-symbol-pin | The same swaps, quote symbol USDT at `0x1111…1111`; the real address with a failed checksum; the real address on `base`: null with `usd conversion unavailable`, no conversion | pass | pass (pin) |
| V112 | I1-no-half-interval-pin | Buy at exactly 60 minutes from the only point (covered), sell at 61 minutes (not): the interval null with `usd conversion unavailable` | pass | pass (pin) |
| V113 | I3-flow-display | `flow_display_at` on V109's interval and a stable-priced one: `{381.48, 190.63, net 190.85, swaps 2, native_x_provider, clock 10:00:00Z, mark coingecko}` and `{125.5, 40.25, net 85.25, swaps 2, tape_usd, clock 10:10:00Z, mark null}` at 10:10Z; no interval at 10:05:10Z (before `heldAt`) | pass | **fails**: `LookupError v3.11 defines no flow display callable` |

`--v311-compat` output:

```
v3.11-compat: negative vectors run against legacy-v311/ (v3.11 code and schema, frozen before the first v3.12 edit)
FAILS-ON-V3.11 V109 (I1-held-point, v3.12 item 1(c): a WBNB swap without priceUsd prices at the nearest held BNB/USD point within 60 minutes): case two-points (): availableAt ['2026-09-28T10:05:00Z'] != ['2026-09-28T10:05:30.500Z']; case two-points (): buyUsd [None] != [381.48]; case two-points (): sellUsd [None] != [190.63]; case two-points (): swaps [None] != [2]; case two-points (): reasons ['usd conversion unavailable'] != [None]; case two-points (): conversions [None] != [{'basis': 'native_x_provider', 'source': 'provider:coingecko', 'quote': 'BNB@bsc', 'points': [{'at': '2026-09-28T10:00:00Z', 'value': '762.9555721478321'}, {'at': '2026-09-28T10:05:00Z', 'value': '762.5013059392626'}], 'heldAt': '2026-09-28T10:05:30.500Z'}]
FAILS-ON-V3.11 V110 (I1-stable-by-address, v3.12 item 1(b): a USDT-quoted swap without priceUsd prices at one, the stable matched by chain and address): case lower-case (): buyUsd [None] != [125.5]; case lower-case (): sellUsd [None] != [40.25]; case lower-case (): swaps [None] != [2]; case lower-case (): reasons ['usd conversion unavailable'] != [None]; case lower-case (): conversions [None] != [{'basis': 'tape_usd', 'quote': '0x55d398326f99059fF775485246999027B3197955', 'stable': 'USDT'}]; case checksummed (): buyUsd [None] != [125.5]; case checksummed (): sellUsd [None] != [40.25]; case checksummed (): swaps [None] != [2]; case checksummed (): reasons ['usd conversion unavailable'] != [None]; case checksummed (): conversions [None] != [{'basis': 'tape_usd', 'quote': '0x55d398326f99059fF775485246999027B3197955', 'stable': 'USDT'}]
PASSES-ON-V3.11 V111 (I1-stable-not-by-symbol-pin, v3.12 pin: a quote whose symbol reads USDT but whose address is not in the table has no USD): no difference (a pin: passes on both by design)
PASSES-ON-V3.11 V112 (I1-no-half-interval-pin, v3.12 pin: one swap 61 minutes from the nearest point leaves the whole interval unread): no difference (a pin: passes on both by design)
FAILS-ON-V3.11 V113 (I3-flow-display, v3.12 item 3: flow_display_at gives a converted interval's basis, its oldest clock and the provider's mark): case at-10:10Z: LookupError v3.11 defines no flow display callable (the surface had no clock or mark for an interval); case before-held: LookupError v3.11 defines no flow display callable (the surface had no clock or mark for an interval)

3 of 3 negative vectors fail on v3.11; 2 pins pass on both, as they must
```

## Item 5. Real documents

**Read, not re-assembled.** `validate.py --doc` on build-11's `bsc-live-now.json`, build-10's `bsc-now.json`, build-10b's `bsc-genius-now.json`, `bsc-tvs-now.json` and `bsc-hpa-now.json`, and build-9's `solana-now.json`: exit 0, `document: OK` on each, and each output **byte-identical** to v3.11's validator on v3.11's files (a copy of `contract/` restored from `legacy-v311/` in `/tmp/w312/root`, the `build-*` folders symlinked read only, compared with `cmp`). `--doc` prints no version label, so there is none to differ. The rail lines, unchanged:

```
build-11  bsc-live-now.json    rail: 61 row-moments (61 per row) through cap_display_at, 0 raised; 1 printed a figure, 60 cap not read (60 titled supply not read at, 0 titled with the price reason)
build-10  bsc-now.json         rail: 61 row-moments (61 per row) through cap_display_at, 0 raised; 0 printed a figure, 61 cap not read (60 titled supply not read at, 1 titled with the price reason)
build-10b bsc-genius-now.json  rail: 61 row-moments (61 per row) through cap_display_at, 0 raised; 1 printed a figure, 60 cap not read (60 titled supply not read at, 0 titled with the price reason)
build-10b bsc-tvs-now.json     rail: 61 row-moments (61 per row) through cap_display_at, 0 raised; 1 printed a figure, 60 cap not read (60 titled supply not read at, 0 titled with the price reason)
build-10b bsc-hpa-now.json     rail: 61 row-moments (61 per row) through cap_display_at, 0 raised; 1 printed a figure, 60 cap not read (60 titled supply not read at, 0 titled with the price reason)
build-9   solana-now.json      rail: 61 row-moments (61 per row) through cap_display_at, 0 raised; 1 printed a figure, 60 cap not read (60 titled supply not read at, 0 titled with the price reason)
```

These documents were written under v3.11 and carry no `conversion` on any interval; v3.12 admits them as they are.

**What re-assembly would price** (`contract/scripts/count-v312-flow.py`, output `contract/scripts/count-v312-flow.out`, read only). For each document the script rebuilds the swaps from the tape files its assembler pinned, with the assembler's rules, on the document's own grid and gaps, and first **reproduces the document**: v3.11's writer (`legacy-v311/nowat_v311.py`) followed by the assemblers' lane ruling of 28 Sep 20:35 (a read interval, zero included, is written `source coverage unknown` until a capture attestation covers it) gives every interval's reason and `availableAt` exactly as on disk, 5 of 5 documents (build-11's two attested read intervals equal the writer's output byte for byte). Then the v3.12 writer on the same swaps, with the pool's quote and, for WBNB, the held reading in build-10's sidecar (`binancecoin` range, held `2026-09-28T23:20:35.948Z`, 23 points 21:25Z to 23:15Z):

| Document | Intervals | Priced with swaps under v3.12 | Read zeros | Unread | Basis |
|---|---:|---:|---:|---:|---|
| 哈基米, build-10 `bsc-live-now.json` (the brief's 2,967) | 2,967 | **27** (18 on one point, 9 on two; all 27 available at `heldAt`, after their end) | 271 | 2,669 `usd conversion unavailable` | 1(c) |
| 哈基米 re-read by build-11 (every pinned tape file) | 3,064 | **38** (29 on one point, 9 on two; 27 available at `heldAt`) | 275 | 2,751 `usd conversion unavailable` | 1(c) |
| GENIUS, build-10b | 2,340 | **1,363** | 305 | 672 `tape gap in this interval` | 1(b) USDT |
| TVS, build-10b | 2,828 | **1,180** | 1,648 | 0 | 1(b) USDT |
| HPA, build-10b | 3,395 | **1,025** | 1,690 | 680 `tape gap in this interval` | 1(b) USD1 |

Two things this shows, and neither is a contract defect. **The reading is two hours wide.** Route B held one range call, 21:25Z to 23:15Z, so only swaps from 20:25Z to 00:15Z can be covered: 27 of 哈基米's 2,696 USD-unavailable intervals, not the rest of its ten days. Pricing the tape needs a reading per stretch of the tape, which is the writer's job (the last section). **The coverage ruling still nulls them.** On every one of these documents the assembler writes a read interval `source coverage unknown` unless a capture attestation covers it (build-11 attests two), so re-assembling today would move 哈基米's 27 intervals from `usd conversion unavailable` to `source coverage unknown`, and GENIUS, TVS and HPA would not move at all (their swaps already priced through build-10b's own `"1"`; v3.12 gives the same totals from the table, with a `conversion` record). The strip fills where both a held reading (or a stable) and a coverage attestation exist.

## Item 6. Schemas, version, stamp

`schemas.py` adds `$defs.FlowConversion` (a `oneOf` of the two records, each strict) and `FlowInterval.conversion` (optional; `additionalProperties` stays false; the null branch now also says `not: {required: [conversion]}`), and the `availableAt` description names `conversion.heldAt`. No key renamed or removed, no pattern changed, no required list changed. The six schema files were regenerated with `schemas.schema_file` exactly as `make.py:1382` writes them (regenerating from `schemas_v311.py` reproduces v3.11's bytes, checked first); `make.py` was not run, so no fixture moved. **`$id` and `meta.contractVersion` stay `companion-v3.7`**: the one key added is optional, so no document written before this sprint is refused by it. `check_v312` strips the additions and finds the rest equal to `legacy-v311/`. The version strings moved to v3.12: the CONTRACT title line and a v3.12 header note, the §7 heading, `validate.py` docstring (a `--v311-compat` entry and check 18) and labels (`v3.12 pass`, `fails on v3.12`, the before-and-after block), `README.md`, `js/README.md`. §7.2 gains **v3.12, the stable rule by address**; §7.7's code block, "A swap's USD, three ways", "The conversion record", `availableAt`, the unread-interval sentence, "The mark on the surface", "Callables" and About this data are rewritten; §11 says why the stamp stays. No migration script.

`check_v311` still states v3.11's facts, now about v3.11's frozen files (`legacy-v311/nowat_v311.py`, `board_v311.py`, `nowat-v311.js` and schemas against `legacy-v310/`), as v3.11 did for `check_v310`; `check_v38` (cover), `check_v39` (exact) and `check_v310` (null assumed) compared the working schemas with v3.7's, v3.8's and v3.9's, and now compare v3.11's, v3.9's and v3.10's frozen schemas, which are those bytes.

## Item 7. JavaScript

`contract/js/nowat.js` adds `flowDisplayAt(row, t)`, the mirror of `flow_display_at` (the oldest clock by `T`, the first on a tie, as `capDisplayAt`), and a header paragraph; nothing is removed (`check_v312`). `flowAt` and `flowNet` read a `conversion`-bearing interval unchanged: the read side forms no product (the net is `decSub` of the stored cents). The writer side, `flow_from_swaps`, stays Python only, as v3.11 stated: no JavaScript flow writer exists in `contract/js/` or in any build's `lib/` (`grep -rl "flowFromSwaps\|flow_from_swaps" build-*/lib` finds nothing). JavaScript's `USD_STABLES` stays the price read's symbol set; the address table is a writer table and has no JavaScript copy until a JavaScript writer exists.

## Item 8. Parity

`contract/js/parity-v312.mjs` and `parity-v312.py`: copies of the v3.11 pair (sections 1 to 5 unchanged), with `--flow` printing V106 and every V109 to V112 case from Python, and a section 6: `flow_display_at` against `flowDisplayAt` on V113's two cases and on each series the Python writer produced (V106, V109, V110 twice, V111 three times, V112), read at its `asOf` with `flow_at`'s net.

| Section | Result |
|---|---|
| 1, vector cases | **37 of 37 byte-equal** (as v3.11) |
| 2, `now_at` | **12 of 12** runs byte-equal |
| 3, STONK a and b, exact and 28-digit | **4 of 4 EQUAL** |
| 4a, rail, as on disk | **61 of 61 EQUAL**; 0 figure, 61 `cap not read`, 0 raised |
| 4b, rail, conversion held, `asOf` 18:15:00Z | **61 of 61 EQUAL**; 1 figure, 60 `cap not read`, 0 raised |
| 5, entry cap | **11 of 11 EQUAL** (as v3.11) |
| 6, flow display | **10 of 10 EQUAL**: V113 `at-10:10Z` and `before-held`; the written V106 (`tape_usd`, clock the end), V109 (`native_x_provider`, clock 10:00Z, mark `coingecko`, net 190.85), V110 twice (`tape_usd`), V111 three times and V112 (every key null) |
| V106, V109 to V112 writer | Python only, printed |

`PARITY-v312.out` `cfe51d56…`.

## Verification

- `python3 contract/validate.py`: exit 0, **199 passed, 0 failed** (v3.11: 192). New: `negative:V109` to `V113` (V111, V112 pins), `v311-vectors-unchanged`, `held-conversion-flow-v312`. `contract/VALIDATE.out` is this run (`c327e758…`).
- `--v311-compat`: exit 1, V109, V110 and V113 fail on v3.11, V111 and V112 pass on both. `--v310-compat`, `--v39-compat`, `--v38-compat`, `--v37-compat`, `--v36-compat`, `--v34-compat`, `--v33-compat`, `--v32-compat`, `--v31-compat`, `--v3-compat`: exit 1 each, **each output byte-identical** to v3.11's validator on v3.11's files (`/tmp/w312/root`, `cmp`), since no older group takes `since: v3.12`.
- `--doc` on the six documents of item 5: exit 0, byte-identical to v3.11's.
- `node contract/js/parity-v312.mjs`: exit 0, every mirrored case EQUAL (item 8). `parity-v311.mjs`, `parity-v310.mjs`, `parity-v38.mjs`: exit 0, `PARITY-v311.out` (`3aaf73ea…`), `PARITY-v310.out` (`768e05a3…`) and `PARITY-v38.out` (`0dc87a96…`) byte-identical after the rerun. `parity-v39.mjs`: exit 0; its rerun rewrote `PARITY-v39.out` in the same two lines v3.10 and v3.11 recorded (section a, the exact product at `17:20:00Z`), and the file was put back to its pre-run bytes (`11a4ce74…`, the hash `CHANGES-v3.9.md` states).
- `(cd contract/legacy-v310 && sha256sum -c SHA256)`: 16 of 16 OK. `(cd contract/legacy-v311 && sha256sum -c SHA256)`: 16 of 16 OK.
- `find build-9 build-10 build-10b build-11 -newer contract/legacy-v311/SHA256 -type f`: no output; nor for any other `build-*` or `design-pass*`. Nothing under `site/`, `reference-*`, `roadmap/` or SR was written by this worker. (`roadmap/roadmap.json` and `site/roadmap/index.html` did change during the run, at the times their mtimes show; this worker never opened them. The roadmap is rebuilt by the orchestrator's landing checks.) No deploy, nothing sent, no network call. a grep of `contract/` outside `legacy-*` for the em dash character (U+2014): nothing.
- **The builds re-pin.** Builds' verify harnesses pin `contract/` byte for byte, and v3.12 moves the pins v3.11 left alone: `js/nowat.js` (`107e6e7b…` to `de18ee47…`) and both schemas (`aeefae9c…`, `7ebe24dd…` to `29d84dfe…`, `51df894e…`). A build that resumes re-pins to these bytes; its pages keep working, since `flowDisplayAt` is added and nothing is removed.
- Hashes: `nowat.py` `9f60bf6e…`; `validate.py` `00e4099a…`; `vectors.py` `e6750bf7…`; `schemas.py` `87d2dcce…`; `state-vectors.json` `68989f8a…`; `COMPANION-CONTRACT-v3.md` `a216d2af…`; `js/nowat.js` `de18ee47…`; `js/parity-v312.mjs` `5f753ed7…`; `js/parity-v312.py` `f5c46166…`; `scripts/count-v312-flow.py` `ea9ee57c…`; `scripts/count-v312-flow.out` `c7e9886c…`; `README.md` `796bd86e…`; `js/README.md` `04636594…`; `companion.schema.json` `29d84dfe…`; `now.schema.json` `51df894e…`; `legacy-v311/SHA256` `c6178d81…`; unchanged: `board.py` `acbee7e1…`, `clocks.py` `d56ef6b8…`, `js/board.js` `44102214…`.

## Still open

1. From v3.11, as far as it still stands: any build whose verify pins `contract/` re-pins to v3.12's bytes when it next runs (this time the JavaScript reader and the schema pin move too). Every build's `lib/board.js` is still the v3.4 port (`b8dfd484…`, 28-digit entry cap, throws on a null assumed supply); the next build that takes the contract copies `contract/js/board.js`. When a JavaScript flow writer appears, its totals take the product and sum exactly (BigInt, `decMul`), its pricing follows item 1, and parity for `flow_from_swaps` starts with V106 and V109 to V112. Everything in CHANGES-v3.7 "Still open" that the builds did not close stands.
2. New: **the reading must span the tape.** One range call held once covers two hours; 27 of 哈基米's 2,967 intervals (38 of 3,064 on build-11's re-read). A writer that wants the strip filled holds readings across the tape's life (see the last section).
3. New: **the coverage ruling, not the conversion, is what still empties the strip** on every real document: re-assembly under v3.12 would print nothing new until a capture attestation covers an interval (build-11 has two). That is B10's and the assemblers' work, not the contract's.
4. New: **the price read's stable check is still by symbol.** `USD_STABLES` checks `PriceRead.native.asset` (`USDT@bsc`), which carries no address. Keying it by address needs the quote address on the read (a key, a stamp question for its own brief).
5. Carried from build-10b §13: a stable is taken at exactly one USD, with no depeg check; USD1's evidence is one pool.
6. New: **no surface prints a converted interval yet.** The builds' Money in/out strip reads `flowAt`; a build that prints a v3.12 interval calls `flowDisplayAt` and prints the mark and the point clock (§7.7).

v3.11's Still open item 3 (a JavaScript flow writer) stands; nothing else it listed is closed here.

## For Bolo's writer

What a writer records so that a document prices under v3.12 (§7.7), in the names §7.7 and the tape already use.

**Per swap** (the input to `flow_from_swaps`): `side` (`buy` | `sell`), `quoteAmount` (the quote asset's amount as the decimal literal the chain gives, never a float), `at` (block time), `availableAt` (the tape's `receivedAt`), `source` (`tape:<chain>`), and `priceUsd` **only when it is USD per one unit of the quote asset that the tape itself holds**. The tape's own `priceUsd` field is USD per **base** token (`priceQuote x quoteUsd`: 0.0339 on 哈基米's first record), not per quote unit, and must never be copied into the swap's `priceUsd`; the assemblers correctly leave it out.

**Per pool**: `quote: {chain, address}`, the quote token's address as bound over RPC (`token0()` / `token1()` and the tape's `_pools.json` agreeing), lower case or EIP-55. The writer never passes a symbol; the contract finds the stable (`USD_STABLE_ADDRESSES`) or the wrapped native (`WRAPPED_NATIVE`) by address.

**Per reading** (for a WBNB or wSOL pool): `{source: "provider:coingecko", asset: "BNB@bsc", availableAt, points: [{at, value}]}`: `availableAt` is when we held it (the sidecar's `fetchedAt`, equal to it), each `at` the provider's clock for the point, each `value` the provider's literal (`parse_float=str`), and the raw bytes and their sha256 kept beside the document, as build-10's `range-raw.json`. A point counts only for swaps within 60 minutes of it and only from `availableAt` on, so to fill a day the writer holds readings that cover the day (CoinGecko's range endpoint returns five-minute points for a window of up to a day); a reading fetched after `asOf` is ignored. **Per record, if the tape keeps its own valuation**: the tape already carries `quoteUsd`, `valuation.at` and `valuation.source` on every record; what it lacks for this rule is the clock at which the tape writer held that quote. With `valuation.fetchedAt` (and `quoteUsd` kept as its literal), the distinct `(valuation.at, quoteUsd, valuation.fetchedAt)` of a stretch are a reading in exactly the shape above, and no second call is needed. A `simple_price` value is a point whose `at` is the provider's `last_updated_at`, not our fetch clock.

**Per interval** (what `flow_from_swaps` returns and the document stores): `start`, `end`, `availableAt` (the later of `end`, the last counted swap's `availableAt` and `conversion.heldAt`), `buyUsd`, `sellUsd` (cents), `swaps`, and `conversion` when (b) or (c) priced a swap; or `buyUsd`, `sellUsd`, `swaps` null with one `reason` (`tape gap in this interval` first, then `usd conversion unavailable`), no `conversion`. Never `netUsd`. The coverage attestation that lets a read interval stand is the writer's too (build-11's `COV.attest`); without it the assemblers write `source coverage unknown` over any number.

**The stable table** lives in `contract/nowat.py` (`USD_STABLE_ADDRESSES`), BSC USDT and USD1 today. A new stable is a contract edit: its chain, its address as read over RPC, and the symbol the table will give it.

Status: DONE
