Files
the-beacon/docs/DEAD_CODE_AUDIT_2026-04-12.md
Alexander Whitestone db08f9a478
Some checks failed
Accessibility Checks / a11y-audit (pull_request) Successful in 9s
Smoke Test / smoke (pull_request) Failing after 16s
fix: resolve #192 — move dead code to docs/reference, fix GENOME.md
- game/npc-logic.js → docs/reference/npc-logic-prototype.js (ES module, never imported)
- scripts/guardrails.js → docs/reference/guardrails-prototype.js (HP/MP validation, wrong game)
- Updated GENOME.md architecture diagram to reflect actual file structure
- Updated DEAD_CODE_AUDIT to mark these as resolved
- Corrected JS line counts (6,033 across 11 files)
- Removed empty game/ directory

The actual CI scripts (guardrails.sh, smoke.mjs) remain active in scripts/.
2026-04-15 21:25:38 -04:00

1.8 KiB

Dead Code Audit — the-beacon

2026-04-12, Perplexity QA

Findings

Dead Code — Resolved (2026-04-15, Issue #192)

The following files were confirmed dead code — never imported by any runtime module. They have been moved to docs/reference/ as prototype reference code.

File Original Resolution
game/npc-logic.js PR #79 (GOFAI NPC State Machine) Moved to docs/reference/npc-logic-prototype.js — ES module using export default, incompatible with the global-script loading pattern. Concept (NPC state machine) is sound but not wired into any game system.
scripts/guardrails.js PR #80 (GOFAI Symbolic Guardrails) Moved to docs/reference/guardrails-prototype.js — validates HP/MP/stats concepts that don't exist in The Beacon's resource system. The scripts/guardrails.sh (bash CI script) remains active.

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.