[P2] Codebase hygiene sweep: diagnostics, UI/tooltip, loader/config, tests, MP, harness literals #257
Labels
No labels
4-29
bug
documentation
duplicate
enhancement
flow improvement
good first issue
help wanted
invalid
investigating
issue-agent
issue-agent-blocked
issue-agent-complete
issue-agent-pr-open
issue-agent-runner-nelsonlaptop
issue-agent-runner-nelsonpc
issue-agent-runner-nelsonpc-user
issue-agent-running
needs-verification
next to do
question
queue
recon
relics-stats-onboarding
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
romaine-life/spirelens#257
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Priority: P2. From the 2026-07-02 audit. A consolidated hygiene sweep grouping lower-severity, mostly-unverified findings. Split into sub-PRs as convenient.
Diagnostics / dead code
RunTracker.Observecarries a self-described "temporary diagnostic for draw-tracking bug" that is now permanent always-onLogger.Info: everyCardDrawnEntry/CardPlayFinishedEntry, the first 500 entries per load, an every-50th joined type-count dump, plus a second per-draw log. Gate behindDebugLoggingor delete. The backing_typeCountDiagdict is also the onlyRunTrackerstatic mutated without_lock.[CUS-diag]Harmony dump prints 60–80Infolines per launch/reload from the global registry (so it can't even confirm SpireLens-installed hooks). Now partly superseded by thePatch install:summary line added in PR #248.%TEMP%\spirelens-loader-diag.log) and itsD()channel grow unbounded — add rotation/truncation.UI / tooltip robustness
CardHoverTooltipPatch.cs:54+ Relic/Enemy/DeckViewInjectRemoved). Guard withGodotObject.IsInstanceValid, drop the_prefsLoadedone-shot, callRuntimeOptionsProvider.Refresh().[b]breaks rendering. Escape them._injectedClonesaccumulates dead wrappers; StatsTooltip rebuild leaks per-frame handlers. Relic tooltip is ~200 lines of drifting near-identical if-blocks with triplicatedRow3/FormatDecimalhelpers — consolidate.Loader / config / build hygiene
EnableDebugLoggingcaptured once atInitialize, so the tickbox is inert until an F5 reload (CoreMain.cs:80).user://SpireLensvs the actualuser://CardUtilityStats) so it never finds anything.BuildInfois compiled only into the never-reloaded Loader (describes the launch loader, not the running Core); LoaderMain load-contract docs no longer match the code (claims per-load ALC but uses the shared Godot ALC).Test-suite fidelity
RunStorage.Options(snake_case +WhenWritingNull) — the same parallel-list pattern that produced theActivationsbug; exposeRunStorage.Options(internal) and consume it in tests.InternalsVisibleTo;NoxiousFumesContributionTestsusesGetProperty(...)?.SetValueso a rename silently skips setup. Use direct member access.lib/stub (they need the live game DLL) — decouple them or mark them as requiring the live game.Multiplayer/co-op ownership
Playerwith an ownership gate at each entry point, or explicitly gate tracking off whenPlayers.Count > 1and document MP as out of scope. Pick one and apply uniformly.Harness hardcoded literals
D:\repos\SpireLensappears ~4× with casing drift acrosshelpers.go/host.go/buildanddeploy.go; bridge port15526has no env override;claude.exe/Steam/mcp paths are frozen. De-hardcode behind config/env.Small stat-hygiene items
Four recorded-but-never-displayed aggregate fields;
RecordPowerReceivedmissing anamount > 0guard (emits zero/negativeTimesApplied);EnemyStatusCardSourceAsyncLocal frame can restore null over a live frame;_pendingMakeItSoSummonsmarker consumed by the first pile change;FindCurrentlyResolvingCardPlaydoes an O(n) LINQReverseper event; README lists closed issue #10 as Open.Uncapped audit pass — two items here should be PROMOTED to P1 (confirmed HIGH, not hygiene):
ViewStatsInjectorPatch.LastInjectedTickbox?.IsTicked, but the node is freed when the deck view closes and the static is never cleared;NTickbox.IsTickedreturns a stalefalseinstead of throwing, soset_spirelens_view_stats_enabled(true)and the settings toggle silently no-op for the rest of the Core lifetime. Guard withGodotObject.IsInstanceValid, callRuntimeOptionsProvider.Refresh()before each read, drop the_prefsLoadedone-shot.LocalContextusage → co-op stat corruption). Remove it from this hygiene bucket.Closing during repository issue cleanup. If this becomes active work again, we can reopen or recreate it as a fresh, specific task.