A merit node awards a configured achievement (awards_flag) to the player
the moment the playthrough arrives on it, with node provenance, then
presents a ceremony. Migration 028 extends node_type + the component_key
CHECK and adds awards_flag; the runtime grants the flag in advance/goto/
new-game write paths; MeritHost renders the ceremony (a component_key can
supply a bespoke one, e.g. a 3D model). Verified: teleport to a merit node
auto-grants its achievement.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
GET /api/mysteries returns only mysteries with an entrypoint (empties are
filtered out), and the splash now lists them as case files with a per-case
BEGIN / RESUME action instead of a single hardcoded New Game.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
vite.config.ts now reads WEB_PORT (Vite) and PORT (API) from .env via
loadEnv, with the /api proxy following PORT and strictPort on — so two
branch checkouts can each run `npm run dev` on their own ports.
Play now always lands on the splash at the bare root instead of silently
resuming an active playthrough; a Resume action continues one when present.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Documents the URL routing (/, /node/:id teleport, /level/:id, /admin,
?phone=1), the demo game-state model (playthrough current_node_id +
achievements), and quick test recipes for the campaign, node teleport,
and the phone achievement seam.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A diegetic 90s handset rendered as a small three.js scene in a fixed 1:2
portrait stage (visual spike at /?phone=1, three.js lazy-loaded so the
board bundle is unchanged). Blocky flat-shaded clamshell with glowing
keys, a flip-open animation with an intro camera orbit that settles
head-on before the DOM screen appears, a hinge barrel on the pivot axis,
and a chubby antenna. Pressable 3D keypad (raycast + keyboard) with DTMF
tones drives a dialer: connect / voicemail / SIT "unobtainable", against
a stub number->node directory with flag-gated node enablement.
The screen UI is real DOM positioned in percent of the stage, kept
pixel-exact by the head-on ortho camera.
Also documents the persistent-board flow model (docs/persistent-boards.md):
board_key reuse across level nodes, present-but-hidden flag-gated exhibits
with live arrival reveals, reset/new-game semantics, and A/B/M citation codes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author a music track and volume (0-100%) per story node; the runtime
scales it to 0-1 and applies it without restarting the track when only
the level changes. Adds migration 024, threads music_volume through the
repository/runtime, and gives the node inspector a volume slider.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A dry synthesized key-clack (filtered noise burst with pitch jitter) plays as
each line types out — every other non-space character — for a detective-terminal
feel. Skipped in the editor preview and when reduced-motion is set.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
sfx() bailed whenever the context wasn't already 'running', so the autoplay-unlock
race dropped the blips. It's invoked from a click, so resume the context there and
always schedule the tone; bump the envelope and use a triangle wave (with a small
up-chirp on choices) for a more audible cue.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- migration 023: story_nodes.music_asset_id (references the asset store).
- src/audio.ts: a tiny audio manager — one looping scene-music track (fade,
dedup, gesture-primed autoplay) and synthesized one-shot SFX; global mute.
- Runtime: RuntimeNode.musicUrl; music follows the current node (null inherits,
a finished playthrough stops). SFX blips on dialogue advance/choice (not in the
editor preview). Floating mute toggle during play.
- Graph inspector: a "Scene music" picker sourced from uploaded audio assets.
No external library (we did not adopt react-winamp — it is a React 16 CRA app,
not an installable package). Bundle grew ~2 KB.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- DialoguePlayer gains an `inline` mode (fills its container, no window key
capture) and a `startId` to jump the walk to a given utterance.
- New DialoguePreview: a scaled-down mini player that fetches the resolved tree
from GET /api/admin/story-nodes/:id/dialogue (same resolver as playback).
- Mystery graph: preview appears next to a selected dialogue node.
- Utterance editor: docked preview that jumps to the clicked/selected utterance
and refreshes after each edit.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Uploaded manifest assets previously became application/octet-stream because the
Blob carried no type, so images/audio/pdf didn't display or thumbnail correctly.
Derive the mime from the extension. (Existing deduplicated assets keep their old
mime; only fresh uploads are affected.)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Mysteries tab: "+ New" (slug + title) and per-row delete; opens the graph editor.
- Assets tab: upload images/audio/PDFs to the shared osint.assets store, grid with
thumbnails/icons, copy id/url, delete (blocked with 409 when the asset is in use).
- Cutscene component_key is now a datalist of registered keys with a
"not registered" warning, instead of free text.
Backend: DELETE /api/admin/mysteries/:id and POST/GET/DELETE /api/admin/assets
(reusing the deduplicated, MinIO-backed asset store).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Input on top, output on the bottom, exit sinks in a row below; wires flow
downward. Cards auto-expand, so their heights are measured (offsetHeight) to
place the bottom output port. Seed and Tab-created utterances now stack downward.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- migration 022 drops utterances.advances_to_utterance_id and .effect, which the
parent-only/child-count dialogue model never used; purge their references.
- rewrite docs/story-graph.md to match what was built (parent-child utterances,
vertical mystery graph, graph runtime, gate stubs).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Introduce the narrative layer as a directed story-flow graph: an authored
campaign a player walks node by node, replacing the interim slot/chapter model.
Schema (migrations 015-021):
- mysteries, global NPC templates + named poses, per-user playthroughs
- story_nodes, terminals, utterances (the flow graph and dialogue trees)
- clean cutover: retire slot cutscenes/chapters/seen_dialogue
Runtime:
- New Game creates a playthrough bound to the JWT identity (dev test-user fallback)
- advance() walks the graph cutscene -> dialogue -> level -> ..., auto-skipping gates
- branching dialogue: player choices route out through node terminals
Admin authoring:
- NPC editor: upload named poses to the gupi MinIO bucket
- mystery graph editor: vertical node canvas, wiring, entrypoint, delete-by-click
- dialogue crafter: utterance tree, Tab to add child, 1/2 speaker, undo
Content authored via the manifest importer / admin panel and seeded for Glass
Harbour. MinIO added to the dev stack; dev container runs in development mode.
Also includes a folder-widget simplification (removes open/close) and a
resolveUserId auth helper.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>