refactor(operator-trend): collapse _side_from_status clone family (T3-2 phase 2)#76
Merged
Merged
Conversation
…ontract Pin the exact current output of every pure (status:str)->str classifier in the restore-tier depth machinery (30 functions x 265 status inputs) to a golden file, generated by executing the modules. Safety net for the upcoming recovery_state depth-collapse: any change to depth-tier translation surfaces as a byte diff before it can reach a consumer.
…itive The four restore-tier translation shims hand-spelled every depth-shifted output string (restore <-> rerestore <-> rererestore <-> rerererestore), cloning the tier arithmetic four ways. Replace the spelled-out value maps with a single _shift_restore_tier(token, delta) primitive plus recognized-input sets; the shims become thin delegators. Proven byte-identical by the restore-tier golden contract (30 classifiers x 265 inputs). First scalar-primitive slice of the operator_resolution_trend fractal collapse.
…olve_side Seventeen reset/reentry/rebuild/restore side classifiers each hand-spelled a confirmation member set plus its clearance mirror (the same strings with the side word swapped), cloning identical control flow seventeen ways. Replace them with a shared _resolve_side(status, *confirmation_members) helper that derives the clearance mirror once (cached); each classifier is now a one-line delegator. Proven byte-identical by the restore-tier golden contract + full suite. Second scalar-primitive slice of the operator_resolution_trend fractal collapse.
…r-trend-side-collapse
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.
Supersedes #75 (auto-closed when its stacked base branch was deleted on #74 merge). Same change, now based on
mainwhich already contains phase 1 (#74).What
Seventeen
_side_from_statusclassifiers in the reset/reentry/rebuild/restore families each hand-spelled a confirmation-member set and its clearance mirror (the same strings with the side word swapped), cloning identical control flow seventeen ways. Replaced with a shared_resolve_side(status, *confirmation_members)helper that derives the clearance mirror once (cached vialru_cache). Each classifier is now a one-line delegator.How (and the safety in it)
Mechanical AST transform that read each confirmation set straight from source (no hardcoding) and asserted behavioral equivalence before writing:
(clearance - confirmation) == (mirror(confirmation) - confirmation), which holds even for the one set containing a confirmation-only token (just-rererestored). Transform script run once and removed.Proof
ruff check: clean.operator_resolution_trend.pyonly.Follow-ups (not here)