- Add Fastify server in `app/src/index.ts` with health check and API routes for game state and turn processing. - Create `latentEntities.ts` to handle personal item plausibility and promote beliefs to facts based on actor context. - Introduce `llmAdapter.ts` for action extraction from prose input. - Develop `truthEngine.ts` for pure validation logic, handling all verbs with explicit rejection reasons. - Define new types in `types.ts` for facts, affordances, and latent entity requests/resolutions. - Update `docker-compose.yml` for improved service structure and volume management. - Create frontend structure with React, including Dockerfile, Vite configuration, and initial components for state inspection. - Implement basic styles and HTML structure for the frontend application. - Document current status and next steps in `thoughts.md`.
3.0 KiB
3.0 KiB
thoughts.md
Current Status
- Scaffold complete:
charactergarden/folder structure created per spec section 9 - Core contracts defined in
app/src/types.ts: Entity, Action, Verb, ValidationResult, StateChange, GameEvent, Turn, Belief, Fact, Affordance, Summary docker-compose.ymlcreated; ollama service gated behind--profile llm(not required for MVP).env/.env.example/.gitignorein place- Container-first runtime files added: app/frontend Dockerfiles and
.dockerignores - Truth Engine implemented in
app/src/truthEngine.ts— pure function, no I/O, no LLMvalidate(actions, worldState)→ ValidationResultapplyChanges(worldState, changes)→ new WorldState (immutable)- All 8 verbs handled with explicit rejection reasons
movenow supports a built-in offscene room convention viacreateOffsceneRoom()latentEntities.tscan promote plausible personal items from belief to fact when the actor has carrying contextdb.tsadded with SQLite schema + persistence helpers forentities,events,turns,beliefs, andsummaries- Minimal Fastify server + app pipeline added with seeded world state and fallback parser
- Minimal Vite React inspector added for visual boot testing and state inspection
Current Architecture Decisions
- App: Node.js + Fastify + TypeScript
- Frontend: React + Vite + TypeScript
- Database: better-sqlite3 (synchronous, no ORM)
- Ollama is optional; system must work without it (per section 14)
Eventtype renamedGameEventin code to avoid collision with the DOMEventglobal- Latent personal items are gated by facts-derived affordances, not accepted directly from beliefs
- The offscene room is represented as a normal room entity with id
offscene - App and frontend should be run and validated through Docker Compose rather than host-installed Node
Next Steps
- Implement App service / turn flow (
app/src/app.ts) per section 6 - Validate Docker boot and iterate on any compile/runtime failures
- Expand fallback parser coverage and tighten truth-engine world rules
- Add LLM adapter implementation beyond fallback parsing
Open Questions
- Should room/location be an Entity attribute or a separate entity type?
- What is the initial world state for the MVP (1–2 rooms, ≤3 characters)?
- Should latent personal-item plausibility live only on actor attributes, or also look at worn item/container entities?
Session Notes
- 2026-04-23: Project started. Scaffold, type contracts, .gitignore, and .env.example created.
- 2026-04-23: Truth Engine implemented. Pure validation with per-verb handlers and immutable applyChanges helper.
- 2026-04-23: Added facts/affordances + latent entity resolver for improv-style personal items, plus offscene room support.
- 2026-04-23: Added SQLite schema module. Host
npm installis blocked bybetter-sqlite3on Windows Node 25, so runtime validation should happen inside Docker on an LTS Node image instead. - 2026-04-23: Added minimal backend/frontend boot slice so the project can be tested visually through Docker.