Files
sql-server-query-ai/kb/Option type and sql to run.md
ahmed mohammedandClaude Opus 4.7 8b42a0931c docs: karpathy-pattern wiki built from the spec, plan, design contract and decisions ledger
kb/ is its own wiki root: 34 pages across 7 categories, index.md catalog, log.md, AGENTS.md schema layer, and raw/ holding copies of README, the spec, the 13-task plan, the design master and the SDD ledger.

Every page cross-references 3 to 6 others and all 107 wikilinks resolve except two [["list"]] artefacts inside JSON snippets in the copied plan.

Kept separate from the repository root on purpose: its generated graph lands in kb/.ua/ instead of overwriting the code graph.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-09-22 12:14:05 +03:00

1005 B

Decision: option_type and sql_to_run

The candidate schema used to carry rewrite_sql. The name was load-bearing — it is sent to the model — and it said "query rewrite only". Result: an index recommendation had no CREATE INDEX anywhere in the pipeline, and the report rendered zero SQL blocks for a plan whose headline finding was missing indexes.

It became option_type (index | statistics | rewrite | schema | app | ops) plus sql_to_run, described as the exact T-SQL the user must execute, with the instruction that an index or statistics option with null SQL is a wrong answer.

Two consequences were deliberate. The report prompt makes a SqlBlock per non-null sql_to_run a hard requirement. And the verify_semantics flag in Jev scoring now keys on option_type === "rewrite", because keying it on "has SQL" would flag every index option for carrying DDL — the exact noise an earlier ruling removed.

Related: Placeholder SQL is dropped, Analyst model, Jev scoring.