Files
the-beacon/docs/DEAD_CODE_AUDIT_2026-04-12.md
Perplexity Computer 5f29863161
Some checks failed
Accessibility Checks / a11y-audit (pull_request) Failing after 2s
Smoke Test / smoke (pull_request) Failing after 3s
Add dead code audit report for the-beacon
2026-04-13 00:27:25 +00:00

1.6 KiB

Dead Code Audit — the-beacon

2026-04-12, Perplexity QA

Findings

Potentially Unimported Files

The following files were added by recent PRs but may not be imported by the main game runtime (js/main.jsjs/engine.js):

File Added By Lines Status
game/npc-logic.js PR #79 (GOFAI NPC State Machine) ~150 Verify import
scripts/guardrails.js PR #80 (GOFAI Symbolic Guardrails) ~120 Verify import

Action: Check if js/main.js or js/engine.js imports from game/ or scripts/. If not, these files are dead code and should either be:

  1. Imported and wired into the game loop, or
  2. Moved to docs/ as reference implementations

game.js Bloat (PR #76)

PR #76 (Gemini GOFAI Mega Integration) added +3,258 lines to game.js with 0 deletions, ostensibly for two small accessibility/debuff fixes.

Likely cause: Gemini rewrote the entire file instead of making targeted edits.

Action: Diff game.js before and after PR #76 to identify:

  • Dead functions that were rewritten but the originals not removed
  • Duplicate logic
  • Style regressions

PR #77 (Timmy, +9/-8) was the corrective patch — verify it addressed the bloat.

Recommendations

  1. Add a js/imports.md or similar manifest listing which files are actually loaded by the game runtime
  2. Consider a build step or linter that flags unused exports
  3. Review any future Gemini PRs for whole-file rewrites vs targeted edits

This audit was generated from the post-merge review pass. The findings are based on file structure analysis, not runtime testing.