refactor(operator-trend): collapse churn builders onto a parametrized base (T3-2 phase 6b)#83
Merged
Conversation
… 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.
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.
What
Second structural collapse, same proven pattern as the persistence base (#82). The
rebuildandrererestorechurn 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
rerererestoredelegation wrapper, and all callers are untouched.Verified (three proofs)
rebuild/rererestorechurn builders vs. base+spec over the net's corpus → byte-identical for both tiers, before touching the file.mainafter the collapse — a correct collapse changes no output.2539 passed, 2 skipped.ruff check src/ tests/clean;mypyon edited source clean.Campaign progress
Two of four clean rebuild↔rererestore families now collapsed (persistence #82, churn this).
refresh_recoveryandhotspotsremain, same pattern.