Parent: #159 Related: #138, #144
Implement correct JSManagedValue conditional clearing before shared precise-GC context groups are available, without pretending the arena reclaimed storage. The bridge must distinguish semantic reachability from physical VM-lifetime allocation.
Acceptance:
- Add a quiescent, cycle-safe reachability walk over every realm root in one
JSContextGroupRef, traversing all strong runtime cell kinds and ignoring WeakRef/weak-collection edges. - Publish a collection epoch for
JSGarbageCollectso managed values clear only after an explicit collection point, not merely on property access. - Keep managed values alive while any registered owner relation exists; owner death and exact add/remove pairs must update this state without retain cycles.
- Clear an unowned
JSManagedValueafter collection when unreachable, while preserving targets reachable from globals, closures, promises/microtasks, modules, and sibling realms. - Add focused C/Zig reachability tests plus Objective-C forced-GC/system-JSC differential rows and fault-injection rollback tests.
- Document that semantic weak clearing is immediate at the collection epoch even though arena storage is physically reclaimed only at VM teardown.