Skip to content

L04: contract docs use the corrected agent precompiles (F-1) - #30

Merged
Matr0xshka merged 4 commits into
mainfrom
hup/n7-chain-precompile-followups
Oct 5, 2026
Merged

Matr0xshka merged 4 commits into
mainfrom
hup/n7-chain-precompile-followups

Conversation

@SaulBuilds

@SaulBuilds SaulBuilds commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

What

content/contracts/models.md now matches the contracts on the chain stack (chain PRs #270..#274, in particular #273):

  • The old 0x1000/0x1001/0x1002 addresses are gone. Model registration is a record only.
  • requestInference and inferWithLoRA call 0x0101 through CitratePrecompiles and revert on 40204 today.
  • Training and merges run off chain (TrainingStarted, new MergeRequested event).
  • New "Precompile calls" section covering 0x0101, 0x0106, 0x0108, 0x0112, 0x0113, 0x0121 and 0x0122, and how they fail closed before the activation height. It links the chain's docs/precompiles/AGENT_PRECOMPILES.md instead of copying it.
  • Rule-12 frontmatter in place; content/_generated/content.ts regenerated.

Why

Playbook item fed-F-1: the public contract docs named precompile addresses the contracts no longer use.

Evidence

  • npm run typecheck clean, npm test 110 passed / 4 skipped, npm run build (with postbuild verify:bundle) green, content-lint --strict 0 em-dashes / 0 word findings, truth-lint --no-fetch OK. Run on the stack top (L19: Almanac pages for Hermes, node MCP, skills, personas and fleet wizard (HUP-S11.4) #31 head 5a28b62), which contains this branch.
  • gitleaks over origin/main..HEAD: no leaks.
  • Lane review (L04): pass-after-fixes. The docs page was checked against the contracts on the chain branch; no other content page names 0x1000/0x1001/0x1002. The review fix (core node MCP precompile_call empty reply) landed in citrate-core, not here.

Pre-existing CI blockers (not from this PR, also failing on main)

  • npm audit --audit-level=high fails on a critical next advisory. security: bump next to 16.3.8 (next/og ImageResponse RCE) #27 bumps next to 16.3.8 and should merge first.
  • truth-lint (with fetch) fails because content/chain/_generated/addresses.md is behind the current 40204 address book (npm run docs:addresses). Unchanged by this PR.

NOT done

  • Multi-node devnet run of the chain's scripts/devnet-precompile-check.sh (DGX ask on the sprint issue).
  • US-7.5 AC2/AC3 need the activation height and the multi-node run; 0x0101 inference stays unreachable from contract code on 40204.
  • gate-g4-precompiles / wp-S7-2: activation height and gas schedule are not set. Nothing was scheduled, deployed or activated.
  • fed-F-1 is built, closes on merge: it closes when the chain stack and this PR merge.

Owner decisions (pending owner sign-off)

  • F-2 (planner's recommended default): keep the conservative agent precompile gas placeholders, use the new registry keyed by (committer, root), schedule the activation height together with the F-4 registry redeploy, and accept ADR-2026-10-01-agent-precompiles. Nothing is scheduled; the 40204 pin stays unset.
  • Merge order: this page describes post-#273 contracts, so it should merge only after the chain stack reaches main.
  • The page sets audited_against_sha to the chain stack head fa7c913; re-point it to the merge commit when the chain stack lands.

External asks

📡 DGX team (posted on the sprint issue, @SaulBuilds): build citrate from chain hup/n7-chain-precompile-followups, start every devnet node with the same CITRATE_AGENT_PRECOMPILES_HEIGHT=<H> (at least 60 blocks above the tip), run scripts/devnet-precompile-check.sh with RPC_URLS, DEPLOYER_KEY_FILE (0600) and EXPECT_CHAIN_ID, and post the JSON receipt. Devnet only, never 40204.

Playbook items

  • fed-F-1 (built, closes on merge)
  • US-7.5 / gate-g4-precompiles / wp-S7-2: prep only

Stack (merge in this order)

  1. This PR: hup/n7-chain-precompile-followups -> main (L04, M5)
  2. L19: Almanac pages for Hermes, node MCP, skills, personas and fleet wizard (HUP-S11.4) #31: hup/n7-docs-almanac-retro -> hup/n7-chain-precompile-followups (L19, M7)

Prerequisites: #27 (next bump) and the citrate-chain stack #270..#274. Main is squash-only with linear history; squash each PR in order.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Lqmrq4rH9YBGCDmmemAG8H

…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
SaulBuilds and others added 3 commits October 4, 2026 20:34
… 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
…40204

The chain lane pinned the 40204 agent precompile activation at genesis,
(40204, Some(0)), for the 2026-10-05 reroll (citrate-chain PR #273, ADR
status accepted, gas schedule owner-signed). The page still said the fork
height H was unscheduled and that 0x0112, 0x0113, 0x0121 and 0x0122 were not
active. The table, the activation paragraph and the failure-mode bullet now
say they are live from the first block of the rerolled 40204, and keep the
fail-closed revert guidance for networks where the height is not reached.
content.ts is regenerated to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lqmrq4rH9YBGCDmmemAG8H
…izard (HUP-S11.4) (#31)

* docs(core): Almanac pages for Hermes, node MCP, skills, personas and 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

* docs(core): Hermes page links the deploy gate model, not only the faucet (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

* chore(content): regenerate content.ts with the core Almanac pages

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

* chore(content): regenerate content.ts with the current address page

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>

@BerryManifold BerryManifold left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed current head and check state. Approving for the requested merge train; merge should still wait on branch protection, stack order, and any remaining CI/security gates.

@Matr0xshka Matr0xshka left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed current head and check state. Approving for the requested merge train; merge should still wait on branch protection, stack order, and any remaining CI/security gates.

@Matr0xshka
Matr0xshka merged commit 61e6455 into main Oct 5, 2026
9 checks passed
@Matr0xshka
Matr0xshka deleted the hup/n7-chain-precompile-followups branch October 5, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants