Commit b9072a7
authored
refactor(operator-trend): extract _build_resolution_trend payload assembly (T3-2 phase 8b, re-landed) (#97)
* refactor(operator-trend): extract _build_resolution_trend payload assembly to its own module (T3-2 phase 8b)
The 1,676-line payload.update({...}) that assembled the 320+ resolution-trend
payload keys moves verbatim into operator_trend_resolution_payload.build_resolution_trend_payload.
The god-function drops 1,852 -> 157 lines: it now reads as a clear pipeline
(run-context -> targets -> apply-chain -> summary-context -> topline payload ->
recovery-tier payload update). The helper re-derives its locals from the
apply-chain / summary-context dicts and takes the three in-module summary
renderers as injected callables (the established no-circular-import pattern;
matches the already-extracted run-context / apply-chain / summary-context /
topline-payload stages).
Pure relocation, proven byte-identical by the characterization net
(tests/test_resolution_trend_golden_contract.py) plus the full suite.
Verify: ruff clean; mypy clean on both files; 2541 passed, 2 skipped.
* refactor(operator-trend): tighten decision_memory_map type to dict[str, dict]
Match the original god-function's annotation (review nit): _decision_memory_map
returns dict[str, dict] and _resolution_targets takes it as dict[str, dict]; the
extracted helper should not widen it to dict[str, Any].1 parent 1952f25 commit b9072a7
2 files changed
Lines changed: 1750 additions & 1704 deletions
0 commit comments