refactor(operator-trend): collapse rererestore tier shims + golden net (T3-2 phase 1)#74
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.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e71c85e97
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if _STATUS_TOKEN.match(value) and len(value) <= 80: | ||
| harvested.add(value) |
There was a problem hiding this comment.
Regenerate the harvested golden
With the current tree, rerunning this enumerator no longer reproduces the committed recovery_state_contract.golden.json: the broad literal harvest now picks up the new restore-tier helper literals (re, store, stored, storing), increasing the vocabulary from 265 to 269 inputs and adding rows for every classifier. Please either regenerate and commit the updated golden or filter those non-status implementation literals, otherwise the documented regeneration command always creates an unrelated diff before any behavior change is made.
Useful? React with 👍 / 👎.
What
First phased slice of the
operator_resolution_trendrestore-tier fractal collapse.Two commits:
(status: str) -> strclassifier in the restore-tier machinery (30 functions × 265 status inputs, 1,437 non-trivial mappings) to a golden file, generated by executing the modules. This is the safety net for the whole collapse: any change to depth-tier translation surfaces as a byte-level diff before it can reach a consumer.*_rererestore_*translation shims hand-spelled every depth-shifted output string (restore ↔ rerestore ↔ rererestore ↔ rerererestore), cloning the tier arithmetic four ways. Replaced the spelled-out value maps with one_shift_restore_tier(token, delta)primitive + recognized-input sets; the shims are now thin delegators.Why
The restore-tier machinery is a hand-cloned depth fractal — each tier was bolted on by duplicating the prior tier's strings + arithmetic. Centralizing the tier arithmetic in one primitive removes the error-prone value-cloning and establishes the parametric building block the later phases reuse.
Proof
ruff check: clean.ignore = ["E501"], no CI formatter).Scope / follow-ups (not in this PR)
_side_from_statusfamily (~19 structural clones) onto a shared_resolve_side(status, *confirmation_members)helper._rerererestore_texttransform was left as-is — it's a lone DRY function with no depth-sibling clone to collapse against.