Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9e4ba52
DEV-1515 analyses: failure-mode notes for post-DEV-1478 households + …
ZmeiGorynych May 31, 2026
1e6b33d
DEV-1515 audited-gold consolidation: mini-interact → single_file
ZmeiGorynych May 31, 2026
5e92cf0
DEV-1515 prompt fix: extend IN-set from sampled-value variants
ZmeiGorynych May 31, 2026
45bdd03
DEV-1515 annotation skeleton: TaskAnnotation + SubmissionAnnotation s…
ZmeiGorynych May 31, 2026
56dc2b2
README: document multi-instance parallelism for claude_sdk_otf{,_aint…
ZmeiGorynych May 31, 2026
83751ce
DEV-1515 tolerant grader + cascading-phase1 report + annotation CLI
ZmeiGorynych May 31, 2026
a91f861
DEV-1515 session-3 + session-4: annotation schema overhaul, multi-var…
ZmeiGorynych Jun 1, 2026
5f0d374
DEV-1515 review fixes — Groups 1-4 from /process-reviews triage on PR…
ZmeiGorynych Jun 1, 2026
627ad14
DEV-1515 follow-up: N9 case-fold tier + multi-variant audit on source…
ZmeiGorynych Jun 1, 2026
c163fcf
DEV-1515 livesqlbench audit + annotate: expand to credit + mental
ZmeiGorynych Jun 1, 2026
862e959
DEV-1515 review fixes — Groups 1-4 from /process-reviews triage on PR…
ZmeiGorynych Jun 1, 2026
5a15380
DEV-1515 session-4: agent-miss failure-mode diagnostics at grading time
ZmeiGorynych Jun 1, 2026
dcfc584
DEV-1515 MissDiagnostics follow-ups: column-shape split + never_asked…
ZmeiGorynych Jun 2, 2026
2a27bb3
DEV-1515 review fixes + DEV-1519 n_ask_user_calls reporting
ZmeiGorynych Jun 2, 2026
cd6ef4b
DEV-1515 review fixes (round 3): missing-gold guard + annotations-roo…
ZmeiGorynych Jun 2, 2026
db37dce
DEV-1515 round 4: wire inline grader into local run.py
ZmeiGorynych Jun 2, 2026
6c6b979
DEV-1515 round 5: sol_sql shape normalisation + honest cascade denomi…
ZmeiGorynych Jun 2, 2026
149f9c2
DEV-1515 round 6: cloud-side fail-everything fallback (symmetric to l…
ZmeiGorynych Jun 2, 2026
cd20288
DEV-1515 round 7: cloud no-submit short-circuit + regrade string-sol_…
ZmeiGorynych Jun 2, 2026
15ee097
DEV-1515 round 8: data_dir routing, upload ordering, attempt-aware merge
ZmeiGorynych Jun 2, 2026
baaaef4
DEV-1515 round 9: restore observation columns + multi-stmt miss_diagn…
ZmeiGorynych Jun 2, 2026
43947b2
DEV-1515 round 10: rows-dir hygiene, primary-first audits, grader rob…
ZmeiGorynych Jun 2, 2026
86d8bf7
DEV-1515 round 11: regrade picks latest attempt + defensive trajector…
ZmeiGorynych Jun 2, 2026
68539cf
DEV-1515 round 12: scope cascade aggregation to current instance set
ZmeiGorynych Jun 2, 2026
5cb2ea8
DEV-1515 round 13: comparator robustness against width + duplicate names
ZmeiGorynych Jun 2, 2026
d57d0a4
DEV-1524: add claude_sdk_otf_raw + claude_sdk_otf_ainteract_raw agents
ZmeiGorynych Jun 3, 2026
048ef2e
DEV-1515 round 14: LLM judge wired, schema widening, sol_sql normalis…
ZmeiGorynych Jun 3, 2026
bc3f006
process-reviews round 1 (partial): use materialized DB for local grad…
ZmeiGorynych Jun 3, 2026
47531df
Merge remote-tracking branch 'origin/egor/dev-1515-multi-variant-gold…
ZmeiGorynych Jun 3, 2026
6b59ba1
process-reviews: fix __file__-based path in consolidate script (workt…
ZmeiGorynych Jun 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions .claude/skills/_shared/audit-gold-sql.contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,94 @@ Use one of: `outer_select`, `projection`, `from`, `join`, `where_predicate`,
6. **Persist** the JSONL line per the benchmark's on-disk layout (see
each SKILL.md).

## Multi-variant audit on source contradiction (MANDATORY)

If two of the task's authoritative sources DIRECTLY contradict on the
SAME parameter, the audit MUST emit **multi-variant** — one row per
defensible reading. Collapsing to a single variant with a note is
**forbidden**. The agent under test cannot satisfy mutually-exclusive
sources; forcing one reading tags genuine ambiguity as `agent_miss`.

What counts as a contradiction:

| Same parameter | Source A | Source B | Verdict |
| --- | --- | --- | --- |
| Boundary operator on a threshold | KB definition: "greater than 7" | labeled sql_snippet: `score >= 7` | **contradiction** (strict vs inclusive) |
| Numeric threshold value | KB: "> 3" | labeled sql_snippet: `> 2` | **contradiction** |
| Bucket inclusion | column_meaning enum: `{A,B,C}` | KB cites bucket `D` | **contradiction** |
| Aggregation choice | KB: "average of …" | labeled sql_snippet: `SUM(…)` | **contradiction** |
| KB-internal | KB.description: one cutoff | KB.definition: another | **contradiction** |

Not a contradiction: one source silent, the other specifies; one source
operationalises in SQL what the other describes in prose; different
parameters that happen to live near each other in the metadata.

**The recipe addendum.** Before classifying the audit as single-variant
in step 4 of the per-clause recipe, scan ALL loaded authoritative
sources (KB items, column meanings, every labeled/anchor citation
shape your benchmark exposes — see the per-benchmark SKILL.md for the
full source list) for pairwise direct contradictions. ANY contradicting
pair triggers multi-variant. No "labeled wins" tie-breaker. No "KB-
anchored is primary" tie-breaker. If you find yourself writing a
regretful note in `reasoning_summary` that names two sources and
explains why you went with one, STOP — that's the multi-variant
trigger and you skipped it. Go back and emit two rows.

**Mechanics when emitting multi-variant.**

- Each row shares `instance_id`; rows are distinguished by `variant_id`
(a short kebab-case slug naming the reading, e.g. `labeled_snippet`,
`kb_strict`).
- Exactly one row carries `primary: true`. The choice is arbitrary —
it only controls which row the grader's strict-N2 path targets by
default; `n3_any_audited_variant` accepts either. Document the
choice in `reasoning_summary` as bookkeeping, not as authority.
- Every row keeps `audit_status: "edited"`.
- Each row's `changes[]` carries AT LEAST one entry with
`clause_kind: "source_conflict"` pointing at the other variant:
- `original`: what THIS variant rejected (paraphrase the other
variant's reading, in parens cite the source).
- `replacement`: what THIS variant chose (paraphrase, in parens
cite the source).
- `why_unjustified`: quote the rejected source's contrary value.
- `justified_by`: the citation tokens backing THIS variant's choice.
- The downstream TaskAnnotation carries
`internal_inconsistency.audit_resolution = "multi_variant"` with
`sources_in_conflict[]` quoting both sides verbatim, and one
`gold_variants[]` entry per audit row.

**Minimal worked example (synthetic).** A task asks "list high-score
items"; KB X.definition says "score must be greater than 7" (strict);
the labeled sql_snippet for "high score" says `score >= 7` (inclusive).
The audit emits two rows:

```jsonl
{"instance_id": "demo_5", "variant_id": "labeled_snippet", "primary": true,
"audit_status": "edited",
"audited_sol_sql": ["… WHERE foo.score >= 7 …"],
"changes": [{"clause_kind": "source_conflict",
"original": "foo.score > 7 (KB X strict reading)",
"replacement": "foo.score >= 7 (labeled-snippet inclusive reading)",
"why_unjustified": "KB X.definition: 'score must be greater than 7' is strict; this variant rejects KB X in favor of the labeled sql_snippet's inclusive boundary.",
"justified_by": ["labeled_ambiguity:high score"]}],
"reasoning_summary": "Task is internally inconsistent on the score threshold. This variant follows the labeled sql_snippet."}
{"instance_id": "demo_5", "variant_id": "kb_strict", "primary": false,
"audit_status": "edited",
"audited_sol_sql": ["… WHERE foo.score > 7 …"],
"changes": [{"clause_kind": "source_conflict",
"original": "foo.score >= 7 (labeled-snippet inclusive reading)",
"replacement": "foo.score > 7 (KB X strict reading)",
"why_unjustified": "labeled_ambiguity:high score uses inclusive >=; this variant rejects the labeled snippet in favor of KB X.definition's explicit 'greater than' wording.",
"justified_by": ["kb:foo_kb#X"]}],
"reasoning_summary": "Task is internally inconsistent on the score threshold. This variant follows KB X's strict reading."}
```

(For LiveSQLBench tasks the citation token for the snippet-anchored
variant would be `external_knowledge:<id>` or `column_meaning:…`
instead of `labeled_ambiguity:` — LiveSQLBench has no labeled-ambiguity
blocks. See the per-benchmark SKILL.md for which sources can take part
in a contradiction.)

## Anti-patterns (call out in the audit)

- **Set arithmetic on counts** with no natural-language analogue in the
Expand Down
Loading