Compare commits
4 Commits
fix/192-re
...
fix/16
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a0c4e6dfb | ||
|
|
834063536d | ||
| d5645fea58 | |||
|
|
db08f9a478 |
16
GENOME.md
16
GENOME.md
@@ -8,24 +8,32 @@ The Beacon is a browser-based idle/incremental game inspired by Universal Paperc
|
||||
|
||||
Static HTML/JS — no build step, no dependencies, no framework. Open `index.html` in any browser.
|
||||
|
||||
**5,128 lines of JavaScript** across 10 files. **1 HTML file** with embedded CSS (~300 lines). **1 Python test file** for reckoning projects.
|
||||
**6,033 lines of JavaScript** across 11 files. **1 HTML file** with embedded CSS (~300 lines). **3 test files** (2 Node.js, 1 Python).
|
||||
|
||||
## Architecture
|
||||
|
||||
```
|
||||
index.html (UI + embedded CSS)
|
||||
index.html (UI + embedded CSS + inline JS ~5000L)
|
||||
|
|
||||
+-- js/engine.js (1590L) Core game loop, tick, resources, buildings, projects, events
|
||||
+-- js/data.js (944L) Building definitions, project trees, event tables, phase data
|
||||
+-- js/render.js (390L) DOM rendering, UI updates, resource displays
|
||||
+-- js/combat.js (359L) Boss encounters, combat mechanics
|
||||
+-- js/combat.js (359L) Canvas boid-flocking combat visualization
|
||||
+-- js/sound.js (401L) Web Audio API ambient drone, phase-aware sound
|
||||
+-- js/dismantle.js (570L) The Dismantle sequence (late-game narrative)
|
||||
+-- js/main.js (223L) Initialization, game loop start, auto-save, help overlay
|
||||
+-- js/utils.js (314L) Formatting, save/load, export/import, DOM helpers
|
||||
+-- js/tutorial.js (251L) New player tutorial, step-by-step guidance
|
||||
+-- js/strategy.js (68L) NPC strategy logic for combat
|
||||
+-- game/npc-logic.js (18L) NPC behavior stub
|
||||
+-- js/emergent-mechanics.js Emergent game mechanics from player behavior
|
||||
|
||||
CI scripts (not browser runtime):
|
||||
+-- scripts/guardrails.sh Static analysis guardrails for game logic
|
||||
+-- scripts/smoke.mjs Playwright smoke tests
|
||||
|
||||
Reference prototypes (NOT loaded by runtime):
|
||||
+-- docs/reference/npc-logic-prototype.js NPC state machine prototype
|
||||
+-- docs/reference/guardrails-prototype.js Stat validation prototype
|
||||
```
|
||||
|
||||
## Entry Points
|
||||
|
||||
@@ -3,20 +3,15 @@ _2026-04-12, Perplexity QA_
|
||||
|
||||
## Findings
|
||||
|
||||
### Potentially Unimported Files
|
||||
### Dead Code — Resolved (2026-04-15, Issue #192)
|
||||
|
||||
The following files were added by recent PRs but may not be imported
|
||||
by the main game runtime (`js/main.js` → `js/engine.js`):
|
||||
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 | 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
|
||||
| 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)
|
||||
|
||||
|
||||
64
docs/issue-16-verification.md
Normal file
64
docs/issue-16-verification.md
Normal file
@@ -0,0 +1,64 @@
|
||||
# Issue #16 Verification
|
||||
|
||||
## Status: ✅ ALREADY IMPLEMENTED ON MAIN
|
||||
|
||||
Issue #16 asked for the Paperclips-style dismantle endgame: The Unbuilding.
|
||||
That implementation is already present on `main` in a fresh clone of `the-beacon`.
|
||||
|
||||
## Mainline evidence
|
||||
|
||||
Repo artifacts already present on `main`:
|
||||
- `js/dismantle.js`
|
||||
- `tests/dismantle.test.cjs`
|
||||
- supporting integration points in `js/engine.js`, `js/render.js`, and `js/data.js`
|
||||
|
||||
What the current implementation already covers:
|
||||
- an explicit Unbuilding offer path (`Dismantle.offerChoice()` / `renderChoice()`)
|
||||
- staged panel removal over time
|
||||
- stage-five resource-card dissolution sequence
|
||||
- final beacon-only moment with the line: `That is enough.`
|
||||
- save/load persistence for active dismantle progress
|
||||
- defer / cooldown handling so the sequence can be postponed and later resumed
|
||||
- render-loop protection so alignment UI does not wipe the Unbuilding prompt
|
||||
|
||||
## Verification run from fresh clone
|
||||
|
||||
Commands executed:
|
||||
- `node --test tests/dismantle.test.cjs`
|
||||
|
||||
Observed result:
|
||||
- the full dismantle regression suite passes on fresh `main`
|
||||
- verified behaviors include:
|
||||
- offering The Unbuilding instead of ending immediately
|
||||
- preserving the prompt across `renderAlignment()`
|
||||
- suppressing pending drift UI during active dismantle
|
||||
- completing the stage-five resource dissolve sequence
|
||||
- save/load restoration of partial progress
|
||||
- defer cooldown persistence across reload
|
||||
|
||||
## Historical trail
|
||||
|
||||
The issue accumulated many closed unmerged attempts while the implementation was hardened across repeated passes.
|
||||
Representative prior PR trail:
|
||||
- PR #116
|
||||
- PR #118
|
||||
- PR #120
|
||||
- PR #121
|
||||
- PR #123
|
||||
- PR #124
|
||||
- PR #135
|
||||
- PR #138
|
||||
- PR #139
|
||||
- PR #145
|
||||
|
||||
Those PRs show the long hardening history, but the important truth today is simpler: the dismantle sequence is already implemented on `main` and the tests pass.
|
||||
|
||||
## Why this should close the issue
|
||||
|
||||
Issue #16 is an atomic implementation issue, not a broad parent epic.
|
||||
The requested feature exists on `main`, passes targeted verification, and does not need to be re-implemented again.
|
||||
|
||||
## Recommendation
|
||||
|
||||
Close issue #16 as already implemented on `main`.
|
||||
This verification PR exists only to preserve a clean evidence trail and stop further duplicate implementation attempts.
|
||||
24
tests/issue-16-verification.test.cjs
Normal file
24
tests/issue-16-verification.test.cjs
Normal file
@@ -0,0 +1,24 @@
|
||||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const ROOT = path.resolve(__dirname, '..');
|
||||
|
||||
test('issue #16 verification doc captures dismantle evidence on main', () => {
|
||||
const doc = fs.readFileSync(path.join(ROOT, 'docs', 'issue-16-verification.md'), 'utf8');
|
||||
const required = [
|
||||
'# Issue #16 Verification',
|
||||
'## Status: ✅ ALREADY IMPLEMENTED ON MAIN',
|
||||
'js/dismantle.js',
|
||||
'tests/dismantle.test.cjs',
|
||||
'PR #116',
|
||||
'PR #118',
|
||||
'node --test tests/dismantle.test.cjs',
|
||||
'The Unbuilding',
|
||||
'That is enough.',
|
||||
];
|
||||
for (const snippet of required) {
|
||||
assert.match(doc, new RegExp(snippet.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')));
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user