Skip to content

fix(semantic): compact judge and contradiction verifier - #102

Merged
VerifiedOrganic merged 4 commits into
mainfrom
ao/planning-agent-entry/semantic-fix
Nov 11, 2026
Merged

VerifiedOrganic merged 4 commits into
mainfrom
ao/planning-agent-entry/semantic-fix

Conversation

@VerifiedOrganic

@VerifiedOrganic VerifiedOrganic commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Diagnosis (public sets only; held-out-4 untouched)

Measured with the pre-fix judge (ollama:gemma4:31b) on #72 and held-out-3. Reports: evals/results/semantic_p4_held-out-72.json, evals/results/semantic_p4_held-out-3.json.

Set Judgments Contradiction No-contradiction Uncertain Confidence >=0.85 Discards Stop reasons Repair p95 output
#72 shadow 200 0 162 38 200 not_contradiction 200 success 45, truncated 52 34.0% 1,200 (2,744 chars)
held-out-3 shadow 119 0 100 19 119 not_contradiction 119 success 31, truncated 75 39.6% 1,200 (2,789 chars)

One sentence: zero findings reached even info because the judge never returned a contradiction verdict; every validated judgment was compatible or insufficient at high confidence, so policy had nothing to promote, downgrade, or discard.

No evidence-anchor, canon-ref, threshold, or dedupe discards were recorded. The dominant failure was output shape/length: 52/97 #72 calls and 75/106 held-out-3 calls truncated at the 1,200-token cap while emitting the verbose report contract.

Root causes and fixes

  • Verbose output contract → compact per-candidate wire format: one short record per candidate, contradiction-only conflict and evidence_quote; the server expands it into the existing validated report contract. Truncation fell to zero on the measured sets.
  • Evidence offsets from the model → server resolves the quote span, tolerating whitespace normalization; exact spans are still verified. Evidence-anchor validity is 1.0.
  • Overclaiming → general family rules plus a second, contradiction-only verifier call. The verifier rejects different quantity events, fact mentions as knowledge, non-disclosures, and action-only world-rule claims; unavailable verification fails closed.
  • Duplicate claims → evidence-identity dedupe (scene + check type + byte span) in addition to structured P1 dedupe.
  • Temporal/world-rule/secret evidence quality → contradiction requires a temporal quantity, rule-constraint overlap, and explicit disclosure/cost evidence respectively.

Stronger model check (one model, same sample)

ollama:deepseek-v4.1-flash was tried on the same #72/held-out-3 sample. It was not an improvement: 111/120 #72 calls and 121/125 held-out-3 calls truncated at the 1,200-token cap, with zero findings and ~8-9 s p95 latency. It is not being adopted; the operator still chooses the judge model.

Results (same head, gemma4:31b)

Set Deterministic Semantic on Warning precision Control warnings Repair shadow/on p95 prompt/output/latency (shadow)
Baseline 28/28 28/28 0.25 +2 quantity 1.1% / 50.0% 2,209 / 626 / 1,831 ms
#72 54/56 54/56 1.00 0 2.6% / 33.3% 2,850 / 981 / 2,768 ms
Held-out-2 55/56, 56/56 type 55/56, 56/56 0.00 +1 dead acting 1.5% / 50.0% 2,038 / 663 / 1,886 ms
Held-out-3 26/56, 28/56 type 29/56, 30/56 1.00 0 4.2% / 50.0% 3,138 / 951 / 2,671 ms

Held-out-3 gains +3 localized/+2 type-present with 1.0 precision, no control rise, evidence validity 1.0, and 4.2% shadow repair. #72's warnings are true positives but duplicate already-detected plants, so they add no recall. Baseline and held-out-2 still emit false-positive control warnings. Shadow/on would-be counts match on baseline and held-out-3 but differ by one on #72 (8 vs 9). The four-set lift/control gates do not pass on this head; the lane stays off by default. Held-out-4 remains sealed.

Gates

  • Deterministic results with --semantic off unchanged: baseline 28/28 (3 controls), feat(evals): held-out continuity contradiction corpus #72 54/56 (0), held-out-2 55/56 + 56/56 type (0), held-out-3 26/56 + 28/56 type (0 control warnings).
  • Per-call prompt/output/latency and shadow repair ceilings pass.
  • Warning precision/control gates fail on baseline and held-out-2; semantic lift is absent on baseline, feat(evals): held-out continuity contradiction corpus #72, and held-out-2.
  • Full workspace tests, clippy -D warnings, fmt: pass.
  • CI/review pending on the reviewed head.
  • Default remains off; checkpoint posted; wait for maintainer merge.

Gates

  • Deterministic results with --semantic off unchanged: baseline 28/28 (3 controls), feat(evals): held-out continuity contradiction corpus #72 54/56 (0), held-out-2 55/56 + 56/56 type (0), held-out-3 26/56 + 28/56 type (0 control warnings).
  • Full workspace tests, clippy -D warnings, fmt: pass.
  • CI/review pending on this PR.
  • Default remains off; checkpoint posted; wait for maintainer merge.

Gates

PENDING final measurements; CI/review pending. The default remains off.

Add verdict, confidence, discard, stop-reason, and output-length breakdowns; record failed/timeout dispatch receipts; compute repair rate and p95 from actual calls; document that the judge returned no contradictions.
Add a compact per-candidate output format, server-side evidence anchoring, general family evidence gates, a fail-closed contradiction verifier, and evidence-identity dedupe. Public held-out-3 gains +3 localized/+2 type-present at 1.0 precision; baseline/#72/held-out-2 do not yet pass the lift/control gates, so activation remains off.

@VerifiedOrganic VerifiedOrganic left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested. Three correctness issues need fixes: Unicode evidence anchoring, invalidation of pre-verifier cache entries, and deduplication of distinct canon violations sharing evidence. Reviewed head 8444ebf against base c3c5915. Static review only; no project programs or tests were run and the checkout was not modified.

Map normalized byte offsets to original UTF-8 bytes, include the judge-policy revision in the semantic cache identity, and keep canon/subject identity in evidence dedupe so distinct violations sharing a quote survive.

@VerifiedOrganic VerifiedOrganic left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved; ready. Reviewed head 1c32dd0 against base c3c5915 and checked the changes since the previous review. All three findings are addressed: normalized evidence offsets now map bytes correctly, cache identity includes a judge-policy revision, and shared-evidence deduplication includes canon and subject identity. Regression tests cover Unicode evidence and distinct canon references sharing a quote. No further required findings. Static review only; tests were not run and the checkout was not modified.

@VerifiedOrganic VerifiedOrganic left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved; ready. Reviewed head 020b114 against base c3c5915, including the measurement/documentation changes since the previously approved revision. Implementation and fixes are unchanged. The refreshed reports support the documented recall/precision results and the decision to keep the lane off by default; no required findings.

Optional documentation cleanup: remove the duplicated section 4.3 heading, and clarify the held-out-2 parity sentence: its would-be warning totals are 1 vs 1, so any claimed mismatch must refer to warning identity rather than counts.

Static review only; no tests or project programs were run and the checkout was not modified.

@VerifiedOrganic
VerifiedOrganic merged commit ed1a1d5 into main Nov 11, 2026
1 check passed
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