-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
⚠️ Issue: Mutable Configuration State (Runtime Map Corruption)
The _CONDUIT_MAP is currently stored as a standard Python dictionary/list. In a MultiThreadedExecutor, there is a risk—however small—that a logic error or a "rogue" thread could modify the paths, active flags, or collection points during runtime. This would lead to non-deterministic harvesting errors that are nearly impossible to trace.
🎯 Location:
robot/vtc/pump.py -> self._CONDUIT_MAP
🦠 Symptoms:
- A sensor suddenly stops updating because its "path" was accidentally modified in memory.
KeyErrorexceptions mid-mission for keys that passed the "Smoke Test."- Memory bloat if the map is being reconstructed unnecessarily.
🩺 Diagnosis:
- Python dictionaries are Mutable. While we trust our own code, "Defensive Programming" dictates that static configurations should be stored in immutable structures. This prevents any part of the program from changing the "Rules of the Game" after the game has started.
💡 Proposal:
Immutable Conduit Mapping
Once the YAML is validated and the "Fail-Fast" check passes, convert the internal conduit mapping into an immutable structure.
- NamedTuples or MappingProxy: Use
collections.namedtuplefor individual conduit entries andtypes.MappingProxyTypefor the top-level dictionary. - Tuple-Based Paths: Ensure the
path(the list of keys) is converted from alistto a tuple. - Read-Only Enforcement: If any code tries to write to
self._CONDUIT_MAPafter initialization, Python will raise anAttributeErrorimmediately.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Projects
Status
Todo