docs(chain): generated precompile addresses + chain-sync tripwire for the 40204 re-roll - #33
SaulBuilds wants to merge 13 commits into
Conversation
…d calls (F-1) Federation item F-1, the doc half. The model contracts no longer call the unserved 0x1000 / 0x1001 / 0x1002 addresses (citrate-chain PR 273, HUP-S7.2): - ModelRegistry registration is a record only; requestInference calls 0x0101 MODEL_INFERENCE in its native layout. - LoRAFactory training and merges run off chain and are recorded by the operator (TrainingStarted, MergeRequested, completeTraining, completeMerge); inferWithLoRA calls 0x0101 with the adapter id; on-chain LoRA arithmetic is 0x0112 LORA_APPLY / 0x0113 LORA_MERGE. - Every call goes through CitratePrecompiles, which reverts with PrecompileUnavailable instead of reading "no answer" as a result. New "Precompile calls" section: the addresses these contracts use (0x0101, 0x0106, 0x0108, 0x0112, 0x0113, 0x0121, 0x0122), what each does on 40204 today, and the behaviour before the agent precompile activation height (every call reverts; nothing changes until H, which is not scheduled). Byte layouts and gas are not copied: the section links the chain's docs/precompiles/AGENT_PRECOMPILES.md (Rule 9). Failure modes updated. Frontmatter: branch and updated added, audited_against_sha moved to the stack head fa7c913. Merge after the chain stack reaches main: until then the deployed contracts and main still carry the old constants, which the Source section says. content-lint --strict: green. truth-lint: one failure that is already on main (content/chain/_generated/addresses.md behind the 40204 book). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lqmrq4rH9YBGCDmmemAG8H
…the fleet wizard (HUP-S11.4) Five member-facing pages under content/core for the Citrate Core 0.5.0 release: Hermes, the node MCP server, skills and verified learning, the six personas and five tracks (owner-approved names, Operator ships as Crew), and the fleet wizard. Each page follows the STYLE_GUIDE template, carries Rule-12 frontmatter (created, branch, author, status), and links to the technical pages in citrate-core docs/ and the runtime PERSONAS.md instead of copying them (Rule 9). Status labels say Implemented (pre-audit), arriving with 0.5.0, and name what is still pending (owner sign-off defaults, packaged-app and two-machine runs). Publish after the 0.5.0 stacks merge so the linked core docs exist on main. Gates: truth-lint (--no-fetch) OK; content-lint --strict OK (0 em-dashes, 0 word findings); build-content indexes all five pages (104 pages). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lqmrq4rH9YBGCDmmemAG8H
…cet (L19 review) The deploy-gate row pointed at FAUCET_IN_APP and "the deploy gate notes in the core repo". It now links the DeployGate section of src-tauri/formal/README.md and names the faucet link for what it is (deploy gas, off by default). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lqmrq4rH9YBGCDmmemAG8H
…tack Stack order: main -> L04 (contracts/models precompile corrections, F-1) -> L19 (Almanac core pages, HUP-S11.4). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lqmrq4rH9YBGCDmmemAG8H
The stack merge brought in L04's regenerated content.ts, which predates the five content/core pages. npm run build regenerates it anyway (prebuild); committing the regenerated file keeps the tracked copy in step with content/ (2 lines, generated by scripts/build-content.mjs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lqmrq4rH9YBGCDmmemAG8H
… add a chain-sync tripwire Precompile addresses on docs.citrate.ai now come from the chain source: scripts/gen-precompiles.mjs reads PURE_PRECOMPILE_ADDRESSES and AGENT_FORK_PRECOMPILE_ADDRESSES (core/execution/src/precompiles/mod.rs), the 40204 release pin in agent_fork.rs and the book's precompiles block, and writes content/chain/_generated/precompiles.md (/chain/precompile-addresses). The only hand-written input is scripts/lib/precompile-descriptions.mjs; the generator fails when the chain or book has a precompile the map lacks, or the reverse, or when the book and chain disagree on an address. gen-addresses.mjs and gen-precompiles.mjs take --chain <dir> and --check (regenerate in memory, fail on drift, never write). The chain-sync-check workflow runs both against CitrateNetwork/citrate-chain at CITRATE_CHAIN_REF (default main) on PRs, main and daily. The hand-written precompile pages point at the generated table and name the four agent precompiles (active from genesis on 40204 from the 2026-10-05 re-roll). The addresses page is unchanged: it waits for the new book. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lqmrq4rH9YBGCDmmemAG8H
… current book The build job failed at npm audit: next 16.3.3 is inside the range of the critical next/og ImageResponse advisory (GHSA-vcvr-r3jv-pc5j, 16.2.0 to 16.3.5). Behind it, truth-lint fails because addresses.md was generated from the 2026-09-12 book while citrate-chain main holds the 2026-09-30 book (0aab474b). Both also fail on main. package.json and package-lock.json match security/next-16.3.8 byte for byte, and addresses.md is the gen-addresses output for book 0aab474b, so a later merge of that branch adds nothing here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lqmrq4rH9YBGCDmmemAG8H
…o (CI fix) Carries the next 16.3.8 bump and the regenerated address page up the docs stack so npm audit and truth-lint pass here too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lqmrq4rH9YBGCDmmemAG8H
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lqmrq4rH9YBGCDmmemAG8H
Brings in the next 16.3.8 bump (clears the npm audit gate in build) and the address page regenerated from the current book. content.ts conflict resolved by regenerating it with npm run content. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lqmrq4rH9YBGCDmmemAG8H
After the merge of #31 the committed page was built by the base generator and lacked the pointer to the generated precompile page. gen-addresses --check is now up to date against citrate-chain main (book 0aab474b). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lqmrq4rH9YBGCDmmemAG8H
When the chain, the book and the description map disagree, --check now also prints a one-line chain-sync drift summary naming the chain commit and the README sync section, so CI shows a reported drift and not an apparent crash. Test asserts the label. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lqmrq4rH9YBGCDmmemAG8H
The job was named check, the same as the content-lint job. merge-gate's ci aggregate groups check runs by name and judges only the latest one, so the outcome depended on which job finished last and a drift failure could be masked. As chain-sync it is judged on its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lqmrq4rH9YBGCDmmemAG8H
CI triage and fixesThe failures on Inherited from #31's base (now fixed there and merged in):
Introduced by this PR:
Expected red until the re-roll book landsChecks now:
It clears once the genesis commit is on chain main, or once the Local checks on The push used |
Stacked on #31 (
hup/n7-docs-almanac-retro), which sits on #30. All three touchcontent/_generated/content.ts, so merge #30 and #31 first and then retarget this one.What it does
scripts/gen-precompiles.mjs(npm run docs:precompiles) reads citrate-chainPURE_PRECOMPILE_ADDRESSESandAGENT_FORK_PRECOMPILE_ADDRESSES(core/execution/src/precompiles/mod.rs), the 40204 release pin incore/execution/src/agent_fork.rs, and the book'sprecompilesblock. It writescontent/chain/_generated/precompiles.md(new nav page/chain/precompile-addresses). Each row has the short and padded address, the name, the family, what it does, whether contracts can call it (the hosted inference family0x0100to0x0106is not bridged), and its activation on 40204. Activation for the agent four comes from the pin:Some(0)renders as active from genesis.scripts/lib/precompile-descriptions.mjs. The generator exits non-zero if the chain or the book has a precompile the map lacks, if the map has an entry neither of them carries, if the book and the chain disagree on an address, or if an array's declared length does not match the elements read.--checkfor both generators.gen-addresses.mjsandgen-precompiles.mjsnow take--chain <dir>(default../citrate-chain) and--check.--checkregenerates in memory, compares with the committed page, exits non-zero on drift, and writes nothing. It also refuses to pass when there is no chain checkout.npm run docs:chain-checkruns both..github/workflows/chain-sync-check.ymlchecks outCitrateNetwork/citrate-chainatinputs.chain_ref || vars.CITRATE_CHAIN_REF || main(full history) and runs both--checksteps. It runs on PRs, on pushes to main, daily, and on manual dispatch.content/chain/precompiles.mdkeeps its prose and ABI tables but no longer keeps its own address list. It points to the generated page, adds the agent precompiles to the family table, and says they are active from genesis on 40204 from the 2026-10-05 re-roll.precompiles-zkp.mdandresearch/verifiable-inference.mdpoint to the generated list. Incontracts/models.mdthe agent rows and the activation paragraph now say "active from genesis".content/_generated/content.tsis rebuilt. The README has a new "Chain-generated pages" section, and package.json has a//note with the sync line.Addresses are unchanged until the DGX posts the new book
content/chain/_generated/addresses.mdis not regenerated in this PR. It is already stale against chain main: the page was built from bookde518be8(deployedAt 2026-09-12), while chain main has0aab474b(2026-09-30). We are leaving it alone on purpose until the re-roll book lands. Until thengen-addresses --checkreports that drift, and so does the existing truth-lint step incontent-lint.The committed precompile page was generated from citrate-chain
hup/n7-chain-precompile-followups(inputs at5d2219dc). On that ref the 40204 agent pin isNone, so today the page truthfully says the agent four are not activated. Once the genesis commit pinsSome(0), regenerating flips them to "active from genesis".Expected CI state before the sync
Against chain
main,chain-sync-checkis red, and that is the tripwire working:AGENT_FORK_PRECOMPILE_ADDRESSESyet. Neither doesreroll/panic-s1at06bcf06d.Sync after the re-roll (2026-10-05)
Chain side, done by the DGX: commit the new
contracts/addresses/40204.jsonand re-probeverification/address-code.snapshot.jsonwithpython3 verification/check_address_code.py --probe, which the addresses generator requires to match the book'sdeployedAt. The genesis commit carriesAGENT_FORK_PRECOMPILE_ADDRESSESandAGENT_PRECOMPILES_PINS = &[(40204, Some(0))].Then, in citrate-docs:
If the genesis commit is not on chain main yet, set the repo variable
CITRATE_CHAIN_REFto that commit so CI checks against it. If the new book adds the agent precompiles to itsprecompilesblock, the generator will fail until each new book key is added asbook:on its entry inscripts/lib/precompile-descriptions.mjs.Tests run
npm test(vitest): 123 passed, 4 skipped (14 files). The newtest/gen-precompiles.test.tsadds 13 tests: parsing, the length tripwire, a missing description in both directions, a book/chain address mismatch, the honest unpinned output,writeOrCheckdrift without writes, CLI--checkpassing on a matching chain and failing when the chain moves, and CLI refusal without a chain.npm run typecheck: clean.node scripts/content-lint.mjs --strict: OK (0 em-dashes, 0 vocabulary).npm run build(prebuild content, postbuild verify:bundle and the other gates): passes.gen-precompiles --checkagainst the n7 chain ref: up to date.gen-addresses --checkagainst the same book as main: drift, as expected.🤖 Generated with Claude Code
https://claude.ai/code/session_01Lqmrq4rH9YBGCDmmemAG8H