test(parser): reword assert messages that leaked planning coordinates (#9268) - #9299
Conversation
…phase-rs#9268) Four `assert!`/`expect` messages carried identifiers from the phase-rs#8785 implementation run — `C3.1`, `C1.5`, and `C3.9` twice. They surface in CI failure output, where a reader debugging an unrelated break has nothing to look them up in: the process artifact they indexed no longer exists. PR phase-rs#9201's comment-only cleanup could not reach them because they sit inside string literals. Each now states the property being asserted, which is the more useful failure message regardless of where the coordinate came from. Example — the message a debugger actually sees changes from C3.9: NEVER an unconditioned CanAttackWithDefender on an interposed line to an interposed line must NEVER yield an unconditioned CanAttackWithDefender — the interposed class is the permission's gate, so dropping it grants the permission unconditionally Reachability verified, not assumed. Each of the four assertions was sabotaged in turn and the run confirmed to print the NEW message; the first attempt at that check was itself faulty (it perturbed a display-only argument, so the `expect` never fired) and was redone by feeding production (b) a line it genuinely declines. Both files restored byte-identical afterwards (md5 verified). SCOPE. `assert!`/`expect` message strings only, which is where the reported harm is — a coordinate in a doc comment reaches a reader who already has the surrounding text. Two things that look like hits and are NOT: * `game/..tests.rs` "L3"/"L4" — Fblthp's printed Oracle LINES 3 and 4, domain vocabulary the doc comments define. Correct usage; untouched. * `"P6 U6a Probe"` — a synthetic CARD NAME passed to `parse_oracle_text`, not a failure message. It is a process identifier, but it is input data and does not reach CI output. Flagged, deliberately not changed here. Test-message-only; no behaviour change, no assertion semantics changed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GVgJDj9cX1g1Csfqz7Cp2U
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: phase-rs/phase/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughFour assertion failure messages in two parser test files now describe the properties under test. The assertions and expected values are unchanged. ChangesParser test failure messages
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~3 minutes Change: Other · Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to The reported changes are limited to test failure messages, with no identified merge-blocking issue. Confirm the final wording and run the normal checks before merging. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5❌ Failed checks (1 inconclusive)
✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Generated for head Parse changes introduced by this PR · 0 card(s), 0 signature(s) (baseline: main
|
|
Battery green on the committed candidate
One note on Gate A, so the line isn't read as more than it is. It reports 🤖 Generated with Claude Code |
|
Held pending verification of a maintainer fix. On head The issue's other three message changes are scoped and useful; the current-head required CI is green and the parse-diff receipt reports no card-parse changes. Tilt is unavailable for this checkout, so the local fix has not been verified or pushed. Next step: verify the corrected candidate with the project Tilt resources, push the fix, then review the new head before approval and merge-queue entry. |
|
Your diagnosis is right and the message is mine to own. The test calls My own reachability check corroborates you: to make that
|
matthewevans
left a comment
There was a problem hiding this comment.
Reviewed head d242715: the four failure messages now describe the tested properties, including the direct parser call. Assertions and inputs are unchanged. Local cargo fmt and diff checks passed; required GitHub checks will gate merge.
|
Approved on head |
Closes #9268. Follow-up from #8785 / PR #9201. Test-message-only; no behaviour
change and no assertion semantics changed.
The leak
Four
assert!/expectmessages carried identifiers from the #8785implementation run —
C3.1,C1.5, andC3.9twice. They surface in CI failureoutput, where someone debugging an unrelated break has nothing to look them up
in: the process artifact they indexed no longer exists. #9201's comment-only
cleanup could not reach them because they sit inside string literals.
What changed
Each message now states the property being asserted. The message a debugger
actually sees goes from
to
oracle_static/tests.rsweathered_sentinels_line_is_consumed_by_the_non_attached_static_productionC3.1:oracle_static/tests.rsunrecognized_interposed_class_is_permanently_inert_and_leaves_the_card_redPhase 1's C1.5oracle_effect/tests.rswalking_bulwark_comma_compound_carries_the_anchored_conditionC3.9:oracle_effect/tests.rsadjacent_defender_grammars_keep_their_own_parse_on_the_effect_sideC3.9:Reachability verified, not assumed
A reworded message is worthless if the assertion can't fire. Each of the four was
sabotaged in turn and the run confirmed to print the new text.
Worth reporting: my first attempt at that check was itself faulty. I sabotaged
the first test by perturbing the second argument to
parse_can_attack_despite_defender, which is display-only — the parse stillsucceeded, the
expectnever fired, and the test simply passed. Had I read"no panic" as "fine", I'd have shipped an unverified message. Redone by feeding
production (b) a line it genuinely declines, which produced the expected panic.
Both files restored byte-identical afterwards (md5 verified against pre-sabotage
copies).
Scope, and two things that are NOT hits
assert!/expectmessage strings only — that is where the reported harm is. Acoordinate in a doc comment reaches a reader who already has the surrounding
text; the issue's complaint is specifically about context-free CI output. Those
files do still contain planning coordinates in comments (
U2.x,Phase N,M-1), left alone deliberately.Two near-misses I checked and did not change:
"L3"/"L4"inoracle_static/tests.rsassert messages — these areFblthp's printed Oracle lines 3 and 4, domain vocabulary the surrounding
doc comments define ("Fblthp L4 — 'You may plot nonland cards…'"). Correct
usage that a regex sweep would have destroyed.
"P6 U6a Probe"inoracle_effect/tests.rs— a synthetic card namepassed to
parse_oracle_text, not a failure message. It is a processidentifier, but it is input data and does not reach CI output. Flagging it
rather than silently widening scope; happy to rename it if you'd prefer.
Verification
Full battery running against the committed candidate
061e15875; I'll post thefigures when they land rather than assert them now.
🤖 Generated with Claude Code
https://claude.ai/code/session_01GVgJDj9cX1g1Csfqz7Cp2U
Summary by CodeRabbit