Dialyzer: clear 114 pre-existing warnings and re-enable the CI gate #43
Labels
No labels
bug
ci-cd
client
epic:security-hardening
feature
optimization
priority:high
priority:low
priority:medium
server
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
BlackLobster/Server#43
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?
Summary
The codebase has 114 pre-existing Dialyzer warnings (
MIX_ENV=test mix dialyzeragainst a clean PLT). It has never passed Dialyzer cleanly. The CIDialyzerstep has been set tocontinue-on-error: trueso it runs for visibility but does not gate CI / image builds. This issue tracks clearing the backlog so the gate can be re-enabled.Breakdown (114 total)
1. Missing
Game.Typesmodule — ~57 warnings (highest leverage)sync.ex(18),tick.ex(16),bot/ai.ex(16),region.ex(7) allalias Game.Typesand referenceGame.Types.player/0,Game.Types.entity_index/0, etc. in@specs — butGame.Typesdoes not exist. Creating it with the referenced type definitions should clear the bulk in one change. Audit everyGame.Types.*reference first to define the full surface correctly.2. Wrong self-type references — ~3
Specs reference
Module.t()instead oft()for the module they're in:game/model/structs/backpack.ex:70→Backpack.t()should bet()game/model/structs/skills.ex:59→Skills.t()should bet()Cache.Definition.ObjectDefinition.t/0(collisionupdate.ex/manager.ex)3. Forward-compat branches over stubs — ~15 (
pattern_match/pattern_match_cov)Stub functions return a constant, making a downstream branch provably unreachable. Examples:
door_manager.exload_objects_at/3→[]; mostbot/goals/*.ex(chop/fish/mine/pk/travel +goal_runner.ex);interactions.ex(5);attack_style.ex;actions.ex;pending_action.ex. Decide per-site: implement the stub, or scope-ignore the forward-compat clause.4. Mix / IEx false positives — ~6 (
unknown_function)BlackLobster.MixProject.name/0andIEx.Helpers.recompile/0are genuinely available at runtime (the server runs viamix run --no-halt, see Dockerfile — not an OTP release), but aren't in the default PLT. Affectsblack_lobster.ex,cache/supervisor.ex,network/supervisor.ex,network/session/js5.ex,game/world/system_update.ex,command/commands/admin/reload.ex. Fix byplt_add_apps: [:mix, :iex]or an ignore file. (Adding apps to the PLT changes analysis breadth — rebuild and re-check after.)5. Misc — ~30
unused_fun(npc_supervisor.ex×5,bot/manager.ex×3,npc.ex),no_return(npc_supervisor.ex,bot/manager.ex),call/call_without_opaque/guard_fail, and opaque-term misuse inpathfinder.ex(passing agb_sets/MapSetinternal across anastar_loopboundary). Plus benign always-true/false comparison warnings from compile-time adapter selection (repo.exSQLite3 == Postgres,cache/definition/loc.exbinary() /= nil,runecraft_and_bank.exStack /= nil) — likely worth# dialyzerguards or restructuring.Suggested order
Game.Types(clears ~57).plt_add_appsvs ignore (~6).Dialyzerback to blocking (removecontinue-on-error).Repro
Suggested labels:
optimization,ci-cd,priority:medium.Update: the highest-leverage item here is already done —
Game.Typesnow exists (lib/black_lobster/game/types.ex) definingplayer/0,entity_index/0,tile/0, so the ~57 warnings that hung on the missing module are resolved..dialyzer_ignore.exsandplt_add_apps: [:mix, :iex]are also in place. Remaining work: rebuild a clean PLT, recount the actual warnings (the '114' and 'Game.Types does not exist' framing in the body is now stale), clear the rest, then removecontinue-on-error: truefrom the Dialyzer step in .forgejo/workflows/ci.yml to make the gate blocking.