Skip to content

refactor(enrichment): collapse follow-through label/summary builders (Arc F)#42

Merged
saagpatel merged 1 commit into
mainfrom
refactor/followthrough-label-collapse
Jun 6, 2026
Merged

refactor(enrichment): collapse follow-through label/summary builders (Arc F)#42
saagpatel merged 1 commit into
mainfrom
refactor/followthrough-label-collapse

Conversation

@saagpatel

Copy link
Copy Markdown
Owner

Arc F — Renderer simplification (shared-layer DRY)

report_enrichment.py had 32 structurally-identical builders:

  • 16 build_follow_through_*_status_label — differed only in mapping key, default status, and labels dict
  • 16 *_summary/checkpoint siblings — differed only in mapping key and NO_* fallback constant

Collapsed the duplicated logic into two shared helpers (_follow_through_status_label, _follow_through_summary) driven by two module-level data tables (_FOLLOW_THROUGH_STATUS_LABELS, _FOLLOW_THROUGH_SUMMARIES). All 32 public names remain as thin delegating wrappers → zero API change (web_export, reporter, excel_review_queue_table_helpers, github_projects, and same-file callers untouched).

Safety

  • Characterization tests first: tests/test_report_enrichment_follow_through_labels.py (97 cases) pins every builder's output. Spec table transcribed independently from the pre-refactor source, so a mis-wired key/default/label/constant fails the net.
  • Char tests pass against both old and new code → behavior preserved.
  • Full suite: 2319 passed, 2 skipped. ruff check . clean.
  • /code-review (2 independent finders, high effort): clean — 0 findings.

Behavior-preserving only. No schema/truth changes.

…rs into data-table helpers

The 16 build_follow_through_*_status_label builders were structurally
identical (differing only in mapping key, default status, and labels dict),
as were the 16 *_summary/checkpoint siblings (differing only in mapping key
and NO_* fallback constant). Collapse the duplicated logic into two shared
helpers (_follow_through_status_label, _follow_through_summary) driven by two
module-level data tables. All 32 public function names remain as thin
delegating wrappers -> zero API change.

Characterization tests added first (tests/test_report_enrichment_follow_through_labels.py,
97 cases pinning every builder's output) and pass against both old and new
code, proving behavior preservation. Full suite 2319 passed, ruff clean.
@saagpatel
saagpatel merged commit eafff40 into main Jun 6, 2026
2 checks passed
@saagpatel
saagpatel deleted the refactor/followthrough-label-collapse branch June 6, 2026 08:29
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