Skip to content

Commit b55d10a

Browse files
committed
docs: name the failed-step kinds and the URL-owner exception once
The exception lived implied in two comments and contradicted the lookup case they described. applyAttemptReport now owns the sentence: alert-read, alert-accept and runner settle to the unknown state, while url-owner reports the seen url-owner-unresolved. The settle doc and the test-table header point at that rule instead of restating it.
1 parent c446fda commit b55d10a

2 files changed

Lines changed: 14 additions & 11 deletions

File tree

‎packages/platform-apple/src/open-policy.test.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ type Report = Readonly<{
1212
}>;
1313

1414
/**
15-
* The one mapping from each answer attempt to what the settle reports, over each state the settle
16-
* can already be in. A seen confirmation replaces the report; a step that failed or went unverified replaces it
17-
* with the unknown state; a completed probe that saw nothing resolves the unknown and keeps any
18-
* confirmation already seen.
15+
* The mapping's cases at both ends: every attempt kind against a fresh settle, and attempts that
16+
* follow a settle already holding a report or an unknown state. `applyAttemptReport` owns the
17+
* rule and its url-owner exception; each expected row here restates only its own case.
1918
*/
2019
const freshCases: ReadonlyArray<Readonly<[string, LaunchConfirmationAttempt, Report]>> = [
2120
['accepted', { outcome: 'accepted' }, { report: { launchConfirmation: 'accepted' } }],

‎packages/platform-apple/src/open-policy.ts‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,10 @@ export function releaseSpeculativeRunner(
127127
* visible after a failed accept also fails the open, even if the app is running. A missing prompt
128128
* leaves the launch unchanged; an unrecognized prompt or an unresolved URL owner leaves it
129129
* unchanged and reports `launchConfirmation: 'unanswered'` with its typed reason, because the
130-
* prompt is on the screen the caller still has to answer. A probe step that failed or went unverified reports
131-
* no confirmation and names itself, leaving the daemon to warn that the prompt state is unknown. An unresolved owner spends both the 3-second presentation window and the bounded
132-
* URL-owner lookup.
130+
* prompt is on the screen the caller still has to answer. A step that failed or went unverified
131+
* settles to the unknown prompt state, which the daemon turns into a check-with-`alert get`
132+
* warning; `applyAttemptReport` owns that reporting rule and its one lookup exception. An
133+
* unresolved owner spends both the 3-second presentation window and the bounded URL-owner lookup.
133134
*/
134135
export async function settleAppleOpen(
135136
host: Pick<PlatformRuntimeHost, 'clock'>,
@@ -296,10 +297,13 @@ function settleAttempt(attempt: LaunchConfirmationAttempt): AttemptSettlement {
296297

297298
/**
298299
* The one rule mapping an answer attempt to what the settle reports. Every attempt states the
299-
* latest the probe knows: a seen confirmation replaces the report, a step that failed or went unverified
300-
* replaces it with the unknown state, and a completed probe that saw nothing resolves the unknown
301-
* and keeps any confirmation already seen — an accepted is a completed action the caller owns. An
302-
* `alert-still-present` attempt belongs to the failed-accept path, which fails the open outright.
300+
* latest the probe knows: a seen confirmation replaces the report, a step that failed or went
301+
* unverified (`alert-read`, `alert-accept` or `runner`) replaces it with the unknown state, and a
302+
* completed probe that saw nothing resolves the unknown and keeps any confirmation already seen —
303+
* an accepted is a completed action the caller owns. The one exception to the failed-step rule is
304+
* `url-owner`: that lookup ran and answered nothing usable, so it reports the seen outcome
305+
* `url-owner-unresolved`. An `alert-still-present` attempt belongs to the failed-accept path,
306+
* which fails the open outright.
303307
*/
304308
export function applyAttemptReport(
305309
previous: Readonly<{

0 commit comments

Comments
 (0)