No description
  • JavaScript 90.3%
  • HTML 9.3%
  • Shell 0.3%
Find a file
2026-08-23 21:22:11 -04:00
.hermes v3.1-F: accessibility polish — 44px min hit targets on all buttons + :focus-visible outline (gold) + prefers-reduced-motion media query + ARIA labels + role=toolbar on bottom row + 4 source-assert tests (122 passing) 2026-08-17 14:53:23 -04:00
.planning chore: update STATE.md — Phase 12 in progress, 92% complete 2026-08-22 13:03:03 -04:00
assets v3.0 Day 1 part B: trace income bonuses (boss +3, no-damage +5, full-vein +2), 12 heirlooms with real cost math (Tier 1 = 1-10 days, Tier 2 = 5-20 days, Tier 3 = 30-100+ days), Cart's Memory at 300 traces is the Tier 5 gate, economy-math.test guards against v2-style regression, 12/12 economy tests + 75 total tests passing 2026-08-16 22:56:21 -04:00
research polish: remove dead _drawStalag (stalactite) from Stratum.js — catalog uses jagged-rock renderer; update source-assert to match; lock with new verify 2026-08-23 00:04:54 -04:00
scripts fix: add cache-buster to <script src> — iOS Safari kept serving cached broken main.js 2026-08-23 21:17:49 -04:00
src build: bump BUILD_VERSION + script cache-buster to 59bc1b5 (visible build chip + click diag) 2026-08-23 21:22:11 -04:00
test fix: add cache-buster to <script src> — iOS Safari kept serving cached broken main.js 2026-08-23 21:17:49 -04:00
tests polish: drill-heat HUD meter — cart.drillHeat finally visible (cyan→amber→red fill bar with overheat pulse) + source-assert verify 2026-08-23 20:53:58 -04:00
.gitignore v3.1 housekeeping: ignore .hermes/ (local-only sprint artifacts) 2026-08-17 14:51:37 -04:00
index.html build: bump BUILD_VERSION + script cache-buster to 59bc1b5 (visible build chip + click diag) 2026-08-23 21:22:11 -04:00
package-lock.json v3.3 polish: Game Speed card purchase — pure dumb module + state + audio (Phase 6 commit 1) 2026-08-18 16:14:53 -04:00
package.json v3.2-v3.3 autobuy: AFK mode for surface phase — src/autobuy.js with tickAutobuy (per-channel miner/upgrade buyers, 10-tier rule prevents starvation), pickBestMiner (deepest-first), pickBestUpgrade (cheapest-to-cap), setAutobuy (toggle helper). Shop.js shows two checkboxes for AFK toggles, hydrates from state.autobuy, persists via _markDirty. main.js ticks autobuy every 2s via _autobuyClock. +13 tests (220 passing) 2026-08-17 16:30:18 -04:00
README.md docs v3.3 patch: SPEC.md §10 patch appendix + §1/§6/§9 annotations, README v3.3 section 2026-08-18 14:30:36 -04:00
RESEARCH_BRIEF.md v3.3 polish: Game Speed card purchase — pure dumb module + state + audio (Phase 6 commit 1) 2026-08-18 16:14:53 -04:00
SPEC.md docs v3.3 patch: SPEC.md §10 patch appendix + §1/§6/§9 annotations, README v3.3 section 2026-08-18 14:30:36 -04:00
TESTING.md spec v1.0: dark-mine-runner design (tycoon+spire+spire-defense tie-in) 2026-08-16 20:58:29 -04:00

Dark Mine Runner

You pilot a drill-cart through a procedurally-shaped mine. The deeper you go, the more crystals you bring back. The deeper you go, the less of you comes back.

A 6-tier idle/incremental mining game. Built in autonomous sessions against the Dark Spire, Spire-Defense, and Crystal Miner Tycoon lineages.

Design philosophy: "Phase shifts beat growth curves." Each tier is its own small game with new verbs. You don't max out the game by buying upgrades — you unlock new verbs by mastering previous ones.

The 6 tiers (verbs mastered → next tier unlocks)

Tier Name Unlock condition New verb
1 Surface Miner (start of game) Idle crystal economy, 6 miners
2 Manual Descent ≥1 cart drop Steer cart, drill, lantern kills
3 Heirloom Compounding ≥10 completed shafts Spend traces on 12+ permanent upgrades
4 Cartwright ≥3 heirlooms + Tier 3 depth reached 5 visual cart variants, equip mechanic
5 Autopilot ≥3 cartwrights + 5 biomes cleared + Cart's Memory heirloom Configure automated descents
6 The City Beneath ≥100 automated shafts Build permanent infrastructure

How to play

You have two inputs:

  • Tap / hold anywhere on the canvas — fires the drill. Hold too long and the drill overheats (1-second cooldown; per-biome threshold varies 95% → 55%).
  • Drag left / right — steers the cart. The cart has inertia (accel + drag). On desktop, A/D or ←/→ keys.

[DROP CART] begins a run. The cart auto-scrolls through a procedurally-shaped tunnel. Lanterns orbit and auto-kill creatures. Reach the bottom of the stratum to trigger the "What do you give the deep?" overlay — type an offering (or leave empty) and submit.

6 biomes (mechanically different)

Biome Depth range Tunnel Drill overheat Heat damage Special
Topsoil 0–400m 320px 95% none Tutorial
Granite 400–900m 280px 95% none Stalagmites (stationary)
Shale 900–1500m 240px 85% none Denser veins
Obsidian 1500–2200m 200px 75% 1 HP/sec First boss tier
The Hollow 2200–3000m 160px 65% 2 HP/sec Shades pierce i-frames
Magma 3000–4000m 140px 55% 3 HP/sec Eruptions, environmental damage

Trace economy (precious, not free)

  • Base: 1 trace per shaft
  • Bonus: +3 per boss kill, +5 for no-damage shaft, +2 for ≥90% vein collection
  • So perfect play = up to 11 traces per shaft

12 heirlooms (spend traces here)

Three tiers of heirlooms. Per-stack cost scales 1.8×. Examples:

  • Tier 1 (5–15 traces each, 1–10 days to max): Cracked Lantern, Iron Treads, Resonant Drill Bit, Sturdy Lantern, Crystal Compass
  • Tier 2 (20–50 traces each, 5–20 days): Deepstone Compass, Memory of the Shaft, Echo of the Spire, Vein Sight, Cartographer's Mark
  • Tier 3 (80–300 traces each, 30–100+ days): The Quiet Lantern (lanterns don't block cart path), The Cart's Memory (Tier 5 gate, 300 traces)

5 cartwrights

Earn by feats:

  • Bone Cart (default)
  • Iron Cart (reach Tier 2)
  • Crystal Cart (complete Tier 3 descent)
  • Magma Cart (reach Tier 5)
  • The Cartwright (reach Tier 6)

Autopilot (Tier 5)

Configure automated descents. Target biome, drill mode (always/rhythmic/manual), retreat threshold (HP%). Decision density drops from 8–12/min (manual) to 2–3/min (autopilot). Per the canon's "make the game feel idle again" pattern.

The City Beneath (Tier 6)

Phase shift. A new game emerges:

  • 5 building types (Mineshaft, Refinery, Storage Silo, Lantern Turret, Research Lab)
  • 4 research upgrades (Deeper Routes, Magma Resistance, Shade Weaponry, City Expansion)
  • 2 threat types (Magma eruptions, Shade incursions) with countdown timers
  • Passive crystal/gem production that feeds back into the surface game

Run locally

cd dark-mine-runner
python3 scripts/server.py 8791
# Open http://localhost:8791/

(Or via Tailscale: https://ogflow.taile970c7.ts.net/dark-mine-runner/)

Project layout

dark-mine-runner/
├── index.html
├── src/
│   ├── main.js                  ← bootstrap + tier gates + input wiring
│   ├── canvas.js, loop.js, state.js, catalog.js, offline.js
│   ├── shop.js                  ← Miner + Cart upgrade shop
│   ├── heirlooms.js             ← 12-heirloom catalog with cost math
│   ├── cartwrights.js           ← 5 cartwrights with unlock conditions
│   ├── autopilot.js             ← Tier 5: automated descent runner
│   ├── city.js                  ← Tier 6: City Beneath phase shift
│   ├── whispers.js              ← 30-entry mid-run prose pool
│   ├── audio.js                 ← WebAudio procedural sound
│   ├── canvas-tiles.js          ← Wall tile preloader
│   ├── run/Cart.js, run/Stratum.js, run/RunLoop.js
│   ├── HeirloomPanel.js, CartwrightPanel.js, AutopilotPanel.js, CityPanel.js
│   └── endgame/OfferOverlay.js, endgame/PastShafts.js
├── assets/
│   ├── tiles/                   ← 6 SVG biome wall textures
│   └── sprites/                 ← 6 SVG icons + 2 crystal variants
├── scripts/server.py
├── SPEC.md                      ← full design doc (12KB, includes tier math)
├── README.md
├── TESTING.md
└── test/                        ← 101 tests across 4 suites

v3.1 — Polish & completion pass (additions on top of v3)

After v3 shipped, OG asked for autonomous work to push toward "project completion". v3.1 landed:

  • Cartwright visual differentiation: each of the 5 cartwrights now renders distinctly on the canvas (chassis tint, motifs, accent stripe). Fixes the long-standing gap where they were mechanical-only.
  • Drill heat visualization: heat bar above the chassis (cool blue → yellow → orange → red), overheat marker line, drill shake when overheated.
  • Heirloom breakpoint descriptions: all 12 heirlooms now show the meaningful levels inline in the shop (was only on 2 of 12).
  • City Beneath content expansion: Trade Outpost building (3 traces → 1 crystal/min), Surface Tribute research (+25% idle prod), Trace Smelting research (50 traces → 1 gem/5min via existing refineries).
  • v2 save migration: players upgrading from v2 get their progress carried forward; migration fires once per device, then the v3 save replaces the v2 save.
  • Accessibility: 44px minimum hit targets, :focus-visible outline, prefers-reduced-motion media query, ARIA labels on all bottom-row buttons.
  • Build identity: src/build.js with BUILD_VERSION + BUILD_TAG, build chip in the bottom-right corner (low opacity, revealed on hover), exposed on window.__dmr.build.

Test count: 101 → 125. (superseded by v3.2 → 166)

v3.2 — Deep expeditions, ratings, prestige preview (additions on top of v3.1)

After v3.1, OG redirected to keep building for the remaining budget. v3.2 added:

  • Per-run star rating — each completed shaft gets a 1–5 star rating weighted across depth / efficiency / safety / full-vein collection. Stored on the entry; rendered in Past Shafts; celebratory hint on 4★+.
  • Prestige preview — the "What do you give the deep?" overlay now shows a "+N shaft dust" preview computed from floor(sqrt(shafts)) + 2*bossKills + floor(traces/25). Preview only — actual reset ships later.
  • Lantern trails — each orbiting lantern leaves a fading 6-frame dot trail behind it so the orbit reads clearly at a glance.
  • Deep Expedition (new City Beneath verb) — spend 100💎+5✦ to launch a 60-second autonomous descent into +1 tier above the player. Boss-kill = 2× crystal payout. 10% chance to drop a unique expedition_relic heirloom (50% on boss kill). Relic grants +10% relic-find chance on future runs.

Test count: 125 → 166.

v3.3 — Polish wave + autobuy AFK + prestige reset + meta-upgrades (additions on top of v3.2)

OG redirected again: ship the polish wave that v3.1 skipped. v3.3 added ~78 commits in 2 days of autonomous iteration. Five categories:

  • 9 verb-class audio + flash confirmations. Every previously-silent button now fires a distinct flash keyframe + WebAudio cue. Deploy Lantern (amber), Heirloom purchase (orange + level-pulse), Cartwright equip (gold + active-row pulse), Expedition launch (purple), Autopilot launch (cyan), Defender forfeit (red), Drop Cart start (lime) vs. abort (red-orange), Shop purchase (teal), Panel toggle (slate-cyan), Tier-Up (deep-amber), Prestige (gold card-breathe + welcome toast). All dispatched through a unified flashBtn(btn, class, ms) helper and playSound(name) route.
  • 9 creature sprite overhauls. Cave Beetle (6-leg scissor gait + twitching antennae), Crystal Bat (flapping wings + eye pulses), Stalag-mite (dripping cone), Stratum Worm (sine-curve spine + tracking eyes), Hollow Shade (4-dot wisp tail), Hollow Wraith (forked tail + opposing-phase pupil scan), Magma Flare (cooling crack-veins + ember sparks), Cinder Wisp (3 flame-tongue shells + rising embers), Lava Lord (5-layer molten boss). Each is a 5-layer composite that breathes / twitches / flickers instead of sitting as a static decal.
  • Autobuy AFK mode — new tier-gated verb into the surface phase. src/autobuy.js with tickAutobuy (per-channel miner/upgrade buyers, 10-tier starvation rule), pickBestMiner (deepest-first), pickBestUpgrade (cheapest-to-cap). Shop.js shows two checkboxes for AFK toggles. HUD chip (🤖 Autobuy: M/U/M+U) lives in the stats column, pulses when the helper actually fires a purchase. Debounced 30s hint toast on AFK purchase so the player notices the autobot doing work.
  • Prestige reset wired (City Beneath → Reset). Captures shaft dust, wipes currencies (crystals/gems/traces/miners/upgrades), preserves heirlooms/cartwrights/tiers/shaft-dust/meta-upgrades. Gold-bordered celebration modal pulse-scales in (KEPT / RESET comparison panels, +N dust card, "Begin Loop #N+1" CTA). First-ever prestige fires a 4.2s slide-in welcome toast @ WELCOME TO THE SECOND LOOP — surface prod ×N.NNN (one-shot, gated on state.meta.welcomeShown). playPrestige() audio: gold sine-bell chord (C5+E5+G5) followed by ascending sine shimmer 440→1320Hz.
  • 5 Dust Echo meta-upgrades — post-prestige permanent multipliers across surface production / trace find / expedition cost / autobuy speed / heirloom ROI. Math deliberately slows the player back down so the second loop takes ~20 sessions, not 3.
  • Per-biome deploy-disabled affordance + autobuy HUD + build chip. Deploy Lantern button on iOS Safari (where native [disabled] has no style) swaps to dim bg + not-allowed cursor + contextual label ("Need 1 ✦" / "Shades cleared"). Build identity chip (window.__dmr.build) shown bottom-right on hover. prefers-reduced-motion disables all breathing/scale animations.
  • Defender verb — replaces v3.1's auto-resolve shade defense. On shade_incursion, a 30-second player-active modal opens. Deploy Lantern costs 1 trace, kills leftmost shade. Forfeit / timeout resolves to mineshaft loss. Turrets no longer settle incursions for free — shade_weaponry research multiplies turret reduction instead of substituting for player action.

Test count: 166 → 250 across 8 suites. 0 regressions.

See SPEC.md §10 for the full patch appendix (file manifest, anti-pattern audit, trade-route economy plan for v3.4, cadence-rule reinforcement).

Tests

npm test

Runs 250 tests across 8 suites:

  • test/smoke.mjs (18 logic tests)
  • test/browser-smoke.mjs (22 jsdom integration tests — incl. v2 save migration)
  • test/source-assert.mjs (~99 source-string assertions — incl. accessibility + build identity + expedition UI + all 9 verb-class flashes + all 9 creature overhauls)
  • test/economy-math.test.mjs (45 tier gate + cost math + cartwright + autopilot + city tests)
  • test/rating-tests.mjs (9 per-run star-rating tests)
  • test/prestige-tests.mjs (11 prestige-preview tests)
  • test/expedition-tests.mjs (11 expedition logic tests)
  • test/defender-tests.mjs (18 defender verb tests)
  • test/autobuy-tests.mjs (13 autobuy AFK tests)
  • test/prestige-reset-tests.mjs (prestige reset + dust-echo meta-upgrades)

Credits

Built by Hermes Agent (Nous Research) for og_arist0tle. v3 + v3.1 + v3.2 + v3.3 developed over 5+ days of autonomous iteration against feedback that v1/v2 were 10-minute toys. Each tier adds real verbs, not just bigger numbers.