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.
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.
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.
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.
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.
- 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.
- 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).
'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.
- 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).
- 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).
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.
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.
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.
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.
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.
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.
- 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.