I need a brutally honest aesthetic and architectural review of this Python codebase. Not "does it pass linters" — what makes it ugly, confusing, or inelegant to read as a human?
Look at:
The overall module structure: ls desloppify/ and ls desloppify/lang/ and ls desloppify/commands/ and ls desloppify/narrative/ and ls desloppify/detectors/ and ls desloppify/review/
Read the main entry point desloppify/cli.py
Read desloppify/scoring.py fully
Read desloppify/state.py fully
Read desloppify/lang/base.py fully
Read desloppify/utils.py fully
Read desloppify/registry.py
Read desloppify/zones.py
Skim desloppify/lang/python/__init__.py and desloppify/lang/typescript/__init__.py
Read desloppify/narrative/core.py and desloppify/narrative/__init__.py
Read a few detector files: desloppify/detectors/security.py, desloppify/lang/python/detectors/security.py
Comments that explain "what" instead of "why" (or missing "why" comments)
Any place where you'd be confused if you were a new contributor
Private underscore soup — too many _helpers, _internal functions that obscure the real API
Dict-heavy code that should be dataclasses/named tuples
Inconsistent error handling patterns
Be specific. Quote line numbers and function names. I want the unvarnished truth about what makes this codebase feel like "engineered but not beautiful."
Assistant
I'll start by surveying the module structure and then reading all the files you specified. Let me kick off everything in parallel.
Assistant
Now let me read all the files you specified in parallel.
Assistant
Now let me read the remaining files.
Assistant
Let me also look at a few more supporting files to round out the picture.
Assistant
Now let me look at a couple more files to understand cross-cutting patterns.
Assistant
User
I need to understand three things about this codebase:
Auto-resolve logic for review findings: Read desloppify/state.py and find the _auto_resolve_disappeared function. Also search for where it's called — probably in desloppify/commands/scan.py. I need to understand:
How does auto-resolve decide which findings to resolve?
Is there any special handling for review findings vs mechanical findings?
Where the wontfix count and strict/lenient scores are printed
The _print_llm_summary or similar function that prints the "INSTRUCTIONS FOR AGENTS" block
Where the score summary line is printed (the "Health: X/100 strict: Y/100" line)
Where would be the right place to add a wontfix warning after the scan
How wontfix findings are counted: Search for how wontfix counts are computed in scoring.py and state.py. How does the strict vs lenient distinction work? What's _STRICT_FAILURES vs ?
Assistant
I'll help you understand these three areas. Let me start by reading the key files and searching for the relevant functions.
Assistant
Now let me search for additional context on wontfix counting and get a complete picture by looking at narrative and review modules:
Assistant
Let me get the review module to understand review findings better:
User
I need to understand the review dimension system and config:
DEFAULT_DIMENSIONS vs all dimensions: Read desloppify/review/dimensions.py. Find:
What's in DEFAULT_DIMENSIONS (the 5 active ones)
What's in DIMENSION_PROMPTS (all 10+ per-file dimensions)
How are dimensions selected for review?
Config system: Search for how config controls which review dimensions are active. Check:
desloppify/config.py or similar
desloppify/review/prepare.py — how does it decide which dimensions to include?
Is there a way to configure active dimensions already?
Cross-module underscore violations: Read desloppify/detectors/ to understand:
What detectors exist already (list them)
How desloppify/lang/python/detectors/unused.py works (does it track imports?)
How the import graph / dependency graph is built (desloppify/lang/python/detectors/deps.py or similar)
Could we detect "private function imported by another module" from existing data?
Assistant
I'll conduct a thorough exploration of the review dimension system, config, detectors, and registry. Let me start with parallel searches.
Assistant
Now let me look at the resolve command to understand how wontfix is handled:
Assistant
Perfect! Now let me look at the narrative dimensions module more closely:
Assistant
Now let me read the config file and continue exploring the detectors and dependencies:
Assistant
Now let me read a few more key detectors to understand the full landscape:
Assistant
Now let me check how review dimensions are actually selected and look at the review initialization:
Assistant
Let me check the review_cmd to see how dimensions are handled:
Assistant
Let me search for any existing cross-module underscore detection:
Assistant
Excellent. Now let me read the coupling detector to understand how it detects cross-module violations:
Assistant
Perfect! Now let me check how the lang plugin system works and look at one more key file:
Assistant
Now let me read the LangConfig class:
Assistant
Assistant
I now have a thorough understanding of the codebase. Here is my honest aesthetic and architectural review.
Brutally Honest Aesthetic Review of desloppify
1. The Fundamental Irony
A tool whose purpose is detecting code sloppiness has accumulated significant sloppiness of its own. The MEMORY.md file documents dozens of bug fixes, each one a story of something that was wrong. The codebase has the feeling of being built incrementally by an LLM under instruction, with features bolted on faster than the architecture could absorb them. It works, clearly, but it reads like engineering-by-accretion rather than design.
2. Module Structure: Too Flat, Too Deep, Both at Once
The top-level desloppify/ has 27 entries. Some are proper subpackages (commands/, narrative/, detectors/, lang/, review/), but the heavy-hitters are standalone modules:
cli.py (287 lines) -- fine
scoring.py (395 lines) -- fine
state.py (462 lines) -- reasonable
utils.py (389 lines) -- a junk drawer
plan.py (340 lines) -- why is this a top-level module and not in commands/?
visualize.py (430 lines) -- same question
zones.py (262 lines) -- fine
scorecard.py + _scorecard_draw.py -- two files for one feature, one with a leading underscore signaling "private" at module level, which is not how Python packages work
issues.py -- top-level but issues_cmd.py is in commands/. The split between "logic" and "command" is inconsistent.
The detectors/ directory has 22 entries including two test_coverage files (test_coverage.py and test_coverage_mapping.py). The review/ directory has 8 files for what is essentially "prepare data for an LLM to review, then import its output." That is a lot of machinery.
The inconsistency is the problem.plan.py does computation and is top-level. plan_cmd.py is a thin wrapper in commands/. But visualize.py is top-level AND handles the tree command directly (line 264 of cli.py: "tree": (".visualize", "cmd_tree")). Sometimes the command handler lives in the module; sometimes it is in commands/. There is no rule.
3. The Dict Problem
This is the deepest aesthetic flaw. Nearly everything is a dict. Findings are dicts. State is a dict. Potentials are a dict. Dimension scores are a dict. Narrative results are a dict. Strategy results are a dict. The Finding TypedDict exists (line 17, state.py) but it is overwhelmingly aspirational -- the actual code passes plain dicts everywhere and accesses them with .get().
scoring.py lines 118-149 -- _detector_pass_rate does f.get("detector"), f.get("zone", "production"), f["status"], f.get("confidence", "medium"), f.get("file", ""), f.get("detail", {}).get("loc_weight", 1.0), f.get("detail", {}).get("holistic"). This is a function that needs to know the shape of a finding intimately, but the type system offers zero help. Every .get() with a default is a silent admission that the data might be wrong.
state.py line 254 -- make_finding returns a dict literal, not a Finding TypedDict instance. The TypedDict is a documentation artifact, not an enforced contract.
narrative/core.py line 72 -- compute_narrative returns a dict with 10 keys. Its callers (scan.py, fix_cmd.py) immediately index into this dict with string keys. A @dataclass would give autocompletion, type checking, and documentation. Instead there is narrative.get("strategy") or {} followed by strategy.get("hint") -- stringly-typed access two levels deep.
commands/scan.py line 290 -- The _write_query call builds a massive dict literal with 12 keys. This is the API surface for LLM consumption. It has no schema, no validation, no type.
Detector entries are the worst offenders. Every detector returns list[dict]. Every dict has different keys. _make_entry in detectors/security.py (line 226) builds a dict with file, name, tier, confidence, summary, detail. The detail sub-dict has kind, severity, line, content, remediation. None of this is typed. The finding factory functions in finding_factories.py each know the shapes of their input dicts implicitly.
What it should be: A DetectorEntry dataclass. A SecurityEntry(DetectorEntry) subclass. A NarrativeResult dataclass. A StrategyResult dataclass. The TypedDict on Finding should be replaced with a frozen dataclass that is actually instantiated.
4. The Underscore Soup
The narrative/__init__.py file (lines 41-66) exports an __all__ list where 14 of 17 entries start with _. These are "private" functions being re-exported for "backward compatibility" -- meaning other modules import them. If something is imported by other modules, it is public. The underscore is lying.
Examples throughout:
_detector_pass_rate in scoring.py -- called only internally, underscore is fine
_count_open_by_detector in narrative/core.py -- imported by narrative/init.py and re-exported in all. Not private.
_compute_actions, _compute_tools, _compute_headline, _compute_reminders, _compute_strategy -- all "private" yet all re-exported. These are the public API of the narrative package.
_COMMAND_POST_FIX in fix_cmd.py (line 116) -- a module-level mutable dict. In a tool that detects module-level mutable state.
_extra_exclusions in utils.py -- documented in MEMORY.md as a known global mutable state trap that has already caused bugs. Still there.
The underscore convention has been diluted to meaninglessness. In some files, everything is underscored. In fix_cmd.py, the public entry point cmd_fix is the only non-underscored name among 11 functions. The helper functions are not actually private -- they are just "not the command handler." A better convention: no underscores, put internal helpers in a separate module, or just accept that these functions are the module's API.
5. Naming Inconsistencies
fix_cmd.py but review_cmd.py, issues_cmd.py, zone_cmd.py, config_cmd.py, plan_cmd.py. Why not fix.py? Because fix collides with... nothing. There is no fix.py. The _cmd suffix is inconsistent -- scan.py, show.py, next.py, resolve.py, detect.py, move.py do not have it.
_state_path and _resolve_lang in _helpers.py -- helper functions with leading underscores in a module that is already underscore-prefixed (_helpers.py). Double-private.
cmd_scan, cmd_fix, cmd_show, cmd_next -- the cmd_ prefix is noise. These are the only functions in their modules that a consumer would call. If they were just scan, fix, show, next, the cli.py dispatch would be cleaner.
make_finding vs make_unused_findings vs make_smell_findings -- the first creates one finding, the second creates many. The plural signals the difference, but the verb is the same. normalize_unused_entries would be clearer about what it actually does.
stderr_fn as a parameter name throughout finding_factories.py (e.g., line 12, 30, 78, 115, 137, 155, 182, 204). This is a dependency injection of log() from utils. But it is named stderr_fn in some places and log when called at the call site. Why not just import log directly? The indirection buys nothing -- this is a CLI tool, not a library.
6. Functions That Do Too Much
cmd_scan in commands/scan.py (lines 179-333) -- 155 lines. It loads state, resolves language, loads zone overrides, populates review cache, enables file cache, generates findings, collects codebase metrics, audits excluded directories, computes deltas, merges scan, expires stale holistic reviews, saves state, shows diff summary, shows score delta, shows detector progress, shows dimension deltas, shows low dimension hints, shows post-scan analysis, persists reminder history, saves state again, writes query, generates scorecard badge, checks README for badge reference, prints LLM summary. This is not a function; it is a screenplay.
_print_llm_summary in commands/scan.py (lines 336-443) -- 108 lines. Prints a structured text blob for LLM consumption. Contains hardcoded markdown table formatting, hardcoded workflow instructions, hardcoded decision guides. This is documentation masquerading as code.
_detector_pass_rate in scoring.py (lines 86-163) -- 78 lines with three distinct code paths (file-based with loc_weight, file-based without loc_weight, per-finding). The file-based path handles holistic findings as a special case. The function has grown organically and the control flow is hard to follow.
_compute_reminders in narrative/reminders.py (lines 33-247) -- 215 lines. Twelve numbered reminder types, each with its own conditional logic, some querying state, some querying config, some checking fp_rates. This is a giant switch statement pretending to be a function. Each reminder type should be its own function, or better, a declarative rule.
7. Magic Numbers and Strings
scoring.py line 41: MIN_SAMPLE = 200 -- what does 200 mean? Why not 100 or 500? No comment explains the calibration.
scoring.py line 55: HOLISTIC_MULTIPLIER = 10.0 -- why 10?
scoring.py line 56: HOLISTIC_POTENTIAL = 10 -- is it a coincidence that both are 10?
scoring.py line 61: SUBJECTIVE_WEIGHT_FRACTION = 0.25 -- 25% is a policy choice with no documented rationale.
scoring.py line 67: SUBJECTIVE_CHECKS = 10 -- "Used for pass_rate/weighted_failures display consistency only" -- a fake number for display purposes. This is a code smell in a code smell detector.
state.py line 418: if len(history) > 20: -- why 20?
narrative/reminders.py line 28: c["total"] >= 5 -- minimum sample for FP rate computation. Undocumented threshold.
commands/scan.py line 126: diff["new"] > 10 and diff["auto_resolved"] < 3 -- hardcoded heuristic for cascading fix detection.
strategy.py line 42: coverage > 0.4 or impact_ratio > 0.3 -- fixer leverage thresholds with no documented basis.
strategy.py line 283: lane["file_count"] >= 5 or lane["total_impact"] >= 1.0 -- "significant" lane threshold.
base.py line 126: complexity_only_min: int = 35 -- hardcoded in the function signature, not in a constant.
finding_factories.py lines 38-39: a["loc"] < 10 and b["loc"] < 10 -- suppression threshold for duplicate findings.
Many of these have comments, but the comments say "what" (the threshold) not "why" (the calibration reasoning). A reader cannot tell if MIN_SAMPLE = 200 was chosen via experiment, intuition, or copy-paste.
8. The Import Disorder
utils.py line 63-65 has import tempfile in the middle of the file, between a comment block and a function definition. It is not at the top with the other imports.
cli.py has imports scattered across the function body: from .config import load_config at line 243, import importlib at line 274. The main() function uses lazy imports throughout. This is intentional (startup speed), but it makes the dependency graph invisible.
commands/scan.py imports within function bodies extensively: from ..narrative import compute_narrative at line 142, from ..state import path_scoped_findings at line 167, from ..scoring import DIMENSIONS at line 367/499/533, from ..registry import display_order, DETECTORS at line 465. The same modules are imported multiple times in different functions within the same file.
narrative/__init__.py re-exports everything with noqa: E402 and noqa: F401 comments -- the linter is being silenced rather than the code being structured to avoid the warnings.
state.pysave_state (line 106): catches OSError on backup copy (ignores), catches OSError on write (prints warning). Inconsistent granularity.
utils.pysafe_write_text (line 68): catches BaseException (line 77) to clean up temp file. Using BaseException is correct here for cleanup, but unusual.
commands/scan.py line 330: except (ImportError, OSError): for scorecard generation -- silently swallows errors. A user would never know why their scorecard was not generated.
detectors/security.py line 248: except SyntaxError: pass -- silently ignores files that cannot be parsed. Fair, but no logging.
commands/fix_cmd.py line 244: except (subprocess.CalledProcessError, OSError, subprocess.TimeoutExpired): pass -- swallows all git errors.
The pattern is: catch, maybe print, usually swallow. There is no consistent strategy. Some errors are logged to stderr, some are silently ignored, some produce user-facing warnings. A new contributor would not know which approach to use.
10. The LangConfig God Object
lang/base.pyLangConfig (lines 54-104) is a 50-line dataclass with 19 fields, 5 of which are underscore-prefixed "private" runtime caches (_zone_map, _dep_graph, _review_cache, _review_max_age_days, _complexity_map). These are not configuration -- they are mutable state smuggled into a configuration object. They are populated by side effects during the scan pipeline:
_zone_map is set in plan.py at scan time
_dep_graph is set in _phase_coupling (line 159 of python/__init__.py)
_review_cache is set in cmd_scan (line 207 of scan.py)
_complexity_map is set in _phase_structural (line 118 of python/__init__.py)
This means the LangConfig object mutates as the scan progresses. The phases are order-dependent because earlier phases populate caches that later phases read. This is fragile, implicit, and undocumented in code (though documented in MEMORY.md, which is itself a smell -- if you need a memory file to explain your architecture, the architecture is not self-documenting).
11. Duplicated Patterns That Scream for Unification
Phase runners in python/__init__.py all follow the same pattern: call detector, filter by zone, call factory, compute potentials, return tuple. There are 7 of them (_phase_unused, _phase_structural, _phase_coupling, _phase_smells, _phase_mutable_state, _phase_dict_keys, plus shared ones). Each one reimplements the same structure:
This is a pattern that should be a higher-order function or a declarative pipeline. Instead it is copy-pasted with minor variations.
The _make_entry pattern in security detectors: detectors/security.py (line 226) defines _make_entry. lang/python/detectors/security.py (line 221) imports it with from ....detectors.security import _make_entry -- a four-level relative import of a "private" function. This is a code smell that _make_entry should be a public utility.
File reading: _read_file_text in utils.py (line 88), Path(filepath).read_text(errors="replace") in detectors/security.py (line 151), Path(filepath).read_text(errors="replace") in python/detectors/security.py (line 235), p.read_text().splitlines() scattered throughout. The file cache in utils.py exists but is opt-in and only used during scans. Detectors that run outside the scan pipeline read files directly, bypassing the cache.
12. Comments and Documentation
Most comments explain "what" rather than "why":
scoring.py line 39: # Minimum checks for full dimension weight -- what is a "full dimension weight"? Why does this exist? What happens if you change it?
scoring.py line 43: # Detectors where potential = file count but findings are per-(file, sub-type) -- this is useful, but it explains mechanism not intent. Why does this distinction matter? Because without it, multi-finding files would blow up the failure rate. That is the insight worth commenting.
state.py line 129: _EMPTY_COUNTERS = ("open", "fixed", "auto_resolved", "wontfix", "false_positive") -- no comment at all. Why a tuple and not a set? Because it is used as keys for dict.fromkeys. But that is not obvious.
zones.py lines 37-42 on ZoneRule: The docstring explains the pattern matching conventions. This is genuinely good documentation. More of this.
detectors/security.py lines 14-32: _SECRET_FORMAT_PATTERNS -- well-structured, self-documenting. The label, pattern, severity, and remediation form a clear schema. This is one of the better-organized parts of the codebase.
The MEMORY.md file contains architectural knowledge that should be in the code. "Zone map: lang._zone_map is set at scan time in plan.py" -- this should be a comment in LangConfig, not an external document. The fact that a separate memory file exists to explain the code is itself a signal that the code is not self-explanatory.
13. The Two-Type Problem
The codebase is in the middle of a migration that was never completed:
enums.py defines Confidence, Status, Tier as StrEnum/IntEnum. Clean.
scoring.py uses Confidence.HIGH and Tier.AUTO_FIX in CONFIDENCE_WEIGHTS and TIER_WEIGHTS.
But the actual finding dicts store "high", "medium", "low" as raw strings.
make_finding in state.py (line 247) takes confidence: str and tier: int, not Confidence and Tier.
Finding TypedDict specifies confidence: str and tier: int, not the enums.
So the enums exist but are only used as keys in the scoring module's lookup tables. They do not flow through the system. The StrEnum trick (where Confidence.HIGH == "high") was explicitly designed to allow gradual migration, but the migration stopped after one file.
14. Abstraction Level Mismatches
cli.py is clean: parse args, dispatch. Good.
commands/scan.py is the opposite: it interleaves user-facing output (print statements), data computation (metrics, deltas), state management (save, load, merge), and coordination logic (cache enable/disable, zone overrides). The function cmd_scan should be 20 lines: load, scan, save, print. The actual computation and display should be separate.
narrative/ is decomposed into 7 modules but the decomposition feels arbitrary. core.py is the orchestrator. _constants.py has 5 constants. phase.py, dimensions.py, actions.py, headline.py, reminders.py, strategy.py each compute one section of the narrative. This is fine architecturally, but the cross-cutting dependencies are complex: strategy.py imports from _constants.py, reminders.py imports from _constants.py and ../state, core.py imports from all siblings. The package's __init__.py then re-exports everything. The decomposition adds files without reducing cognitive load.
15. The "Engineered But Not Beautiful" Summary
The codebase has many signs of care:
Atomic writes with temp-file-and-rename
Backup recovery for corrupted state
Zone-aware scoring exclusions
Reminder decay to avoid nagging
Union-find for lane computation
But these are point solutions, not architectural beauty. The overall shape is:
Everything flows through dicts with string keys
The LangConfig accumulates mutable state during execution
Phase runners are copy-paste patterns
The narrative system is complex machinery for generating text
Naming is inconsistent across modules
"Private" functions are public in practice
Magic numbers are calibration choices with no recorded rationale
The enum migration was started but never finished
Error handling is ad-hoc per callsite
The MEMORY.md file is doing the job that the code's own structure should do
The codebase works. It is maintainable by someone who has the MEMORY.md open. But it is not self-documenting, and a new contributor would spend significant time understanding the dict schemas, the phase execution order, and which underscore-prefixed functions are actually part of the contract. The irony of a code health tool that has these issues is not lost, but it is also the most understandable kind of technical debt -- the tool was built to solve a problem, and it solved it, and the building happened faster than the polishing.
_LENIENT_FAILURES
Be thorough — read full files, quote line numbers.
Registry: Read desloppify/registry.py to understand how new detectors are registered and what metadata they need.
Be thorough — quote file paths and line numbers.
Excellent! Now I have all the information needed. Let me provide a comprehensive summary:
Summary of Three Key Areas
1. Auto-Resolve Logic for Review Findings (state.py)
Skip if found: if fid in current_ids — if the finding appears in the current scan, don't auto-resolve
Skip if not open/wontfix: if old["status"] not in ("open", "wontfix") — already handled findings are left alone
Language scoping: If lang is specified, skip findings from other languages
Path scoping: If scan_path is specified, skip findings outside that path
Exclusion patterns: Skip findings matching the exclude tuple (via matches_exclusion())
Suspect detectors: Skip if the finding's detector is in suspect_detectors — this is the critical safety check
When all criteria pass, the finding is marked auto_resolved with a contextual note (lines 321-325):
For wontfix findings: "Fixed despite wontfix — disappeared from scan (was wontfix)"
For open findings: "Disappeared from scan — likely fixed"
Special handling for review findings:
Line 282-283 shows the key distinction:
python
# review is import-only (not a scan detector) — always protect from auto-resolve
_IMPORT_ONLY_DETECTORS = {"review"}
Review findings are ALWAYS marked as suspect (line 288), which means they never get auto-resolved even if they disappear. This makes sense because review findings are manually assessed and imported, not generated by automated scans.
What is suspect_detectors?
Found in _find_suspect_detectors() (lines 260-298). A detector is "suspect" if:
It had open findings before the scan
It returned 0 findings now (empty result)
It's NOT in ran_detectors (i.e., didn't actually run this scan)
The key check (lines 290-293):
python
if current_by_detector.get(det, 0) > 0:
continue # Detector produced findings — not suspect
if ran_detectors is not None and det in ran_detectors:
continue # Detector ran and found nothing — legitimate
This is the trust mechanism: If potentials data shows a detector ran and returned 0 findings, that's trusted (user probably fixed everything). If potentials show the detector didn't run at all, it's marked suspect (can't trust a 0 result).
2. Scan Output / Post-Scan Summary (scan.py)
Score printing locations:
Score delta line (lines 95-118): _show_score_delta()
Prints: "Health: X/100 (±delta) strict: Y/100 (±delta) | N open / M total"
Uses dimension-based scoring if potentials available (lines 102-107)
Falls back to legacy weighted-progress if potentials missing (lines 108-118)
Wontfix-related output:
No explicit wontfix count is printed in the main output
However, wontfix appears in narrative debt analysis (called at line 144)
Only runs when inside an agent environment (CLAUDE_CODE or DESLOPPIFY_AGENT env vars)
Prints structured dimension table with scores, strict scores, and issue counts
Shows workflow guide and decision framework
No explicit wontfix count printed — but it's tracked in stats (line 398-399)
Where the complete score line is printed:
Lines 262-278 show the scan complete section:
python
print(colorize(" Scan complete", "bold"))
print(colorize(" " + "─" * 50, "dim"))
_show_diff_summary(diff) # +new / -resolved / reopened line
_show_score_delta(state, ...) # Health/Score line with strict
if not include_slow:
print(colorize(" * Fast scan ...", "yellow"))
_show_detector_progress(state) # Progress bars
_show_dimension_deltas(...) # Dimension movement tracking
_show_low_dimension_hints(...) # Hints for low dimensions
Right place to add wontfix warning:
The ideal location would be after _show_low_dimension_hints() (line 278) and before _show_post_scan_analysis() (line 282). This way it appears after the score display but before the narrative coaching.
This teaches users to minimize wontfix — it degrades the strict score even though it improves the lenient score.
How wontfix is counted in scoring:
In _detector_pass_rate() (lines 86-163):
python
failure_set = _STRICT_FAILURES if strict else _LENIENT_FAILURES
# For file-based detectors (smells, test_coverage, security, etc.)
if detector in _FILE_BASED_DETECTORS:
# ... count failures using failure_set
Line 104 selects the failure set based on strict parameter. All subsequent counting uses failure_set, so:
Lenient mode: Only "open" status counts against the score
Strict mode: Both "open" and "wontfix" count against the score
Wontfix is explicitly counted in:
_analyze_debt() in narrative/dimensions.py (lines 98-151)
python
wontfix_count = sum(1 for f in findings.values() if f["status"] == "wontfix")
Returns debt analysis dict with "wontfix_count" field.
Status command (commands/status.py line 285)
python
debt_count = sum(1 for f in area_findings if f["status"] == "wontfix")
Narrative headline (narrative/headline.py line 70)
python
wontfix = debt.get("wontfix_count", 0)
Used in headline generation to point out mounting debt.
Dimension gap analysis (narrative/dimensions.py lines 55-61)
python
wontfix_count = sum(
1 for f in scoped.values()
if f["status"] == "wontfix" and _finding_in_dimension(f, name, dim_scores)
)
Breaks down wontfix by dimension to show which areas have deferred debt.
The gap metric (lenient - strict):
In _analyze_debt() lines 104-128:
python
for name, ds in dim_scores.items():
tier = ds.get("tier", 3)
w = TIER_WEIGHTS.get(tier, 2)
w_sum_l += ds["score"] * w # Lenient (wontfix ignored)
w_sum_s += ds.get("strict", ...) * w # Strict (wontfix penalized)
w_total += w
gap = ds["score"] - ds.get("strict", ...)
This gap is tracked and reported as "biggest gap dimensions" in narrative output — showing which areas have the most wontfix debt.
Status quo: Wontfix is deeply integrated but never explicitly printed in the main scan output. It appears in:
CONFIG_SCHEMA: dict[str, ConfigKey] = {
"review_max_age_days": ConfigKey(int, 30,
"Days before a file review is considered stale (0 = never)"),
"holistic_max_age_days": ConfigKey(int, 30,
"Days before a holistic review is considered stale (0 = never)"),
"generate_scorecard": ConfigKey(bool, True,
"Generate scorecard.png after each scan"),
"badge_path": ConfigKey(str, "scorecard.png",
"Output path for scorecard image"),
"exclude": ConfigKey(list, [],
"Path patterns to exclude from scanning"),
"ignore": ConfigKey(list, [],
"Finding patterns to suppress"),
"zone_overrides": ConfigKey(dict, {},
"Manual zone overrides {rel_path: zone_name}"),
}
Key observations:
No active_dimensions config key exists. Review dimensions are hardcoded in DEFAULT_DIMENSIONS and HOLISTIC_DIMENSIONS, or overridden via CLI --dimensions.
Config controls staleness thresholds (review_max_age_days), scorecard generation, exclusions, and zone overrides, but NOT dimension selection.