test: reproduce native import retention without managed caller

This commit is contained in:
Joseph Doherty
2026-11-10 17:39:00 -05:00
parent 041189aa6d
commit 1298ecc194
14 changed files with 619 additions and 29 deletions
@@ -177,3 +177,29 @@ from Apple caching; a later independently owned public-Apple sequence could be
justified then. A flat result would not by itself prove a managed bug: omitted
managed parsing/matching, registry bookkeeping or lifetime differences remain. No
production implementation or additional experiment is approved by this design.
## Association-driven correction after attempt A
Attempt A's exact original source is preserved with its failed receipts. The
revised child retains all nine native wrapper copies but treats successful null
results as unassociated, as the installed TrackItem does. Only non-null copies
whose type, pointer and private generated path match the owned keychain create a
logical owner. A previously tracked item's missing association at release fails;
no owner is silently decremented. A copy of a retired keychain cannot consume a
registry owner. Explicit fallback cleanup remains a failed diagnostic outcome.
The initial import-state owner is still released after original-certificate
disposal. The actual last owner determines when the native delete and original
CFRelease happen: import-state release if no item owner remains, otherwise the
actual final tracked-item Untrack while its copy and item references remain
alive. The receipt records that exact stage, live CF ownership at delete, and
each copy's logical owner/native owner state before and after. The collector
independently reconstructs the transitions from observed associations; it does
not assume identity/copied-cert association or a fixed non-null count. Leaf
identity checks remain first/last, and all returned CF outputs must reconcile.
This correction changes only the diagnostic ownership model. It does not alter
the pinned bridge, imported material, fixed count, native calls, limits,
permissions, cleanup, or production. The corrected code passed a separate Astra gate and coordinator serialization
clearance before one fresh fixed-200 attempt. [Attempt B results](NATIVE_IMPORT.md)
record its actual association/deletion order and native inventory outcome.