Skip to content

test: add direct unit coverage for domain-expert heuristic analyzers - #1183

Draft
madara88645 wants to merge 1 commit into
mainfrom
tests/add-domain-expert-heuristics-20260803
Draft

test: add direct unit coverage for domain-expert heuristic analyzers#1183
madara88645 wants to merge 1 commit into
mainfrom
tests/add-domain-expert-heuristics-20260803

Conversation

@madara88645

Copy link
Copy Markdown
Owner

Summary

  • Adds direct unit tests for pure heuristic functions in app/heuristics/handlers/domain_expert.py: _analyze_business, _analyze_education, _analyze_data_science, _analyze_creative_writing, _detect_story_structure, and the public analyze_domain router.
  • These were previously only exercised indirectly through full-pipeline compile_text() integration tests, which never asserted on their specific branch/edge-case behavior (e.g. which suggestions/diagnostics fire for which inputs).
  • Also adds a few detect_implied_persona cases (multi-match confidence scaling, no-match fallback, position-based tie-break) that aren't covered by the existing tests/test_regex_precompilation.py, without duplicating the cases that file already covers.
  • Test-file-only change — no source, config, or CI files touched.

Test plan

  • python -m pytest tests/heuristics/test_domain_expert_analyzers.py -v — 25 passed
  • python -m pytest tests/ -q (full suite) — 2380 passed, 7 skipped, unchanged from baseline

Generated by Claude Code

_analyze_business, _analyze_education, _analyze_data_science,
_analyze_creative_writing, _detect_story_structure, and the analyze_domain
router in app/heuristics/handlers/domain_expert.py were previously only
exercised indirectly through full-pipeline compile_text() calls, which never
asserted on their specific branch/edge-case behavior. This adds direct
coverage for each, plus a few detect_implied_persona cases (multi-match
confidence scaling, no-match fallback, position tie-break) not covered by
the existing tests/test_regex_precompilation.py.

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
compiler Ready Ready Preview Aug 3, 2026 4:27am

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.

2 participants