Skip to content

Stage D: apply the two must-fix resolution-floor / resolved-tag constants - #343

Merged
WilfordGrimley merged 1 commit into
masterfrom
worktree-agent-a0ad3d248f75b6bb6
Jul 23, 2026
Merged

Stage D: apply the two must-fix resolution-floor / resolved-tag constants#343
WilfordGrimley merged 1 commit into
masterfrom
worktree-agent-a0ad3d248f75b6bb6

Conversation

@WilfordGrimley

Copy link
Copy Markdown

Summary

  • Owner-ruled must-fix (2026-07-22, docs/pipeline-fidelity-gate.md SS3): applies the two remaining MISSING knowledge-inventory constants to Stage D's _eligible_cards_queryset (local_calculate_verdicts.py), shared by both the join-key and fallback calculators.
  • RESOLUTION_FLOOR_DPI = 200 excludes cards whose source image sits below the pilot's empirically-validated resolution floor. Implemented as .exclude(Q(dpi__lt=200) & Q(dpi__isnull=False)), not a bare .exclude(dpi__lt=200) — the bare form is not null-safe (NOT (dpi < 200) evaluates to NULL, not TRUE, for a NULL dpi under SQL's three-valued logic, so it would silently drop a null-dpi card too). Card.dpi is a DB-level NOT NULL column today (confirmed live: 0 nulls), so this only matters if that constraint ever moves — guarded anyway per the task spec.
  • EXCLUDED_RESOLVED_TAGS = ["custom-art", "non-english"] excludes cards already tagged either, via the same tags__contains mechanism the live pilot's own _eligible_base_queryset uses.
  • Constant Simplify flag icons: static SVG assets instead of hand-rolled geometry #3 (the deductive-backfill exclusion) is unaffected — it was separately ruled NOT restored the same day (PR Add Stage D fallback channel calculator (pre-fire prep) #341) and this PR does not touch that decision.
  • Sizing (verified live 2026-07-22T23:47Z, cited in the task): the two excludes remove 28 (dpi) + 47 (custom-art) + 0 (non-english) = 75 non-overlapping cards from the current 179,766-card eligible pool (0.042%).
  • Both constants are duplicated as module-level literals in local_calculate_verdicts.py (not imported from local_identify_printing_tags), matching this module's own established "avoid a hard import-time dependency between sibling engines over one constant" convention.
  • See docs/pipeline-fidelity-gate.md SS3 for the full gate status this closes out (not edited in this PR — Dumont owns that doc this cycle in Ratify pipeline-fidelity gate artifact-1 parity-replay outcome #342).

Test plan

  • pytest cardpicker/tests/test_local_calculate_verdicts.py — 84 passed (new TestEligibleCardsQueryset class: below-floor excluded, dpi==200 boundary included, null-dpi included, custom-art/non-english tagged excluded, untagged/differently-tagged included)
  • pytest cardpicker/tests/test_local_calculate_verdicts.py cardpicker/tests/test_review_cluster_views.py cardpicker/tests/test_review_clusters.py cardpicker/tests/test_reparse_collector_evidence.py cardpicker/tests/test_local_detect_ai_art.py cardpicker/tests/test_local_identify_printing_tags.py — 413 passed (every module that touches this queryset or its sibling)
  • pre-commit (ruff/isort/black/mypy/prettier) — all green on the commit
  • Full-catalog Stage D fire — separate, owner-gated prod step, not part of this PR

🤖 Generated with Claude Code

@WilfordGrimley
WilfordGrimley merged commit 6c55dc0 into master Jul 23, 2026
3 checks passed
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