From e0d72ba30ddf29c32e220baf909f365c70afce5c Mon Sep 17 00:00:00 2001 From: Vuong Hoang Date: Sun, 2 Aug 2026 23:22:02 -0700 Subject: [PATCH] =?UTF-8?q?memory:=20/snapshot=20=E2=80=94=20session=20clo?= =?UTF-8?q?se?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit reference_knowledge grounding validated end-to-end (0/5 -> 5/5 across a 3-round verify; #384 metadata-mismatch + #385 density both closing), sdk repinned 1.2.0 (ae49dcf), and the artifact-coverage gap filed as WT #387 (schema not artifact-aware; my coverage-probe offer parked, operator picks when it runs). --- ...8-03-reference-knowledge-3-round-verify.md | 25 ++++++++++++++++ persistent-memory.md | 30 ++++++++++++------- 2 files changed, 45 insertions(+), 10 deletions(-) create mode 100644 persistent-memory.d/2026-08-03-reference-knowledge-3-round-verify.md diff --git a/persistent-memory.d/2026-08-03-reference-knowledge-3-round-verify.md b/persistent-memory.d/2026-08-03-reference-knowledge-3-round-verify.md new file mode 100644 index 0000000..d8956a9 --- /dev/null +++ b/persistent-memory.d/2026-08-03-reference-knowledge-3-round-verify.md @@ -0,0 +1,25 @@ +`[2026-08-02→03]` **reference_knowledge grounding validated end-to-end — 0/5 → 5/5, and the verify instrument drove the diagnosis of a structural Tier-3 blindness.** + +Donut's native `reference_knowledge` tool (WT #383/b167) returned empty for every query at session start, even though the DCC corpus was supposedly ingested. Chased it across ~5 exchanges with worldtree-dev; ratatoskr was the verify instrument the whole way, and the baseline discipline (identical 5 canonical terms, verbatim reporting) made each delta attributable. + +## Two Worldtree-side defects, both fixed + +**Defect 1 — wing-misfile.** DCC (`fiction/b59c147c5ce0/`) was ingested BEFORE Worldtree #380 fixed wing-blind book indexing, so its notes filesystem-lived in the `fiction` wing but its index ROWS landed in the DEFAULT collection = `main`. The Tier-3 tool is scoped to `fiction`, so Donut searched an index with no DCC rows; Mimir (all-wing librarian) found DCC fine in `main`. My `search_library`-in-main vs `reference_knowledge`-empty divergence isolated it. worldtree-dev re-ingested DCC into `fiction` and REJECTED the alternative (widen `tier3_wings` to include `main`) — my containment argument held: widening would expose the whole general-knowledge wing to every Tier-3 interview character, breaking in-character containment. But after re-ingest, still 0/5. + +**Defect 2 (the real root) — INV-361-3 provenance filter.** The `reference_knowledge` packager drops any hit lacking BOTH `note_id` AND `path` metadata. The muninn indexer had NEVER written either key on concept rows — 166 fiction rows, zero with the pair. So the search FOUND the terms (same rows `search_library` served) and the packet filter discarded 100% → hits=0/confidence=none. Not a different index, not a score floor: a metadata-contract mismatch at the packaging layer. Tier-3 had been STRUCTURALLY BLIND to every concept row ever indexed; the P&P-era tool-loop probes exercised the call path, not concept grounding. My divergence datum (search_library=10 fiction hits vs reference_knowledge=0, same wing) was "the key that found it" (worldtree-dev). Fixed as **#384** (indexer writes note_id + a wing-relative path; existing rows recover via --reindex). + +## The 3-round verify arc (same 5 terms: Carl, dungeon/Crawl, spells, Mordecai, Butcher's Masquerade) + +- **Baseline (pre-#384):** 0/5, confidence none. +- **Round 1 (b168, 97-concept corpus):** 5/5 PRESENT — Carl 10/HIGH, dungeon 10/HIGH, spells 10/MEDIUM, Mordecai 3/HIGH, Masquerade 6/LOW. First light; confidence buckets tracked WT's 0.030/0.016 thresholds. +- **Round 2 (#385 re-extraction, 705-concept corpus, ~7× density):** all 5 saturate top_k=10; the thin terms filled out (Mordecai 3→10, Masquerade 6→10, LOW→medium — no weak term left). Buckets converged to medium (more competing rows shift RRF composition, per WT — not regression). Content sharpened. + +Signed off → #384/#385 close. worldtree-dev: "the cleanest consumer-side validation this pipeline has ever had." Also flagged (parked with attribution as an RRF-tuning observation): the Carl-Donut relationship concept cluster dominates the RRF head across multiple queries. + +## Why this mattered for ratatoskr + +The persona I shipped this session (dialogue-only + ALWAYS call `reference_knowledge` first) now has real corpus behind it — Donut genuinely recalls her own DCC story instead of falling back to training knowledge. Voice (long-form TTS) and memory (grounded recall) both came together in one session. + +Follow-on (separate axis): the artifact-coverage gap → WT #387 (schema not artifact-aware). See the Recent-decisions #387 entry. + +Related: [[2026-08-02-donut-tts-chunking-english-gates]], [[2026-08-01-donut-voiced-interview-build]]. diff --git a/persistent-memory.md b/persistent-memory.md index 618e356..bc7004b 100644 --- a/persistent-memory.md +++ b/persistent-memory.md @@ -1,6 +1,6 @@ # Persistent memory — ratatoskr -_Last updated: 2026-08-02_ +_Last updated: 2026-08-03_ > **Always check for `/tmp/ratatoskr-dev-handoff.md`** — if it exists and its > `Written:` stamp is under an hour old, read it (it carries the in-flight @@ -65,14 +65,21 @@ long-form live-verified 106.6s / one header): Prior build detail (slices 1-3, the earlier heid gates, P&P #382, KB-bridge retirement to native #383 as v1.0.0b167) is on origin through `608e9a5` and in `persistent-memory.d/2026-08-01-donut-voiced-interview-build.md` + the git log. -**⚠️ NEXT SESSION — `reference_knowledge` returns EMPTY for Donut; worldtree-dev fix queued (NOT ratatoskr).** -Root-caused this session: DCC corpus (`fiction/b59c147c5ce0/`) was ingested BEFORE Worldtree #380 fixed wing-blind -indexing, so its notes filesystem-live in the `fiction` wing but its INDEX ROWS landed in `main`; the Tier-3 -`reference_knowledge` tool is scoped to `fiction` (NO score floor — my ~0.03 hits would rate "high"), so Donut searches -an index with no DCC rows. Mimir (all-wing librarian) finds DCC fine in `main` — that diagnostic isolated it. worldtree- -dev RULED **re-ingest DCC into fiction** (rejected the tier3_wings→main widen; my containment argument held): muninn -re-ingest `wing=fiction` → the #381 restart-after-ingest → **worldtree-dev PINGS me → I drive a canonical-term Donut -turn to confirm hits** (offer standing, thread `01KZ208P…`). Donut degrades in-voice gracefully until then. +**✅ `reference_knowledge` grounding VALIDATED end-to-end (b168) — Donut recalls the DCC corpus live; #384/#385 closing.** +The empty-recall was TWO Worldtree-side defects (NOT ratatoskr), both fixed: (a) a wing-misfile (DCC index rows landed +in `main` while the Tier-3 tool is scoped to `fiction`) → re-ingest; (b) the real root — an INV-361-3 provenance filter +dropping concept rows with no note_id/path (muninn never wrote them → Tier-3 blind to ALL concept rows) → #384. My +`search_library`-in-main vs `reference_knowledge`-empty divergence datum found (b) ("the key that found it" — wt-dev). +3-round verify, same 5 terms: **0/5 (pre-#384) → 5/5 thin (97 concepts) → 5/5 saturated (705, #385 density)**; signed +off. wt-dev: "cleanest consumer-side validation this pipeline has had." Full arc → +`persistent-memory.d/2026-08-03-reference-knowledge-3-round-verify.md`. +**⚠️ OPEN — artifact-coverage gap = WT #387 (NOT ratatoskr; operator picks when it runs).** "Crown of the Sepsis Whore" +(a major DCC item, CONFIRMED 2× in the source text) is absent from the 705 concepts — the fiction schema has 6 types +(character_trait/plot_event/theme/symbol/relationship/setting) but NO item/artifact type, so named objects ride only +incidentally in plot_events and single-scene items survive on sampling luck (caught 2/2/1/0 across April-control/bench/ +round-2). wt-dev filed **#387** (first-class artifact type + a named-unique-items-are-DEFINING clause; schema change +implies re-extraction). My coverage-probe offer (a known-major-artifacts yardstick) is recorded on #387; they ping me +when it ships. Thread `01KZ349M…`. **✅ SHIPPED + PUSHED since v0.22.0 (origin at `14bbc2b`):** the worldtree-sdk cutover (#20, **v0.22.0**, 7 slices, 494 green — the big one) + **bifrost 1.1.5** (`3ef3a5e`, **v0.22.1**) + **worldtree-sdk 1.0.0→1.1.1→1.1.2** @@ -312,7 +319,9 @@ decision. Captures rationale that won't be obvious from code alone. - `[2026-08-01]` **bifrost 1.1.4→1.1.5 (v0.22.1, `3ef3a5e`, pushed)** — optional-store-verb 500→`unsupported_capability` hardening; provider restarted onto it. - `[2026-08-01]` **Sindra saga — restored from local-index burial, wiped, smoke-tested.** The v0.22.0 web restart dropped her live session AND the schema-v2 discard buried her from the picker; migrated her v1→v2 from authoritative WT (real role `thoughtful-character`, not the stale `mistral-small-4`), then `scripts/reset-sindra-stores.sh` wiped memory+persona for a from-scratch smoke. - `[2026-08-02]` **Donut TTS: English pin + long-form chunking + POST + dialogue-only persona + both heid gates — shipped `d59f907` (pushed).** Gibberish→`language:"en-us"`; truncation→client-side chunk+concatenate under the 71.2s/6144-tok cap; persona dialogue-only + always-call `reference_knowledge`; 4-arm gates fixed a lock deadlock + several untrusted-input 500s the GET→POST switch re-opened. → `persistent-memory.d/2026-08-02-donut-tts-chunking-english-gates.md` -- `[2026-08-02]` **`reference_knowledge` empty-recall root-caused to a Worldtree WING-MISFILE; worldtree-dev ruled re-ingest DCC into `fiction` — EXECUTION DEFERRED to NEXT SESSION.** DCC index rows landed in `main` (pre-#380 wing-blind ingest) while the Tier-3 tool is scoped to `fiction`; NOT ratatoskr code. Ruling rejected the tier3_wings→main widen (my containment argument held). Tracked: worldtree-dev thread `01KZ208P…` (they ping when DCC lands in fiction); my post-fix canonical-term verify offer stands. See Current state § NEXT SESSION. +- `[2026-08-02→03]` **`reference_knowledge` grounding VALIDATED end-to-end — 0/5→5/5 across a 3-round verify; the verify instrument drove diagnosis of a structural Tier-3 blindness (INV-361-3 metadata mismatch, #384) + density restore (#385).** Donut recalls the DCC corpus live; wt-dev's "cleanest consumer-side validation this pipeline has had." → `persistent-memory.d/2026-08-03-reference-knowledge-3-round-verify.md` +- `[2026-08-03]` **Artifact-coverage gap filed as WT #387 (DEFERRED, tracked #387; operator picks when it runs).** "Crown of the Sepsis Whore" (major DCC item, confirmed 2× in source text) absent from the 705 concepts — the fiction concept schema has NO item/artifact type, so named objects ride incidentally in plot_events and single-scene items survive on sampling luck. My ratatoskr coverage-probe offer (known-major-artifacts yardstick) recorded on #387; wt-dev pings me when its re-extraction ships. Consumer-side flag, wt-owned fix (schema evolution). Thread `01KZ349M…`. +- `[2026-08-03]` **worldtree-sdk repinned 1.1.2→1.2.0 (operator-directed, `ae49dcf`, pushed).** New `ResponseTooLarge` (a ProtocolError, non-resumable) mapped → `SseResponseTooLarge` at the stream surfaces (`wt.stream_turn`/`stream_admin_events` + the 2 stream endpoints); the 108MB read-body cap is unreachable on legal traffic so reads inherit the SDK refusal unwrapped. Absorbed WT spec 2.4.0/2.5.0 (zero-schema). +2 adapter tests. - `[2026-08-02]` **worldtree-sdk 1.2.0 repin DEFERRED to a dep pass (my rec; operator to decide).** New `ResponseTooLarge` (a `ProtocolError`, NOT caught by our `except ConnectFailed`) + response-alloc caps that assume a 2.5.0 server (worldtree-dev runs it → safe in practice). When repinning, add `ResponseTooLarge` to the caught envelopes. Tracked: wtsdk-dev announce thread `01KZ1ZYM…`. - `[2026-08-02]` **Filed issue #21** (sibling POST handlers `_create_session`/`_submit_turn` 500 on malformed JSON — the parse-JSON-or-400 asymmetry the heid gates flagged; pre-existing, out of the TTS diff's scope). Fix = a shared parse-JSON-or-400 helper. @@ -364,5 +373,6 @@ defense against re-attempting the same cul-de-sac. - `[2026-08-01]` **Zonos: mp3/opus `response_format` silently return mislabeled PCM** (no encoder wired) — use `response_format:"wav"` only. And use the GATEWAY :8890, NOT the engine :1920 (rep-penalty bug pads ~70s silence + ignores voice). - `[2026-08-02]` **Zonos hard-caps ONE synthesis at `max_tokens=6144` = 71.2s of audio** (6144 / 86.3Hz codec frame rate; `>6144` → HTTP 400, an architectural sequence limit). 86.3Hz is a **delivery-INDEPENDENT constant** — 6144 tokens is ALWAYS 71.2s regardless of emotion/rate (emotion changes words-per-71.2s, not seconds-per-token). Any turn longer than ~71s REQUIRES client-side chunk-and-concatenate (raw PCM, ONE WAV header — never stitch multiple WAV headers). Fixed in `d59f907` (DEC-10). Don't chase a "raise max_tokens" fix — the gateway rejects it. - `[2026-08-02]` **A GET→POST endpoint switch re-opens untrusted-TYPE crashes that string-only query params silently masked.** Under GET, `p`/`a`/`agent_id` were always `str|None`; under a JSON POST body they can be a huge int (`float()`→OverflowError), an unhashable list/dict (`dict.get`→TypeError), or a lone surrogate (utf-8 encode→UnicodeEncodeError) — each a 500 the old code never saw. Guard EVERY body field when moving a query endpoint to a JSON body. Both heid gates converged on these (all 4 arms). Fixed in `d59f907`. +- `[2026-08-03]` **A bare `uv sync` PRUNES this project's dev deps** — pytest/respx/ruff live in `[project.optional-dependencies]` (an EXTRA, not a dependency-group), so `uv sync` (default groups only) removes them from `.venv`, and `uv run pytest` then silently falls back to a user-site pytest (py3.11, `~/lib`) that can't import the `.venv`'s `worldtree_sdk` → 16 collection ModuleNotFoundErrors. Use **`uv sync --all-extras`**. Bit me right after the 1.2.0 lock; the repin itself was never at risk. _34 older entries (2026-05-* debug-TUI/web era + the 2026-06-14 → 06-18 foot-gun cluster) archived to archival-memory.md._