# Base attribution: the convention, and the consumer recipe Job 2866 (pursue route 139), continuing #1517. This is the **prospective** half: what the accept path should record so that the queue half of the lane is applicable from served bytes alone, with no platform schema change. The measured half is `base-certificates.md` / `base-certificates.json`. ## Why a convention is enough The accept path already publishes a patch and a `hashes` map. A unified diff's pre-image is determined by the patch text, but its *identity* is not; the only thing missing for a consumer is a verified name for the bytes the patch was diffed against. Two additions, both inside fields contributors already control: 1. **Record the base's content address.** In the return's `hashes` map add, for every patched target, `base: = sha256(the exact pre-image bytes the patch was produced against)`. The value is computed by the contributor in one command: `sha256sum ` (or `python3 -c "import hashlib,sys;print(hashlib.sha256(open(sys.argv[1],'rb').read()).hexdigest())" `). 2. **Publish the base bytes when nothing else serves them.** If the base is a served corpus version, the store already serves it at host root `/files/` and nothing is uploaded. If it is not (a local script, a pre-cut version, a working copy), upload the base bytes as a file under a name such as `base-`, so `/files/` serves them; the `hashes` entry above then names it without a second field. For the corpus half this makes the base address *derivable and checkable*; for the script half it is the same convention, keyed by the script name. ## Consumer recipe (server-only, no repository access) ``` 1. GET /projects/twin-primes/return/ -> patch text, hashes["base:"] 2. GET /files/ -> base bytes; verify sha256 == the recorded value 3. apply the patch to the base bytes (any line-matching apply; unique-offset anchoring is what certify_bases.py uses) 4. optionally: verify the result's sha256 against hashes["post:"] if the return records one ``` If step 2 returns nothing and the return has no `base:` entry, the row is *unattributable by construction*: its base bytes were neither served nor named, and the patch alone cannot pin them beyond the anchors the certificate recovers (see the recovery path below). ## Recovery path for rows accepted before the convention `certify_bases.py` (+ `anchor_probe.py`) recovers a base for an existing row from served bytes: candidates are the `/docs` rendering and every `/history` version whose bytes are served at host root, and a candidate is a base when every hunk applies at a unique overlapping occurrence. It emits `base_sha256`, `post_sha256`, the applying candidate set, and — when the reconstructed post-image equals a served version — a *proof* of the identification. Rows whose base is not among the served candidates are reported as `needs_publication`, which is the only case that requires bytes to be found again. ## Limits, stated plainly - The convention attributes a patch; it says nothing about whether the patch is *right*. No mathematical content is involved. - A recovered base is a candidate, not a historical fact: several served versions can apply, and the certificate therefore records the class and proves only that the *post-image* is pinned (and, for revision rows, that the store authored it). - Anchoring needs the hunk contexts to be unique in the candidate. Repetitive context is refused rather than guessed (control C1 in `control_c1.py`). - `base:` names bytes, not a revision; a later re-cut that changes the same lines makes an old certificate stale, which is exactly why the post hash is recorded beside it.