Skip to content

Test order-clearer and order context words for both orders in clear3 - #2937

Merged
thedavidmeister merged 2 commits into
mainfrom
clear-bob-order-clearer-test
Oct 27, 2026
Merged

thedavidmeister merged 2 commits into
mainfrom
clear-bob-order-clearer-test

Conversation

@thedavidmeister

@thedavidmeister thedavidmeister commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Closes #2936

doClear now takes bob's calculate/handle sources. New testClearBothOrdersContextWords makes both orders ensure raindex(), sender(), order-owner(), order-counterparty() and order-clearer() in calculate and handle IO, so bob's clearing = true in clear3 is pinned. Existing clear tests keep their behaviour (bob stays _ _:1 1;:;).

QA

  • Discriminating tests: testClearBothOrdersContextWords - main's code is correct, so it passes on base (targeted --match-test testClear run, 3/3 pass); it fails under the M03 mutant below, which every other test survives
  • Mutations applied: src/concrete/raindex/RaindexV6.sol clear3 bob's calculateOrderIO last arg true -> false (M03, Build.sol regenerated) -> killed by testClearBothOrdersContextWords only (panic: array out-of-bounds access (0x32)); testClearCalculateContextWords / testClearHandleIOContextWords pass under it
  • Oracle: test constants - CLEARER is the pranked clear3 caller, TAKER/ACTOR are the pranked owners of bob/alice; counterparty of each order is the other order's owner
  • Category check: issue asks bob's calculate and handle IO read order-clearer() == clearer with alice's still checked; covered both sides x both sources, plus bob's owner/counterparty/sender/raindex
  • pre-commit run --all-files: clean

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Expanded coverage for clearing both orders, verifying that each order’s calculation and handling sources receive the expected owner and counterparty context.

Closes #2936

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this Oct 26, 2026
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between d84b25c and 05133f3.

Files selected for processing: 1
  • test/concrete/raindex/RaindexV6.contextWordEntrypoints.t.sol

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The clear test helper now accepts calculate and handle sources for both orders. Updated tests check context words in both orders’ calculate and handle sources.

Changes: Clear context-word tests

Layer / File(s) Summary
Configure and check both orders
test/concrete/raindex/RaindexV6.contextWordEntrypoints.t.sol
doClear accepts separate calculate and handle sources for each order. The tests check the TAKER order’s clearer, owner, and counterparty context alongside the ACTOR order’s context. A new test covers both orders’ calculate and handle sources.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

Merge Risk: Minimal · up to 05133

The PR adds the intended clear context-word coverage without an established merge-blocking risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Test order-clearer and order context words for both orders in clear3" matches the main change. The PR adds testClearBothOrdersContextWords and updates doClear so that Bob's order has its ow…
Linked Issues check Passed Issue #2936 requires a clear test in which both orders' calculate and handle IO sources ensure their context words, including order-clearer() == clearer for the second (bob) order. The diff changes on…
Out of Scope Changes check Passed The whole-PR diff against the merge base touches one file, test/concrete/raindex/RaindexV6.contextWordEntrypoints.t.sol. No production code in src/ changes. Every hunk serves issue #2936: the doClear …
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 …
Full details: Title check

Explanation

The title "Test order-clearer and order context words for both orders in clear3" matches the main change. The PR adds testClearBothOrdersContextWords and updates doClear so that Bob's order has its own calculate and handle sources. The new test checks raindex(), sender(), order-owner(), order-counterparty() and order-clearer() for both orders in both sources. The title is specific and short. It names the test target (clear3) and the context words under test, so a teammate scanning history can identify the change.

Full details: Linked Issues check

Explanation

Issue #2936 requires a clear test in which both orders' calculate and handle IO sources ensure their context words, including order-clearer() == clearer for the second (bob) order. The diff changes only test/concrete/raindex/RaindexV6.contextWordEntrypoints.t.sol. The change adds bobClearChecks() with raindex(), sender() == CLEARER, order-owner() == TAKER, order-counterparty() == ACTOR, and order-clearer() == CLEARER. doClear() now accepts bobCalculate and bobHandle and builds bob's order from them. testClearBothOrdersContextWords passes bobClearChecks() through ensures() in both the calculate and handle sources of bob's order, so it covers the requirement. Alice's checks (clearChecks()) are kept on both sides. testClearCalculateContextWords and testClearHandleIOContextWords still pass alice's checks and use bob sources of '_ :1 1;' and ':;', which matches the previous bob expression ' _:1 1;:;'. The mutant result (M03, failure of only the new test) is reported by the author and was not re-run in this review. The requirement is met by the test code as written.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff against the merge base touches one file, test/concrete/raindex/RaindexV6.contextWordEntrypoints.t.sol. No production code in src/ changes. Every hunk serves issue #2936: the doClear signature and bob order construction (needed to parameterise bob's sources), the new bobClearChecks() helper, the updated call sites for the existing tests (which keep bob's original behaviour), and the new testClearBothOrdersContextWords. No unrelated change is present.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thedavidmeister
thedavidmeister merged commit 634f081 into main Oct 27, 2026
15 of 17 checks passed
@linear

linear Bot commented Oct 27, 2026

Copy link
Copy Markdown

RAI-3925

@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai assess this PR size classification for the totality of the PR with the following criterias and report it in your comment:

S/M/L PR Classification Guidelines:

This guide helps classify merged pull requests by effort and complexity rather than just line count. The goal is to assess the difficulty and scope of changes after they have been completed.

Small (S)

Characteristics:

  • Simple bug fixes, typos, or minor refactoring
  • Single-purpose changes affecting 1-2 files
  • Documentation updates
  • Configuration tweaks
  • Changes that require minimal context to review

Review Effort: Would have taken 5-10 minutes

Examples:

  • Fix typo in variable name
  • Update README with new instructions
  • Adjust configuration values
  • Simple one-line bug fixes
  • Import statement cleanup

Medium (M)

Characteristics:

  • Feature additions or enhancements
  • Refactoring that touches multiple files but maintains existing behavior
  • Breaking changes with backward compatibility
  • Changes requiring some domain knowledge to review

Review Effort: Would have taken 15-30 minutes

Examples:

  • Add new feature or component
  • Refactor common utility functions
  • Update dependencies with minor breaking changes
  • Add new component with tests
  • Performance optimizations
  • More complex bug fixes

Large (L)

Characteristics:

  • Major feature implementations
  • Breaking changes or API redesigns
  • Complex refactoring across multiple modules
  • New architectural patterns or significant design changes
  • Changes requiring deep context and multiple review rounds

Review Effort: Would have taken 45+ minutes

Examples:

  • Complete new feature with frontend/backend changes
  • Protocol upgrades or breaking changes
  • Major architectural refactoring
  • Framework or technology upgrades

Additional Factors to Consider

When deciding between sizes, also consider:

  • Test coverage impact: More comprehensive test changes lean toward larger classification
  • Risk level: Changes to critical systems bump up a size category
  • Team familiarity: Novel patterns or technologies increase complexity

Notes:

  • the assessment must be for the totality of the PR, that means comparing the base branch to the last commit of the PR
  • the assessment output must be exactly one of: S, M or L (single-line comment) in format of: SIZE={S/M/L}
  • do not include any additional text, only the size classification
  • your assessment comment must not include tips or additional sections
  • do NOT tag me or anyone else on your comment

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.

No test pins order-clearer for the second (bob) order in clear3

1 participant