20 Commits
Author SHA1 Message Date
ssmithx d64c316240 Replace 'Login as Guest' with 'Create New Account' + nsec backup
The throwaway guest identity was disposable by design — lost the
session, lost the account, no way to recover it, not even shown the key
to write down. Replaced with a real onboarding flow:
- generateNewAccount() (lib/nsec.ts) creates a fresh keypair client-side
  and returns both nsec and npub for display, reusing the exact same
  login mechanism as the existing 'paste an nsec' path (loginWithNsec) —
  no new backend surface.
- LoginView.vue now has a backup step between 'Create New Account' and
  actually being signed in: shows the npub (safe to share) and nsec
  (never share), a copy-to-clipboard button, and an explicit 'this will
  not be shown again' warning before the player confirms and logs in.
- Removed lib/guest.ts and the loginAsGuest store action entirely —
  fully superseded, not kept alongside.

Verified the nip19 encode/decode round-trip (nsec -> decode -> same
pubkey) and the full generate-then-login flow work correctly before
deploying.
2026-08-06 18:37:24 +00:00
ssmithx 885116dac6 Add 'Login as Guest' — no extension or nsec needed
Generates a fresh random nostr keypair client-side and signs the NIP-98
login with it, same mechanism as the existing nsec path but nothing is
typed by a human and nothing is ever displayed/saved — the key exists in
page memory only long enough to sign the one login request (lib/guest.ts).

Visible and clearly labeled on the login screen (unlike the de-emphasized
'paste an nsec' option), with an explicit note that it's disposable: if
the session is lost there's no way to recover the same identity, since
nothing was saved for the player to do it with. Verified end-to-end
locally with a real generated key before deploying.
2026-08-06 17:51:13 +00:00
ssmithx 68fd77ac9d Make the header and floating panels responsive — was overflowing on mobile
Header packed logo + two full team-stat lines + user info + 3 buttons
into one unwrapped flex row — badly overflows anything narrower than a
wide desktop window. Now flex-col (stacked, small text) below the sm:
(640px) breakpoint, reverting to the original single-row layout above
it. Button labels shorten to icon-only on mobile (Sync -> just the ↻,
Disconnect -> ⏻) since 'Sync BTC Map' / 'Disconnect' text alone were
wide enough to force wrapping even in a flex-wrap row.

Also capped the two floating map panels (link-source banner, selected-
place detail) to the viewport width — w-72 (288px) plus its offset was
already right at the edge of a 320px phone screen and would overflow on
anything narrower.
2026-08-06 12:45:55 +00:00
ssmithx 66ac521037 Redesign SFX to actually sound cyberpunk, not just plain blips
Previous version was a single oscillator sweep per sound — thin and
generic. Rebuilt with the layering that actually reads as sci-fi/digital:
- Filtered white-noise bursts (bandpass/highpass/lowpass sweeps) under
  most sounds, the 'digital texture' that plain tones don't have on
  their own.
- A soft-clip WaveShaperNode distortion curve for grit on the harsher
  sounds (link zap, error).
- Detuned dual-oscillator layers for thickness (claim, field).
- Claim: two detuned rising saws through an opening lowpass filter, a
  rising noise sweep underneath, bright ping on top.
- Link: fast descending saw through heavy grit, sharp noise crack.
- Field: detuned arpeggio with a per-note opening filter sweep, a noise
  swell, and a sub-bass hit landing on the final note.
- Error: two harsh low blips through heavy grit plus a noise crackle
  (was a single smooth sweep).
- Click: tightened to a crisp tick with a short high noise transient.
2026-08-06 12:29:24 +00:00
ssmithx acb6510a11 Add SFX and ambient music, with a mute toggle
Everything is synthesized via Web Audio (oscillators/filters) — no
external audio files, since sourcing licensed music/SFX isn't something
to do without the rights to it, and synthesis fits the HUD aesthetic
anyway:
- Claim: rising power-up blip
- Link: descending zap
- Field closes: ascending 4-note arpeggio (distinct from a plain link —
  checks fields.length before/after to tell them apart)
- Rejected action: low buzz
- Minor UI (marker select, sync): short neutral blip
- Background: generative ambient loop (minor-pentatonic arpeggio through
  a lowpass filter + short feedback delay), starts on map mount, stops
  on unmount (was leaking into the login screen on logout otherwise)

🔊/🔇 toggle in the header, persisted to localStorage (regress_muted),
takes effect immediately including stopping/resuming the ambient loop.
2026-08-06 11:56:16 +00:00
ssmithx 1584676978 Sharpen the cyberpunk visuals — too diffused/hard to read
- Removed the whole-app animated scanline overlay entirely — biggest
  single contributor to the hazy look.
- text-shadow glow blur cut from 8px to 2px across the board (headers
  keep a hint of neon, body text is now crisp).
- hud-panel: solid 0.97-alpha background (was 0.88 + backdrop-blur(10px),
  which softened everything behind/inside it), tighter box-shadow.
- Map: dropped the saturate/hue-rotate tile filter (just brightness now),
  halved drop-shadow blur radii on markers/links/fields/clusters.
- Bumped low-opacity text (many labels were down at /30-/60 which reads
  fine on a mockup but is genuinely hard to read against a busy map) up
  to /75-/95 across Login/TeamPick/MapView.
2026-08-05 23:05:04 +00:00
ssmithx 6b8f5b1945 Cluster color reflects claimed contents; drop redundant team word from status
- iconCreateFunction now inspects each cluster's actual child markers
  (tracked via a WeakMap<L.Marker, Team> since markercluster only hands
  back raw marker instances, not our Place data) and colors the cluster
  orange/green if every claim inside belongs to one team, a split
  orange/green 'contested' look if both teams have claims inside, cyan
  neutral only when nothing in it is claimed. Previously every cluster
  looked identical regardless of contents.
- Status panel: 'held since block XXXXXX' — dropped 'in orange'/'in
  green', the color already carries that (was redundant).
2026-08-05 17:50:52 +00:00
ssmithx ab5fe5cb96 Show claim block height in the portal status panel
'held since block XXXXXX in orange/green' instead of just 'held by
orange' — the backend already returned claimed_at_block (routes/places.ts),
it just wasn't wired into the frontend Place type or the status display.
2026-08-05 17:42:38 +00:00
ssmithx bb03bfc365 Go global: worldwide BTC Map sync, marker clustering, response compression
- Sync now pulls every BTC Map place worldwide (~29k live), not just
  Madeira — dropped BTCMAP_CENTER_LAT/LON/RADIUS_KM entirely.
- Incremental via a stored watermark (settings.btcmap_synced_since):
  only fetches what changed since the last sync, not the whole dataset
  every time. Handles deletions too (BTC Map delistings correctly evict
  the local place + cascade its claim/links, not just go unclaimed).
- Real bug caught and fixed before it shipped: tried BTC Map's own
  recommended updated_since+limit pagination first, but their timestamps
  mix millisecond and whole-second precision, and naive string comparison
  across that isn't chronologically safe — silently truncated a real
  sync to ~4,000 of ~42,000 records with no error. Measured the
  alternative (single unpaginated request) instead: 2-3s for the full
  dataset, simpler and actually correct. Full writeup in
  services/btcmap.ts, regression test for the specific bug in
  services/btcmap.test.ts.
- @fastify/compress added — the places list is now tens of thousands of
  rows, gzip/br/zstd auto-negotiated.
- Also fixed while touching dependencies: @fastify/static had a real
  high-severity path-traversal/auth-bypass advisory (GHSA-pr96-94w5-mx2h
  et al) affecting the version we were pinned to — bumped to the patched
  10.1.2.
- Frontend: leaflet.markercluster (raw per-marker rendering doesn't scale
  to tens of thousands of points), cyberpunk-themed cluster icons to
  match the existing HUD styling, batch marker insertion (addLayers, not
  a per-marker addLayer loop) since that's dramatically faster at this
  scale. Default map view is now world-scale, recentering on the
  player's location if geolocation is available.
- 60 backend tests passing throughout (7 new for the sync rewrite).
2026-08-05 17:32:54 +00:00
ssmithx 4fef930029 Add 500km link cap, block-height-based claim expiry, and link count in score
- MAX_LINK_DISTANCE_KM (default 500): flat cap on link length. Real
  Ingress scales this off portal/resonator level (up to ~655km); Regress
  has no leveling system to scale off of, so this is a single ceiling.
- PORTAL_TIMEOUT_BLOCKS (default 2100): claims stamp the current Bitcoin
  block height (claimed_at_block, new migration) and expire back to
  neutral after this many blocks — the game's clock is block height, not
  wall-clock. Current height comes from mempool.space (BlockHeightService,
  60s cache), same trust model as the BTC Map dependency. A background
  sweep actively reverts timed-out claims (tearing down their links, same
  as a normal recapture); claim/link routes also check inline so
  correctness doesn't depend on sweep timing between runs.
- Pre-existing claims (already live in production) get backfilled with
  the real current block height once at startup rather than a guessed
  historical value — dry-run verified against an actual copy of the live
  production database before deploying.
- Score now reports link count per team alongside places/fields/area
  (backend already computed this; only the frontend display was missing).

22 new tests (53 total): pure expiry-logic unit tests plus full
claim/link/sweep integration tests using a network-free fake block-height
provider (BlockHeightProvider interface + FakeBlockHeight test double).
2026-08-05 17:20:35 +00:00
ssmithx 927997543d Move to dedicated regress.atobitcoin.io subdomain
DNS now exists for the subdomain, so retired the podsteadr.atobitcoin.io/regress/
path-prefix arrangement in favor of a clean root deployment on its own
domain: real Let's Encrypt cert (certbot certonly --webroot, same method
as podsteadr's own cert), independent nginx server blocks, no more
ROUTE_PREFIX/VITE_BASE needed for the live deploy (though still supported
and tested for future use elsewhere). Removed the now-dead /regress/
location from podsteadr's own nginx config.
2026-08-05 15:07:38 +00:00
ssmithx 517186ac55 Add path-prefix deployment support for migrating to podsteadr's domain
Regress needs to live at podsteadr.atobitcoin.io/regress/ since / is
already podsteadr. Two coordinated pieces:
- VITE_BASE build arg (frontend asset/script paths, %BASE_URL% in
  index.html for the nostr-provider.js script tag)
- ROUTE_PREFIX runtime env (backend routes registered under the prefix
  via Fastify's plugin-encapsulation, including /api/health)

The nginx location must forward the prefix unstripped (proxy_pass with
no trailing path) — NIP-98 login signs the exact URL it calls, so a
stripped prefix makes the backend reconstruct a different URL than what
was signed and every login fails. Caught this with a real nginx+docker
integration test locally before it could break the live migration, then
fixed a matching bug in auth.ts (it was signing the unprefixed URL while
api.ts fetched the prefixed one). New routePrefix.test.ts proves the
prefix is actually enforced, including a negative case. 40 tests passing.

Also fixes a latent bug: import.meta.env usage had no vite/client type
reference, so it only ever passed typecheck by accident in earlier local
runs — added the standard vite-env.d.ts.
2026-08-05 14:58:43 +00:00
ssmithx df9a4ae74b Cyberpunk visual overhaul
Dark CARTO basemap (was default bright OSM tiles), Orbitron/Share Tech
Mono fonts, neon cyan/magenta HUD chrome with glassmorphism panels,
glowing divIcon portal markers (pulsing when claimed) replacing plain
circle dots, neon drop-shadow filters on links/fields, and a subtle
scanline overlay. Login and team-pick screens restyled to match.
2026-08-05 14:14:38 +00:00
ssmithx cd3d82d1c1 Add unsafe raw-nsec login fallback
Collapsed-by-default 'paste an nsec (unsafe)' option on the login screen,
signs the NIP-98 login event client-side with nostr-tools and never
persists the key (used once in memory, discarded) — for testing/kiosk
use without a NIP-07 extension. Clearly labeled as unsafe in the UI.
2026-08-05 13:56:50 +00:00
ssmithx 0bf9b8997c Document archy-x250-dev3 deployment
Dedicated nginx server block on :8543 (not proxied under the dashboard's
80/443) because the dashboard sets Permissions-Policy: geolocation=()
server-wide, which would silently break Regress's core claim/link
mechanic. Also documents a found-but-not-fixed gap: the dashboard's
app iframe has no allow="geolocation", so the in-dashboard launch path
won't get location access either until that shared component is patched.
2026-08-05 13:41:38 +00:00
ssmithx 8286156412 Add Containerfile for deployment (single-container: server + built frontend) 2026-08-05 13:36:31 +00:00
ssmithx f0d437b60f Enforce Ingress-style link-crossing prevention
A new link can no longer cross any existing link from either team —
segmentsIntersect() does a standard orientation-based segment test,
and routes/links.ts excludes shared-endpoint pairs (fanning multiple
links out of the same portal is fine, that's not a crossing). 6 new
tests; 37 total passing.
2026-08-05 13:33:06 +00:00
ssmithx d6ef514c84 Scaffold Regress: Fastify+SQLite server and Vue frontend for the Ingress-style BTC Map capture game
- Server: NIP-98 nostr auth (session cookies), BTC Map sync, claim/link/field
  routes, physical-presence checks via geolocation distance. 31 tests passing.
- Frontend: Leaflet map, team pick, claim/link UI, Archipelago identity
  bridge vendored (nostr-provider.js) for dashboard launch support.
- Verified end-to-end against the live BTC Map API (167 real Madeira places)
  and via genuine NIP-98-signed HTTP requests against the built app.
2026-08-05 13:14:03 +00:00
ssmithx cac528ba9a Add design research: Ingress mechanics + BTC Map API + live Madeira dataset (167 places) 2026-08-05 12:59:43 +00:00
ssmithx a4b209d7a6 Initial commit 2026-08-05 12:57:33 +00:00