Skip to content

Move soldeer release metadata under foundry's [external] section - #36

Merged
thedavidmeister merged 1 commit into
mainfrom
2026-08-18-issue-35-external-package-section
Aug 18, 2026
Merged

Move soldeer release metadata under foundry's [external] section#36
thedavidmeister merged 1 commit into
mainfrom
2026-08-18-issue-35-external-package-section

Conversation

@thedavidmeister

@thedavidmeister thedavidmeister commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Closes #35

Same change as the worked precedents,
rainlanguage/rain.sol.codegen#143 and
rainlanguage/rain.solmem#144.

Verified against main first

Re-measured on e39f90b (main at branch point):

  • foundry.toml still opens with a bare [package], and nix develop -c forge config still prints, on every invocation:

    Warning: Found unknown config section in foundry.toml: [package]
    This notation for profiles has been deprecated and may result in the profile not being registered in future versions.
    Please use [profile.package] instead or run `forge config --fix`.
    
  • The repo does call rainix's autopublish: .github/workflows/package-release.yaml
    is rainix-autopublish.yaml@main with soldeer-package: rain-math-binary, so
    version is the next, unpublished slot (0.1.5, published latest 0.1.4) and
    is rewritten by the release.

  • The issue also says to fix prose naming [package].version. Nothing in this
    repo names it — grep -rn '\[package\]\|package\.version' over
    *.md/*.toml/*.yaml/*.yml/*.nix/*.txt hits foundry.toml:1 and
    nothing else. So this PR is one file.

Changed

[package][external.package], with a comment saying what the section is.
[external.*] is the section foundry reserves for another tool's config and
ignores (foundry-rs/foundry#5866), and it is excluded from forge config --fix
(#12723). forge config --fix was NOT run — mutant 2 below reproduces in this
repo the measurement the issue gives for why its suggestion is worse.

Publishing is provably untouched

rainix-static soldeer-gate at the SHA rainix-autopublish.yaml pins
(53e96a7d), run with only foundry.toml differing:

before: remote=0.1.4 publish=0.1.5 next=0.1.6 OLD=f7307e5f… NEW=f7307e5f…
after:  remote=0.1.4 publish=0.1.5 next=0.1.6 OLD=f7307e5f… NEW=f7307e5f…

Byte-identical content hash, same version/next, same changed=false, both
exit 0. The reader is read_local_version in
rainix-static/src/soldeer_gate.rs — a line scan for the first line matching
is_version_line (version, optional spaces/tabs, =), with no section
awareness anywhere; the file at the pinned 53e96a7d is byte-identical to
rainix main, and every occurrence of the string package in it is a comment,
an error message or a test fixture, never a parse target. The gate runs
forge soldeer push --dry-run internally, so the dry-run also succeeds on the
new section. Autopublish's bump step
(sed -i -E "0,/^version[[:space:]]*=.*/s//version = \"$NEXT\"/" foundry.toml)
applied to the new file rewrites line 7 to 0.1.6 and touches nothing else —
the four added comment lines contain the word version but are # -prefixed,
so they do not match the ^version anchor. foundry.toml is also in
.soldeerignore here, so it is not even in the pushed zip.

Mutation table

There is no executable line in the diff, so the mutants are of the changed TOML
region and the oracles are the tools that read it: forge config,
rainix-static soldeer-gate (what autopublish reads), and the bump sed.
Baseline first, so a "killed" is not a tool that errors on everything.

# Mutant Oracle Result
baseline ([external.package]) forge config 0 warnings
baseline soldeer-gate exit 0, version=0.1.5 next=0.1.6 NEW=f7307e5f…
1 [external.package][package] (revert) forge config killed — 1 warning: Found unknown config section in foundry.toml: [package]
2 [external.package][profile.package] (forge config --fix's suggestion) forge config killed — 2 warnings: Found unknown `name` config for profile `package` , same for version
3 indent the version line by two spaces soldeer-gate killed — exit 1, ::error::foundry.toml has no [package].version
4 version = "0.1.5""0.1.3" soldeer-gate killed — exit 1, ::error::foundry.toml [package].version (0.1.3) is not ahead of the published revision (0.1.4)

Mutants 3 and 4 are the ones that prove the rename did not detach the reader
from the value: the gate still finds that exact line under the new section
header, reports its value, and fails loudly on it. Mutants 3 and 4 both pass
forge config with 0 warnings, and mutants 1 and 2 both pass the gate — neither
oracle alone kills all four, so neither is a rubber stamp.

Checks

Repo toolchain, nix develop (the flake's sol-shell):

  • forge config: warning before, silent after; the 216-line config body is
    otherwise byte-identical (diff clean).
  • forge soldeer install + forge build: exit 0.
  • forge test: 8 passed / 0 failed / 1 suite.
  • forge fmt --check: exit 0. taplo fmt --check foundry.toml (the pre-commit
    hook): exit 0.

Not done here

  • rainix's own text still says [package].version — the soldeer-package input
    description in rainix-autopublish.yaml and soldeer-gate's failure messages
    (visible in mutants 3 and 4 above). Behaviourally correct, since the reader is
    a line scan with no section awareness; it is a rainix change, not this repo's.
  • Unrelated, pre-existing, and NOT touched by this diff: solc, optimizer,
    optimizer_runs, bytecode_hash, cbor_metadata and evm_version sit after
    the [soldeer] header in foundry.toml, so TOML puts them in [soldeer], not
    [profile.default], and forge silently ignores them. forge config on main
    reports evm_version = "osaka", optimizer = false, optimizer_runs = 200,
    bytecode_hash = "ipfs", cbor_metadata = true — foundry defaults, not the
    file's values. Confirmed by moving solc/evm_version under
    [profile.default] on a scratch copy, after which forge config reports
    solc = "0.8.25" / evm_version = "cancun". Identical before and after this
    diff (the config body diff is clean), so it is out of scope here and wants its
    own issue.

QA

  • Discriminating tests: n/a — no Solidity behaviour changes, so there is no
    test/src/** mirror position this belongs in (the tree mirrors src/** by
    subject and release metadata has no src/ counterpart), and a test asserting a
    config file's prose is the kind of doc-binding test that is not written here.
    The discriminating check is a command, run both ways: nix develop -c forge config prints Warning: Found unknown config section in foundry.toml: [package] on origin/main (e39f90b) and prints no warning on this branch.
  • Mutations applied: the four in the table above — section header → [package]
    and → [profile.package], both killed by forge config; version line
    indented and version value lowered below the published revision, both killed
    by rainix-static soldeer-gate at the pinned rainix SHA 53e96a7d. Every
    mutant was run against a recorded unmutated baseline (0 warnings, gate exit 0),
    and each oracle passes two of the four mutants, so neither is vacuously green.
  • Oracle: not the warning text — the tools that actually consume the section.
    foundry's treatment of [external.*] (feat: support external sections in foundry.toml foundry-rs/foundry#5866, #12723) is
    measured through forge config at the nix-pinned toolchain;
    rainix-static/src/soldeer_gate.rs (read_local_version / is_version_line)
    and rainix-autopublish.yaml's bump sed at the SHA that workflow pins are
    what autopublish reads and writes, exercised directly rather than reasoned
    about.
  • Category check: the issue asks for one change — rename [package] to
    [external.package], keep the version line unindented and first, add a
    comment naming the section as another tool's metadata, and fix any prose that
    names [package].version. All four covered; the prose clause is vacuous here
    because no file in the repo names it (grep evidence above). The issue's
    explicit non-goals — running forge config --fix, raising anything upstream —
    are not done.

Summary by CodeRabbit

  • Chores
    • Updated release metadata configuration to align with the automated publishing workflow.
    • Added documentation clarifying how the metadata is used.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ea31bd50-4241-43ab-a255-6a37591454dc

📥 Commits

Reviewing files that changed from the base of the PR and between e39f90b and f621a3c.

📒 Files selected for processing (1)
  • foundry.toml

Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review.


Walkthrough

The Foundry configuration moves release metadata from [package] to [external.package] and adds comments stating that rainix-autopublish consumes the metadata.

Changes

Configuration update

Layer / File(s) Summary
External package metadata
foundry.toml
The package metadata section now uses [external.package]. Comments identify the section as release metadata consumed by rainix-autopublish, not Foundry configuration.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to f621a

This localized metadata change removes the obsolete Foundry warning while preserving release-version handling and build behavior; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: dcatki

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes moving Soldeer release metadata to Foundry's external section.
Linked Issues check ✅ Passed The change addresses issue #35 by moving metadata to [external.package] and preserving the release metadata format.
Out of Scope Changes check ✅ Passed The changes are limited to the requested foundry.toml metadata section and related documentation comments.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-08-18-issue-35-external-package-section

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thedavidmeister
thedavidmeister merged commit a47d3e7 into main Aug 18, 2026
4 checks passed
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.

foundry.toml's bare [package] warns on every forge invocation, and forge's suggested fix makes it worse

1 participant