Skip to content

test: one contract per file (satisfy rainix single-contract gate)#537

Open
thedavidmeister wants to merge 4 commits into
mainfrom
2026-06-15-one-contract-per-file
Open

test: one contract per file (satisfy rainix single-contract gate)#537
thedavidmeister wants to merge 4 commits into
mainfrom
2026-06-15-one-contract-per-file

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

The rainix rainix-sol-single-contract gate (rainix #214) enforces the Rain convention of one contract / abstract contract per .sol file. 14 pre-existing test files declared more than one contract, which fails the gate and reds main.

This PR splits each offending file so every .sol declares exactly one contract. The primary test contract stays in the original file named after it; each helper / mock / secondary contract moves into its own file named after the contract, carrying the SPDX header, pragma, and the imports it needs. Each original file imports the contracts it still references. This is a pure file reorganization: no test logic or contract behavior changed.

Files split (original -> moved contracts in their own new files)

  • test/src/abstract/BaseRainlangExtern.construction.t.sol (5) -> TestableExtern.sol, EmptyPointersExtern.sol, MismatchedExternMoreOpcodes.sol, MismatchedExternMoreIntegrity.sol
  • test/src/abstract/BaseRainlangExtern.ierc165.t.sol (2) -> ChildRainlangExtern.sol
  • test/src/abstract/BaseRainlangExtern.integrityOpcodeRange.t.sol (2) -> TwoOpExtern.sol
  • test/src/abstract/BaseRainlangSubParser.ierc165.t.sol (2) -> ChildRainlangSubParser.sol
  • test/src/abstract/BaseRainlangSubParser.subParseLiteral2.t.sol (4) -> HappyPathLiteralSubParser.sol, NoMatchLiteralSubParser.sol, MismatchedLiteralSubParser.sol
  • test/src/abstract/BaseRainlangSubParser.subParseWord2.t.sol (3) -> MismatchedWordSubParser.sol, EmptyWordParsersSubParser.sol
  • test/src/concrete/RainlangInterpreter.zeroFunctionPointers.t.sol (2) -> ZeroFPRainlangInterpreter.sol
  • test/src/concrete/RainlangParser.parseMemoryOverflow.t.sol (2) -> ModifierTestParser.sol
  • test/src/concrete/RainlangReferenceExtern.subParserIndexOutOfBounds.t.sol (2) -> MockExternBadLiteralIndex.sol
  • test/src/lib/integrity/LibIntegrityCheck.t.sol (3) -> IntegritySingleOp.sol, IntegrityHighwater.sol
  • test/src/lib/parse/LibSubParse.badSubParserResult.t.sol (2) -> BadLengthSubParser.sol
  • test/src/lib/parse/LibSubParse.constantAccumulation.t.sol (3) -> ConstantReturningSubParser.sol, MultiConstantSubParser.sol
  • test/src/lib/parse/LibSubParse.subParseWords.t.sol (2) -> ContextReturningSubParser.sol
  • test/src/lib/state/LibInterpreterStateDataContract.t.sol (2) -> LibInterpreterStateDataContractExtern.sol

14 files split into 22 new single-contract files; contract count is conserved (36 contracts before and after).

Verification

  • rainix-sol-single-contract exits 0 (no violations remain).
  • forge build clean; forge fmt --check clean.
  • forge test: 1524 passed. The only 16 failures are pre-existing fork tests that need RPC env vars (ARBITRUM_RPC_URL, BASE_RPC_URL, etc.) not set in the local sandbox; they fail identically on clean main and are in files this PR does not touch.

Greens main and unblocks coverage PRs #534 and #536.

🤖 Generated with Claude Code

Split each test .sol that declared more than one contract so every file
declares exactly one. The primary test contract stays in the original
file; each helper/mock/secondary contract moves to its own file named
after the contract, with the SPDX header, pragma, and imports it needs.
Each original file imports the contracts it still references.

Pure file reorganization: no test logic or contract behavior changes.
Satisfies the rainix rainix-sol-single-contract gate (rainix #214),
greening main and unblocking coverage PRs #534 and #536.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this Jun 15, 2026
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@thedavidmeister, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 83a7078d-b248-41d0-aad0-db49bc9ff582

📥 Commits

Reviewing files that changed from the base of the PR and between 8b9bdfb and 23d6050.

📒 Files selected for processing (36)
  • test/src/abstract/BaseRainlangExtern.construction.t.sol
  • test/src/abstract/BaseRainlangExtern.ierc165.t.sol
  • test/src/abstract/BaseRainlangExtern.integrityOpcodeRange.t.sol
  • test/src/abstract/BaseRainlangSubParser.ierc165.t.sol
  • test/src/abstract/BaseRainlangSubParser.subParseLiteral2.t.sol
  • test/src/abstract/BaseRainlangSubParser.subParseWord2.t.sol
  • test/src/abstract/ChildRainlangExtern.sol
  • test/src/abstract/ChildRainlangSubParser.sol
  • test/src/abstract/EmptyPointersExtern.sol
  • test/src/abstract/EmptyWordParsersSubParser.sol
  • test/src/abstract/HappyPathLiteralSubParser.sol
  • test/src/abstract/MismatchedExternMoreIntegrity.sol
  • test/src/abstract/MismatchedExternMoreOpcodes.sol
  • test/src/abstract/MismatchedLiteralSubParser.sol
  • test/src/abstract/MismatchedWordSubParser.sol
  • test/src/abstract/NoMatchLiteralSubParser.sol
  • test/src/abstract/TestableExtern.sol
  • test/src/abstract/TwoOpExtern.sol
  • test/src/concrete/MockExternBadLiteralIndex.sol
  • test/src/concrete/ModifierTestParser.sol
  • test/src/concrete/RainlangInterpreter.zeroFunctionPointers.t.sol
  • test/src/concrete/RainlangParser.parseMemoryOverflow.t.sol
  • test/src/concrete/RainlangReferenceExtern.subParserIndexOutOfBounds.t.sol
  • test/src/concrete/ZeroFPRainlangInterpreter.sol
  • test/src/lib/integrity/IntegrityHighwater.sol
  • test/src/lib/integrity/IntegritySingleOp.sol
  • test/src/lib/integrity/LibIntegrityCheck.t.sol
  • test/src/lib/parse/BadLengthSubParser.sol
  • test/src/lib/parse/ConstantReturningSubParser.sol
  • test/src/lib/parse/ContextReturningSubParser.sol
  • test/src/lib/parse/LibSubParse.badSubParserResult.t.sol
  • test/src/lib/parse/LibSubParse.constantAccumulation.t.sol
  • test/src/lib/parse/LibSubParse.subParseWords.t.sol
  • test/src/lib/parse/MultiConstantSubParser.sol
  • test/src/lib/state/LibInterpreterStateDataContract.t.sol
  • test/src/lib/state/LibInterpreterStateDataContractExtern.sol
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-06-15-one-contract-per-file

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

Copy link
Copy Markdown
Contributor Author

🤖 ai:producer
Producer note: MAIN-STATE red, not PR-caused — the only failures on rainix-sol / test (run 28749242292) are the 5 testProdDeploy* 'Interpreter not deployed' prod-pins; main fails identically (run 28658876491, 2026-07-03). This PR is a pure test-file reorganization (no bytecode change); it greens when main's pending interpreter deploy lands. No empty-commit retrigger pushed — a re-run reproduces the same pins.

@thedavidmeister thedavidmeister added the ai:ready AI vetter: passes review, ready for human decision label Jul 6, 2026
@thedavidmeister

thedavidmeister commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

🤖 ai:vetter
Reviewed 23d6050: ready — re-vet after merge-main-only commit, full-diff line-multiset check confirms pure reorganization with
cost 185 — mechanical file split, gate-verified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai:ready AI vetter: passes review, ready for human decision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant