Skip to content

refactor(operator-trend): collapse churn builders onto a parametrized base (T3-2 phase 6b)#83

Merged
saagpatel merged 1 commit into
mainfrom
refactor/operator-trend-collapse-churn
Jun 20, 2026
Merged

refactor(operator-trend): collapse churn builders onto a parametrized base (T3-2 phase 6b)#83
saagpatel merged 1 commit into
mainfrom
refactor/operator-trend-collapse-churn

Conversation

@saagpatel

Copy link
Copy Markdown
Owner

What

Second structural collapse, same proven pattern as the persistence base (#82). The rebuild and rererestore churn builders are one algorithm differing only in the per-event freshness/reset keys, three reason strings, and output keys. Extract _churn_for_target_base + a _ChurnTierSpec; both public builders become thin wrappers that pass their spec.

−40 net lines. Public signatures unchanged, so the apply-chain wiring, the rerererestore delegation wrapper, and all callers are untouched.

Verified (three proofs)

  1. Differential test — real rebuild/rererestore churn builders vs. base+spec over the net's corpus → byte-identical for both tiers, before touching the file.
  2. Composer golden byte-identical to main after the collapse — a correct collapse changes no output.
  3. Full suite green2539 passed, 2 skipped.

ruff check src/ tests/ clean; mypy on edited source clean.

Campaign progress

Two of four clean rebuild↔rererestore families now collapsed (persistence #82, churn this). refresh_recovery and hotspots remain, same pattern.

… base (T3-2 phase 6b)

Second structural collapse, same pattern as the persistence base (#82): the rebuild
and rererestore churn builders are one algorithm differing only in the per-event
freshness/reset keys, reason prose, and output keys. Extract _churn_for_target_base
+ a _ChurnTierSpec; both public builders become thin wrappers passing their spec.

Public signatures unchanged -> apply-chain wiring, the rerererestore delegation
wrapper, and all callers untouched. Net -40 lines.

Verified: differential test (real builders vs base+spec over the net corpus,
byte-identical both tiers) + composer golden byte-identical to main + full suite
(2539 passed). ruff + mypy clean.
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