Skip to content

docs: codegen is delegated to freenet-migrate-build - #618

Merged
sanity merged 1 commit into
mainfrom
docs/codegen-delegation
Aug 13, 2026
Merged

docs: codegen is delegated to freenet-migrate-build#618
sanity merged 1 commit into
mainfrom
docs/codegen-delegation

Conversation

@sanity

@sanity sanity commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Problem

Two agent-facing rule files describe the legacy-delegate codegen as something River's own build.rs performs. That stopped being true when River adopted freenet-migrate-build (#398): the build script is now only the entry point, and the generation is done by the crate.

Stale statements:

  • .claude/rules/delegate-migration.md:34 "The UI's build.rs generates Rust code from it at compile time"
  • .claude/rules/delegate-migration.md:90 key-files row "ui/build.rs | Generates LEGACY_DELEGATES const from the delegate TOML"
  • .claude/rules/river-publish.md:163-164 "LEGACY_DELEGATES is generated at compile time from legacy_delegates.toml by ui/build.rs."

common/build.rs has the same shape for the room-contract registry and was described the same way at delegate-migration.md:44.

Approach

Correct the attribution without inflating it. ui/build.rs is still the entry point, so the fix names the delegation rather than rewriting the surrounding procedure:

  • ui/build.rs:125 calls freenet_migrate_build::codegen() with .entry_registry("../legacy_delegates.toml", Component::Delegate) and .delegate_pair_view("LEGACY_DELEGATES").
  • common/build.rs:29 calls the same freenet_migrate_build::codegen() with Component::Contract and .contract_hash_view("LEGACY_ROOM_CONTRACT_CODE_HASHES").
  • What each build script still owns locally is the append-only emptiness gate that asserts on the generated output (ui/build.rs:143-158, common/build.rs:41-46). The wording says so, since that is the part a reader would otherwise assume moved into the crate too.

freenet-migrate-build is pinned at 0.2 in ui/Cargo.toml:108 and common/Cargo.toml:77. Note this is a separate crate from the runtime half freenet-migrate, which is at 0.5 (ui/Cargo.toml:98); the two are at different versions and the doc text does not cite a version for either.

river-publish.md already carries an accurate crate-walk section at :239, so that content is not duplicated. The only addition there is a pointer to the new freenet-migrate-adoption skill from the existing "Release 2 retires the sweep" line.

Testing

Documentation only, no code paths touched. Every claim was read from origin/main source rather than the working tree.

[AI-assisted - Claude]

…in build.rs

Both agent-facing migration rules described `ui/build.rs` as generating the
legacy-delegate table itself. Since #398 the build script is only the entry
point: generation is done by `freenet_migrate_build::codegen()`, and the
script keeps just the local emptiness gate. `common/build.rs` has the same
shape for the room-contract registry.

Also points at the new `freenet-migrate-adoption` skill from the existing
crate-walk section.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FAezAbjCVSmNqa44Ra1nPA
@sanity
sanity merged commit cd4f194 into main Aug 13, 2026
6 checks passed
@sanity
sanity deleted the docs/codegen-delegation branch August 13, 2026 04:57
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.

1 participant