Repository navigation
chore(module): make comments readable without the issue tracker - #412
Merged
Merged
Conversation
…lowances Comments in module/src carried ~830 issue-number references. A reader with no tracker access cannot follow them, and CODING_STANDARDS forbids them. Strip the reference tokens only, keeping the surrounding explanation. Delete five stale `allow(dead_code)` attributes whose callers have since landed, mark the three split/reset cores that only a debug reducer reaches with `cfg_attr(not(feature = "debug_reducers"), allow(dead_code))`, and delete the three DR category constants that no code reads. Add `tripwires::issue_reference_tripwire`, a ratchet that fails when a comment under module/src carries a tracker reference again. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Comments under
module/srcpointed at the issue tracker about 830 times:(#119),Issue #237: …,#120's opener,pre-#22 order. A reader without tracker access cannot follow any of them, andCODING_STANDARDS.mdforbids the practice. A second group ofallow(dead_code)attributes claimed a caller was coming "with the Trade Session work" or kept a core "for a futuregw_*twin". Those callers either already exist or never will.What changed
Comments keep their explanation and lose the reference token.
(#119)disappears,#120's openerbecomesthe opener,MERGE ORDER (#19 × #20)becomesThe merge order, and a sentence that carried nothing but a pointer is gone. A script did the mechanical pass; every changed line was then read and about 60 sentences were repaired by hand where the removal broke the grammar. No explanation was shortened. String literals, attributes and test names were not touched.Dead-code allowances:
helpers.rs: deleted three.trade.rsalready callsplayer_interaction_gate,PlayerInteractionDeniedand the range constant.talent.rs: deleted two.gw_reset_talentsexists and callsdo_reset_talents.instance.rs,items/inventory.rs: five becamecfg_attr(not(feature = "debug_reducers"), allow(dead_code))with a one-line note naming the sole caller. Nogw_reset_instanceorgw_split_itemreducer exists;debug_reset_instanceanddebug_split_itemare what reach these cores. This is the idiom nine other sites in the crate already use, and unlike a hardcfgit keeps the unit tests for those gates compiling in a defaultcargo test.spell/stacking.rs: deletedDR_CAT_CHARM,DR_CAT_SLEEPandDR_CAT_DISORIENT. No mechanic maps to them, nothing reads them, and the numbering is internal rather than a wire contract.Five unconditional allowances remain:
RULE_STACKS(the wildcard fallback, read only by a test),EquipStat::Spirit(an item-template stat column with a live match arm and no constructor yet), and three taxonomy bindings._RESERVED_NON_KIND_TAXONOMYnow holds 18 residual values, includingP_SPELLMOD_OP. A source tripwire pins the unconditional count at five; conditionalcfg_attrallowances do not count.Keeping it clean
tripwires::issue_reference_tripwirelexes Rust source before it checks comments. It detects full-line and trailing//comments, nested block comments, and forms such aspre-#22; it ignores code, ordinary escaped strings, raw strings, byte raw strings, and character literals. Build, opcode, patch, and revision numbers are not tracker references. Those five exception words match ASCII case-insensitively.The only allow-listed file is
spell/cast/targeting.rs, with exactly six references. A lower count, a higher count, or an absent allow-listed file fails. Direct fixtures cover the comment and literal forms, both stale-count directions, and the missing-file condition.Verification
cargo test -p lyracore-module --lib --features=debug_reducers: 1467 passed.cargo clippy -p lyracore-module --features=debug_reducers -- -D warningsstops on 31 existing errors in unrelated files. No error is in the scanner, taxonomy, or EventAI change.cargo check --target wasm32-unknown-unknown -p lyracore-module --features=debug_reducerscompletes cleanly.Written by Claude Fable 5.1 in Claude Code.
Review fixes by GPT-5.6 through the Codex harness in T3 Code.