Skip to content

refactor(operator-trend): collapse rererestore tier shims + golden net (T3-2 phase 1)#74

Merged
saagpatel merged 3 commits into
mainfrom
refactor/operator-trend-collapse
Jun 19, 2026
Merged

refactor(operator-trend): collapse rererestore tier shims + golden net (T3-2 phase 1)#74
saagpatel merged 3 commits into
mainfrom
refactor/operator-trend-collapse

Conversation

@saagpatel

Copy link
Copy Markdown
Owner

What

First phased slice of the operator_resolution_trend restore-tier fractal collapse.

Two commits:

  1. Golden characterization net — pins the exact current output of every pure (status: str) -> str classifier 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.
  2. Scalar tier-translation collapse — the four *_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

  • Restore-tier golden contract: 31 passed, byte-identical before/after the collapse.
  • Full suite: 2,493 passed, 2 skipped (1 pre-existing unrelated warning).
  • ruff check: clean.
  • Diff is the logical change only (+94/−69) — the harness auto-formatter's unrelated reflow of pre-existing long lines was deliberately excluded (project sets ignore = ["E501"], no CI formatter).

Scope / follow-ups (not in this PR)

  • Phase 2: collapse the _side_from_status family (~19 structural clones) onto a shared _resolve_side(status, *confirmation_members) helper.
  • Phase 3: the dict-helper composers + deletion of the per-depth clone modules and their mirror tests.
  • The prose _rerererestore_text transform was left as-is — it's a lone DRY function with no depth-sibling clone to collapse against.

…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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +82 to +83
if _STATUS_TOKEN.match(value) and len(value) <= 80:
harvested.add(value)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@saagpatel saagpatel merged commit f0c10fd into main Jun 19, 2026
3 checks passed
@saagpatel saagpatel deleted the refactor/operator-trend-collapse branch June 19, 2026 17:34
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