test(ios): add a shared AX recovery conformance fixture with a host adapter - #2425
Conversation
Size Report
Startup median (7 runs, lower is better):
|
|
Reviewed 509bc1c against #2424 and both capture producers. The shared fixture is the right direction, and I found no runtime regression in the production extraction. I would address these before merging: [P1] Assert the recovered tree, not only its maximum depthThe host assertions and runner assertions check outcome, counts and deepest level, but not which nodes survived or their structure. Verified counterexample: in a temporary copy of the host materializer, I discarded every sibling except the first after recovery. Every applicable shared host case still passed (11 executed; 3 marked not applicable). A capture can therefore lose branches and still satisfy this conformance suite as “complete.” Please assert a compact canonical tree signature covering ordered node identities and parent relationships, plus retained node count. Include successful multi-branch recovery and the expected retained tree for bounded captures, with producer-specific expectations where necessary. Prove dropped, duplicated and reordered siblings fail. This is central to #2424's completeness contract. [P2] Remove or exercise the unused hint-outcome fieldsThe hint loop reads Either drive the real recovery-to-learning transition with these inputs and assert its observations, or delete the unused fields and narrow the case names/claims to direct memory-state tests. Preserve the runner's current behavior of learning a lower accepted rung even from bounded recovery; this characterization PR need not change that policy. Scope cleanupThe actual diff is 1,551 gross lines (1,512 additions + 39 deletions), above the repository's 1,000-line PR budget. Please reduce unnecessary fixture/schema scaffolding or split the memory characterization into a separate cohesive PR. Keep meaningful recovery coverage rather than compressing JSON just to lower the count. Validation: compiled and ran the standalone host fixture, then repeated it with the sibling-loss mutation. I did not run the native Swift suite locally. No repository source files were changed. |
509bc1c to
2ac55a1
Compare
|
Re-reviewed
One small cleanup from the split: CI on this exact head is still running, with no reported failures so far. Code looks ready once CI is green; the above is documentation cleanup, not a new runtime blocker. |
|
The host-only correction at 2ac55a1 addresses the tree-completeness findings; the smaller scope also reduces packaged growth to 831 B. Please update the README and ADR to mark the runner adapter as pending, as noted above. Merge #2414 first; this slice does not yet complete two-producer conformance. CI on the new head is still running. |
|
Addressed on P1 (tree structure). Every recovery expectation now carries P2 (unused hint fields). The runner memory test now drives the real transition: each hint step builds a chain that fits the accepted rung ( Scope. Split by producer: this PR keeps the fixture and the host adapter (904 lines, 720 of them fixture); #2428 carries the runner seam, the Swift adapter, and the memory characterization; #2427 rebases on top and adds the host hint column (its hint cases now run through the source adapter rather than the unit). |
…dapter Add contracts/fixtures/ios-ax-recovery-conformance.json, a shared executable recovery contract for the host AX bridge and the XCTest runner's private AX bridge. Every expectation names the outcome, the native request accounting, and the delivered tree as a canonical preorder signature with its retained node count, so a producer that drops, duplicates, reorders, or re-parents nodes cannot pass as complete. The fixture records per-producer expectations and documents the intentional differences (depth vocabulary, ladders, frontier evidence, budgets, ownership and deadlines, hint lifetime). The host adapter is an Objective-C driver over captureSnapshotTree, compiled and run per case by native-runtime.test.ts. The runner adapter and the accepted-depth memory characterization follow in a stacked PR.
2ac55a1 to
d9a3c2a
Compare
|
Docs and body reconciled at |
|
Summary
Adds
contracts/fixtures/ios-ax-recovery-conformance.json, a shared executable recovery contract for the host AX bridge and the XCTest runner's private AX bridge. Fifteen recovery cases (569 fixture lines; hint cases arrive with the runner adapter in #2428) cover zero-based depth versus native levels, node budgets, complete/withheld/unknown frontier evidence, missing live elements, owner change, request exhaustion, deadline, explicit raw depth, hinted first requests, and multi-branch recovery. Every expectation names the outcome, the native request accounting, the deepest level, and the delivered tree as a canonical preorder signature with its retained node count, so a producer that drops, duplicates, reorders, or re-parents nodes cannot pass as complete. Expectations are per producer, and the fixture documents the intentional differences instead of averaging them away.This PR carries the host adapter: an Objective-C driver over
captureSnapshotTree, compiled and run per case bynative-runtime.test.ts. The runner adapter and the accepted-depth memory characterization follow in #2428, which executes the fixture'srunnercolumn and adds the hint cases; README and ADR 0004 mark the runner adapter as pending until then.First step of #2424, stacked on #2414; no runtime behaviour change. Five files, 903 lines (569 fixture).
Validation
Tested head:
d9a3c2afa9.pnpm check:affected --run --base origin/fix/ios-ax-depth-recoverypassed.native-runtime.test.ts.multi-branch-recovery,runner-extension-budgetred; duplicate the last sibling → 8 cases red (signature and node count); reverse siblings → 2 red. Also: missing boundary child count accepted → 7 red; request budget 33 → 3 red; native levels off by one → 8 red.