refactor(operator-trend): collapse remaining recovery-tier payload onto the data emitter (T3-2 phase 8d)#100
Conversation
…to the data emitter (T3-2 phase 8d) Sweeps the rest of the payload assembly onto the generic emitter from phase 8c: all 316 primary_target-ternary / passthrough entries become one _RESOLUTION_PAYLOAD_ENTRIES table (out_key, source_name, is_ternary), the re-derivation preamble is deleted (the emitter resolves sources straight from apply_chain), and build_resolution_trend_payload drops from ~1,740 to 47 lines. Only the 4 genuinely-irregular entries stay explicit: the three summary-fn renderers and the bare decision_memory_map. The operator_trend...rererestore payload fractal -- ~1,676 lines of hand-cloned ternaries -- is now a 14-line loop over an auditable data table. Byte-identical by construction and proven by the characterization net. Verify: net byte-identical; ruff + mypy clean; 2541 passed, 2 skipped.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b29bbb48e
ℹ️ 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".
| _emit_resolution_payload_entries( | ||
| payload, | ||
| primary_target=primary_target, | ||
| sources=sources, | ||
| entries=_RESET_REENTRY_REBUILD_TIER_ENTRIES, | ||
| entries=_RESOLUTION_PAYLOAD_ENTRIES, |
There was a problem hiding this comment.
Preserve payload insertion order
Because the explicit payload.update() now runs before the generic emitter, the three summary keys and decision_memory_map are inserted before all 316 table-driven keys instead of staying in their previous in-place/end positions. The control-center artifacts serialize this nested payload with json.dumps(..., indent=2) without sort_keys in src/cli.py, so this no-op refactor will churn generated operator-control-center JSON ordering even when values are unchanged; the existing golden check misses this because it only compares key sets/values.
Useful? React with 👍 / 👎.
What
The sweep that finishes the payload collapse. Converts all remaining A/B entries onto the generic emitter from #99: the payload contract becomes one
_RESOLUTION_PAYLOAD_ENTRIEStable of 316(out_key, source_name, is_ternary)rows, the re-derivation preamble is deleted, andbuild_resolution_trend_payloaddrops from ~1,740 → 47 lines.The result
Only the 4 genuinely-irregular entries stay explicit — the three summary-fn renderers (
class_transition_health_summary,class_transition_resolution_summary,closure_forecast_hysteresis_summary) and the baredecision_memory_map. The 27 now-dead source unpacks are pruned; the 3 still referenced by the OTHER entries stay.Faithfulness
Byte-identical by construction — the conformance proof verified every one of the 316 entries matches the emitter's two patterns (get-key included), so the table regenerates the identical expressions. The full ordered table is sourced from the original inline dict (#97), so output key ordering is preserved too.
Proof
tests/test_resolution_trend_golden_contract.py) → byte-identical greenuv run pytest -q→ 2541 passed, 2 skippedruff check src/ tests/→ clean (no F841) ·mypy→ cleanArc (T3-2 god-function decomposition)
After this, the payload assembly is a data table — the T3-2 fractal thesis, landed.