docs(skill): prescribe solved-question recall in F4/F6/F7; refresh PROJECT_STATE
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -232,6 +232,10 @@ Prerequisite: Phase 3 closed.
|
||||
|
||||
1. `tht schema introspect` + `tht schema render --format mschema-text` for the schema
|
||||
context. Copy table/column names EXACTLY from it — never invent objects.
|
||||
Also run `tht memory solved-search "<question>" --json`: similar already-solved
|
||||
questions show which tables comparable questions used. Cite relevant precedents
|
||||
(session id + tables) to the reviewer as CONTEXT — they are reference material,
|
||||
NOT decisions to apply; their filters/periods may not transfer.
|
||||
2. Propose tables to promote/exclude with **`reviewer_schema_linking`**: pass
|
||||
`tables[]` as `{id, name, kind: "promote"|"exclude", rationale, suggested_columns}`.
|
||||
Do NOT list every column yourself — the gate loads the full column set (with
|
||||
@@ -281,6 +285,8 @@ Prerequisite: Phase 5 closed.
|
||||
|
||||
1. Read `cte.md`. Decompose the rewritten question into CTEs (Agent View Generation):
|
||||
each CTE captures an informative subset with a clear purpose, named in snake_case.
|
||||
`tht memory solved-search "<question>" --json` shows how similar solved questions
|
||||
were structured — use as reference only.
|
||||
2. Present the full CTE plan to the reviewer with `reviewer_confirm kind:"cte_plan"`,
|
||||
passing a **structured v2 artifact** (`artifact:{kind:"cte_plan", data:{…}}`). You
|
||||
author `question`, `strategy` and each `ctes[]` entry (`name`, `purpose`,
|
||||
@@ -322,6 +328,9 @@ Prerequisite: Phase 6 closed.
|
||||
|
||||
1. Read `sql-generation.md`. Recursive divide-and-conquer: the CTEs approved in
|
||||
Phase 6 are the preferred building blocks (reuse them by name).
|
||||
`tht memory solved-search "<question>" --json` gives the final SQL of similar
|
||||
solved questions: reference exemplars — never copy filters, periods or
|
||||
populations without checking them against the current rewritten question.
|
||||
2. Compose the final SQL (PostgreSQL dialect, exact names from the schema context).
|
||||
**Output columns (F4 honoring).** The columns promoted in Phase 4's
|
||||
`schema_linking.json` are the reviewer-approved OUTPUT columns: project exactly
|
||||
@@ -354,5 +363,7 @@ Prerequisite: Phase 7 closed.
|
||||
## Session end
|
||||
|
||||
When the workflow is complete (Phase 8), `tht session finalize` closes the session
|
||||
and unlocks input. The persisted state (ledger `review_decisions.jsonl` + artifacts)
|
||||
is the truth: what is not recorded did not happen.
|
||||
and unlocks input. 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 recorded did not happen.
|
||||
|
||||
Reference in New Issue
Block a user