Repository navigation
refactor(tripwires): drop the Package name from the character-fence budget - #623
Conversation
…fence The raw-character-lookup tripwire hard-coded packages/playerbots/src/mod.rs in its budget list, so a Package change could fail a Core test and Core named a Package in its own source. Replace the per-path entry with PACKAGE_FILE_BUDGET, keyed by a file's path relative to its own Package root (src/mod.rs) instead of which Package ships it, so the same budget applies to any installed Package with no Package name in Core. The source-scan test that used packages/playerbots as an example path now uses a made-up package name. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 42 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (3)
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 |
Code review: two axes (Standards, Spec)Fixed point: StandardsP1: the ratchet now gets looser, not tighter (behaviour change). The P2: tracker references in code comments. P3 (judgement): possible Duplicated Code. P3 (judgement): no test for the new path parsing. CODING_STANDARDS, Tests, asks an Architecture Test to "prove it detects the forbidden mutation". The PR description says this was checked by hand. A unit test for No other findings. Removing SpecPartial: the sibling tripwire in the same file still names a Package. The spec says "Core's own source named a Package" and the fix is to stop that. But Scope note (not blocking). The spec says "Core named a Package". Core comments and identifiers still name playerbots in many places ( Implemented as described: the playerbots entry is removed from Summary: Standards has 4 findings; the worst is P1, which applies the budget of 4 to every Package with no staleness ratchet. Spec has 1 partial and 1 scope note; the worst is that Generated by Claude Code |
Review feedback on the new PACKAGE_FILE_BUDGET and module-doc comments: drop the ticket cross-references (no issue/ticket refs in code comments) and cut the prose to the terse style the rest of this file uses. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Problem
Core's character-fence tripwire scans every installed Package's source for a raw
game_characterlookup and checks it against a per-file budget. That budget list hard-codedpackages/playerbots/src/mod.rs, so a change inside playerbots could fail a Core test, and Core's own source named a Package.A separate scan test used the same path as a worked example of the optional-directory rule, for the same reason.
Solution
WHITELISTnow holds Core's own files only. A newPACKAGE_FILE_BUDGETlist keys a budget on a file's path relative to its own Package root (src/mod.rs), not on which Package ships it. The same budget applies to any installed Package, and Core carries no Package name to grant it.The example-path test now uses a made-up package name,
sample_package.Verified locally with the playerbots Package installed: the full tripwire and scan-test suite passes, and inserting one extra raw
game_characterlookup intopackages/playerbots/src/mod.rsfailsno_unwhitelisted_raw_character_lookupsas expected (reverted before this PR). With no Package installed, the same tests pass.Claude Sonnet, via Claude Code, made this change.
🤖 Generated with Claude Code