No-AI mode, observability/security hygiene, and docs truth pass
Summary
Post-audit cleanup (full audit 2026-07-20). The Venice AI provider account was cancelled in June 2026 and every call has 402'd since; this PR makes the no-AI path a first-class, fully playable mode instead of a degraded accident, applies the audit hygiene wins, and rewrites the public docs to match reality (code and docs change together so the tree is consistent at every commit of this branch).
No-AI mode (behavioral):
- Quest NPCs offer template quests without an AI key (was: silent no-op), and kill/area progress reaches the static quest service so those quests complete (
venice.handler.ts,quest.service.ts, newai/static-services.ts) - Static quest descriptions are type-aware ("Explore X!", not "Defeat 1 forest!"), and explore quests only target unvisited areas (progress fires on first visit — a visited-area quest was uncompletable)
- Thought bubbles, newspaper headlines, and companion hints all serve their static content without AI; kill/death/area stats record without the Venice service
- Production wiring (dead code in all modes until now): zone transitions fire
handleAreaChange, player death fireshandleDeath, sub-30% HP crossings firehandleLowHealth(once per dip), and player exit callscleanupVenice()(was: per-player state leaked for process lifetime) - Boot log: "key not found" warning → info line for the supported default mode
Hygiene:
- OTel trace/log export is opt-in: the SDK only starts when
OTEL_EXPORTER_OTLP_ENDPOINTis explicitly set (traceExporter: undefinedstill falls back to env-default otlp → localhost:4318 — sdk-node behavior, verified against vendored source) - Debug WebSocket binds 127.0.0.1 (was: 0.0.0.0; UFW contained it, this is defense-in-depth)
- Removed hardcoded Venice API key fallback from
tools/test-venice.ts(env-only; the key remains in git history — account cancelled, rotation moot) deploy/fracture.service: dropped the dead OTEL env line; retired SigNoz/Grafana/ClickHouse deploy configs removed (deploy/ships only the systemd unit; history retains them)server/config.example.json/.env.examplehonesty sweep
Docs truth pass (README, devto article, server README, ARCHITECTURE_SRP, ROADMAP): AI integration and the observability stack rewritten past-tense — what was built, that it ran in production, when/why it retired, and what remains (instrumentation reactivates with one env var; static fallbacks kept the game alive when the provider died — that actually happened). Corrected test/file counts, stack tables, env tables; removed the compose quickstart.
Test plan
pnpm test: 67 files / 3,198 tests green (+31 vs master, covering every behavioral change above)pnpm build:server(tsc) andpnpm build:client(webpack) both clean- Deploy note: full no-AI mode takes effect when
VENICE_API_KEYis unset in the production.env; with the key set the old 402-fallback behavior persists
Summary by Sourcery
Formalize and fully support a no-AI gameplay mode while cleaning up observability/security configuration and aligning documentation with the current production reality.
New Features:
- Provide static quest, companion, thought bubble, and newspaper content so the game remains fully playable when AI services are disabled.
Enhancements:
- Wire AI/companion hooks for zone changes, low-health events, deaths, and disconnect cleanup so static and AI paths share consistent behavior.
- Introduce shared static AI fallback services and profile tracking singletons for kill and area progress, with tests covering quest templates, thoughts, companion hints, and news in no-AI mode.
- Make OpenTelemetry trace and log export explicitly opt-in, disabling the default localhost collector assumptions when no OTEL endpoint is configured.
- Restrict the debug WebSocket server to localhost and ensure per-player AI-related state is cleaned up on player exit to avoid process-lifetime growth.
Documentation:
- Update README, server README, dev.to article, ARCHITECTURE_SRP, and ROADMAP to reflect retired AI and observability stacks, current test/file counts, and the static-fallback behavior.
- Remove retired observability stack deployment configs and Docker Compose instructions, documenting that instrumentation remains and can be reactivated with an OTEL endpoint.
Tests:
- Add and extend tests for combat hooks, world and zone handlers, static AI fallback services, and quest behavior to cover the new no-AI mode and wiring, increasing overall test count.
Summary by cubic
Make no-AI mode fully playable and production-ready: quests, thoughts, and newspaper now work without VENICE_API_KEY, with proper progress, hooks, and cleanup. Observability export is opt-in; debug server binds to localhost; retired SigNoz/Grafana/ClickHouse configs removed; docs/env samples updated, plus small resilience fixes in combat and player exit.
-
New Features
- Static services power quests, thoughts, news, and companion hints when Venice is absent; quests complete and stats record without the API.
- Quest UX: type-aware descriptions, explore targets limited to unvisited areas, and templates with missing areas are skipped.
- Production hooks: zone change → handleAreaChange, death → handleDeath, sub-30% HP → handleLowHealth (fires once per dip and re-arms on healing), and player exit → cleanupVenice() (cleans static-service state too).
- Resilience: death hook falls back to killer type "unknown" if unmapped; player exit cleanup is try-catch guarded so removal always runs.
-
Migration
- No-AI: leave
VENICE_API_KEYempty to run on static content; an empty env var now overridesconfig.jsonto force off. Set it to re-enable Venice behavior. - Observability:
OTEL_EXPORTER_OTLP_ENDPOINTmust be set to enable OTLP export; dotenv loads before reading the endpoint, and the OTel SDK/log transport are not constructed when unset (no localhost traffic). - Security: the debug WebSocket binds to
127.0.0.1; use local tooling only. - Deploy: retired the SigNoz/Grafana/ClickHouse compose stack; only
deploy/fracture.serviceships. - Dev tooling:
tools/test-venice.tsno longer falls back to a hardcoded key; exportVENICE_API_KEYbefore running.FISH_AUDIO_API_KEYis independent and remains dormant on narration paths in no-AI mode.
- No-AI: leave
Summary by CodeRabbit
- New Features
- Static fallback quests, news, companion hints, and thought bubbles now run when AI services are unavailable.
- Added low-health/death reactions, area-change hook support, and improved fallback quest progression.
- Bug Fixes
- Better player-state cleanup on disconnect; low-health triggering now re-arms correctly.
- Debug WebSocket now binds to localhost only.
- Documentation
- Updated
.env.exampleand refreshed README/architecture/roadmap/server docs for dormant AI and retired observability.
- Updated
- Chores
- Retired bundled observability and load-testing deployment configs; tracing/log shipping is now opt-in via environment settings.
- Tests
- Expanded “no-AI mode” test coverage across multiple services and handlers.