-
Notifications
You must be signed in to change notification settings - Fork 0
Detector: Intent Comparison
Jacob Centner edited this page Apr 13, 2026
·
1 revision
Multi-artifact triangulation — compares code, docstring, tests, and documentation for contradictions.
| Property | Value |
|---|---|
| Name | intent-comparison |
| Tier | LLM_ASSISTED |
| Languages | Python |
| External tool | None |
| LLM required |
Yes — minimum advanced capability tier (frontier-class model recommended) |
| Confidence | 0.55 (basic), 0.70 (enhanced) |
Contradictions across up to 4 independent sources of intent for the same symbol:
- Code body — what the function actually does
- Docstring — what the author says it does
- Test functions — what the tests expect it to do
- Documentation sections — what the docs tell users it does
Catches inconsistencies that pairwise detectors (semantic-drift, test-coherence, inline-comment-drift) miss — e.g., tests expect one behavior, docs describe another, and the code does a third thing.
- Discovers Python implementation files (excludes test files)
- Extracts symbols (functions/classes with ≥3 code lines)
- Builds lookup tables for test functions (
test_<name>matching) and doc sections (backtick references in.md/.rst) - For each symbol, gathers available artifacts. Only proceeds if ≥3 artifacts are available (triangulation requirement — code always counts as 1, so needs 2+ of: docstring, tests, doc sections)
- Sends all artifacts in a single prompt asking for contradictions between any pair
- Creates one finding per contradiction
| Parameter | Value |
|---|---|
| Min artifacts | 3 (code + 2 others) |
| Max per file | 10 symbols |
| Max per scan | 50 symbols |
| Max test functions per symbol | 3 |
| Max doc sections per symbol | 2 |
Default num_ctx
|
4096 |
| Tier | Behavior |
|---|---|
basic |
Concise "find factual contradictions" prompt, shorter context, confidence 0.55 |
advanced |
Detailed role-based prompt with explicit ignore list (style, verbosity, coverage), larger context, confidence 0.70 |
[INTENT-COMPARISON] src/sentinel/config.py:parse_config (line 22)
Contradiction between test vs documentation: Test expects parse_config()
to raise ValueError on missing keys, but the architecture doc says it
returns defaults for missing keys.
Severity: MEDIUM, Confidence: 0.55
This detector requires frontier-class models. The multi-artifact prompts are significantly larger than pairwise detectors, and reliable cross-reference reasoning needs stronger models. Use gpt-5.4-nano or better. Configure via per-detector providers:
[sentinel]
model = "qwen3.5:4b" # main model for other detectors
[sentinel.detector_providers.intent-comparison]
provider = "openai"
model = "gpt-5.4-nano"
api_base = "https://api.openai.com/v1"
api_key_env = "OPENAI_API_KEY"
model_capability = "advanced"Local Repo Sentinel · MIT License
Getting Started
Reference
Detectors
- Detector: Todo Scanner
- Detector: Complexity
- Detector: Dead Code
- Detector: Dep Audit
- Detector: Docs Drift
- Detector: Unused Deps
- Detector: Lint Runner
- Detector: ESLint Runner
- Detector: Go Linter
- Detector: Rust Clippy
- Detector: Git Hotspots
- Detector: Stale Env
- Detector: Semantic Drift
- Detector: Test Coherence
- Detector: CI/CD Drift
- Detector: Architecture Drift
- Detector: Inline Comment Drift
- Detector: Intent Comparison
Advanced
Workflow