Files
ThothII/harness/.pi/skills/tht-sessione/memoria.md
T
marcopan 292048f777 feat(harness): language workspace param + skill riscritta in inglese (semantica completa)
Due cambiamenti interconnessi da user review:

1. language come parametro workspace (spec decisione 9):
   - Config.language (default 'en') + workspaces PSD con 'language: it'
   - Generalizza Thoth oltre l'italiano: descrizioni tabelle/colonne ed evidence
     sono nel workspace language; le istruzioni della skill restano in inglese
     (piu' affidabili per modelli piccoli, meno ambigue)

2. Skill riscritta in INGLESE preservando la semantica COMPLETA dell'originale
   (autocritica: la mia riscrittura precedente aveva perso ~10 vincoli precisi):
   - 'promuovere' ambiguo (3 accezioni: phase advance / recommend / memory promote)
     -> 'never advance a phase or record a decision without confirmation'
   - recuperati vincoli persi: choice-is-confirmation (no reviewer_confirm dopo
     reviewer_decide), reviewer_select SOLO per iterazione no-decision, messaggi
     auto-contenuti obbligatori, artefatto = superficie di decisione (gate rilegge
     da disco per CTE/SQL), candidati con provenienza+score non verita', opzione
     'leave ambiguity open', F1 passa lista completa non solo ultima
   - language contract esplicito (istruzioni EN, output nel workspace language)

Sottomoduli cte/memoria/rewriting/sql-generation in inglese, semantica tecnica
intatta (regole AV-SQL, dim_time trick, max 5 memorie solo 3 tipi riusabili).

Verifica: 0 residui nsp/chirone, tutti i tht <cmd> citati registrati, 165 passed.
2026-06-27 14:50:30 +02:00

40 lines
2.2 KiB
Markdown

# Presenting reusable memories
Memories arrive from `tht memory search "<question>" --session <id> --json`, already
ordered by similarity. You argue them, the reviewer decides. NEVER apply them on
your own. **ALWAYS pass `--session <id>`**: the CLI excludes memories already decided
in this session (applied or rejected), so you don't re-propose what the reviewer has
already discarded (even after a Phase 2 reopen).
For each memory to present in the checklist, include in the option's `label` and/or
`description`:
- **What it says**: type + subject + detail (e.g. "table_promoted:
fact_seeablazione — main table for ablazioni").
- **Where it comes from**: question_context and origin session_id.
- **Why it might apply here**: overlap of concepts/tables with the current question
(fields tables/concepts), similarity score.
- **Out-of-context risk**: what was in the original session that might not hold here
(different period, different population, changed schema).
Rules:
- Propose at most **5** candidates. Include ONLY memories of the 3 reusable types:
`concept_clarified`, `table_promoted`, `table_excluded`. Query-specific decisions
(e.g. `question_rewritten`, `sql_approved`) are NOT to be proposed: they don't
transfer to other questions.
- All candidate memories go in **a single** `reviewer_decide(multi:true,
advance:true, allow_empty:true)`: each selected option is applied (register the
decision with the appropriate type, citing the memory id in the rationale), each
deselected option is **recorded as `memory_rejected` by the gate** (so the next
`tht memory search --session` won't re-propose it). To enable this, EVERY memory
option MUST carry the field `mem_id:"mem-<id>"` (besides `type`/`subject`/
`rationale`). The checklist starts pre-selected with the recommended memories.
With `allow_empty:true` an **empty selection is accepted** (no memory applied; the
deselected ones are still recorded as rejected) and the phase advances — no
separate gate.
- For "inspect": show the memory's full JSON record in the prose before presenting
the checklist, if the reviewer asks.
- If no memory clears score 0.5, say so and close the phase quickly (with
`reviewer_confirm kind:"phase"` if the list is empty).