refactor(enrichment): collapse follow-through label/summary builders (Arc F)#42
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Arc F — Renderer simplification (shared-layer DRY)
report_enrichment.pyhad 32 structurally-identical builders:build_follow_through_*_status_label— differed only in mapping key, default status, and labels dict*_summary/checkpointsiblings — differed only in mapping key andNO_*fallback constantCollapsed 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
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.ruff check .clean./code-review(2 independent finders, high effort): clean — 0 findings.Behavior-preserving only. No schema/truth changes.