Rotate TODO.md for completed refactor step 2

The rotation should have ridden the step-2 commit per the Workflow
section, but the file was edited concurrently and the update was lost;
recording it now. Step 3 (un-overload Object fields) is Next Step.
This commit is contained in:
2026-07-06 22:01:33 +02:00
parent 4b04ac08ea
commit c75af2ec22

48
TODO.md
View File

@@ -29,15 +29,21 @@ Refactor ground rules:
# Next Step # Next Step
Refactor step 2 (branch refactor/typed-kinds): typed kind enums — Refactor step 3 (branch refactor/object-fields): un-overload Object
PotionKind, ScrollKind, RingKind, WandKind, WeaponKind, ArmorKind, fields — split Object.Arm into ArmorClass/Charges/GoldValue; parse
TrapKind as iota enums with fmt.Stringer; Object.Which and the ObjInfo damage dice ("1x4/1x2") once into a DiceSpec type at table definition
tables move to the typed kinds; the object category glyph bytes ('!', instead of per swing; save-format update with round-trip test
'?', ...) become an ObjectKind with a Glyph() method so item category migration.
and map character stop sharing one byte namespace.
# Completed Steps # Completed Steps
- 2026-07-06 Refactor step 2 (refactor/typed-kinds, b940cfc):
ObjectKind separates item category from map glyph (Object.Type byte
→ Kind ObjectKind with Glyph()); PotionKind/ScrollKind/RingKind/
WandKind/WeaponKind/ArmorKind/TrapKind typed iota enums with
Stringer; typed accessors on Object; getItem/inventory/whatis
filters take ObjectKind (KindCallable/KindRingOrStick replace
CALLABLE/R_OR_S); save format bumped to 5.4.4-go2. Suite green.
- 2026-07-06 Refactor step 1 (refactor/descriptive-constants): renamed - 2026-07-06 Refactor step 1 (refactor/descriptive-constants): renamed
all flag bits, trap types, item subtype constants, and Max* counts to all flag bits, trap types, item subtype constants, and Max* counts to
descriptive names (IsHuh→Confused, SeeMonst→SenseMonsters, descriptive names (IsHuh→Confused, SeeMonst→SenseMonsters,
@@ -65,52 +71,48 @@ and map character stop sharing one byte namespace.
# Future Steps # Future Steps
1. Refactor step 3: un-overload Object fields — split Object.Arm into 1. Adopt the house Go linting standards: copy .golangci.yml from the
ArmorClass/Charges/GoldValue; parse damage dice ("1x4/1x2") once
into a DiceSpec type at table definition instead of per swing;
save-format update with round-trip test migration.
2. Adopt the house Go linting standards: copy .golangci.yml from the
prompts repo and bring game/, term/, and cmd/ lint-clean (the port prompts repo and bring game/, term/, and cmd/ lint-clean (the port
is greenfield code, so no exemptions apply). is greenfield code, so no exemptions apply).
3. Refactor step 4: method renames, movement/world subsystem 2. Refactor step 4: method renames, movement/world subsystem
(doMove→moveHero, beTrapped→springTrap, rndmove→randomStep, (doMove→moveHero, beTrapped→springTrap, rndmove→randomStep,
doRooms/doPassages/doMaze→digRooms/digPassages/digMaze, doRooms/doPassages/doMaze→digRooms/digPassages/digMaze,
chgStr→changeStrength, ...); remove the goto/label flows in doMove, chgStr→changeStrength, ...); remove the goto/label flows in doMove,
dispatch, and saveGame in favor of loops and helpers. dispatch, and saveGame in favor of loops and helpers.
4. Refactor step 5: method renames, items/combat/UI subsystems 3. Refactor step 5: method renames, items/combat/UI subsystems
(invName→inventoryName, rollEm→rollAttacks, doPot→applyPotionFuse, (invName→inventoryName, rollEm→rollAttacks, doPot→applyPotionFuse,
getItem→promptPackItem returning (obj, ok), getDir→promptDirection); getItem→promptPackItem returning (obj, ok), getDir→promptDirection);
int status codes (attack returning -1) become named results. Two or int status codes (attack returning -1) become named results. Two or
three commits, one subsystem each. three commits, one subsystem each.
5. Refactor step 6: extract types from the god object — MessageLine 4. Refactor step 6: extract types from the god object — MessageLine
owns the msg/addmsg/endmsg machinery; pack/inventory operations move owns the msg/addmsg/endmsg machinery; pack/inventory operations move
onto *Player; monster/object list management and map queries onto *Player; monster/object list management and map queries
consolidate onto *Level; RogueGame keeps turn orchestration and consolidate onto *Level; RogueGame keeps turn orchestration and
cross-system effects only. cross-system effects only.
6. Refactor step 7: effects dispatch — the giant quaff/readScroll/doZap 5. Refactor step 7: effects dispatch — the giant quaff/readScroll/doZap
switches become per-kind handler tables of small named methods, switches become per-kind handler tables of small named methods,
keeping effect order and RNG call sequence identical. keeping effect order and RNG call sequence identical.
7. Refactor step 8: constructor and style pass per the house 6. Refactor step 8: constructor and style pass per the house
styleguide — game.New(game.Params{...}) replacing NewGame(Config); styleguide — game.New(game.Params{...}) replacing NewGame(Config);
replace the gameEnd panic unwind with error-based turn results where replace the gameEnd panic unwind with error-based turn results where
feasible; 77-column wrap sweep. feasible; 77-column wrap sweep.
8. Docs refresh: update ARCHITECTURE.md Part 2 and README.md for the 7. Docs refresh: update ARCHITECTURE.md Part 2 and README.md for the
post-refactor names; add the C name → Go name rename table. post-refactor names; add the C name → Go name rename table.
9. Playtest hardening pass: play several full games with the tcell 8. Playtest hardening pass: play several full games with the tcell
binary and extend run_test.go to script a deeper multi-level binary and extend run_test.go to script a deeper multi-level
playthrough (descend past level 5, use potions, scrolls, zapping, playthrough (descend past level 5, use potions, scrolls, zapping,
save/restore). Fix any panics, message mismatches, or divergences save/restore). Fix any panics, message mismatches, or divergences
from the C behavior that this uncovers, with regression tests. from the C behavior that this uncovers, with regression tests.
10. Verify the seed-compatibility claim against the C reference on 9. Verify the seed-compatibility claim against the C reference on
c-master: same seed, same dungeon, same item tables, for several c-master: same seed, same dungeon, same item tables, for several
seeds. seeds.
11. Broaden unit test coverage where playtesting finds thin spots 10. Broaden unit test coverage where playtesting finds thin spots
(rings, sticks, wizard commands). (rings, sticks, wizard commands).
12. Tag a release once a full game (Amulet retrieval and score entry) 11. Tag a release once a full game (Amulet retrieval and score entry)
completes without defects. completes without defects.
13. Full-terminal-size support (deferred by explicit decision 12. Full-terminal-size support (deferred by explicit decision
2026-07-06): per-game dungeon dimensions instead of the 80x24 2026-07-06): per-game dungeon dimensions instead of the 80x24
constants; open design questions are resize policy, gameplay constants; open design questions are resize policy, gameplay
tuning at larger sizes, and a --classic 80x24 mode. tuning at larger sizes, and a --classic 80x24 mode.
14. Note: this repo is exempt from the standard policy scaffold. Do not 13. Note: this repo is exempt from the standard policy scaffold. Do not
add Makefile, Dockerfile, or REPO_POLICIES.md. add Makefile, Dockerfile, or REPO_POLICIES.md.