Skip to content

Separate intermediate calculations from final answer selection - #356

Draft
seyoung4503 wants to merge 5 commits into
feat/sql-result-cardinalityfrom
fix/final-selection-contract
Draft

seyoung4503 wants to merge 5 commits into
feat/sql-result-cardinalityfrom
fix/final-selection-contract

Conversation

@seyoung4503

@seyoung4503 seyoung4503 commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

A request to calculate grouped metrics and then identify the worst group returned every intermediate group. On local302 the five averages were correct, but the final selection was omitted. The model declared expected_rows=5, so the existing deterministic cardinality guard correctly accepted the declared contract and could not infer that declaration was wrong.

Extend the existing output-contract instruction to distinguish intermediate calculations from the final requested ranking/filter/aggregation. Keep requested detailed rows and ties. No new tool, executor, grader, definition policy, model setting, or SQL rewrite is added. This is an explicit prompt-only follow-up after validating the deterministic tools and execution path, not a substitute for those fixes.

Validation:364root tests passed,1skipped; scoped Ruff passes with only the pre-existing BLE001 exception handler excluded; diff passes. No CODE MAP generator or new function. On frozen0d02188, a fresh Astra/high run of only local302 improves0→1. It computes all groups then selects the one most-negative average. Original user prompt bytes match; MCP system instructions intentionally differ. No prior SQL/reference/grade/offline counterfactual was supplied. Selected single-run repair, not full accuracy, repeated reliability, or broad regression evidence.

Evidence: mcp-review-results/recovered-spider-astra retains the preceding0/3 attempt (local020/local075 ask for definitions; local302 wrong output scope), full traces, official grades, comparisons and an offline final-selection-only audit. mcp-review-results/final-selection retains the new1/1 probe and its paired trace.44archive hashes verified. Legacy recovered Sol prompts were not archived; no byte-identical claim for that older baseline. The offline LIMIT-only counterfactual is diagnosis, not model performance.

Reuse: existing BASE_INSTRUCTIONS, RunSQL output contracts, runner, trace comparison and official scorer. Production net0lines (one existing line extended),0new functions. Keep draft: no full135-case95% or regression-free claim, and no merge.

Principle Verdict Evidence
Reuse O Existing output rule and execution/validation paths; net0lines,0functions
Cause only O Correct intermediate values but missing final selection; one rule extension
Logging O Unchanged raw trace capture; all failures and new success preserved
Error levels N/A No exception or fallback path changed
Environment N/A No env or configuration additions
Issue comments O No new issue-number comments
Verification O 364passed/1skipped, scoped Ruff/diff,44hashes, official1/1; no CODE MAP generator
Authority O Draft PR only; no merge, paid API or live-job restart
Consumers O Existing MCP system instructions → model final selection → unchanged RunSQL/evaluator
Sync/async N/A No new I/O or alternate execution path
Constants/deployment O No operational constants/env/deployment changes

Additional new-failure probe, frozen cf328f6: bird299 improves0→1 with no further code/prompt edit. It retains all three tied winning events and projects only event_name; the prior run returned the same names plus extra IDs and ratios. Exact original prompt bytes match and no prior/reference/analyst feedback was supplied. The new SQL also uses raw SUM(spent) rather than integer-cent rounding, and several earlier output fixes differ from the old0c79539source, so this is not isolated attribution to the final-selection sentence. Full trace/official score/comparison and native projection audit are in mcp-review-results/ranked-event-output with16verified hashes. The separate parent BIRD checkpoint009 remains273/284 and is not a500-case score. Artifact-only follow-up: no product change, previous364passed/1skipped validation applies; source/input/event/archive hashes and staged diff passed; no merge.

Negative generalization probe: local059 remains0/1 on frozen1c84760. It ranks products within division but still computes one global average after selection, rather than the reference's division-grain result. Original prompt bytes match the original Astra source; no previous SQL/reference/grade/offline diagnosis was supplied. No new code/prompt edits for this probe and no unchanged repeat planned. This bounds the claim: the rule repaired local302, not all final-grain interpretation errors. Full evidence: mcp-review-results/final-grain-probe (16verified hashes). Artifact-only verification passed; prior364passed/1skipped source validation still applies, no merge.

Additional negative experiment: ten previously untested-max Spider failures (local064/003/077/360/356/062/263/059/283/297), Astra/max on frozen6417338, 0/10. All10executed SQL; none were timeout/no-SQL failures. No model retry, gold, analyst feedback, or additional code/prompt edits. Raw traces and five validated historical baseline comparisons are archived in bench/accuracy/mcp-review-results/spider-max-remaining (80hashes). Max effort is not promoted as default and these unchanged cases will not be repeated. This is a selected-failure result with mixed historical baselines, not full accuracy or an isolated effort ablation.

The new offline local263 audit shows4regression models satisfy strong and soft at different steps: allowing both yields21soft; exclusive strong precedence yields17soft, matching the reference's17while37strong remains unchanged. This is diagnostic evidence only; the reference-derived priority was not supplied to inference or silently adopted in product policy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant