Skip to content

test: prove the call recorder records non-initialize calls - #264

Open
thedavidmeister wants to merge 2 commits into
mainfrom
2026-09-21-issue-122-call-recorder-records
Open

thedavidmeister wants to merge 2 commits into
mainfrom
2026-09-21-issue-122-call-recorder-records

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

Closes #122

testCloneDeterministicInitializeIsTheOnlyCall pins "MUST NOT call any other
functions on the cloned proxy before initialize completes successfully" with
assertEq(selectors.length, 1). That is a negative assertion, and the only
thing in the repo that can make it fail is TestCloneableCallRecorder.fallback()
appending msg.sig. No test ever dispatched a non-initialize selector at a
recorder clone, so that push never executed: the assertion could not tell "the
factory made exactly one call" from "the recorder stopped recording".

testCallRecorderRecordsNonInitializeCalls fuzzes a selector off the fixture's
own declared functions, plus trailing argument bytes, at a factory-deployed
clone, and asserts the sequence becomes [initialize, selector] with the
initialized sData untouched.

QA

  • Discriminating tests: testCallRecorderRecordsNonInitializeCalls
    (test/src/lib/LibICloneableFactoryV4.cloneDeterministic.t.sol).
  • Mutations applied: 1 — TestCloneableCallRecorder.fallback() replaced
    with an empty body, i.e. the detector stops detecting. On main it SURVIVES:
    the cloneDeterministic file stays 20 passed / 0 failed, with
    …InitializeIsTheOnlyCall among the passes — the exact silent vacuity the
    issue names. On this branch the file goes 20 passed / 1 failed, killed by this
    test and nothing else. Unmutated, the whole suite is 79 passed / 0 failed.
  • Oracle: the fixture's own role. …InitializeIsTheOnlyCall is an assertion
    about the factory only if the recorder records; otherwise it is an assertion
    about nothing, and no src/ mutant can say which, because the defect lives in
    test-side code the campaign does not mutate.
  • Category check: the category is "a test-side detector that nothing in the
    suite triggers". Every fixture in test/concrete/ was enumerated against its
    users: TestCloneable's once-only guard and typed-overload revert are
    triggered by test/src/interface/ICloneableV2.initialize.t.sol,
    TestCloneableFailure's non-success return by …InitializeFailureFails on
    both paths, TestCloneableRevert's revert by …InitializeRevertBubbles,
    TestCloneableRawAnswer's raw return by cloneAndInitialize.t.sol,
    TestCloneFactory's delegation by every flow test, and the recorder's
    Initializing event by …EventPrecedesInitialize. The recorder's fallback
    was the only one nothing reached.

Touches test/src/lib/LibICloneableFactoryV4.cloneDeterministic.t.sol, as does
the PR for #166 — both branch off main, about 25 lines apart in that file.

🤖 Generated with Claude Code

thedavidmeister and others added 2 commits September 21, 2026 11:25
`testCloneDeterministicInitializeIsTheOnlyCall` pins the spec's "MUST NOT
call any other functions on the cloned proxy" with `selectors.length == 1`,
and the only thing that can make that assertion fail is
`TestCloneableCallRecorder.fallback` appending `msg.sig`. No test ever
dispatched a non-`initialize` selector at a recorder clone, so the fallback's
push never ran anywhere and nothing separated "the factory made exactly one
call" from "the recorder stopped recording".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this Sep 21, 2026
@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 29 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 11a8a69a-9453-4f32-b33f-c9697c6b943b

📥 Commits

Reviewing files that changed from the base of the PR and between f2d9e5a and 7894aa7.

📒 Files selected for processing (1)
  • test/src/lib/LibICloneableFactoryV4.cloneDeterministic.t.sol

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.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

1 participant