From 3dac5d3b4464e8190b0594e1eca753f088e894fe Mon Sep 17 00:00:00 2001 From: Vuong Hoang Date: Wed, 1 Jul 2026 14:47:32 -0700 Subject: [PATCH] =?UTF-8?q?memory:=20snapshot=20=E2=80=94=20persona-pane?= =?UTF-8?q?=20rebuild=20(relation=5Fedge/1=20+=20trend)=20+=20canonical=20?= =?UTF-8?q?affect-NL=20vendored=20(v0.19.5);=20relation=5Fcontext/agency?= =?UTF-8?q?=20flag=20WAD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- persistent-memory.md | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/persistent-memory.md b/persistent-memory.md index b7ddeb0..63636ed 100644 --- a/persistent-memory.md +++ b/persistent-memory.md @@ -42,7 +42,15 @@ upstream API key stays server-side (INV-003). _As of 2026-07-01:_ **THE WEB SURFACE (`ratatoskr-web`, `:8765`) IS NOW THE OPERATOR'S PRIMARY DEBUG SURFACE, at full TUI -pane parity — `v0.19.3`.** This session ported the three admin/debug panes the TUI had but the web +pane parity + a rebuilt persona pane — `v0.19.5`.** The **persona/affect pane** was rebuilt: it read +the stale `snap.valence` (empty "valence (0)") while Worldtree now emits `snap.relations` +(relation_edge/1: trust_ability/benevolence/integrity + warmth + agency + relation_context, each +`{value,confidence,evidence_count}`). Now it renders that model with per-value **Δ + unicode sparkline +trend** (client-side, one sample/turn, `v0.19.4`) AND the **CANONICAL affect→NL** Worldtree +context-injects — mood word (`describe_pad`) + relationship directive (`render_d2_canonical`), +**byte-exact-verified** against Worldtree's own renderer, **vendored + drift-pinned** (`v0.19.5`, +`docs/vendor/worldtree-persona-canon/`, `.corviduo-canonicals.toml`, regen `scripts/build_persona_canon.py`). +This session ported the three admin/debug panes the TUI had but the web lacked: **BifrostState** (`GET /admin/sessions/{id}/bifrost`), **AdminEvents** (`GET /admin/events` SSE, session-filtered server-side), **Tools inventory** (`GET /sessions/{id}/tools`, folded into the tools pane) — all via thin server proxies with the **admin key SERVER-HELD** (`app.state.admin_key` @@ -53,7 +61,7 @@ pondering…" on `thinking` deltas — she emits ~253/turn). heid-code-review pa artifact-only) found **zero server-side drift + clean INV-004**; the real catches were 2 client-side SSE-lifecycle bugs on the un-unit-tested SPA (fixed in `v0.19.3`). Contract: `docs/contracts/web_debug_surface.contract.md`. Launch recipe is now self-contained: `source env.sh && ratatoskr-web --host 0.0.0.0` comes up -bind-ready (env.sh persists the 3 bind vars). All pushed to origin (`75dec01`). +bind-ready (env.sh persists the 3 bind vars). All pushed to origin (`a99f247`). **THE v1 COVERAGE-AUDIT HAS CONVERGED.** The audit that ran this session (2026-06-30 → 07-01) reached its scope-A done-definition: **every frozen Worldtree v1 I/O point is classified — covered @@ -99,8 +107,8 @@ findings, cross-model-verified); b2 + the later slices were offered but not revi runs dirty (auto-regen, not chased — never stage it). Contract-skip was invoked for the low-effort GET wrappers + `stream_admin_events`, but contract #2 / #1 / #6 were amended to stay canonical. -Branch: `main` — **in sync with `origin/main`** at **`v0.19.3`** (`75dec01`); the whole session's arc -(web parity + review fixes) is pushed. Remote: `origin → git@gitea.phasefinal.com:vh/ratatoskr.git`. +Branch: `main` — **in sync with `origin/main`** at **`v0.19.5`** (`a99f247`); the whole session's arc +(web parity + review fixes + persona-pane rebuild + canonical NL) is pushed. Remote: `origin → git@gitea.phasefinal.com:vh/ratatoskr.git`. ## Recent decisions @@ -175,6 +183,11 @@ decision. Captures rationale that won't be obvious from code alone. - `[2026-07-01]` **Web debug-surface parity SHIPPED (`v0.19.2`, `a0a9d5f`) — direct in-session TDD.** 3 proxy routes (tools/bifrost/admin-events) + admin-key wiring (entrypoint→create_app→app.state) + AdminEvents SSE proxy re-emitting under a FIXED `admin_event` name (one browser listener, no per-type drops) + session-filter `_admin_event_matches_web` (mirrors TUI §6). Frontend: 2 tabs (bifrost ⌃5, admin ⌃6) + tools-inventory folded into the tools pane. 9 respx tests (admin-bearer override, filter unit, SSE stream-filter); live-proven against sindra (bifrost connected, both caps). Contract-skip invoked (reuses already-contracted client wrappers); contract authored post-hoc as the trail (`docs/contracts/web_debug_surface.contract.md`). - `[2026-07-01]` **heid-code-review (`v0.19.3`, `75dec01`) — panel caught 2 real client-side SSE-lifecycle bugs TDD missed.** Contract-anchored (authored the web contract to enable it — no contract → no drift axis). Gróa/Hulda/Regin (artifact-only, Gróa under Landlock jail): ZERO functional server-side drift + INV-004 clean; 2 genuine drifts on the un-unit-tested SPA — (1) turn `es.onerror` didn't `hideThinkingNote()` (reasoning line + setInterval leak on a raw drop), (2) `openAdminEvents` never closed the EventSource on error → native auto-reconnect RETRY LOOP (fixed: close on `stream_error` + permanent `onerror`/CLOSED; transient CONNECTING still reconnects). + 2 test-gaps fixed (route-registration + admin stream_error). 1 precision → contract-clarified (tools-inventory names-only by design). **Re-confirms: the JS render/lifecycle paths are the review's highest-value target — unit tests don't reach them (same lesson as #18 D2).** +- `[2026-07-01]` **Affect snapshot shape CHANGED valence→relations (relation_edge/1) — the persona pane was reading a dead field.** Worldtree's #265 Vili rework replaced the flat `valence[]` ({entity_id,familiarity,regard}) with `relations[]` (target_entity + trust_ability/benevolence/integrity + warmth + agency + relation_context, each `{value,confidence,evidence_count}`). `renderAffectPane` still read `snap.valence` → showed empty "valence (0)". Rebuilt to render `relations` (v0.19.4, `ca46a93`) with per-value **Δ + unicode sparkline** (client-side, HIST_CAP=24, one sample/turn deduped by emitted_at). **Retires the stale "regard dead axis" note (2026-06-30) — that whole axis is gone.** Foot-gun: the affect snapshot shape is Worldtree's emit and can change under us — verify the live shape (query affect.db) before trusting a render. +- `[2026-07-01]` **Trust/warmth VALUES converge and go FLAT at confidence 1.0 — that's WAD, not a stuck pane.** sindra→ratatoskr trust ~0.82-0.84 / warmth 0.79 barely move (~1e-7/turn) while `evidence_count` climbs (46→62); confidence maxed → tiny updates. The live-moving signals are PAD (mood, per-turn) + evidence_count. **To WATCH a relation FORM (values shift), use a BRAND-NEW agent + end_user** (low evidence, confidence <1). The sparkline flat-guards sub-0.01 ranges so it doesn't amplify noise. +- `[2026-07-01]` **relation_context "stranger" + agency-all-zero flagged to worldtree-dev → both WAD/intentional-v1-deferrals.** relation_context is a FIXED config build-prior (not trust-derived; `registry.py:131` defaults "stranger"; dynamic progression ~#319); agency is schema-present-unpopulated (deferred #319; v1 = warmth+trust only). worldtree-dev is escalating the **consumer-coherence angle to Vuong** (static "stranger" + zero-agency next to trust 0.82/62-interactions reads incoherent from the store). The consumer/provider thesis paying off; DB-offer (read-only affect.db on the shared box) declined this time. +- `[2026-07-01]` **Persona pane displays the CANONICAL affect→NL Worldtree injects — ADOPT, don't invent (operator steer + reference-impl posture).** Worldtree's `describe_pad` (mood word, valence×arousal grid, ±0.3 bands) + `render_d2_canonical` (relationship directive) are deterministic + canon-driven; the pane now renders them **byte-exact-verified** against Worldtree's own renderer on the live snapshot (v0.19.5, `a99f247`). KEY LESSON: adopting canonical is load-bearing — for sindra's small PAD the canonical says **"neutral"**, but an invented octant vocab would've said "faintly excited" and MISLED. Vendored the two d2 canons (`docs/vendor/worldtree-persona-canon/`) + drift-pinned in `.corviduo-canonicals.toml` (green); flat browser form (`static/persona_render_canon.json`) regenerated via Worldtree's OWN loader (`scripts/build_persona_canon.py`). Vendoring-handshake sent to worldtree-dev (broadcast on canon bumps). [auto-memory: `feedback-ratatoskr-is-a-reference-impl-adopt-canonical`] + _41 older entries (2026-05-* — the original debug-TUI/web build era) archived to archival-memory.md._ _For per-issue TDD implementation notes, Volva findings, and contract amendments, see the git log — every per-issue commit carries a structured message capturing the trail._