Findings G-H5, G-M10, V-M8 in DEEP_ANALYSIS.md (parent #261).
src/easyscience/global_object/map.py:
- G-H5 (lines 164-178, 218-220):
add_vertex deletes a stale __type_dict entry on name reuse but never detaches the old object's finalizer; prune_type_dict deletes by name only, so when the old object is later collected it silently removes the new object's type/adjacency entry. Map._clear() (lines 326-334) clears dicts without detaching finalizers — heavily used in tests, so cross-test contamination is realistic.
- G-M10 (lines 180-184, 218-220): edges to collected objects are never pruned — adjacency lists keep dangling names;
classTools.generatePath then crashes on get_item_by_key.
- V-M8 (
descriptor_base.py:266-269, new_base.py:83-87, based_base.py:94-97): unique_name setters assign before validating; on collision the object claims a name the map attributes to a different object. Renaming also registers the new name without removing the old — object registered under both names with two live finalizers.
Fix: detach finalizers on re-registration and in _clear(); have finalizers verify identity (name -> expected ref) before pruning; prune inbound edges on removal; validate-then-assign in the setters.
Findings G-H5, G-M10, V-M8 in DEEP_ANALYSIS.md (parent #261).
src/easyscience/global_object/map.py:add_vertexdeletes a stale__type_dictentry on name reuse but never detaches the old object's finalizer;prune_type_dictdeletes by name only, so when the old object is later collected it silently removes the new object's type/adjacency entry.Map._clear()(lines 326-334) clears dicts without detaching finalizers — heavily used in tests, so cross-test contamination is realistic.classTools.generatePaththen crashes onget_item_by_key.descriptor_base.py:266-269,new_base.py:83-87,based_base.py:94-97):unique_namesetters assign before validating; on collision the object claims a name the map attributes to a different object. Renaming also registers the new name without removing the old — object registered under both names with two live finalizers.Fix: detach finalizers on re-registration and in
_clear(); have finalizers verify identity (name -> expected ref) before pruning; prune inbound edges on removal; validate-then-assign in the setters.