Repository navigation
fix(ios): name the tree a snapshot refusal's index counts in - #4894
Conversation
Size Report
Startup median (7 runs, lower is better):
|
26a2574 to
832efb8
Compare
A regular snapshot refusal reports `details.index` for the array it just checked. One capture is numbered several times over: the raw acquisition, the tree the Apple runner published, and the tree the host publishes after its own compaction. Nothing said which one a printed index counted in, so the number could not be resolved to a node, while the recovery advice in the same message family points at `snapshot --raw` — a different tree. `IosSnapshotEngineFailureDetails` gains a typed `indexTree`, and every refusal that names a node now carries the tree it was counted in. `validateIosPayload` and `validateIosSnapshotGraph` take it as a parameter, so each call site states the tree it handed over: `acquired`, `presented`, `runner-payload`, or `runner-quality-payload`. A refusal that names no node carries none.
832efb8 to
0a10921
Compare
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
|
The code at 0a10921 is ready, and nothing needs to change before merge. CI is green: the one cancelled Body rules run was superseded by the concurrency setting, and a second Body rules run at the same head passed. Not verified here: the tests were not run and the head was not checked out, and the pass counts in the PR body are the author's own numbers. Not blocking, and fine to take or leave: three of the six call-site labels are not reached by a test (a raw-projection acquired-stage malformed-graph case would cover engine.ts:98, and engine.ts:153 may be unreachable); the quality-payload docs bullet in snapshots.md should say "when details.frame is present", since some refusals carry no frame; and the tree value |
Summary
Fixes #4701.
A regular iOS snapshot refusal reports
details.indexfor the array the engine just checked. One capture is numbered several times over: the raw acquisition, the tree the Apple runner published to the host, and the tree the host publishes after its own compaction. Every renumbering shifts a node, so a bare index could not be resolved — while the recovery advice in the same message family points atsnapshot --raw, a different tree.IosSnapshotEngineFailureDetailsgains a typedindexTree, and every refusal that names a node now carries the tree it was counted in:acquired,presented,runner-payload, orrunner-quality-payload.validateIosPayloadandvalidateIosSnapshotGraphtake it as a parameter, so each call site states the tree it handed over. A refusal that names no node carries none. This is the issue's second option: the first cannot hold, because an interactive refusal is raised in the renumbered tree and the quality payload has no mapping back.Device-free. Docs state how to read the field.
Before / after
Refusing a payload whose escaping row sits at index 3, from the engine seam:
At base the reader cannot tell which numbering index 3 counts; at head it is stated.
Validation
Head
0a10921a88, base55be96bb60.engine.test.tsandrunner-presentation.test.ts.pnpm exec vitest run --project unit-core packages/capture-kit packages/platform-apple test/repo-guards— 3177 passed.pnpm exec tsc --noEmit,pnpm format, and layering node tests pass.🤖 Generated with Claude Code