Find how the strict score is presented after a scan in the desloppify codebase. I need to understand:
Where the scan summary/score is printed to the user after a scan completes
How it knows whether subjective dimensions have been scored or are still placeholder
What the current output looks like when presenting the strict score
Look in:
/Users/user_c042661f/Documents/desloppify/desloppify/app/commands/scan/reporting/ (likely summary.py or similar)
/Users/user_c042661f/Documents/desloppify/desloppify/app/commands/scan/cmd.py (the main scan command)
Also check how dimension_scores and subjective_assessments are used in the reporting layer. I need to understand what data is available at report time to compute "X of Y subjective dimensions scored" and "subjective dimensions account for N% of the score".
Read the key files fully - don't just grep snippets.
Assistant
I'll help you understand how the strict score is presented in the desloppify codebase. Let me explore the key files you mentioned.
Assistant
Now let me read the key files:
Assistant
Now let me read the dimensions.py file to see the subjective measures output:
Assistant
Now let me check the scorecard_projection module to understand how subjective entries are determined:
Assistant
Now let me check the integrity module to understand how subjective_review_open_breakdown works:
Assistant
Perfect! Now let me check the state module to understand the score_snapshot function:
Assistant
Now let me look for the scoring functions to see how strict score is calculated:
Assistant
Perfect! Now let me look at an example output or test to see what the actual presentation looks like:
Assistant
Now let me check for test data showing what the scorecard dimensions output looks like:
Assistant
Let me look for tests that call show_scorecard_subjective_measures:
Assistant
Now let me find the specific test to see full example output:
Assistant
Perfect! Now let me look for a test that shows the actual full scorecard with placeholder and stale indicators:
Assistant
Let me look at the code where these indicators are used:
Assistant
Excellent! Now let me get a final look at the complete scoring formula and flow. Let me check how the strict score formula works:
Assistant
Perfect! Now I have all the information I need. Let me create a comprehensive summary document:
Summary: Strict Score Presentation in Desloppify
Based on my thorough analysis of the desloppify codebase, here's how the strict score is presented after a scan completes:
1. Where the Strict Score is Printed
The scan summary/score is printed in /Users/user_c042661f/Documents/desloppify/desloppify/app/commands/scan/cmd.py through the cmd_scan() function:
Flow:
Line 161: show_diff_summary(merge.diff) — prints +new/-resolved/↻reopened counts
Lines 162-169: show_score_delta() — prints the main four-score quartet
Line 173: show_scorecard_subjective_measures() — shows dimension breakdown with placeholders/stale markers
Line 174: show_score_model_breakdown() — shows score recipe and weighted drags
2. The Four-Score Quartet Output
Located in /Users/user_c042661f/Documents/desloppify/desloppify/app/commands/scan/reporting/summary.py, lines 181-206 (_print_score_quartet function):
objective: Mechanical detectors only (no subjective review)
strict: Like overall but wontfix counts against you — the north star metric
verified: Strict but only credits scan-verified fixes
This is printed with color-coding: green for improvements, red for declines, yellow for no change.
3. Subjective Dimensions Presentation
Located in /Users/user_c042661f/Documents/desloppify/desloppify/app/commands/scan/reporting/dimensions.py, lines 103-147 (show_scorecard_subjective_measures function):
─── skipped ─────────────────── (yellow) — not scanned (fast scan)
4. How Subjective Completeness is Determined
The codebase determines whether dimensions have been scored by checking multiple indicators in /Users/user_c042661f/Documents/desloppify/desloppify/engine/planning/scorecard_projection.py, lines 70-132 and 135-193:
A dimension is considered "placeholder" (unscored) if ANY of these are true:
python
placeholder = bool(
assessment_meta.get("placeholder") # Explicit placeholder flag
or (
data.get("score", 0) == 0
and data.get("failing", 0) == 0
and data.get("checks", 0) == 0
)
)
A dimension is "stale" if:
python
stale = bool(
dim_key
and isinstance(assessments.get(dim_key), dict)
and assessments[dim_key].get("needs_review_refresh")
)
Available data at report time:
state["dimension_scores"] — Dictionary with dimension metadata
name — Display name (e.g., "Naming quality")
score — Health score (0-100)
strict — Strict score (0-100)
failing — Number of open issues/review items
checks — Number of checks performed
detectors.subjective_assessment — Metadata for subjective dimensions
placeholder — Boolean flag
dimension_key — Key for looking up in subjective_assessments
state["subjective_assessments"] — Assessment details with needs_review_refresh flags
5. Score Model Breakdown
Located in /Users/user_c042661f/Documents/desloppify/desloppify/app/commands/scan/reporting/presentation.py, lines 117-165 (show_score_model_breakdown):
Stale count — dimensions with needs_review_refresh=true
Files needing review — from subjective_review_open_breakdown()
Current collapsed summary output:
code
Subjective: 3 below target (85%), 1 unassessed, 2 stale, 5 files need review.
Run `desloppify show subjective` for details.
7. Key Data Structures
State scorecard_dimension_entries (lines 47-100 in dimensions.py):
Returns list of entries with fields:
placeholder — Is this dimension unscored?
stale — Does this dimension need re-review?
carried_forward — Was score carried from prior scan?
not_scanned — Was this skipped (fast scan)?
dimension_key — Maps to subjective_assessments for metadata
Subjective entry (scorecard_subjective_entries):
score — Current health score
strict — Current strict score
placeholder — Unassessed flag
stale — Re-review needed flag
cli_keys — Command-line keys for desloppify review --dimensions
8. Integrity Warnings
If subjective dimensions are flagged for anti-gaming (lines 128-179 in summary.py):
code
⚠ Subjective integrity: 2 target-matched dimensions were reset to 0.0 (target 85.0).
Repeated penalty across scans. Use a blind, isolated reviewer...
9. Complete Example Flow in cmd_scan()
python
# Line 161: Print diff
show_diff_summary(merge.diff) # +2 new · -1 resolved
# Lines 162-169: Print scores with deltas
show_score_delta(
runtime.state,
merge.prev_overall, # Previous strict/overall/objective/verified
merge.prev_objective,
merge.prev_strict,
merge.prev_verified,
target_strict=target_value, # e.g., 85.0
)
# Prints: Scores: overall 90.0/100 (+1.5) objective 88.0/100 ...
# Prints: wontfix warning if gap > 5 and wontfix >= 10
# Prints: Score guide on first scan or large gap
# Prints: Target progress if target_strict != None
# Line 173: Show dimensions with placeholder/stale markers
show_scorecard_subjective_measures(runtime.state)
# Line 174: Show score recipe and weighted drags
show_score_model_breakdown(runtime.state)
# Line 178: Show dimension score changes
if new_dim_scores and merge.prev_dim_scores:
show_dimension_deltas(merge.prev_dim_scores, new_dim_scores)
10. The Current Output Looks Like:
code
Scan complete
──────────────────────────────────────────────
+2 new · -1 resolved
Scores: overall 90.0/100 (+1.5) objective 88.0/100 strict 82.0/100 verified 81.0/100
Score guide:
overall = 40% mechanical + 60% subjective (lenient — ignores wontfix)
objective = mechanical detectors only (no subjective review)
strict = like overall, but wontfix counts against you <-- your north star
verified = strict, but only credits scan-verified fixes
Scorecard dimensions (matches scorecard.png):
File health ████████░░░░░░░ 92.0% (strict 90.0%)
Naming quality ██████░░░░░░░░░ 75.0% (strict 75.0%) [unassessed]
Elegance ██████░░░░░░░░░ 80.0% (strict 80.0%) [stale — re-review]
Code quality █████████░░░░░░ 85.0% (strict 85.0%)
Score recipe:
overall = 40% mechanical + 60% subjective
Pool averages: mechanical 92.5% · subjective 80.0%
Biggest weighted drags:
- Naming quality: -5.00 pts (score 75.0%, 30.0% of subjective pool)
Moved:
File health 92.0% → 94.0% (+2.0%) strict: 90.0%→92.0% (+2.0%)
Code quality 82.0% → 85.0% (+3.0%) strict: 82.0%→85.0% (+3.0%)
Subjective: 1 below target (85%), 1 unassessed, 1 stale.
Run `desloppify show subjective` for details.
This comprehensive presentation gives users:
At a glance: The four scores (overall, objective, strict, verified) with deltas
Context: The score recipe showing what drives the north star
Dimension-level detail: Which dimensions are scored vs. unassessed/stale
Action items: Explicit guidance on what to re-review or fix
Anti-gaming safeguards: Integrity warnings if dimensions suspiciously match target