docs: name the phase-engine package in every cargo invocation - #7205
Conversation
Eight comments and script strings tell a reader to run `cargo ... -p engine
...`. None of them can work. The workspace package is `phase-engine`; `engine`
is only the lib TARGET name, so `-p engine` names a package that does not
exist:
$ cargo test -p engine --lib pool_structure_census -- --list
error: package ID specification `engine` did not match any packages
$ cargo pkgid -p engine
error: package ID specification `engine` did not match any packages
$ cargo pkgid -p phase-engine
path+file:///.../crates/engine#phase-engine@0.50.0
The authority is `crates/engine/Cargo.toml`: `[package] name = "phase-engine"`
against `[lib] name = "engine"`.
Every one of these strings is an instruction someone is meant to follow -- a
perf benchmark's `#[ignore]` reason, a census test's reproduce line, a
migration script's closing "Verify with:" -- so each one costs its reader a
failed command and a detour before they work out that the package is named
something else. The corrected forms resolve, and resolve to the intended
tests rather than to nothing:
$ cargo test -p phase-engine --lib pool_structure_census -- --list
parser::oracle_ir::feature::pool_structure_census::census: test
1 test, 0 benchmarks
Running the fully corrected `--ignored` form reaches the test body and stops
on the environment variable the comment itself tells you to set
(`ORACLE_POOL_DIR`), which is the expected outcome and the point: the package
selector, target filter and test filter all resolve, and only the documented
setup step remains. Cargo agrees -- its own rerun hint prints
`-p phase-engine --lib`.
Three further instances of this defect exist in `game_state_size.rs`,
`bin/interaction_bindings.rs` and the generated `client/src/adapter/generated/
interaction/index.ts`; they are fixed by a separate in-flight PR and are
deliberately untouched here so the two changes cannot conflict in either merge
order. Seven more live in `.claude/wf/*.md` planning documents and are left for
maintainer discretion.
A naive `grep -rn -- '-p engine'` also matches `.cargo/config.toml`'s
`-p engine-inventory-gen`. That is a substring hit, not a defect --
`engine-inventory-gen` is a real package and `cargo pkgid` resolves it.
Assisted-by: ClaudeCode:claude-opus-5
📝 WalkthroughWalkthroughThe pull request replaces outdated ChangesPackage name updates
Estimated code review effort: 1 (Trivial) | ~2 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ 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✓ No card-parse changes detected. |
Completes the live documentation selector migration for the generated interaction bindings and GameState size measurement instructions. Co-authored-by: Lindsey Gray <lindsey.gray@gmail.com>
|
Held pending current-head CI. The maintainer follow-up Once those checks settle green, this will resume directly to approval and merge-queue handling; no contributor action is needed. |
matthewevans
left a comment
There was a problem hiding this comment.
Approved — documentation-only command correction.
✅ Clean
crates/engine/Cargo.toml:1defines the package asphase-engine, while:11keepsengineas the library target; every changed command therefore now selects the correct Cargo package without changing production behavior.- The updated generated interaction header matches its source authority in
crates/engine/src/bin/interaction_bindings.rs:24. - The current-head parse-diff artifact for
a812b75e7215a30f09925b53e6e54ca634f496e0reports no card-parse changes, and the refreshed required CI checks are green.
Recommendation: merge via the queue.
🤖 AI text below 🤖
Summary
Eleven comments and script strings instruct a reader to run
cargo ... -p engine ..., which cannot work: the workspace package isphase-engineandengineis only the lib target name. Each one costs its reader a failed command and a detour. This renames the package selector at all eleven live instruction sites; no behaviour changes.Files changed
crates/engine/src/game/combat.rs— doc comment oncombat_tax_profile_gate_go_wide_boardcrates/engine/src/game/stack.rs— doc block forreal_scute_board_resolution_is_not_full_eval_per_tokencrates/engine/src/game/token_presets.rs— doc comment oncatalog_loads_and_validatescrates/engine/src/game/triggers.rs—#[ignore]reason onscute_swarm_throughputcrates/engine/src/parser/oracle_ir/feature.rs— doc comment onmod pool_structure_censuscrates/engine/src/types/game_state_size.rs— GameState layout measurement commandcrates/engine/src/bin/interaction_bindings.rs— generated-file header authoritycrates/engine/tests/integration/squirrel_perf_probe.rs—//!module headerclient/src/adapter/generated/interaction/index.ts— generated header synchronized with its authorityscripts/migrate-mana-target-roles.mjs— "HOW TO USE IT" comment and the closingconsole.logTrack
Developer
LLM
Model: claude-opus-5
Tier: Frontier
Thinking: high
Implementation method (required)
Method: /engine-implementer
CR references
None. No game logic is touched — the diff is doc comments, one
#[ignore]reason string, one block comment and oneconsole.log.Verification
The contributor ran these at
0f50602f8613f9d4931b8446eed70ab089d72c4c:cargo fmt -p phase-engine -- --check— exit 0cargo clippy --workspace --all-targets -- -D warnings— exit 0cargo test -p phase-engine --lib— 18830 passed; 0 failed; 6 ignoredcargo test -p phase-engine --test integration— 4794 passed; 0 failed; 2 ignorednode --check scripts/migrate-mana-target-roles.mjs— exit 0The defect, measured:
Authority:
crates/engine/Cargo.toml—[package] name = "phase-engine"against[lib] name = "engine".The fix, measured — discriminating in both directions. The old form dies at package resolution before any build; the new form resolves and its filter selects a nonzero count of the intended tests (a corrected command selecting zero would mean the filter was wrong too):
Five corrected commands were probed in review; all resolve, all select nonzero (1, 2, 1, 1, 1). Running the fully corrected
--ignoredform reaches the test body and stops on the environment variable the comment itself tells you to set (ORACLE_POOL_DIR) — the expected outcome, and the point: selector, target filter and test filter all resolve. That is deliberately not claimed as a green test run. Cargo's own rerun hint prints-p phase-engine --lib.Completeness. 18 word-exact hits at base, 11 live instruction sites fixed here. The 7 remaining hits are in
.claude/wf/*.mdhistorical planning documents, left for maintainer discretion.Maintainer follow-up
a812b75e7215a30f09925b53e6e54ca634f496e0completed the three live selector sites that the original body had mistakenly described as covered by another PR. It is documentation-only; fresh CI for that head is pending.--package engineand-p=enginespellings were also swept: no hits.Reviewer note for anyone running their own grep: a naive
grep -rn -- '-p engine'also matches.cargo/config.toml's-p engine-inventory-gen. That is a substring match, not a defect —engine-inventory-genis a real package andcargo pkgidresolves it. A word-boundary pattern finds only the 7 historical planning-document references.Gate A
Gate A PASS head=0f50602f8613f9d4931b8446eed70ab089d72c4c base=ee76bc54aee4941f20c126b49c5d6b54a36d86c5. The documentation-only maintainer follow-up
a812b75e7215a30f09925b53e6e54ca634f496e0is awaiting its fresh CI run.Anchored on
cargo nextest run -p phase-engine: the working form of exactly this command, in the resource that actually runs the engine testscargo run -p phase-engine --features interaction-bindings ...: existing correct package selection at the same seamFinal review-impl
Final review-impl PASS head=a812b75e7215a30f09925b53e6e54ca634f496e0 (documentation-only follow-up; fresh CI pending)
Claimed parse impact
None.
crates/engine/src/parser/oracle_ir/feature.rsappears in the diff, but the change is one word inside a doc comment; no parser behaviour, card data, or coverage output is affected.Scope Expansion
None.
Validation Failures
None.
CI Failures
None.
Summary by CodeRabbit