Repository navigation
Commit 45125d7
authored
refactor(ios): give each snapshot capture step its penalty authority (#3947)
* refactor(ios): give each snapshot capture step its penalty authority
EffectiveSnapshotCapturePlan carried a backend array, the channel state, a
tree-slice budget override, and a pin in parallel. Whether the first step was
the periodic probe was inferred from position, and the penalty recorder
accepted a channel state defaulted to .normal, so a caller that ran a bounded
recovery attempt but forgot its state could re-arm the penalty it was
recovering from - the #3896 bug class, still reachable at the interface.
A factory-built SnapshotCaptureStep now carries the backend together with its
execution mode. captureWithBackend returns the attempt carrying that step; the
recorder takes the attempt plus the warmup exemption and no other policy
arguments. Only an ordinary attempt has an arming branch; only an accepted
completed bounded recovery can clear the penalty early. Plan shapes, the
selection-cause slots from #3916, the in-band claim after the occupied skip,
and SnapshotXCTestChannelPenalty as the sole expiry owner are unchanged. The
channel policy and its verdict helpers move to a named policy file.
* refactor(ios): encode the probe claim in the step factory
Bind the periodic-probe claim to an XCTest-backed leading step at the factory,
so the mode cannot hand claim authority to a non-XCTest step. Align the
warmup-exemption and claim-ordering comments with the code, and drop repeated
narration of the step-carries-authority constraint.
* refactor(ios): keep snapshot channel policy at constraint-only comments
Collapse the step's execution mode into the step itself, drop the accessors the
step made redundant, and trim the moved policy's comments to constraints the
code cannot show. Net production lines vs main now shrink.
* refactor(ios): shrink snapshot channel policy below its removed surface
Merge the plan construction into one site, drop the step factory and the
plan accessor the steps made redundant, and cut narration to the
constraints the code cannot show.
* refactor(ios): drop the pin doc sentence the step type already decides
A tree pin stays an ordinary attempt and can arm the penalty; only the
private-AX pin defers. The step mode owns that, so the struct says nothing.1 parent 6fc0db5 commit 45125d7
6 files changed
Lines changed: 464 additions & 426 deletions
File tree
- apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests
- UnitTests
0 commit comments