feat(web): persona pane shows the CANONICAL affect->NL Worldtree injects (v0.19.5)
The pane now renders the LITERAL mood word + relationship directive Worldtree context-injects into the agent — adopted from Worldtree's canon, not invented: - canonMood(pad) mirrors Worldtree describe_pad (valence×arousal grid, ±0.3 bands); for sindra's PAD the canonical render is "neutral" — an invented octant vocab would have said "faintly excited" and MISLED. Adopting canonical is the point. - canonDirective(rel) mirrors render_d2_canonical byte-exact: "...warmth is clear warm regard; ability trust is strong; ...; speak with direct warmth; ..." — the exact stance instruction the agent receives (which makes the WAD "stranger" relation_context read even more incoherent, as flagged to worldtree-dev). - Both VERIFIED byte-exact against Worldtree's OWN renderer on the live snapshot. - Canon vendored (docs/vendor/worldtree-persona-canon/) + drift-pinned in .corviduo-canonicals.toml (canonical_drift green); flat browser form (static/persona_render_canon.json) regenerated by scripts/build_persona_canon.py via Worldtree's authoritative loader. Reference-impl posture: adopt canonical. - Fail-open (canon absent -> lines omit); INV-004 esc() preserved. JS syntax clean. Refresh + drive turns to see the canonical NL under mood + each relation.
This commit is contained in:
@@ -115,6 +115,15 @@ functions:
|
||||
- "POST-004: INV-001 honesty — no fabricated Tier-1 fields (no synthesized dominant_emotion). INV-004 — head() escapes its whole argument (incl. target_entity + relation_context from the snapshot) and metric() escapes every cell; numeric values go through toFixed, never innerHTML-raw."
|
||||
flexibility: "open"
|
||||
|
||||
- name: "canonical affect-NL (v0.19.5 — vendored Worldtree d2 render canons)"
|
||||
signature: "canonMood(pad) ; canonDirective(rel) ; loadPersonaCanon()"
|
||||
description: "Render the LITERAL mood word + relationship directive Worldtree context-injects into the agent, byte-exact to Worldtree's own describe_pad + render_d2_canonical."
|
||||
postconditions:
|
||||
- "POST-001: DETERMINISTIC, no LLM. canonMood mirrors describe_pad (valence×arousal grid + strict ±0.3 bands + dominance clause); canonDirective mirrors render_d2_canonical (interval band-cut lookup + per-band phrase assembly + cross-axis low-trust-precedence behavior clause). BOTH VERIFIED BYTE-EXACT against Worldtree's own renderer run on the live snapshot (the reference harness re-runs Worldtree's functions + asserts string equality — reproducible)."
|
||||
- "POST-002: the canon DATA is VENDORED (docs/vendor/worldtree-persona-canon/{d2-mood-render-canon-v1,d2-render-canon-v1}.json), pinned drift-gated in .corviduo-canonicals.toml (worldtree-persona-{mood,d2}-render-canon-v1); the flat browser form (static/persona_render_canon.json, served /static) is regenerated by scripts/build_persona_canon.py via Worldtree's OWN authoritative loader. Reference-impl posture: ADOPT the dep's canonical render, do NOT invent vocab — an invented 'faintly excited' would MISLEAD where the canonical (±0.3 bands) says 'neutral'."
|
||||
- "POST-003: fail-open — canon absent (fetch fails) → the canonical lines OMIT, the structured pane still renders. The canon-derived strings are esc()'d before the DOM for INV-004 consistency."
|
||||
flexibility: "open"
|
||||
|
||||
invariants:
|
||||
- "INV-004 (untrusted-render): ALL model / tool / admin / agent-supplied text is escaped before entering the DOM (esc via textContent, or esc(JSON.stringify)). No new render path introduces an innerHTML sink for upstream content. This is the highest-value review target — the new JS render paths are NOT unit-tested."
|
||||
- "INV-ADMIN-KEY: the admin key exists ONLY at app.state.admin_key (from RATATOSKR_ADMIN_API_KEY). It is never serialized into any response, never sent to the browser, never logged. The browser receives only the session-filtered RESULT of admin-scoped reads."
|
||||
|
||||
Reference in New Issue
Block a user