mirror of
https://github.com/zvx-echo6/meshai.git
synced 2026-08-26 17:31:34 +00:00
chore(central-ripout 2d-i): relocate the fire engine + renderer out of central/ (#164)
Moves the last two live files out of the retired-Central folder. central/ is now EMPTY and deleted entirely (incl. __init__.py). - fire-fusion engine (ingest_hotspot_pixel + the growth/cluster/spotting engine) → env/fire_fusion.py, next to its sole consumer env/firms.py. - wildfire text renderer (_render + its live helpers) → env/fire_render.py. THE COUPLING RESOLVED: firms_handler._handle_pass_boundary had a LAZY import inside a function body — `from meshai.central.wfigs_handler import _render` — sitting on the live FIRMS fire-growth path. It is now a normal top-of-file import (`from meshai.env.fire_render import _render`), visible and greppable. PURE MOVE — no behavior change: - The parity oracle (test_fire_refactor.py) PASSES UNCHANGED (only its import paths updated) — proving the fire wire output is byte-for-byte identical before and after. Fire alerts say exactly what they said. - handle_firms / handle_wfigs (dead entrypoints, only caller was the deleted consumer.py) were KEPT and moved rather than dropped — the wording-cleanup PR removes them deliberately. "When unsure, keep." - fire_render.py's geo-helper imports still point at central_normalizer — that file's split is a SEPARATE PR; carried the imports along, did not touch it. Consumers + test import paths rewired. Full suite: 2059 passed, 0 failed. Co-authored-by: Matt Johnson <mj@k7zvx.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
dd932b4ee9
commit
de91751bbc
19 changed files with 97 additions and 72 deletions
|
|
@ -3,6 +3,13 @@ must be importable without error after the budget shim refactor.
|
|||
|
||||
This guards against a broken import chain (e.g. circular imports or a bad
|
||||
re-export in the shim) that would silently break all handlers.
|
||||
|
||||
chore/ripout-2d: the last two central/ handlers (firms_handler.py,
|
||||
wfigs_handler.py) relocated to meshai/env/fire_fusion.py + fire_render.py
|
||||
(central/ has no *_handler.py left -- the fusion engine's only consumer is
|
||||
the native env/firms.py adapter). The glob below now also covers those two
|
||||
explicitly so this guard still exercises the relocated live import chain;
|
||||
it keeps globbing central/ too in case a future handler lands back there.
|
||||
"""
|
||||
|
||||
import glob
|
||||
|
|
@ -11,17 +18,16 @@ import os
|
|||
|
||||
|
||||
def _handler_modules():
|
||||
"""Collect meshai.central.*_handler module names by globbing the source tree."""
|
||||
pattern = os.path.join(
|
||||
"""Collect handler-ish module names: meshai.central.*_handler (glob) +
|
||||
the fire-fusion modules relocated out of central/ during the ripout."""
|
||||
central_pattern = os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
"..", "meshai", "central", "*_handler.py",
|
||||
)
|
||||
paths = sorted(glob.glob(pattern))
|
||||
assert paths, "No *_handler.py files found — check the glob path"
|
||||
modules = []
|
||||
for p in paths:
|
||||
name = os.path.basename(p)[:-3] # strip .py
|
||||
modules.append(f"meshai.central.{name}")
|
||||
central_paths = sorted(glob.glob(central_pattern))
|
||||
modules = [f"meshai.central.{os.path.basename(p)[:-3]}" for p in central_paths]
|
||||
modules += ["meshai.env.fire_fusion", "meshai.env.fire_render"]
|
||||
assert modules, "No handler-ish modules found — check the glob path"
|
||||
return modules
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue