Skip to content

fix(ios): name the tree a snapshot refusal's index counts in - #4894

Merged
thymikee merged 1 commit into
mainfrom
t3/fix-snapshot-refusal-index
Nov 21, 2026
Merged

thymikee merged 1 commit into
mainfrom
t3/fix-snapshot-refusal-index

Conversation

@thymikee

@thymikee thymikee commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes #4701.

A regular iOS snapshot refusal reports details.index for 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 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: acquired, presented, runner-payload, or runner-quality-payload. validateIosPayload and validateIosSnapshotGraph take 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:

base: {"reason":"regular-node-outside-cumulative-clip","index":3,"frame":{…},"clip":{…}}
head: {"reason":"regular-node-outside-cumulative-clip","index":3,"indexTree":"runner-payload","frame":{…},"clip":{…}}

At base the reader cannot tell which numbering index 3 counts; at head it is stated.

Validation

Head 0a10921a88, base 55be96bb60.

  • New tests fail at base, pass at head: 5 failed / 30 passed across engine.test.ts and runner-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.
  • No device run; CI owns the full gate.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.48 MB 6.48 MB +216 B
Package (unpacked) 6.48 MB 6.48 MB +216 B
Package (download) 1.97 MB 1.97 MB +40 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 21.8 ms 22.5 ms +0.7 ms
CLI --help 47.8 ms 46.0 ms -1.8 ms

@thymikee
thymikee force-pushed the t3/fix-snapshot-refusal-index branch from 26a2574 to 832efb8 Compare November 21, 2026 11:55
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.
@thymikee
thymikee force-pushed the t3/fix-snapshot-refusal-index branch from 832efb8 to 0a10921 Compare November 21, 2026 12:01
@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 0a10921

No open findings.

Reviewed with this repository's own Sentinel configuration (55be96bb6018).

💬 Talking to Sentinel

In a finding's thread, reply with:

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.

@thymikee

Copy link
Copy Markdown
Member Author

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 presented overlaps with the existing presented stage vocabulary, so a rename such as published could be a follow-up.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 21, 2026
@thymikee
thymikee merged commit 8fc4c43 into main Nov 21, 2026
22 of 23 checks passed
@thymikee
thymikee deleted the t3/fix-snapshot-refusal-index branch November 21, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

snapshot: a refusal's details.index names a node in a tree the caller cannot list

1 participant