Skip to content

fix: review follow-up — rag adapter crash, count/link false positives, hygiene - #7

Merged
silversurfer562 merged 1 commit into
mainfrom
fix/review-followup-accuracy-and-hygiene
Jul 18, 2026
Merged

fix: review follow-up — rag adapter crash, count/link false positives, hygiene#7
silversurfer562 merged 1 commit into
mainfrom
fix/review-followup-accuracy-and-hygiene

Conversation

@silversurfer562

Copy link
Copy Markdown
Member

What

The remaining findings from the library review (follow-up to #6). One turned out to be a live crash, not a comment problem.

rag adapter crashed on every call

The adapter read result.is_faithful — a field attune-rag's FaithfulnessResult has never had (verified against installed attune-rag 0.1.23 and the current attune-rag source; its verdict is score/claims-based). Every semantic run raised AttributeError and degraded to a warning. faithful is now derived from unsupported_claims, the translation lives in a unit-tested _to_verdict(), and calling the sync judge from inside a running event loop raises a clear, actionable error. The stale Phase-3 TODO and the wrong "verified against rag 0.2.0" protocol claim are gone.

Count checker false positives

  • "Released 2026 versions of the widgets." flagged 2026 against widgets=12 (error severity → fails a clean doc). Values in 1900–2099 are now compared only when the source keyword directly follows the number — "2026 widgets" is still checked, so no recall loss (guarded by a hallucinated corpus case).
  • Keyword matching now requires a leading word boundary: test no longer matches inside latest; plural drift (widget ~ widgets) still matches.
  • check_counts docstring no longer promises warnings the code never produced.

Link checker root escape

../-traversal targets that happen to hit a real file outside project_root (e.g. /etc/passwd) previously passed silently. Escapes now yield a warning (unverifiable as a project link — same "never a silent pass" rule as flags), and site-absolute targets (/docs/page.md) resolve under project_root instead of the filesystem root.

Hygiene

  • FindingKind.CHECKER_ERROR for checker infra failures (was repurposing unresolved_import)
  • Import resolution cached per call — one subprocess per distinct module
  • VerifyContext.judge typed Optional[Judge]
  • README status unstaled (was "implementation in progress" at 0.2.1)
  • black enforced in CI Lint alongside ruff; repo formatted

Tests

  • 2 new corpus cases (year-FP clean guard + year-valued-count recall guard)
  • 8 new behavioral/semantic tests, incl. year-guard boundary values (1899/1900/2099/2100) for mutation killing
  • pytest: 83 passed · ruff + black --check: clean

🤖 Generated with Claude Code

…, hygiene

Remaining findings from the library review:

- rag adapter read result.is_faithful, a field FaithfulnessResult has never
  had (verified against installed attune-rag and its current source), so the
  semantic layer crashed and degraded to a warning on every call. faithful
  is now derived from unsupported_claims; calling from inside a running
  event loop raises a clear error instead of asyncio.run's generic one.
- Count checker: values 1900-2099 near a source keyword are treated as
  years unless the keyword directly follows the number, and keyword
  matching now requires a leading word boundary ("test" no longer matches
  "latest"). check_counts docstring aligned with actual skip behavior.
- Link checker: targets escaping project_root (../ traversal) yield a
  warning instead of silently passing when the file exists elsewhere on
  disk; site-absolute targets (/docs/page.md) resolve under project_root.
- FindingKind.CHECKER_ERROR replaces the repurposed UNRESOLVED_IMPORT for
  checker infrastructure failures.
- Import resolution cached per call (one subprocess per distinct module).
- VerifyContext.judge typed Optional[Judge]; README status unstaled;
  black enforced in CI and repo formatted.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@silversurfer562
silversurfer562 merged commit 5c802fb into main Jul 18, 2026
7 checks passed
@silversurfer562
silversurfer562 deleted the fix/review-followup-accuracy-and-hygiene branch July 18, 2026 00:27
@silversurfer562 silversurfer562 mentioned this pull request Jul 18, 2026
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