Lighthouse for developers. Beacons for API endpoints, fog as downtime, ships as deployments, rocks as bugs.
  • JavaScript 100%
Find a file
2026-06-30 11:13:17 +00:00
node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709 test: add e2e tests 2026-06-24 11:08:22 +00:00
src feat(#1): lighthouse engine — beacons, fog, ships, keepers, ASCII tower 2026-06-15 04:10:29 +00:00
tests fix: e2e tests now use CommonJS require for node --test compatibility 2026-06-30 11:13:14 +00:00
package.json feat(#1): lighthouse engine — beacons, fog, ships, keepers, ASCII tower 2026-06-15 04:10:29 +00:00
README.md feat(#1): lighthouse engine — beacons, fog, ships, keepers, ASCII tower 2026-06-15 04:10:29 +00:00

code-lighthouse

Lighthouse for developers. Beacons for API endpoints, fog as downtime, ships as deployments, rocks as bugs.

Usage

const { Lighthouse, WEATHER, BEACON_PATTERNS, ROCK_TYPES } = require('./src/lighthouse');

const lh = new Lighthouse('Point Production');
lh.setKeeper('Old Salt');

// Install beacons for API endpoints
lh.addBeacon('users-api', { endpoint: '/api/users', range: 60, pattern: BEACON_PATTERNS.STEADY });
lh.addBeacon('payments-api', { endpoint: '/api/payments', range: 40, pattern: BEACON_PATTERNS.FLASHING });

// Place known rocks (bugs)
lh.placeRock(ROCK_TYPES.NULL_REF, 30);
lh.placeRock(ROCK_TYPES.RACE_CONDITION, 45);

// Incoming deployment
lh.registerShip('SS Deploy v2', { cargo: 'release-2.0', distance: 80 });

// Weather changes
lh.setWeather(WEATHER.FOGGY);

// Scan for hazards
lh.scan();

// Sound the horn if danger
lh.soundHorn();

// Time passes
for (let i = 0; i < 10; i++) lh.tick();

console.log(lh.towerView());
console.log(lh.report());

Components

  • Beacon — 6 patterns (steady, flashing, rotating, occulting, quick, SOS), fuel/visibility tracking
  • Ship — Deployments with cargo, health, ETA, collision damage
  • Rock — 5 bug types (null ref, race condition, off-by-one, circular dep, memory leak)
  • Lighthouse — Keeper, weather (clear/cloudy/foggy/stormy), horn alerts, scanning, ASCII tower