A140: Construction Tracking Release
Temporary constructor tracking must not retain structs after an action returns nil or rejects its result. Cleanup releases those scratch references at the evaluation boundary.
Mechanism and Invariants
Successful, nil and failed action results, predicates and bindings release construction tracking. Go clears discarded backing tails as well as truncating length; TypeScript uses finalization cleanup. Returned values and environment-held values retain their identity and ownership. Clearing bookkeeping cannot clear the actual returned object.
Scope and State
Default closure, VM, generated Go Node/typed direct/conversion and TypeScript evaluation paths. Generated parsers have no stream API, but still need evaluation cleanup.
Reference Control
No maintained same-source cleanup-disable comparator exists.
Evidence and Implementation
Historical record 068 records about 15 MiB of extra live heap from retained temporary construction tracking in a discard-heavy stream. Cleanup keeps sampled 20k-to-60k growth at 0–6 KiB and reduces focused stream allocations. Ordinary batch allocation is unchanged and some generated timings cost more. TypeScript semantics pass but timing is unmeasured. Adoption protects ownership and bounded tracking rather than promising every action is faster.
Evidence records: 068.
Source owners: constructor tracking cleanup, VM evaluator cleanup, generated construction tracking, typed tracking, TypeScript cleanup.
The comparison policy distinguishes same-source controls, historical changes and full checkpoints.