fix: finalize session after memory promotion
This commit is contained in:
@@ -41,7 +41,7 @@ substantive decisions.
|
||||
| F5 sintesi | — | `reviewer_confirm kind:"phase"` (after `tht session check`) |
|
||||
| F6 cte | `cte_plan.json`, `ctes/`, `cte_tests.json` | approve each CTE `kind:"cte_result"`, then `reviewer_confirm kind:"phase"` |
|
||||
| F7 sql_finale | `sql_final.sql` | `kind:"sql"` records `sql_approved`, then `reviewer_confirm kind:"phase"` |
|
||||
| F8 datamart | — | `reviewer_confirm kind:"phase"` |
|
||||
| F8 datamart | — | auto: the `reviewer_memory_promote` gate advances F8 and finalizes the session itself (`reviewer_confirm kind:"phase"` only as fallback if it reports an error) |
|
||||
|
||||
## Disciplines (hold in every phase)
|
||||
|
||||
@@ -387,19 +387,24 @@ Prerequisite: Phase 7 closed.
|
||||
1. Ask the reviewer whether they want a datamart (`reviewer_select` yes/no).
|
||||
2. If yes: `tht datamart generate` (stub — raises NotImplementedError for now). Tell
|
||||
the reviewer that dbt generation is not implemented yet.
|
||||
3. **Memory promotion.** Call `reviewer_memory_promote` with ONLY the session id: the
|
||||
gate computes the candidates itself (`tht memory promote --preview` — the 3
|
||||
reusable types, already excluding promoted/declined ones) and shows the reviewer a
|
||||
pre-selected checklist. Selected → saved to the vectordb + `memory_promoted`;
|
||||
deselected → `memory_promotion_declined` (never re-proposed). If the gate reports
|
||||
zero candidates, move on — do not retry.
|
||||
4. Close with `reviewer_confirm kind:"phase"`. The gate auto-finalizes the session
|
||||
after advancing the last phase — you do NOT need to call `tht session finalize`
|
||||
yourself. If auto-finalize fails, the error message tells you the recovery command.
|
||||
3. **Memory promotion closes the session.** Call `reviewer_memory_promote` with ONLY
|
||||
the session id: the gate computes the candidates itself (`tht memory promote
|
||||
--preview` — the 3 reusable types, already excluding promoted/declined ones) and
|
||||
shows the reviewer a pre-selected checklist. Selected → saved to the vectordb +
|
||||
`memory_promoted`; deselected → `memory_promotion_declined` (never re-proposed).
|
||||
After recording the promotion (even with zero candidates) the gate advances F8 and
|
||||
finalizes the session itself — do NOT present a `reviewer_confirm kind:"phase"`
|
||||
afterwards: there is nothing left to approve. When the gate answers "sessione
|
||||
finalizzata", give the reviewer the final summary and end the turn.
|
||||
4. If the gate reports an error instead (e.g. the datamart decision is missing),
|
||||
fix the prerequisite and call `reviewer_memory_promote` again. Only if the gate
|
||||
says the session is still open, close with `reviewer_confirm kind:"phase"` as a
|
||||
fallback — it auto-finalizes after advancing the last phase too.
|
||||
|
||||
## Session end
|
||||
|
||||
When Phase 8 is approved, the gate calls `tht session finalize` automatically.
|
||||
When the promotion gate (or, as fallback, the F8 phase gate) closes Phase 8, the
|
||||
gate calls `tht session finalize` automatically.
|
||||
Finalize also indexes the question→SQL pair in the vectordb (kind `solved_question`,
|
||||
best-effort — on failure recover with `tht memory solved-index <id>`). The persisted
|
||||
state (ledger `review_decisions.jsonl` + artifacts) is the truth: what is not
|
||||
|
||||
Reference in New Issue
Block a user