# Root merge 1 of 2: changeme build, recovery, audit and remediation (25 results) Source labels are the input names under `.imd/reads/artifacts/`. All 25 were present and non-empty; none is missing. Each reports `status: done`. These are reports from the workers, not independently re-run by this merge. I read them only as data. ## 1. Verdict - **Deployment is not approved.** Open findings remain, so the goal rule "never deploy with an open finding" blocks release. - b02-handoff: `tools/check-release.mjs` ran and exited 0 with `releaseReady` false. Eight open findings were listed: LC-01, LC-02, LC-04, LC-08, LC-10, CONFORMANCE-001, RC-01 and FINAL-SITE-01. It also reported no outer site at `dist/index.html`. - b02-audit-final says the same: "Audit target done is NOT deployment approval." - Nothing was deployed. No paid order was placed. Every worker that mentions this says so (b02-handoff, b02-repair, b03-*). - The contract side is built and tested. The website (`changeme.imd.site`) is **not built**. - b02-audit-final records FINAL-SITE-01 (High): the site, frame, styling, history, chat, wallet, proof and recovery UI are missing. - b02-handoff records no `dist/index.html`. - I found no result that delivers the site. That is a gap. ## 2. What was built, by result **b01-cards** (`src/cards/ChangemeCards.sol`) - Abstract ERC721 "changeme"/"CHANGE", uncapped, no ERC-2981, no owner. - Hooks: `roundCid(uint256)` and `_mintCard(to, round, slot, message)`. Token ids start at 1. It uses `_mint`, not `_safeMint`. - `tokenURI` is base64 JSON. The image is an onchain SVG until the round has a CID, then `ipfs://{CID}/cards/{ROUND}.png`. - Vendored OpenZeppelin 5.1.0 subset and forge-std v1.9.4, with provenance in `lib/VENDORED.md`. Solc is pinned to 0.8.28, EVM cancun. - Check: 18 tests passed, exit 0. **b02-toolchain** - Added a pinned solc binary, `tools/forge-test.sh`, `tools/check-audit.mjs` and `tools/README.md`. - `forge-test.sh` fails on zero tests, a skipped test or a wrong compiler. - `check-audit.mjs` checks the structure of findings files only. It does not judge findings. - `git add` failed with exit 128 because `.git/index.lock` is on a read-only filesystem. This recurs in b02-bodies, b02-rules-hostile and b02-rules-recovery. **b02-intake** (`src/intake/*`, mocks, `docs/INTAKE.md`) - The Sourcify-verified Intake v2 runtime matches `cast code`. - At block 26539294: `priceOf(job.open|job.continue @ job-1, IMD)` = 0.5e18, `callbackGas` = 200000, `MAX_BODY_BYTES` = 16384. - IMD is a BridgedFP OFT (OZ ERC20, 18 decimals, no hooks). - Tests run against real etched bytecode and against a mock, so the mock cannot drift. Check: 78 passed. - Caveats it recorded: - Callbacks can be lost. - Intake does not reject a zero `resultHash`. - The Intake owner can change price, writer, callbackGas and payTo. - The engine needs its own reentrancy guard. - A callback writing about 6 fresh slots plus reentry can exceed 200k gas. **b02-bodies** (`src/body/OrderBody.sol`, `docs/BODIES.md`) - Emits compact open and continue JSON with the literal objective and bracketed, slot-ordered messages. - Check: 16 passed. `POST https://api.imd.fun/requests/check` returned HTTP 200 on all five saved examples. - Four had no blockers. - One was a hosted parent. It was rejected for named IPFS on pre-success recovery. A different public parent without an existing binding passed. - Limits: the public receipts do not verify paid-continuation ownership or actual made-by-chat publication. An empty retry replays the original order. Retrying the latest explicit override needs its id again, because it is never stored. **b02-proof** (`src/proof/ResultProof.sol`, `docs/PROOF.md`) - `verifyAndExtract(proof, resultHash)` checks the hash is non-zero and the size is at most 16384. It checks keccak256 of the raw bytes, then runs a strict RFC 8259 parser (depth at most 64). - It requires every `jobId` member to be a 36-byte UUID string, and all of them equal. - Check: 18 passed. - Open: it was not verified from public Intake docs that real results use the key `jobId`. **b02-versions** (`src/version/CidCodec.sol`, `VersionCids.sol`, `docs/VERSIONS.md`) - Decodes the ENSIP-7 contenthash into a CIDv1. The read runs in one self-staticcall capped at 60,000 gas and never reverts. Saves are write-once. - Check: 44 passed. - Namehash of `made-by-chat.identitymd.eth` is `0xc6b13660620ed6a877c2494c7be2cdfdd507666f344d3c004656e51cb7fe5fc8`. - At mainnet registry `0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e`, `resolver`/`owner` of that node were `0x0`/`0x0`. **The name has no resolver or contenthash yet**, so no version CID is stored until IMD sets one. - ENSIP-10 wildcard and CCIP-read resolvers are deliberately not followed. **b02-engine** (`src/Changeme.sol`, `docs/DESIGN.md`) - Fixed Intake and IMD addresses, no owner. Guarded add, retry, skip and save. - Ceiling payments with a current-price top-up. The fifth message or a push orders the build. - Proof-verified continuation, authenticated callbacks and timeout/skip. - URI clipping and best-effort CID saves. - Check: 3 tests, plus a format check. **Rule suites** (all test per rule) - b02-rules-add: 15 tests in `test/rules-add`. They cover all 256 bytes, ceiling dues, changing quotes, top-ups, atomic rollback and 130 cards over 26 rounds. Full suite 192 passed. - b02-rules-callbacks: 21 tests, full suite 213 passed. It repaired a real defect: a duplicate or stale `onResult` re-ran, and a repeat round-1 success could roll `lastSuccessfulRound` back. A per-round `answered` flag fixed it. - Callback gas: worst `onResult` 179,727 (129-byte URI), `onFailure` 62,659, under a 190,000 cap with cold storage. - Forge under-reports gas for very large calldata, so those cases are bounded by success under the cap, not by a number. - b02-rules-recovery: 9 tests, full suite 222 passed. - Retry accepts an empty or valid 36-byte override and collects the full current price. - The failure timestamp is `orderedAt + 1 day`, and skip opens one more day later. - It noted that `docs/DESIGN.md` predates these semantics (it was outside that worker's scope). - Six distinct bodies passed `/requests/check` with HTTP 200 and no blockers. - b02-rules-hostile: 15 tests, full suite 237 passed (15 passed at 1024 fuzz runs). - Repairs: timeout/callback reentrancy, zero and duplicate request ids, bounded returndata, an ENS gas cap and bounded ERC-721 receiver returndata. - ENS CID attribution depends on publisher timing. The onchain contenthash alone cannot authenticate which build published it. ## 3. Independent audits and repairs (chronological) | Result | Revision / hash | Outcome | |---|---|---| | b02-audit-money | 4ebe7bd | 0 findings. Covers ceiling dues, quote changes, remainder, allowance, retry payment, reentrancy and rollback. 237 passed. | | b02-audit-conformance | 4ebe7bd | 1 finding, CONFORMANCE-001 (Medium, external): the ENS name has no resolver or contenthash. 141 landed tests passed. | | b02-audit-lifecycle | 4ebe7bd (sourceHash 8ec9625c…94bb) | 10 findings, all OPEN, 251 passed. See below. | | b02-repair | sourceHash bb14ea38…21af0 | 257 passed, runtime 24,293 B. Repaired delayed proof recovery, live-request completion, callback gas, attempt state and one-based slots. | | b02-audit-recheck | acb3989 | 13 findings, 263 passed. LC-01, 05, 06, 07, 09 and REPAIR-SIZE resolved. LC-03 and LC-08 accepted as specified. New RC-01 open. | | b02-followup | — | Repaired RC-01, 271 passed, runtime 24,535 B. | | b02-audit-final | e6a77cfa…, sourceHash 81138517…42730 (62 blobs, no byte mismatches) | 14 findings, 8 OPEN. 275 passed (baseline 271). | Lifecycle findings (b02-audit-lifecycle): - **LC-01 High.** After a first success, an unusable `result.json` makes every order revert with no recovery. The causes are a nested second `jobId` (JobIdConflict), an id under another key (JobIdMissing), more than 16 KiB, or unavailable bytes. With no request, `markTimedOut`, retry and skip all revert, so the contract locks while contributions are held. - **LC-10 Medium.** The real `result.json` format and `resultHash` definition were unverified. - **LC-02 Low.** A cold 128-byte success needed about 157.4k of the 200k stipend (179.7k measured elsewhere). A lost success cannot be replayed. - **LC-03 Low.** A free skip can front-run a late success. - **LC-04 Low.** Intake success arguments are not bound to the request. - **LC-05..09 Info.** Stale failure views, a dead pre-success proof branch, a misnamed `NotFailed` in add, an unrestricted override parent, and zero-based `messageAt`. Other measured figures: - Cold callback 187,623 (b02-followup, b02-audit-final) versus 187,645 (b02-audit-recheck, b03-proof-fix). Both are under 200,000. - Minimum stipend 135,253 (b02-audit-recheck) versus 135,156 (b02-followup, b02-audit-final). - A 16 KiB proof order costs 4,151,933 gas (b02-audit-recheck). A 32 KiB order costs 8.54M (b03-proof-fix). ## 4. Remediation round (b03) - **b03-website-evidence** (LC-10) - It preserved a 754-byte raw build-website result and matching mainnet Requested/Completed logs, Intake and job API records, and a continuation-check input and response. - The raw result hashes to the Completed `resultHash` and contains its `jobId`. The alternate API route hashes differently. - The public checker validated the sample with no blockers but identified the sample EOA as owner. IMD docs require the same payer for `job.continue`. - No Changeme deployment, contract-owned paid continuation or deployed site proof-attachment run exists, so **LC-10 stays open**. - PublicNode historical logs returned 403. BlockPI worked. - **b03-intake-evidence** (LC-02, LC-04) - The Sourcify ABI matched the repo. Pinned mainnet `eth_getCode` and `eth_call` verified the runtime digest, owner and 200000 stipend. 122 tests passed. - Findings: LC-02 is an owner-set stipend with committed delivery loss and no replay. LC-04 is success arguments unbound, so a completed live attempt can accept a mismatched hash from the authorized writer. - **b03-callback-fix** - No source change. It documented LC-02 and LC-04 as open limitations of Intake, with repair proposals in `audit/e4/callback-repair/REPORT.md`. - It kept the reproduction `test_RC_LC04ResidualAfterUndeliveredLiveCompletion`. 271 passed, plus 105 on the targeted set. - **b03-proof-fix** - It replaced `recoverProof(bytes,uint256)` with `recoverProof(bytes)`, which uses the same semantic `ResultProof.verifyAndExtract` as add. The parser decodes keys and values, including escapes and whitespace. - `MAX_PROOF_BYTES` rose from 16384 to 32768. Runtime is 24,484 B (92 B margin). 271 passed. - It says LC-01 is only partly fixed. Unavailable raw bytes, missing or conflicting `jobId`, and more than 32 KiB stay locked. Resolving that needs a requester decision, and it invented no callback, refund or escape path. - `docs/ABI.json` and `docs/DEPLOY.md` still show the old `recoverProof(bytes,uint256)`. - **b03-publication-evidence** - 18 unpaid checks: 16 had `blockers: []`, and 2 were hosted-parent pre-success `invalid_input` refusals despite HTTP 200. - Pinned block 26540046. Archive reads returned 403. - Open: LC-08 and CONFORMANCE-001 (a delayed previous CID can be locked under a newer round). - Absence before the first build is not failed publication. - **b03-publication-fix** - It stopped a delayed prior CID from being saved for a newer round. When an admitted successor overtakes an unsaved success, automatic CID snapshots close for that lineage. History stays immutable and affected cards keep the SVG. - 272 passed, runtime 24,528 B, 13 emitted bodies. - 12 of 13 checks were clear, and 1 was the hosted-parent refusal. - Open: LC-08 and CONFORMANCE-001. ## 5. Where results disagree or are stale 1. **RC-01 design.** b02-followup bound recovery to `recoverProof(bytes proof, uint256 at)` with a lexical offset. b02-audit-final then reported "RC-01 whitespace parent bypass persists" and listed it open. b03-proof-fix replaced that with the semantic `recoverProof(bytes)`. So the b02-followup design is superseded. b03-proof-fix says the fix awaits independent retest. **No result closes RC-01.** 2. **LC-01 status.** b02-audit-recheck calls it resolved. b02-audit-final reopens it as "proof lock reopened". b03-proof-fix says it is partly fixed with residual lock cases. I treat it as **open** (High). 3. **Test counts** move as the code changes: 192, 213, 222, 237, 251, 257, 263, 271, 275, 272. Different results measured different revisions. The latest, 272 (b03-publication-fix), is not a regression of the 275 in b02-audit-final. b03-callback-fix and b03-proof-fix ran 271 and b03-publication-fix ran 272, with no stated reconciliation to 275. A reconciled final count is not available. 4. **Runtime size** (limit 24,576 B): 24,293 (b02-repair), 24,535 (b02-followup, b02-audit-final, b02-handoff), 24,484 (b03-proof-fix), 24,528 (b03-publication-fix). All are under the limit, with a margin of only 48 to 283 B. 5. **Hosted-parent / named IPFS (LC-08).** b02-audit-recheck calls it "accepted as specified". b02-audit-final lists it open, and b03-publication-* keep it open. Cause: `/requests/check` refuses named `made-by-chat` IPFS with a hosted parent on pre-success recovery. The public checker still returns HTTP 200, so the refusal shows only in `invalid_input`. 6. **Retry-parent behavior.** b02-bodies and b02-rules-recovery agree that an empty retry repeats the original order. b02-engine's `docs/DESIGN.md` narrative predates the recovery semantics (stated in b02-rules-recovery). **Treat DESIGN.md as possibly stale.** 7. **Price.** b02-intake measured `priceOf` = 0.5 IMD at block 26539294, so a message costs ceil(0.5/5) = 0.1 IMD. This matches the goal's "add · 0.1 IMD" label. The goal's "build now · 0.2 IMD" label is not explained by any result; no result checked it, because there is no site. The price is read live from Intake and can change. ## 6. Open items (nothing silently dropped) | ID | Severity | Status | Source | |---|---|---|---| | LC-01 unusable proof locks orders | High | Open; residual cases need a requester decision | b02-audit-final, b03-proof-fix | | FINAL-SITE-01 site missing | High | Open; no site exists | b02-audit-final, b02-handoff | | RC-01 recovery proof override | Medium | Reworked in b03-proof-fix, retest pending | b02-audit-recheck, b02-audit-final, b03-proof-fix | | LC-10 real build-website result / paid continuation | Medium | Open; sample evidence exists, no contract-owned run | b03-website-evidence | | CONFORMANCE-001 ENS resolver unset; CID/card attribution | Medium | Open; the 'delayed CID' part was code-fixed in b03-publication-fix, the resolver part needs IMD | b02-versions, b03-publication-fix | | LC-02 lost callback, owner-set stipend | Low | Open; Intake limitation | b03-intake-evidence, b03-callback-fix | | LC-04 success args unbound | Low | Open; Intake limitation | same | | LC-08 hosted-parent compatibility | Informational | Open | b03-publication-evidence | | LC-03 free skip can front-run a late success | Low | Accepted as specified | b02-audit-recheck | Facts that require someone else's action: - IMD must set a resolver and contenthash for `made-by-chat.identitymd.eth`. - A requester decision is needed on stuck-proof recovery. - A live paid build-website run through the contract has not happened. - Intake's owner-set price, writer, callbackGas and payTo are a trust assumption. ## 7. Unchecked or not found - The site, wallet flow, chat UI, frame rules and bottom bar: no result. - The `cards/{ROUND}.png` screenshot flow and live `/requests/check` of production bodies: only unpaid checks of local bodies were run. - The stale `docs/ABI.json` and `docs/DEPLOY.md` (b03-proof-fix). - Historical source diff: unavailable (git objects missing, exit 128, b02-audit-final). - Whether the earlier hash-pinned figures in section 3 still apply to the final code: the final hashes (b02-audit-final 81138517…42730) predate b03 source changes.