# Response to Terry's Gap Analysis — 2026-06-10

> **From:** Dmitry
> **To:** Terry
> **Re:** Kai Behaviour Graph v0 — Implementation Gap Analysis (your doc, dated 2026-06-10)

Strong analysis. Decisions on your six asks below, plus three quick clarifications and what we deferred. No surprises — none of the gaps are fatal, all addressable before ch.2 extraction.

## Decisions on the six asks

| # | Topic | Decision | Notes |
|---|---|---|---|
| 1 | Scenario YAMLs | **No new artifact needed — clarification only.** Scenarios already live in the chapter markdown under the `# validation_scenarios` section (e.g. `chapters/01-finding-prospects.md` — search for the heading; you'll find six scenarios as numbered steps). The FigJam sidebar is just the visual render. Treat the markdown section as canonical and parse it directly. If parsing convenience becomes a real issue down the road we can re-emit as YAML, but the content's already there. | Pointer fix, no upstream change. |
| 2 | Step enrichment | **Yes — enriching.** Every step in `loop.steps` will carry: a `kai_intent` field (one-sentence statement of what Kai aims to achieve in that step), and optionally a `script_ref` if a script implements the step. Closes the "opaque labels" problem. | Pipeline amendment — template + extraction protocol updated; ch.0 + ch.1 retrofitted. |
| 3 | Multi-language strategy | **Option B: native-authored variants.** Our market is ~80% KR/JP; EN-only isn't shippable. Canon scripts ship EN (`language: en`); KR / JP / RU / VN variants ship as separate nodes linked to the canon via `paraphrase_of`. **Timing:** native variants land as a batched workstream **after all 7 EN chapters are extracted**, not per-chapter — keeps glossary consistent across the corpus. Your transpiler shouldn't block on variants. Your runtime needs language-fallback (use variant if exists for the user's language, else EN canon). | Adds `requires_variants` field to script ontology. |
| 4 | Loop-as-resumable-subgraph | **Confirmed. Loops can and should span multiple sessions.** L-01-03 (daily add-to-list) is explicitly multi-session by design — it's a weekly cadence. L-01-01 (one-time list dump) may run in one session or several depending on user pace. Step-index checkpointing is the right shape. | No pipeline change. |
| 5 | MemPalace runtime role | **Confirmed.** MemPalace stays as my editorial workspace. Your runtime layer — staging and prod — is your call. PostgreSQL (`graph_edges` table) is the right answer. | Aligned. |
| 6 | JSON Schema | **Yes — we generate it.** Canonical `schema/v1.0.json` derived from ch.0 + ch.1 fields, published as part of the artifact set. Minor version bumps when a chapter introduces new fields. You consume it; you don't need to infer from markdown. | We own this artifact. |

## Three quick clarifications

- **Schema:** we publish; you consume. Inference from markdown is no longer your problem.
- **MemPalace KG runtime:** never the runtime store — we agree, PostgreSQL is the right call.
- **Data-dependencies map (IC-1):** you derive heuristically for v0 against the current MCP catalog. We don't own this upstream. When Andres's MCP catalog stabilises, we'll revisit if there are systematic data-binding patterns worth lifting into the content pipeline.

## What we deferred (track, don't act)

- **Voice persona enforcement (RA-1)** — your workstream. Send your writeup whenever you have one; I'll iterate on the persona if your analysis surfaces gaps.
- **EU AI Act risk_level overlay (RA-2)** — legal pass, longer horizon. Not blocking the pipeline. We'll add the `risk_level` field as an overlay when legal review starts.

## Pipeline amendments shipping before ch.2

Applied as a single commit before ch.2 extraction begins:

- `kai_intent` (required) + `script_ref` (optional) added to step schema in `templates/_chapter.md`
- Extraction protocol updated so Stage 1 emits `kai_intent` per step (not deferred)
- Script ontology gains `requires_variants` field, default `[kr, jp, ru, vn]`
- Chapter-workflow Phase 6 adds: emit / validate `schema.json` per chapter
- `schema/v1.0.json` published, derived from ch.0 + ch.1 fields
- Ch.0 + ch.1 retrofitted: every step gets a `kai_intent`; canon scripts get `language: en` + `requires_variants`

You'll get a heads-up when these land. Your transpiler design shouldn't change — the additions are additive to existing fields.
