Skip to content

fix(engine): redact hidden card printed identity - #7273

Merged
matthewevans merged 2 commits into
mainfrom
ship/fix-engine-redact-hidden-card-identity
Aug 12, 2026
Merged

fix(engine): redact hidden card printed identity#7273
matthewevans merged 2 commits into
mainfrom
ship/fix-engine-redact-hidden-card-identity

Conversation

@matthewevans

@matthewevans matthewevans commented Aug 12, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes
    • Improved privacy for hidden cards and face-down permanents by removing identifying card details from their displayed data.
    • Preserved publicly visible runtime state while preventing hidden card information from being revealed.
    • Added coverage to verify hidden cards no longer expose printed identity metadata.

@matthewevans
matthewevans enabled auto-merge August 12, 2026 03:35
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

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

Next review available in: 22 minutes

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

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 Plus

Run ID: 514648d8-2bf3-4878-811c-bdd7240d6a10

📥 Commits

Reviewing files that changed from the base of the PR and between 21a0888 and 40813ab.

📒 Files selected for processing (1)
  • crates/engine/src/game/visibility.rs
📝 Walkthrough

Walkthrough

The visibility layer now centralizes printed-identity redaction for hidden cards and face-down permanents. The change clears identity-bearing fields while preserving public runtime state. A regression test verifies different owner and opponent projections.

Changes

Hidden card redaction

Layer / File(s) Summary
Centralized redaction and regression coverage
crates/engine/src/game/visibility.rs
redact_printed_identity clears printed identity fields for hidden cards. Face-down observer redaction reuses the helper. Tests verify that owners retain metadata while opponents receive redacted projections.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

  • phase-rs/phase#7201: The change centralizes hidden-card redaction and clears base_name and related printed identity fields.

Possibly related PRs

  • phase-rs/phase#4538: Both changes modify viewer-specific hidden and face-down card identity redaction in visibility.rs.
  • phase-rs/phase#7094: Both changes modify hidden-card projections, with this change redacting identity metadata.

Suggested labels: bug

Suggested reviewers: lgray, parthmishra, invalidcards

🚥 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 and concisely describes the main change: redacting printed identity from hidden cards in the engine.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ship/fix-engine-redact-hidden-card-identity

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.

@matthewevans
matthewevans force-pushed the ship/fix-engine-redact-hidden-card-identity branch from 69227ac to 2026338 Compare August 12, 2026 04:25
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown

Generated for head 21a08880c24bd420c5a6b943820c6148c12d2973.

Parse changes introduced by this PR

✓ No card-parse changes detected.

@matthewevans
matthewevans force-pushed the ship/fix-engine-redact-hidden-card-identity branch from 2026338 to 21a0888 Compare August 12, 2026 05:43

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/engine/src/game/visibility.rs`:
- Around line 1791-1825: Update redact_printed_identity in
crates/engine/src/game/visibility.rs:1791-1825 to clear obj.room_unlocks
alongside the other redacted printed metadata. In
crates/engine/src/game/visibility.rs:2812-2879, add a room_unlocks sentinel and
assert that both the opponent view and serialized payload omit it.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0f66dd23-296c-41bc-a47b-72305827f814

📥 Commits

Reviewing files that changed from the base of the PR and between e5534ea and 21a0888.

📒 Files selected for processing (1)
  • crates/engine/src/game/visibility.rs

Comment thread crates/engine/src/game/visibility.rs
@matthewevans
matthewevans added this pull request to the merge queue Aug 12, 2026
@matthewevans
matthewevans removed this pull request from the merge queue due to a manual request Aug 12, 2026
@matthewevans
matthewevans added this pull request to the merge queue Aug 12, 2026
Merged via the queue into main with commit 50f0873 Aug 12, 2026
3 checks passed
@matthewevans
matthewevans deleted the ship/fix-engine-redact-hidden-card-identity branch August 12, 2026 09:24
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.

1 participant