diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index 4323aa1..1f81bdd 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -46,7 +46,7 @@ {"id":"ge-cwu","title":"Integration: run embedding test in CI (manual trigger)","description":"Add a GitHub Actions workflow to run the real-model embedding integration test on-demand via workflow_dispatch and optionally on a nightly schedule. Use the npm script from the related task. Include cache for node_modules and model artifacts if possible.\\n\\nAcceptance criteria:\\n- .github/workflows/integration-embedding.yml exists and can be triggered manually\\n- Workflow uses \nadded 839 packages, and audited 840 packages in 10s\n\n239 packages are looking for funding\n run `npm fund` for details\n\nfound 0 vulnerabilities and runs \\n- Document workflow in CHANGES or PR notes\\n\\nFiles to be created: .github/workflows/integration-embedding.yml","status":"open","priority":1,"issue_type":"feature","created_at":"2026-01-17T20:47:30.221503844-08:00","created_by":"rgardler","updated_at":"2026-01-17T20:47:30.221503844-08:00"} {"id":"ge-e8j","title":"Flaky E2E: telemetry smoke fails intermittently on touch worker","status":"closed","priority":3,"issue_type":"bug","created_at":"2026-01-06T23:32:43.292579156-08:00","created_by":"rgardler","updated_at":"2026-01-06T23:55:10.393828203-08:00","closed_at":"2026-01-06T23:55:10.393828203-08:00","close_reason":"Resolved via test instrumentation/relaxation","comments":[{"id":5,"issue_id":"ge-e8j","author":"rgardler","text":"Observed intermittent failure in Playwright run (chromium-touch): smoke state not running when expected. Local run produced 1 failing test in the touch worker while desktop workers passed.\n\nSuggested next steps:\n- Increase timeout/waiting logic in tests when asserting Smoke.getState() (race between UI and effect start).\n- Capture console logs and Smoke.getState() earlier to help diagnose timing.\n- Run failing test repeatedly in CI matrix or locally to reproduce flakiness.\n\nFiles touched during this session:\n- jest.config.js (created)\n- jest.setup.js (created)\n- tests/unit/inkrunner.test.js (created)\n- tests/demo.telemetry.spec.ts (created)\n- tests/demo.smoke.spec.ts (modified)\n- web/demo/js/inkrunner.js (modified)\n- package.json (modified)\n- package-lock.json (modified)\n- .beads/issues.jsonl (modified)\n\n","created_at":"2026-01-07T07:32:49Z"},{"id":6,"issue_id":"ge-e8j","author":"rgardler","text":"Flake mitigated by telemetry test relaxation and smoke.js event instrumentation. Smoke emits smoke_state events and test now accepts either state or events. Stress runs on chromium-touch (repeat-each=3) now pass. No further action planned.","created_at":"2026-01-07T07:55:10Z"}]} {"id":"ge-hbd","title":"CI: Verify Playwright demo E2E runs in CI and uploads artifacts on failure","status":"closed","priority":1,"issue_type":"task","assignee":"rgardler","created_at":"2026-01-07T00:22:46.424888216-08:00","created_by":"rgardler","updated_at":"2026-01-07T00:38:40.883482911-08:00","closed_at":"2026-01-07T00:38:40.883482911-08:00","close_reason":"Completed","dependencies":[{"issue_id":"ge-hbd","depends_on_id":"ge-k3p","type":"discovered-from","created_at":"2026-01-07T00:22:46.430418906-08:00","created_by":"rgardler"}],"comments":[{"id":14,"issue_id":"ge-hbd","author":"rgardler","text":"Assigning this follow-up to rgardler to watch the PR checks and verify artifacts are uploaded on failure. Steps: monitor PR #97, review workflow run, confirm test-results/playwright-report artifacts present on failed runs.","created_at":"2026-01-07T08:24:33Z"}]} -{"id":"ge-hch","title":"Dynamic Interactive Story Engine","description":"Build an InkJS-based narrative engine that enables rapid creation of immersive, story-first games, starting with an Ink-powered text-only MVP (M1) and evolving through AI-assisted branching toward a reactive simulated world.\\n\\n- Problem\\n - We need an engine that makes it fast and repeatable to create dynamic, immersive narrative games, with a roadmap toward AI-assisted branching and world reactivity.\\n - The repository currently lacks a clear runtime-ready vertical slice (story runtime + player UX + save/load + runtime telemetry) that can be iterated in small focused loops.\\n\\n- Users\\n - Players: narrative-focused players (15–45 minute sessions) on desktop/mobile browsers.\\n - Creators (internal initially): Producer using AI assistance to generate initial Ink content for demos (future: writers/designers).\\n\\n- Success criteria (M1 / MVP)\\n - Runtime story play: InkJS runtime loads and executes one Ink story end-to-end (branching choices at runtime) with no fatal runtime errors; demo story completes.\\n - Player UX: player can select choices; single-slot save/load works (autosave + manual save).\\n - Performance: first story screen cold start ≤ 8s on desktop browsers and ≤ 12s on mobile browsers (targets are measurable and can be tuned later if needed).\\n - Observability: runtime telemetry events emitted for story start, choice selected, and story completion.\\n - Content: at least 1 AI-generated demo story is included and playable.\\n\\n- Constraints\\n - Runtime: InkJS (Node / browser).\\n - Content source (M1): AI creates demo Ink story content.\\n - Timeline: undefined / not fixed.\\n - Telemetry: must work at runtime (design-time-only telemetry is insufficient).\\n - Ownership: Producer (you) is owner/assignee for this epic.\\n - Non-goals (M1): none specified (explicitly).\\n\\n- Existing state (if applicable)\\n - No existing beads found that represent this engine epic; any current open bead(s) appear unrelated.\\n - No existing runtime Ink integration artifacts were found during high-level scanning (if they exist, Producer should point to the location).\\n\\n- Desired change (if applicable)\\n - Establish the initial “vertical slice” narrative runtime using InkJS (Ink runtime + minimal UI + save/load + runtime telemetry) to enable rapid iteration, and provide a baseline to expand toward AI-assisted branching and, later, a simulated world.\\n\\n- Milestones (suggested; editable)\\n - M0 (Scaffold / smoke demo): browser-based scaffold that can display static text panels and advance pages; basic UI layout works on desktop browsers and mobile.\\n - M1 (MVP): fully scripted, text-only interactive novel using Ink at runtime:\\n - branching choices, save/load (single slot), runtime telemetry, 1 playable demo story.\\n - M1.5 (Content iteration loop): workflow/tooling to rapidly swap stories + basic automated story regression replays (e.g., “golden path” replays).\\n - M2: scripted story with AI-generated branches:\\n - AI proposes branches within constraints; guardrails to prevent incoherent/unsafe output; runtime can integrate generated branches.\\n - M3: basic 2D backgrounds + 3D posed characters:\\n - story beats can trigger staging (background swap, character pose, simple animation cues).\\n - M4: simulated world reacting to player actions while following scripted arc:\\n - world state model + AI adaptation that preserves a high-level authorial arc; player agency feels real while narrative remains guided.\\n - M5 (optional / advanced): richer interaction + systemic characters:\\n - NPC goals/memory, quest/state graphs, and a narrative “director” steering toward story arcs.\\n\\n- Related issues (Beads ids)\\n - None identified as directly related.\\n\\n- Recommended next step\\n - PRD: docs/prd/GDD_M1_dynamic_interactive_story_engine.md\\n\\n- Risks \u0026 assumptions (notes)\\n - Ink runtime integration risk: runtime APIs may require glue code or adaptation.\\n - Telemetry gap: design-time telemetry exists; runtime telemetry may need new plumbing and event schema decisions.\\n - Browser constraints: memory/CPU budgets may force design constraints; early profiling may be needed.\\n - AI-generated content quality/safety: outputs may be incoherent or unsuitable; need guardrails and provenance/versioning later.\\n - Save compatibility: changes to story structure may break existing saves; define expectations early.","status":"tombstone","priority":0,"issue_type":"epic","assignee":"rgardler","created_at":"2026-01-03T01:55:07.534717179-08:00","created_by":"rgardler","updated_at":"2026-01-08T02:20:27.165245541-08:00","labels":["Status: Milestones Defined"],"comments":[{"id":22,"issue_id":"ge-hch","author":"rgardler","text":"","created_at":"2026-01-08T01:24:37Z"},{"id":23,"issue_id":"ge-hch","author":"rgardler","text":"","created_at":"2026-01-08T01:24:41Z"},{"id":24,"issue_id":"ge-hch","author":"rgardler","text":"","created_at":"2026-01-08T03:06:12Z"}],"deleted_at":"2026-01-08T02:20:27.165245541-08:00","deleted_by":"daemon","delete_reason":"delete","original_type":"epic"} +{"id":"ge-hch","title":"Dynamic Interactive Story Engine","description":"Build an InkJS-based narrative engine that enables rapid creation of immersive, story-first games, starting with an Ink-powered text-only MVP (M1) and evolving through AI-assisted branching toward a reactive simulated world.\\n\\n- Problem\\n - We need an engine that makes it fast and repeatable to create dynamic, immersive narrative games, with a roadmap toward AI-assisted branching and world reactivity.\\n - The repository currently lacks a clear runtime-ready vertical slice (story runtime + player UX + save/load + runtime telemetry) that can be iterated in small focused loops.\\n\\n- Users\\n - Players: narrative-focused players (15–45 minute sessions) on desktop/mobile browsers.\\n - Creators (internal initially): Producer using AI assistance to generate initial Ink content for demos (future: writers/designers).\\n\\n- Success criteria (M1 / MVP)\\n - Runtime story play: InkJS runtime loads and executes one Ink story end-to-end (branching choices at runtime) with no fatal runtime errors; demo story completes.\\n - Player UX: player can select choices; single-slot save/load works (autosave + manual save).\\n - Performance: first story screen cold start ≤ 8s on desktop browsers and ≤ 12s on mobile browsers (targets are measurable and can be tuned later if needed).\\n - Observability: runtime telemetry events emitted for story start, choice selected, and story completion.\\n - Content: at least 1 AI-generated demo story is included and playable.\\n\\n- Constraints\\n - Runtime: InkJS (Node / browser).\\n - Content source (M1): AI creates demo Ink story content.\\n - Timeline: undefined / not fixed.\\n - Telemetry: must work at runtime (design-time-only telemetry is insufficient).\\n - Ownership: Producer (you) is owner/assignee for this epic.\\n - Non-goals (M1): none specified (explicitly).\\n\\n- Existing state (if applicable)\\n - No existing beads found that represent this engine epic; any current open bead(s) appear unrelated.\\n - No existing runtime Ink integration artifacts were found during high-level scanning (if they exist, Producer should point to the location).\\n\\n- Desired change (if applicable)\\n - Establish the initial “vertical slice” narrative runtime using InkJS (Ink runtime + minimal UI + save/load + runtime telemetry) to enable rapid iteration, and provide a baseline to expand toward AI-assisted branching and, later, a simulated world.\\n\\n- Milestones (suggested; editable)\\n - M0 (Scaffold / smoke demo): browser-based scaffold that can display static text panels and advance pages; basic UI layout works on desktop browsers and mobile.\\n - M1 (MVP): fully scripted, text-only interactive novel using Ink at runtime:\\n - branching choices, save/load (single slot), runtime telemetry, 1 playable demo story.\\n - M1.5 (Content iteration loop): workflow/tooling to rapidly swap stories + basic automated story regression replays (e.g., “golden path” replays).\\n - M2: scripted story with AI-generated branches:\\n - AI proposes branches within constraints; guardrails to prevent incoherent/unsafe output; runtime can integrate generated branches.\\n - M3: basic 2D backgrounds + 3D posed characters:\\n - story beats can trigger staging (background swap, character pose, simple animation cues).\\n - M4: simulated world reacting to player actions while following scripted arc:\\n - world state model + AI adaptation that preserves a high-level authorial arc; player agency feels real while narrative remains guided.\\n - M5 (optional / advanced): richer interaction + systemic characters:\\n - NPC goals/memory, quest/state graphs, and a narrative “director” steering toward story arcs.\\n\\n- Related issues (Beads ids)\\n - None identified as directly related.\\n\\n- Recommended next step\\n - PRD: docs/prd/GDD_M1_dynamic_interactive_story_engine.md\\n\\n- Risks \u0026 assumptions (notes)\\n - Ink runtime integration risk: runtime APIs may require glue code or adaptation.\\n - Telemetry gap: design-time telemetry exists; runtime telemetry may need new plumbing and event schema decisions.\\n - Browser constraints: memory/CPU budgets may force design constraints; early profiling may be needed.\\n - AI-generated content quality/safety: outputs may be incoherent or unsuitable; need guardrails and provenance/versioning later.\\n - Save compatibility: changes to story structure may break existing saves; define expectations early.","status":"in_progress","priority":0,"issue_type":"epic","assignee":"rgardler","created_at":"2026-01-03T01:55:07.534717179-08:00","created_by":"rgardler","updated_at":"2026-01-18T17:04:10.045346812-08:00","labels":["Status: Milestones Defined"],"comments":[{"id":22,"issue_id":"ge-hch","author":"rgardler","text":"","created_at":"2026-01-08T01:24:37Z"},{"id":23,"issue_id":"ge-hch","author":"rgardler","text":"","created_at":"2026-01-08T01:24:41Z"},{"id":24,"issue_id":"ge-hch","author":"rgardler","text":"","created_at":"2026-01-08T03:06:12Z"}],"deleted_at":"2026-01-08T02:20:27.165245541-08:00","deleted_by":"daemon","delete_reason":"delete","original_type":"epic"} {"id":"ge-hch.1","title":"M0 — Scaffold / Smoke Demo","description":"M0 — Scaffold / Smoke Demo\\n\\nMinimal browser-based scaffold proving VN-style text UI and a working InkJS dev path.\\n\\n## Scope\\nCreate a small browser-based scaffold that proves the InkJS runtime dev path and produces a smoke demo playable in desktop and mobile browsers. The scaffold should be simple HTML/JS using a fork of InkJS to load and run an Ink story (a short demo story should be included). Suggested repository location: web/ or demo/.\\n\\nThis task is documentation/text-only for the M0 scaffold description. Do not modify Unity project files, .unity scenes, C# source, or binary assets in this issue. If a sibling bead references a code or binary artifact that must be changed, handle that with a discovered-from follow-up bead (do not edit the artifact here).\\n\\n## Success Criteria\\n- Demo loads and executes an Ink story end-to-end in a desktop browser and in a mobile browser viewport (no fatal runtime errors).\\n- Branching choices present and selectable at runtime.\\n- Single-slot save/load implemented and demonstrable (e.g., localStorage or downloadable save file).\\n- Developer instructions included describing how to run the demo locally (example: cd web \u0026\u0026 npm ci \u0026\u0026 npm start or open demo/index.html).\\n- Minimal telemetry hook points are documented (story_start, choice_selected, story_complete). Implementation of telemetry can be deferred to follow-ups, but hooks and example calls must be visible in the demo docs.\\n\\n## Dependencies\\n- None (this is a docs/scaffold definition). Any implementation work that touches code or binaries should be managed by separate follow-up beads.\\n\\n## Deliverables\\n- Updated M0 scaffold description and success criteria (this issue).\\n- Suggested demo location noted (web/ or demo/) and basic developer run instructions.\\n- bd comment (by implementer) listing any doc files updated and a short rationale.","status":"closed","priority":1,"issue_type":"epic","created_at":"2026-01-03T13:04:51.294401396-08:00","created_by":"rgardler","updated_at":"2026-01-07T02:17:05.53320038-08:00","closed_at":"2026-01-07T02:17:05.53320038-08:00","close_reason":"Completed","dependencies":[{"issue_id":"ge-hch.1","depends_on_id":"ge-hch","type":"parent-child","created_at":"2026-01-03T13:04:51.298188806-08:00","created_by":"rgardler"}]} {"id":"ge-hch.1.2","title":"Project scaffold","description":"Project scaffold: web project container, repo layout guidance, and README.\\n\\n## Acceptance Criteria\\n- docs/InkJS_README.md created (or docs/Unity_README.md replaced) with clear developer guidance for the web demo and InkJS runtime.\\n- Repo layout shows where the M0 web scaffold lives (suggested: web/ or demo/) and how to run it locally.\\n- LFS / binary guidance updated to reflect that Unity binaries are not used for the ink-js path; any legacy Unity artifacts are referenced as archived in history/ if needed.\\n- Any references to Unity editor/version, .unity scenes, Assets/ paths or Unity-specific binary policy are removed from this bead and replaced with InkJS/web guidance.\\n\\n## Minimal Implementation\\n- Create docs/InkJS_README.md containing:\\n - Purpose: InkJS-based dev/demo scaffold for M0.\\n - Repo layout: high-level paths (e.g., web/, stories/, docs/).\\n - Dev run instructions (example):\\n - Run demo locally (if using a simple runner): cd web \u0026\u0026 npm ci \u0026\u0026 npm start\\n - Or, open web/demo/index.html in a browser if no dev server is used.\\n - Demo content: where the demo story lives (e.g., web/stories/demo.ink).\\n - Save/load guidance: single-slot save via localStorage or downloadable save file.\\n - Telemetry hooks: document story_start, choice_selected, story_complete hook locations and example calls (console examples).\\n - Artifact policy: how CI should archive web artifacts; guidance on not committing large binary assets to repo.\\n - Legacy Unity note: if Unity project files exist, document that they are legacy and must be handled via separate follow-ups; point to history/unity-archive/ if archived.\\n\\n- Update this bead (ge-hch.1.2) description to reflect the above and reference docs/InkJS_README.md.\\n\\n## Deliverables\\n- docs/InkJS_README.md (new or replacement)\\n- Updated ge-hch.1.2 description (this bead)\\n- bd comment on ge-hch.1.2 listing any doc file(s) added/changed (paths)\\n- Any required discovered-from follow-up beads created for code/binary artifacts referenced by sibling beads\\n","status":"closed","priority":2,"issue_type":"feature","created_at":"2026-01-03T20:11:29.903486523-08:00","created_by":"rgardler","updated_at":"2026-01-06T03:00:40.797549705-08:00","closed_at":"2026-01-06T02:45:19.27817597-08:00","dependencies":[{"issue_id":"ge-hch.1.2","depends_on_id":"ge-hch.1","type":"parent-child","created_at":"2026-01-03T20:11:29.930636519-08:00","created_by":"rgardler"}]} {"id":"ge-hch.1.2.1","title":"Implement: Project scaffold","description":"Implement: Project scaffold (InkJS)\\n\\nCreate docs/InkJS_README.md noting InkJS runtime, web project layout, and web dev flow.\\n\\n## Acceptance Criteria\\n- docs/InkJS_README.md is present at docs/InkJS_README.md in the repository.\\n- README documents Node/browser dev flow and steps to run the demo (example: cd web \u0026\u0026 npm ci \u0026\u0026 npm start or open web/demo/index.html).\\n- README documents where the demo Ink stories live (e.g., web/stories/).\\n- Guidance on artifact policy: do not commit large binary assets; legacy Unity files should be archived in history/ if needed.\\n\\n## Minimal Implementation\\n- Add docs/InkJS_README.md with sections: InkJS runtime, repo layout (web/, stories/, docs/), dev run instructions, demo story location, save/load guidance, and a brief legacy Unity note pointing to history/unity-archive/.\\n","status":"closed","priority":1,"issue_type":"task","created_at":"2026-01-03T20:15:57.120564111-08:00","created_by":"rgardler","updated_at":"2026-01-06T03:00:40.799104885-08:00","closed_at":"2026-01-04T13:48:47.345852552-08:00","dependencies":[{"issue_id":"ge-hch.1.2.1","depends_on_id":"ge-hch.1.2","type":"parent-child","created_at":"2026-01-03T20:15:57.142675797-08:00","created_by":"rgardler"}]} @@ -165,9 +165,16 @@ {"id":"ge-hch.5.15.7","title":"Director Configuration UI","description":"Let players tune Director sensitivity via the settings panel.\n\n## Player Experience Change\nPlayers can adjust how selective the Director is. Lower risk threshold = stricter filtering (fewer AI branches but higher quality). Higher threshold = more permissive (more AI branches but potentially less coherent). Power users can disable Director entirely to return to naive injection mode.\n\n## Acceptance Criteria\n- [ ] Risk threshold slider (0.1–0.8, default 0.4) in AI Settings modal\n- [ ] 'Enable Director' checkbox (default: checked)\n- [ ] When disabled, falls back to naive injection (all valid proposals accepted)\n- [ ] Settings persist in localStorage\n- [ ] UI changes take effect on next choice point (no page reload needed)\n- [ ] Unit test: changing threshold updates `getSettings().directorRiskThreshold`\n- [ ] Unit test: invalid threshold value (e.g., 2.0) is clamped to valid range\n- [ ] Integration test: high threshold (0.8) accepts more proposals than low threshold (0.2)\n\n## Minimal Implementation\n- Extend `renderSettingsPanel()` in api-key-manager.js\n- Add 'Director Settings' section below 'AI Settings'\n- Bind slider to `settings.directorRiskThreshold`\n- Bind checkbox to `settings.directorEnabled`\n\n## Dependencies\n- ge-hch.5.15.6 (Director Integration \u0026 Injection)\n\n## Deliverables\n- Extended api-key-manager.js\n- UI tests","status":"closed","priority":2,"issue_type":"feature","assignee":"@Patch","created_at":"2026-01-16T15:02:32.281278376-08:00","created_by":"rgardler","updated_at":"2026-01-18T02:42:58.787928924-08:00","closed_at":"2026-01-18T02:42:58.787928924-08:00","close_reason":"Completed","dependencies":[{"issue_id":"ge-hch.5.15.7","depends_on_id":"ge-hch.5.15","type":"parent-child","created_at":"2026-01-16T15:02:32.282245731-08:00","created_by":"rgardler"},{"issue_id":"ge-hch.5.15.7","depends_on_id":"ge-hch.5.15.6","type":"blocks","created_at":"2026-01-16T15:04:32.543472979-08:00","created_by":"rgardler"}],"comments":[{"id":217,"issue_id":"ge-hch.5.15.7","author":"rgardler","text":"Verified acceptance criteria already satisfied in existing Director UI/logic. Tests run: (1) npm test -- --runTestsByPath tests/unit/inkrunner.test.js tests/demo.telemetry.spec.ts, (2) npx start-server-and-test \"npm run serve-demo -- --port 4173\" http://127.0.0.1:4173/demo \"npx playwright test --config=playwright.config.ts --reporter=list,html,junit tests/demo.telemetry.spec.ts\". All passing; no code changes required.","created_at":"2026-01-18T10:42:56Z"}]} {"id":"ge-hch.5.15.8","title":"Decision Telemetry Emitter","description":"Emit telemetry events for Director decisions to enable future analysis and tuning.\n\n## Player Experience Change\nNone directly visible. Enables the team to analyze Director performance, identify common rejection reasons, and tune risk weights based on real data.\n\n## Acceptance Criteria\n- [ ] Emits `director_decision` event on each `evaluate()` call\n- [ ] Event includes: `{ proposal_id, timestamp, decision, reason, riskScore, latencyMs, metrics: { confidence, pacing, returnPath, thematic, lore, voice } }`\n- [ ] Uses existing telemetry.js if available; console.log fallback otherwise\n- [ ] Events stored in sessionStorage buffer for offline analysis (last 50 events)\n- [ ] Unit test: decision emits event with all required fields\n- [ ] Unit test: event timestamp is valid ISO8601\n- [ ] Unit test: event without proposal_id still emits with generated UUID\n- [ ] Integration test: after 5 choices, sessionStorage contains 5 telemetry events\n\n## Minimal Implementation\n- Create `emitDecisionTelemetry(decision, metrics)` in director.js\n- Integrate with telemetry.js or console.log\n- Buffer recent events in sessionStorage\n\n## Dependencies\n- ge-hch.5.15.1 (Decision Flow Engine)\n\n## Deliverables\n- Telemetry emitter in director.js\n- Event schema documentation","status":"closed","priority":2,"issue_type":"feature","assignee":"@Patch","created_at":"2026-01-16T15:02:44.228894318-08:00","created_by":"rgardler","updated_at":"2026-01-17T12:34:58.682680447-08:00","closed_at":"2026-01-17T12:34:58.682680447-08:00","close_reason":"Completed","external_ref":"https://github.com/TheWizardsCode/GEngine/pull/161","labels":["Status: PR Created"],"dependencies":[{"issue_id":"ge-hch.5.15.8","depends_on_id":"ge-hch.5.15","type":"parent-child","created_at":"2026-01-16T15:02:44.229808395-08:00","created_by":"rgardler"},{"issue_id":"ge-hch.5.15.8","depends_on_id":"ge-hch.5.15.1","type":"blocks","created_at":"2026-01-16T15:04:32.584486358-08:00","created_by":"rgardler"}],"comments":[{"id":202,"issue_id":"ge-hch.5.15.8","author":"rgardler","text":"Implemented director_decision telemetry emitter with sessionStorage buffer (50), ISO timestamps, UUID fallback. Added unit tests for schema, timestamp validity, buffer cap, evaluate integration; ran jest: tests/unit/director.telemetry.test.js tests/unit/director.test.js tests/unit/inkrunner.test.js (all pass).","created_at":"2026-01-17T20:24:00Z"}]} {"id":"ge-hch.5.15.9","title":"Implement: Decision Flow Engine","description":"Create web/demo/js/director.js with 5-step decision pipeline.\n\n## Acceptance Criteria\n- [ ] Module exports director.evaluate(proposal, storyContext)\n- [ ] Returns { decision, reason, riskScore, latencyMs }\n- [ ] Implements 5 steps: validation, return-path, risk scoring, coherence, final decision\n- [ ] Latency tracking via performance.now()\n\n## Implementation Notes\n- Async function to allow future async steps\n- Integrate with existing proposal-validator.js\n- Stub return-path and risk scoring (implemented in F2, F3)\n\n## Related Feature\nge-hch.5.15.1 (Decision Flow Engine)","status":"closed","priority":1,"issue_type":"task","assignee":"@Patch","created_at":"2026-01-16T15:03:14.275580677-08:00","created_by":"rgardler","updated_at":"2026-01-17T19:21:42.153281048-08:00","closed_at":"2026-01-17T19:21:42.153281048-08:00","close_reason":"Completed","dependencies":[{"issue_id":"ge-hch.5.15.9","depends_on_id":"ge-hch.5.15","type":"parent-child","created_at":"2026-01-16T15:03:14.276609992-08:00","created_by":"rgardler"}],"comments":[{"id":208,"issue_id":"ge-hch.5.15.9","author":"rgardler","text":"Validated existing director implementation meets acceptance: evaluate returns decision/reason/riskScore/latencyMs with 5-step pipeline and perf.now tracking; return-path check uses ink knots/fallbacks; risk scoring deterministic. Ran targeted tests: npx jest tests/unit/director.test.js --runInBand (pass). No code changes required.","created_at":"2026-01-18T03:21:36Z"}]} -{"id":"ge-hch.5.16","title":"Runtime Integration \u0026 Hooks","description":"Formalize runtime integration with full state machine, rollback semantics, and save/load support.\n\n## Scope\n- Implement 12-state integration state machine (formalizing the injection flow from M3)\n- Implement automatic rollback semantics with checkpoint support\n- Persistence model for branch integration logging\n- Save/load compatibility: integrated branches persist correctly across save/load cycles\n- **Player experience change**: Branches now survive save/load. If a branch fails mid-execution, player sees graceful recovery (\"The story encountered an issue. Returning to last save point.\") rather than a crash. Branch history visible in save file metadata.\n\n## Success Criteria\n- State machine transitions are logged and auditable\n- Rollback restores game state without corruption\n- Player can save mid-branch, reload, and continue the AI branch correctly\n- Player sees graceful recovery message if branch fails (no crashes)\n- Player's save file reflects branch history\n\n## Dependencies\n- Milestone 3: AI Director Implementation (ge-hch.5.15)\n\n## Deliverables\n- `src/runtime/` module with hook manager and state machine\n- Rollback mechanism with checkpoint support\n- Integration audit logging\n- Save/load integration for branch state","status":"in_progress","priority":1,"issue_type":"epic","assignee":"@OpenCode","created_at":"2026-01-16T13:23:11.35351188-08:00","created_by":"rgardler","updated_at":"2026-01-18T16:48:58.194663603-08:00","external_ref":"https://github.com/TheWizardsCode/GEngine/pull/178","labels":["Status: PRD Completed","milestone"],"dependencies":[{"issue_id":"ge-hch.5.16","depends_on_id":"ge-hch.5","type":"parent-child","created_at":"2026-01-16T13:23:11.354888255-08:00","created_by":"rgardler"},{"issue_id":"ge-hch.5.16","depends_on_id":"ge-hch.5.15","type":"blocks","created_at":"2026-01-16T13:24:21.629044825-08:00","created_by":"rgardler"}],"comments":[{"id":220,"issue_id":"ge-hch.5.16","author":"rgardler","text":"Added dedicated PRD for this epic at . Kept original M2 PRD unchanged and restored to origin/main. New PRD included in PR #178.","created_at":"2026-01-19T00:28:34Z"},{"id":221,"issue_id":"ge-hch.5.16","author":"rgardler","text":"PRD moved to docs/prd/PRD_M2_Runtime_integration_and_hoks.md; PR: https://github.com/TheWizardsCode/GEngine/pull/178","created_at":"2026-01-19T00:29:18Z"}]} -{"id":"ge-hch.5.16.1","title":"WebLLM local LLM mode","description":"## Goal\nIntegrate MLC WebLLM into the InkJS demo so players can choose an in-browser, fully local model in addition to the existing OpenAI-compatible adapter.\n\n## Acceptance Criteria\n- [ ] Add a new optional execution path that loads WebLLM (models hosted locally or via CDN) and runs inference entirely in-browser via WebGPU\n- [ ] Provide lightweight UI controls to select WebLLM mode vs remote API mode, choose a bundled model, and show download/progress status\n- [ ] Ensure WebLLM output still flows through proposal validation + branch injection so the player experience matches remote mode\n- [ ] Document hardware/browser requirements (WebGPU, cache sizes), model download sizes, and how to host custom models\n- [ ] Add telemetry/logging hooks that signal which mode is active\n\n## Suggested Implementation Notes\n- Start by wiring WebLLM as an alternative backend in `web/demo/js/llm-adapter.js`, toggled via settings\n- Use a small default model (e.g., Phi-2/3 or Llama 3.2 1B) with CDN-hosted weights; allow advanced users to specify custom manifests\n- Reuse existing prompt templates and schema validation; only the transport/execution changes\n- Consider loading WebLLM in a Web Worker to avoid blocking the UI during large downloads; show progress in the AI Settings modal\n- Gate the feature behind a flag so production builds can hide it if WebGPU support is insufficient\n\n## Dependencies / Related Work\n- Builds on ge-hch.5.14 (current AI writer) for prompt/validation logic\n- Complements planned backend relay ge-hch.5.20.1 by covering the “offline/local” story\n\n## Files Likely Touched\n- `web/demo/js/llm-adapter.js` (add WebLLM backend)\n- `web/demo/js/api-key-manager.js` (settings UI for local mode)\n- `web/demo/js/inkrunner.js` (pass mode selection through to runtime)\n- `web/demo/js/*` (any module needing to know which backend is active)\n- `docs/README` and `docs/dev/` (document requirements, usage)\n- `package.json` (add @mlc-ai/web-llm dependency, build steps if needed)\n\n## Definition of Done\n- Player can run the demo with no internet connection (after initial model download) and still receive AI options generated locally\n- Remote API mode remains unchanged\n- README clearly explains when to use each mode and their trade-offs","status":"open","priority":1,"issue_type":"feature","assignee":"@claude","created_at":"2026-01-16T17:33:32.286201241-08:00","created_by":"rgardler","updated_at":"2026-01-16T17:33:42.074742281-08:00","dependencies":[{"issue_id":"ge-hch.5.16.1","depends_on_id":"ge-hch.5.16","type":"parent-child","created_at":"2026-01-16T17:33:32.292425866-08:00","created_by":"rgardler"}],"comments":[{"id":188,"issue_id":"ge-hch.5.16.1","author":"rgardler","text":"Created new P1 feature bead to integrate MLC WebLLM as an optional local LLM mode for the demo (player can run offline once models are cached).","created_at":"2026-01-17T01:33:46Z"}]} +{"id":"ge-hch.5.16","title":"Runtime Integration \u0026 Hooks","description":"Formalize runtime integration with full state machine, rollback semantics, and save/load support.\n\n## Scope\n- Implement 12-state integration state machine (formalizing the injection flow from M3)\n- Implement automatic rollback semantics with checkpoint support\n- Persistence model for branch integration logging\n- Save/load compatibility: integrated branches persist correctly across save/load cycles\n- **Player experience change**: Branches now survive save/load. If a branch fails mid-execution, player sees graceful recovery (\"The story encountered an issue. Returning to last save point.\") rather than a crash. Branch history visible in save file metadata.\n\n## Success Criteria\n- State machine transitions are logged and auditable\n- Rollback restores game state without corruption\n- Player can save mid-branch, reload, and continue the AI branch correctly\n- Player sees graceful recovery message if branch fails (no crashes)\n- Player's save file reflects branch history\n\n## Dependencies\n- Milestone 3: AI Director Implementation (ge-hch.5.15)\n\n## Deliverables\n- `src/runtime/` module with hook manager and state machine\n- Rollback mechanism with checkpoint support\n- Integration audit logging\n- Save/load integration for branch state","status":"in_progress","priority":1,"issue_type":"epic","assignee":"@OpenCode","created_at":"2026-01-16T13:23:11.35351188-08:00","created_by":"rgardler","updated_at":"2026-01-18T16:48:58.194663603-08:00","external_ref":"https://github.com/TheWizardsCode/GEngine/pull/178","labels":["Status: Milestones Defined","Status: PRD Completed","milestone"],"dependencies":[{"issue_id":"ge-hch.5.16","depends_on_id":"ge-hch.5","type":"parent-child","created_at":"2026-01-16T13:23:11.354888255-08:00","created_by":"rgardler"},{"issue_id":"ge-hch.5.16","depends_on_id":"ge-hch.5.15","type":"blocks","created_at":"2026-01-16T13:24:21.629044825-08:00","created_by":"rgardler"}],"comments":[{"id":220,"issue_id":"ge-hch.5.16","author":"rgardler","text":"Added dedicated PRD for this epic at . Kept original M2 PRD unchanged and restored to origin/main. New PRD included in PR #178.","created_at":"2026-01-19T00:28:34Z"},{"id":221,"issue_id":"ge-hch.5.16","author":"rgardler","text":"PRD moved to docs/prd/PRD_M2_Runtime_integration_and_hoks.md; PR: https://github.com/TheWizardsCode/GEngine/pull/178","created_at":"2026-01-19T00:29:18Z"},{"id":222,"issue_id":"ge-hch.5.16","author":"rgardler","text":"Milestones created: 1) Hook Manager \u0026 Integration Points; 2) Integration State Machine (12 states); 3) Checkpointing \u0026 Rollback Engine; 4) Save/Load Persistence Integration; 5) Audit Logging \u0026 Telemetry Hooks; 6) QA, Fuzzing \u0026 E2E Tests; 7) Docs, Runbook \u0026 Handoff","created_at":"2026-01-19T01:14:20Z"},{"id":223,"issue_id":"ge-hch.5.16","author":"rgardler","text":"Automated review (2026-01-19):\n- Completeness: Added concise Success Criteria and Deliverables to each milestone (Hook Manager, State Machine, Checkpointing, Save/Load, Audit, QA, Docs).\n- Sequencing: Milestones are ordered and blocked in sequence (Hook Manager -\u003e State Machine -\u003e Checkpointing -\u003e Save/Load -\u003e Audit -\u003e QA -\u003e Docs). Dependency edges present.\n- Scope sizing: Milestones split to keep implementation-focused scope; QA covers unit+fuzz+e2e.\n- Traceability: Each milestone references expected src/runtime paths and test locations.\n- Open Questions recorded on each milestone for API shape, storage backend, resume payload size, log retention, CI fuzz cadence, and runbook owner.\n\nNext: run a human review and confirm Open Questions or request edits. If accepted, I will finalize by syncing and showing the updated parent bead.\n","created_at":"2026-01-19T01:44:04Z"}]} +{"id":"ge-hch.5.16.1","title":"WebLLM local LLM mode","description":"## Goal\nIntegrate MLC WebLLM into the InkJS demo so players can choose an in-browser, fully local model in addition to the existing OpenAI-compatible adapter.\n\n## Acceptance Criteria\n- [ ] Add a new optional execution path that loads WebLLM (models hosted locally or via CDN) and runs inference entirely in-browser via WebGPU\n- [ ] Provide lightweight UI controls to select WebLLM mode vs remote API mode, choose a bundled model, and show download/progress status\n- [ ] Ensure WebLLM output still flows through proposal validation + branch injection so the player experience matches remote mode\n- [ ] Document hardware/browser requirements (WebGPU, cache sizes), model download sizes, and how to host custom models\n- [ ] Add telemetry/logging hooks that signal which mode is active\n\n## Suggested Implementation Notes\n- Start by wiring WebLLM as an alternative backend in `web/demo/js/llm-adapter.js`, toggled via settings\n- Use a small default model (e.g., Phi-2/3 or Llama 3.2 1B) with CDN-hosted weights; allow advanced users to specify custom manifests\n- Reuse existing prompt templates and schema validation; only the transport/execution changes\n- Consider loading WebLLM in a Web Worker to avoid blocking the UI during large downloads; show progress in the AI Settings modal\n- Gate the feature behind a flag so production builds can hide it if WebGPU support is insufficient\n\n## Dependencies / Related Work\n- Builds on ge-hch.5.14 (current AI writer) for prompt/validation logic\n- Complements planned backend relay ge-hch.5.20.1 by covering the “offline/local” story\n\n## Files Likely Touched\n- `web/demo/js/llm-adapter.js` (add WebLLM backend)\n- `web/demo/js/api-key-manager.js` (settings UI for local mode)\n- `web/demo/js/inkrunner.js` (pass mode selection through to runtime)\n- `web/demo/js/*` (any module needing to know which backend is active)\n- `docs/README` and `docs/dev/` (document requirements, usage)\n- `package.json` (add @mlc-ai/web-llm dependency, build steps if needed)\n\n## Definition of Done\n- Player can run the demo with no internet connection (after initial model download) and still receive AI options generated locally\n- Remote API mode remains unchanged\n- README clearly explains when to use each mode and their trade-offs","status":"open","priority":1,"issue_type":"feature","assignee":"Build","created_at":"2026-01-16T17:33:32.286201241-08:00","created_by":"rgardler","updated_at":"2026-01-18T17:05:47.255835984-08:00","dependencies":[{"issue_id":"ge-hch.5.16.1","depends_on_id":"ge-hch.5.16","type":"parent-child","created_at":"2026-01-16T17:33:32.292425866-08:00","created_by":"rgardler"},{"issue_id":"ge-hch.5.16.1","depends_on_id":"ge-hch.5","type":"parent-child","created_at":"2026-01-18T17:05:47.260459116-08:00","created_by":"rgardler"}],"comments":[{"id":188,"issue_id":"ge-hch.5.16.1","author":"rgardler","text":"Created new P1 feature bead to integrate MLC WebLLM as an optional local LLM mode for the demo (player can run offline once models are cached).","created_at":"2026-01-17T01:33:46Z"}]} {"id":"ge-hch.5.16.2","title":"Refactor: externalize director risk tuning","description":"Move director risk scorer tuning values (weights, pacing targets, tolerance, placeholder defaults) into a config file so they can be tuned without code changes.\\n\\nAcceptance Criteria\\n- Risk scorer default weights and pacing targets are loaded from a config file (or settings module) instead of hard-coded constants in director.js.\\n- Config supports overriding weights, placeholder defaults, pacing targets, and pacing tolerance.\\n- Director continues to accept per-call overrides; defaults come from config.\\n- Tests updated to cover config loading and overriding behavior.\\n\\nNotes\\n- Current hard-coded defaults live in web/demo/js/director.js (computeRiskScore).\\n- Keep backward compatibility for callers passing config directly.\\n","status":"open","priority":1,"issue_type":"task","created_at":"2026-01-17T15:55:13.985715559-08:00","created_by":"rgardler","updated_at":"2026-01-17T15:55:13.985715559-08:00","labels":["refactor"],"dependencies":[{"issue_id":"ge-hch.5.16.2","depends_on_id":"ge-hch.5.16","type":"parent-child","created_at":"2026-01-17T15:55:13.987657318-08:00","created_by":"rgardler"}]} +{"id":"ge-hch.5.16.3","title":"Hook Manager \u0026 Integration Points","description":"Hook Manager \u0026 Integration Points\\n\\nShort summary: Implement the runtime hook manager and surface safe hook points for branch injection.\\n\\nSuccess Criteria:\\n- Hook API emits: pre_inject, post_inject, pre_checkpoint, post_checkpoint, pre_commit, post_commit, on_rollback at documented beats.\\n- Two example subscribers (telemetry + persistence) implemented in demo showing non-blocking behavior.\\n- Hook handlers are idempotent and safe to call multiple times in recovery scenarios.\\n\\nDeliverables:\\n- src/runtime/hook-manager/ with README and usage snippets\\n- Example subscriber implementations: telemetry subscriber, persistence subscriber\\n- Unit tests for hook emission and ordering\\n\\nOpen Questions:\\n- Preferred API shape for subscribers (async/Promise-based or callback)? Recommend Promise-based to allow async subscribers but require non-blocking behavior.\\n","status":"open","priority":1,"issue_type":"epic","assignee":"Build","created_at":"2026-01-18T17:14:20.415473741-08:00","created_by":"rgardler","updated_at":"2026-01-18T17:44:03.78047479-08:00","labels":["milestone"],"dependencies":[{"issue_id":"ge-hch.5.16.3","depends_on_id":"ge-hch.5.16","type":"parent-child","created_at":"2026-01-18T17:14:20.41733901-08:00","created_by":"rgardler"}]} +{"id":"ge-hch.5.16.4","title":"Integration State Machine (12 states)","description":"Integration State Machine (12 states)\\n\\nShort summary: Implement the deterministic 12-state integration state machine and transition rules.\\n\\nSuccess Criteria:\\n- State machine implements canonical 12 states with deterministic transitions for same input.\\n- Unit tests cover all allowed transitions and assert forbidden transitions throw or are ignored.\\n- Transition logs are emitted via audit hooks for every state change.\\n\\nDeliverables:\\n- src/runtime/integration-state-machine/ implementation\\n- Unit tests exercising transitions and serialization of state\\n- Transition trace logger and sample traces for demo runs\\n\\nOpen Questions:\\n- Confirm canonical state names (ProposalAccepted, PreInjectCheckpoint, Injecting, Executing, CheckpointOnBeat, CommitPending, Committed, RollbackPending, RollingBack, RolledBack, TerminalSuccess, TerminalFailure). Confirm these names are final before broad rollout.\\n","status":"open","priority":1,"issue_type":"epic","assignee":"Build","created_at":"2026-01-18T17:14:20.464979714-08:00","created_by":"rgardler","updated_at":"2026-01-18T17:44:03.83474637-08:00","labels":["milestone"],"dependencies":[{"issue_id":"ge-hch.5.16.4","depends_on_id":"ge-hch.5.16","type":"parent-child","created_at":"2026-01-18T17:14:20.466253966-08:00","created_by":"rgardler"},{"issue_id":"ge-hch.5.16.4","depends_on_id":"ge-hch.5.16.3","type":"blocks","created_at":"2026-01-18T17:14:20.861933204-08:00","created_by":"rgardler"}]} +{"id":"ge-hch.5.16.5","title":"Checkpointing \u0026 Rollback Engine","description":"Checkpointing \u0026 Rollback Engine\\n\\nShort summary: Add atomic checkpoint/commit/rollback primitives and restore logic.\\n\\nSuccess Criteria:\\n- Checkpoints are written atomically (temp+rename) and carry checksum/version metadata.\\n- Rollback restores runtime to last valid checkpoint in fuzz and corrupt-checkpoint tests without state corruption.\\n- Automatic rollback path surfaces graceful player-facing recovery messaging.\\n\\nDeliverables:\\n- src/runtime/checkpoint/ checkpoint API and engine\\n- Fuzz test harness exercising corrupt checkpoints and recovery\\n- Integration tests demonstrating checkpoint/rollback in the demo story\\n\\nOpen Questions:\\n- Storage backend preference: file-like blobs in localStorage vs IndexedDB vs host-provided adapter. Recommend IndexedDB for larger payloads; will follow team guidance.\\n","status":"open","priority":1,"issue_type":"epic","assignee":"Build","created_at":"2026-01-18T17:14:20.518569166-08:00","created_by":"rgardler","updated_at":"2026-01-18T17:44:03.87741647-08:00","labels":["milestone"],"dependencies":[{"issue_id":"ge-hch.5.16.5","depends_on_id":"ge-hch.5.16","type":"parent-child","created_at":"2026-01-18T17:14:20.51938493-08:00","created_by":"rgardler"},{"issue_id":"ge-hch.5.16.5","depends_on_id":"ge-hch.5.16.4","type":"blocks","created_at":"2026-01-18T17:14:20.912035071-08:00","created_by":"rgardler"}]} +{"id":"ge-hch.5.16.6","title":"Save/Load Persistence Integration","description":"Save/Load Persistence Integration\\n\\nShort summary: Extend save/load to carry minimal resume payload and branch_history metadata with migration/versioning.\\n\\nSuccess Criteria:\\n- Save files include branch metadata (branch_history, last_checkpoint_id, schema_version) without embedding large audit logs by default.\\n- Loader resumes branch only when checksum/schema_version match; otherwise performs conservative rollback.\\n- Migration rules allow loading older schema versions with documented behavior.\\n\\nDeliverables:\\n- src/runtime/save-adapter.js and load-adapter.js implementations\\n- Migration guide and example old-\u003enew migration steps\\n- Test save files demonstrating resume and rollback cases\\n\\nOpen Questions:\\n- Desired maximum size for resume_payload in save files (recommend keeping minimal to avoid large save sizes). If you have an explicit size target, state it.\\n","status":"open","priority":1,"issue_type":"epic","assignee":"Build","created_at":"2026-01-18T17:14:20.564946238-08:00","created_by":"rgardler","updated_at":"2026-01-18T17:44:03.93002452-08:00","labels":["milestone"],"dependencies":[{"issue_id":"ge-hch.5.16.6","depends_on_id":"ge-hch.5.16","type":"parent-child","created_at":"2026-01-18T17:14:20.565574966-08:00","created_by":"rgardler"},{"issue_id":"ge-hch.5.16.6","depends_on_id":"ge-hch.5.16.5","type":"blocks","created_at":"2026-01-18T17:14:20.958724556-08:00","created_by":"rgardler"}]} +{"id":"ge-hch.5.16.7","title":"Audit Logging \u0026 Telemetry Hooks","description":"Audit Logging \u0026 Telemetry Hooks\\n\\nShort summary: Implement integration audit logs and telemetry hook emission for observability.\\n\\nSuccess Criteria:\\n- Integration audit events emitted for proposal lifecycle stages and stored append-only (not embedded in saves by default).\\n- Telemetry events emitted conforming to telemetry schema and include PII-redaction where applicable.\\n- Operator can query integration logs by save id or player id in test harness.\\n\\nDeliverables:\\n- logging adapter to write append-only integration logs\\n- telemetry event emitters wired into hook points\\n- docs describing PII redaction and example queries\\n\\nOpen Questions:\\n- Retention and access model for integration logs (how long to keep, where to store). Recommend keeping short-term dev logs in local test harness and longer retention in external telemetry store; will coordinate with telemetry team.\\n","status":"open","priority":1,"issue_type":"epic","assignee":"Build","created_at":"2026-01-18T17:14:20.613991773-08:00","created_by":"rgardler","updated_at":"2026-01-18T17:44:03.97434528-08:00","labels":["milestone"],"dependencies":[{"issue_id":"ge-hch.5.16.7","depends_on_id":"ge-hch.5.16","type":"parent-child","created_at":"2026-01-18T17:14:20.615240667-08:00","created_by":"rgardler"},{"issue_id":"ge-hch.5.16.7","depends_on_id":"ge-hch.5.16.6","type":"blocks","created_at":"2026-01-18T17:14:21.058348541-08:00","created_by":"rgardler"}]} +{"id":"ge-hch.5.16.8","title":"QA, Fuzzing \u0026 E2E Tests","description":"QA, Fuzzing \u0026 E2E Tests\\n\\nShort summary: Provide unit tests, fuzzed save/load tests, and Playwright E2E smoke scenarios for mid-branch save/load and rollback.\\n\\nSuccess Criteria:\\n- Unit tests for state machine, checkpoint, and hook manager reach target coverage for new runtime modules (recommend ≥80% for these modules).\\n- Fuzz suite finds and reproduces rollback-inducing checkpoint corruptions.\\n- Playwright E2E tests: save mid-branch -\u003e reload -\u003e resume or graceful rollback pass locally.\\n\\nDeliverables:\\n- tests/unit/ for new runtime modules\\n- tests/fuzz/ harness and example failing cases captured for triage\\n- Playwright e2e test scripts and CI job suggestion notes\\n\\nOpen Questions:\\n- CI resource considerations for fuzz runs (how long to run, parallelization). Recommend short nightly fuzz runs initially; will tune based on results.\\n","status":"open","priority":1,"issue_type":"epic","assignee":"Build","created_at":"2026-01-18T17:14:20.665062196-08:00","created_by":"rgardler","updated_at":"2026-01-18T17:44:04.02352771-08:00","labels":["milestone"],"dependencies":[{"issue_id":"ge-hch.5.16.8","depends_on_id":"ge-hch.5.16","type":"parent-child","created_at":"2026-01-18T17:14:20.665714764-08:00","created_by":"rgardler"},{"issue_id":"ge-hch.5.16.8","depends_on_id":"ge-hch.5.16.7","type":"blocks","created_at":"2026-01-18T17:14:21.13016178-08:00","created_by":"rgardler"}]} +{"id":"ge-hch.5.16.9","title":"Docs, Runbook \u0026 Handoff","description":"Docs, Runbook \u0026 Handoff\\n\\nShort summary: Finalize PRD updates, runtime docs, migration notes, and operator runbook for rollback and debugging.\\n\\nSuccess Criteria:\\n- Docs contain clear steps to read integration logs, force rollback in a test/dev environment, and migrate save versions.\\n- Developer docs show how to subscribe to hooks and use checkpoint API with code snippets.\\n- Handoff notes created for telemetry team and a changelog entry added to parent bead.\\n\\nDeliverables:\\n- docs/dev/runtime-hooks.md (usage examples), docs/runbook/rollback.md, migration notes in docs/dev/\\n- Handoff comment and changelog entry in parent bead\\n\\nOpen Questions:\\n- Who is the intended runbook owner for operational steps (recommend Build by default; change if you want a named owner).\\n","status":"open","priority":1,"issue_type":"epic","assignee":"Build","created_at":"2026-01-18T17:14:20.716956186-08:00","created_by":"rgardler","updated_at":"2026-01-18T17:44:04.07595162-08:00","labels":["milestone"],"dependencies":[{"issue_id":"ge-hch.5.16.9","depends_on_id":"ge-hch.5.16","type":"parent-child","created_at":"2026-01-18T17:14:20.717856366-08:00","created_by":"rgardler"},{"issue_id":"ge-hch.5.16.9","depends_on_id":"ge-hch.5.16.8","type":"blocks","created_at":"2026-01-18T17:14:21.183515324-08:00","created_by":"rgardler"}]} {"id":"ge-hch.5.17","title":"Telemetry Implementation","description":"Implement telemetry event emission and collection for observability.\n\n## Scope\n- Implement 6 telemetry event types (generation, validation, director decision, presentation, choice, outcome)\n- Event emission at each pipeline stage\n- Privacy/redaction for sensitive data\n- **Player experience change**: Minimal direct change. System now collects data enabling future improvements. Optional: player can view a \"branch history\" summary showing AI vs authored content encountered in their playthrough.\n\n## Success Criteria\n- All 6 event types emit correctly in test environment\n- Events conform to telemetry schema\n- PII redaction applied before storage\n- Events can be queried for analysis\n- Player can optionally view summary of AI branches encountered in current session\n\n## Dependencies\n- Milestone 4: Runtime Integration \u0026 Hooks (ge-hch.5.16)\n\n## Deliverables\n- `src/telemetry/` module with event emitters\n- Telemetry configuration (retention, redaction rules)\n- Example dashboard queries\n- Optional player-facing branch history view","status":"open","priority":1,"issue_type":"epic","assignee":"Build","created_at":"2026-01-16T13:23:19.188194703-08:00","created_by":"rgardler","updated_at":"2026-01-16T13:23:19.188194703-08:00","labels":["milestone"],"dependencies":[{"issue_id":"ge-hch.5.17","depends_on_id":"ge-hch.5","type":"parent-child","created_at":"2026-01-16T13:23:19.190188453-08:00","created_by":"rgardler"},{"issue_id":"ge-hch.5.17","depends_on_id":"ge-hch.5.16","type":"blocks","created_at":"2026-01-16T13:24:21.668183753-08:00","created_by":"rgardler"}]} {"id":"ge-hch.5.18","title":"Policy \u0026 Sanitization Engine","description":"Implement the full validation pipeline with policy checks and sanitization transforms.\n\n## Scope\n- Implement policy ruleset engine (5 categories: content safety, narrative consistency, structure, format, return path)\n- Implement sanitization transforms (profanity redaction, HTML stripping, whitespace normalization)\n- Validation report generation with rule-level diagnostics\n- Replace minimal inline validator with full pipeline\n- **Player experience change**: Content quality noticeably improves. Inappropriate content blocked more reliably. Edge cases (odd formatting, encoding issues) no longer slip through. Players experience more polished AI-generated text.\n\n## Success Criteria\n- Policy engine evaluates proposals against configurable rulesets\n- Sanitization transforms are deterministic (same input → same output)\n- Validation reports conform to `validation-report.json` schema\n- Unit tests cover all policy categories and sanitization transforms\n- Player encounters no profanity, broken formatting, or encoding artifacts in AI content\n- Player experiences consistent text quality across AI branches\n\n## Dependencies\n- Milestone 5: Telemetry Implementation (ge-hch.5.17)\n\n## Deliverables\n- `src/validation/` module with policy engine and sanitizers\n- Configuration loader for policy rulesets\n- Validation report generator","status":"open","priority":1,"issue_type":"epic","assignee":"Build","created_at":"2026-01-16T13:23:30.97235286-08:00","created_by":"rgardler","updated_at":"2026-01-16T13:23:30.97235286-08:00","labels":["milestone"],"dependencies":[{"issue_id":"ge-hch.5.18","depends_on_id":"ge-hch.5","type":"parent-child","created_at":"2026-01-16T13:23:30.973289052-08:00","created_by":"rgardler"},{"issue_id":"ge-hch.5.18","depends_on_id":"ge-hch.5.17","type":"blocks","created_at":"2026-01-16T13:24:21.713979517-08:00","created_by":"rgardler"}]} {"id":"ge-hch.5.19","title":"Validation Test Corpus \u0026 Tuning","description":"Create a full-length test story and build test corpus to tune validation pipeline for production readiness.\n\n## Scope\n- Create new full-length story (`web/stories/test-story.ink`) with sufficient narrative variety for comprehensive testing\n- Keep `demo.ink` small for rapid playtesting\n- Create ≥100 example branch proposals for validation testing (generated against full test story)\n- Tune policy thresholds based on acceptance/rejection rates\n- Document ruleset rationale and tuning parameters\n- **Player experience change**: New full-length story available for involved testing. Better balance between safety and variety. Fewer \"good\" branches incorrectly rejected (more AI content available). Fewer \"bad\" branches incorrectly approved (higher quality). Players notice more frequent and more varied AI branch options across a complete narrative arc.\n\n## Success Criteria\n- New test story created with ≥10 scenes and varied narrative contexts\n- `demo.ink` remains small and unchanged (rapid playtesting)\n- Test corpus includes ≥100 proposals covering edge cases across the full test story\n- Validation pipeline passes ≥20 structured test cases\n- False positive rate \u003c5% on valid proposals\n- Tuning report documents threshold decisions\n- Player can experience a complete story arc in test story (beginning to end)\n- Player encounters AI branch options more frequently (reduced false rejections)\n- Player feedback indicates maintained or improved content quality\n\n## Dependencies\n- Milestone 6: Policy \u0026 Sanitization Engine (ge-hch.5.18)\n\n## Deliverables\n- New `web/stories/test-story.ink` (full-length story for testing)\n- Extended test corpus in `docs/dev/m2-schemas/examples/`\n- Validation test suite\n- Tuning report with threshold rationale","status":"open","priority":1,"issue_type":"epic","assignee":"Build","created_at":"2026-01-16T13:23:44.11356842-08:00","created_by":"rgardler","updated_at":"2026-01-16T13:23:44.11356842-08:00","labels":["milestone"],"dependencies":[{"issue_id":"ge-hch.5.19","depends_on_id":"ge-hch.5","type":"parent-child","created_at":"2026-01-16T13:23:44.114199912-08:00","created_by":"rgardler"},{"issue_id":"ge-hch.5.19","depends_on_id":"ge-hch.5.18","type":"blocks","created_at":"2026-01-16T13:24:21.755035562-08:00","created_by":"rgardler"}]}