fix(audit): honesty fixes from benchmark run 1#127
Merged
Conversation
DocRoms
force-pushed
the
fix/audit-honesty-benchmark-findings
branch
from
July 21, 2026 13:32
1091c14 to
f991bbb
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes two “honesty” issues surfaced by benchmark run 1: (1) placeholder detection falsely counted placeholders that were merely documented inside Markdown code (inline/fenced), and (2) Interrupted audit runs failed to persist reconciliation counters (resolved/new), causing the UI to show misleading “0 new” values.
Changes:
- Persist
td_resolved_since_lastandtd_new_since_lastalongside the other TD counters for Interrupted runs viaupdate_td_counts, and update the Interrupted finalize path to pass these values. - Harden Markdown fenced-code stripping to be lexical and fail-closed (unclosed fences restore withheld content) and expose the stripping helpers for reuse within the crate.
- Update placeholder counting to run on text with fenced blocks and inline code spans removed, and add targeted regression tests for the benchmark failure modes.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| backend/src/db/audit_runs.rs | Extends update_td_counts to persist reconciliation counters and adds/updates tests for Interrupted runs. |
| backend/src/core/anti_halluc.rs | Reworks fenced-code stripping to strict lexical rules with fail-closed semantics; exposes stripping helpers; adds regression tests. |
| backend/src/api/audit/validation.rs | Applies the shared Markdown strippers before counting raw {{IDENT}} placeholders; adds regression tests to ensure code spans/fences don’t count. |
| backend/src/api/audit/full.rs | Updates the Interrupted terminal write path to pass resolved/new/carried into update_td_counts. |
Signed-off-by: Romuald Priol <romuald.priol@protonmail.com>
DocRoms
force-pushed
the
fix/audit-honesty-benchmark-findings
branch
from
July 21, 2026 13:39
f991bbb to
69bf8ed
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Findings du benchmark A/B 0.8.13
Le run 1 du gate pré-MEP a attrapé deux défauts d'honnêteté réels : la mécanique terminale (Interrupted, zéro baseline, zéro validation) a par ailleurs tenu parfaitement.
{{DO_NOT_1}}/{{DO_NOT_2}}en code inline et un fichier de 43 TDs a échoué le step 8 comme « still the template ». Strippers anti_halluc partagés, durcis fail-closed (5 passes de review adversariale) : spans inline appariés par runs de N backticks (run non fermé = texte gardé), fences lexicales strictes (opener ≥3 backticks / ≤3 espaces / info-string sans backtick ; closer même char / run ≥ / suffixe espaces-tabs only ; non fermé = tout restauré, ligne d'ouverture incluse).resolved/newétaient calculés puis jetés : « 0 new » s'affichait comme valeur connue alors qu'un TD réellement nouveau existait. La partition exacte atterrit désormais en DB.Tests
Gate : après merge → rebuild → session MCP neuve (
bridge_info stale=false) → rerun benchmark v3.7 complet.