Skip to content

fix(close): keep a disproved boot on record and decide it in the daemon - #4869

Merged
thymikee merged 10 commits into
0.22from
fix/0.22-boot-owner-review-followup
Nov 21, 2026
Merged

thymikee merged 10 commits into
0.22from
fix/0.22-boot-owner-review-followup

Conversation

@thymikee

@thymikee thymikee commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to #4864 (#4791). A boot that a session disproved stays on the session record until the session owns a stop, so a later plain close still warns boot-owner-unverified. CloseBootOwnership becomes the exclusive union proved | inferred | disproved | none, and the ownership decision moves from contracts to the daemon session lifecycle (ADR 0038). The refusal read matches CoreSimulator's own wording only. Help and the iOS skill card state the rule.

Before / after

call base head
open (boot disproved), reopen finds it up and fails at dispatch, then close simulator kept, no warning simulator kept, warnings: [boot-owner-unverified]
close --shutdown on a disproved session stops stops, no warning

Validation

Head rebased onto 0.22 at 62f24be4fd. Local: build, typecheck, lint, layering, command-docs, daemon-wire-compat, full vitest --project unit-core (20891 passed). Mutation-checked: removing the lifecycle forwarding or the store retention turns the new tests red. Live cases on #4864 still describe the running-simulator behavior. CI: hosted checks at this head.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff Turn on auto-fix

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.20 MB 6.20 MB +882 B
Package (unpacked) 6.20 MB 6.20 MB +882 B
Package (download) 1.89 MB 1.89 MB +172 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 20.2 ms 20.4 ms +0.2 ms
CLI --help 40.8 ms 41.6 ms +0.8 ms

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

000138383a fixes the two Coverage failures from b2a61c2621. scripts/__tests__/simulator-skills-contract.test.ts reads the iOS card's close paragraph as one contiguous requiredText and removes that exact string for its negative fixture; item 5 inserted the boot-owner-unverified sentence mid-paragraph, so the pinned string no longer matched and both the positive contract and the fixture failed. The fix restores the pinned paragraph verbatim and states the new warning after it, so neither the contract nor its fixture changed.

Verification now includes the lane the earlier report missed: full pnpm exec vitest run --project unit-core (2,161 files, 20,852 passed / 10 skipped, including scripts/__tests__) and pnpm lint.

@thymikee

Copy link
Copy Markdown
Member Author

At 0001383, all 13 checks pass and no conflicts are known, but this device-facing change has no live evidence at this head yet.

The change touches the Apple boot-refusal read in simctl.ts (used by ensureAppleReady and ensureBootedSimulator) and the daemon's ownership recording. The only live run cited was taken at #4864's earlier head, bece9b3. At this head, the claim "a simulator this open really booted still gets stopped, a foreign boot is kept" rests only on routed and unit tests with mocked simctl.

Please run the Apple open/close routes once at this head on a dedicated throwaway simulator, using the branch CLI with an isolated --state-dir, and attach the JSON transcripts. They must show: (1) simulator Shutdown, then open, then plain close: data.shutdown.success is true and the simulator is Shutdown afterwards; (2) simulator Booted beforehand, then open, then plain close: it stays Booted with no warnings; (3) the foreign-boot race held at the readiness boundary as on #4864: the log shows CoreSimulator's "Unable to boot device in current state: Booted", and close keeps the simulator Booted and warns boot-owner-unverified; (4) on that disproved session, re-open with the simulator still Booted, then plain close: the warning is still present and the simulator is still Booted; (5) close --shutdown on a disproved session stops it. This is required before merge.

Not verified here: this review read the code only, with no device or mutation runs. The mutation claims were checked by reading the base store logic. It is also not confirmed that CoreSimulator never emits "current device state: Booted"; the removed phrase existed only since #4864, and the pre-#4864 code matched the same two phrases as this head.

Not blocking, take or leave: CloseBootOwnership in device-boot.ts has no consumer outside packages/daemon, so it can be declared in session-boot-ownership.ts beside its resolver; the sentence in SKILL.md about "something else booted the simulator before your open's own boot step ran" also covers a simulator booted before the open's selection snapshot, which resolves to "none" and closes without a warning, so it could read "When the simulator your open found stopped was booted by something else before its own boot step ran, ..."; and the comment at session-open-execution.ts still says "The pair below" though bootOwnership is now one union value, so it could say "The answer below".

thymikee added a commit that referenced this pull request Nov 21, 2026
Addresses non-blocking review on #4869:
- CloseBootOwnership leaves contracts. Its only consumers are in the
  daemon, so contracts had vocabulary no zone above it shared. R81
  rejects a core -> sessions type read, and core/session-store.ts
  consumes the answer, so it lands in core/session-state.ts beside the
  flags it decides, which both consumers read downward
- the iOS skill card now scopes the boot-owner-unverified warning to a
  simulator the open FOUND stopped, which is the case that can be
  disproved; the pinned contiguous paragraph is intact
- session-open-execution comment names one union answer, not a pair
@thymikee
thymikee force-pushed the fix/0.22-boot-owner-review-followup branch from 0001383 to 00b93ef Compare November 21, 2026 00:08
@thymikee

Copy link
Copy Markdown
Member Author

Live validation at head 00b93ef78a

Dedicated simulator agent-device-4869-live (iPhone 17 Pro, iOS 26.2, UDID 34463C96-8E03-43F4-97A0-8BD4E162F473), created with xcrun simctl create for these runs and deleted after them; no other simulator touched. Branch CLI node bin/agent-device.mjs --json built at this head (pnpm build after the last source change), isolated --state-dir per case under the worktree's .tmp/. pnpm build, typecheck, lint, format, check:layering, fallow audit --base origin/0.22, check:production-exports, and the full vitest --project unit-core lane (2,161 files, 20,862 passed) all green before the push.

# Command (all with --json) Result
1 open com.apple.Preferences --platform ios --device agent-device-4869-live (from Shutdown) → plain close open selection.bootOccurred: true; sim Booted; close data.shutdown.success: true, exitCode: 0; sim Shutdown
2 simctl boot first → open → plain close open bootOccurred: false; close ok, no shutdown key, no warnings; sim Booted
3 cold open started; second shell boots the sim at +2 s and wins → plain close open ok bootOccurred: true (foreign boot won the window); close ok, no shutdown, warning boot-owner-unverified; sim Booted
4 the case-3 session re-opened while Booted (open again, bootOccurred: false — proves nothing) → plain close close ok, no shutdown, the same boot-owner-unverified warning still present; sim Booted
5 close --shutdown on that disproved session data.shutdown.success: true, exitCode: 0, no warnings; sim Shutdown

Key JSON. Case 1 close:

{ "success": true, "data": { "session": "default",
  "shutdown": { "success": true, "exitCode": 0, "stdout": "", "stderr": "" },
  "message": "Closed: default" } }

Case 2 close (no shutdown key, warnings absent — printed from the parsed response): {"ok": true, "shutdown": null, "warnings": null}, sim stayed Booted.

Cases 3 and 4 close (identical warning, kept running):

{ "success": true, "data": { "session": "default", "message": "Closed: default",
  "warnings": ["This session's open found this device stopped, but reported boot-owner-unverified: its own boot step never booted the device, so close did not request a stop. The device is still running."] } }

Case 5 close: {"ok": true, "shutdown": {"success": true, "exitCode": 0}, "warnings": null}, sim Shutdown.

The race was hit for real, both times it was attempted. The script starts the cold open, then a background subshell issues xcrun simctl boot on the same UDID at +2 s; the foreign boot won on loop iteration 1 of the subshell each time (cases 3 and 4 are two independent race runs, each racing once). Selection still answered bootOccurred: true, and close on head kept the simulator with the typed warning — the exact #4791 behavior.

On the review's open question about the removed phrase: CoreSimulator's refusal for this simulator, captured directly by booting a Booted device, is exactly:

An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=405):
Unable to boot device in current state: Booted   (exit 149)

No current device state: variant appears from this runtime (iOS 26.2 / Xcode toolchain here), consistent with the commit dropping it.

Cleanup: every session closed, each case daemon stopped with daemon stop --state-dir, simulator deleted (xcrun simctl list devices | grep -c agent-device-4869-live → 0).

The branch was also rebased onto origin/0.22 (c50f522720) and the three non-blocking review items taken in one commit: CloseBootOwnership left contracts — its only consumers are daemon-side, and R81 rejects the core→sessions read the daemon-module location would need, so it now sits in core/session-state.ts beside the flags it decides; the skill card sentence is scoped to a simulator the open found stopped (pinned paragraph intact, contract test green); the session-open-execution.ts comment says "The answer below".

@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

Two of the earlier findings (#4869 (comment)) are now fixed at 00b93ef, and one remains. CI is green (14 checks, none failing), and there are no conflicts.

The new workflow help at https://github.com/callstack/agent-device/blob/00b93ef/src/commands/schema/cli-help-workflows.ts#L32 (and line 347) promises a reason whenever an Apple open reports that its boot step did not perform the boot. On a fresh open of an already-running simulator, readiness reports performed:false with reason already-booted (readiness/runtime.ts:67-87), selection gives no stopped-device inference, and session-boot-ownership.ts:25-28 returns none. The store records no warning flag, so plain close returns without the token. Case 2 in the author's transcript (issue comment 7053910619) shows this outcome. Agents will expect boot-owner-unverified on an ordinary prebooted open, and a warning-free close contradicts that. Please scope both help entries to a simulator that open found stopped, whose boot step did not start it, and where the session has no earlier proof that it owns the stop.

Not verified here: the device runs and tests were not re-run, and the branch CLI used in the author's transcripts was built at 00b93ef only by the author's statement.

@thymikee

Copy link
Copy Markdown
Member Author

Reply to the review at 00b93ef (#4869 (comment)). Head is now 5249a56aac; it changes only the two workflow help entries in src/commands/schema/cli-help-workflows.ts.

Both entries now scope the boot-owner-unverified case to an Apple simulator that open found stopped, that something else started before open's own boot step, where the session has no earlier proof that it owns the stop. The closing sentence says a device that was already running keeps running without a warning, which is what case 2 of the live transcript shows.

Checks on this head: lint, typecheck, format, check:command-docs, check:mcp-metadata, check:doc-prose, the help tests and scripts/__tests__ pass. No device-facing code changed, so the live transcript at 00b93ef still describes the behavior.

@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

The change at 5249a56 has two remaining problems, both in the new help text and its evidence; the 13 checks are green and no conflicts are known. The earlier findings from 00b93ef are addressed in this head, and the remaining issue is the new no-warning sentence in the two workflow help entries.

The new sentence says an already-running Apple simulator stays running "without a warning" after plain close (cli-help-workflows.ts:32, cli-help-workflows.ts:347). That does not hold when the simulator starts externally after the session's first open saw it stopped. That open leaves a recorded boot disproval. A later reopen in the same session finds the simulator running, adds no boot evidence, and keeps the disproval (session-store.ts:445-465). Plain close then reports boot-owner-unverified (session-close.ts:619-623). An agent following the help can read that expected warning as a close failure. In both entries, please limit the no-warning statement to a simulator that was already running when the session first opened it. Please also say that a reopen keeps any earlier boot-ownership warning until the session owns a stop.

The claim that the help can promise silence for every already-running simulator rested on a source trace only. The new test at session-close-foreign-boot.test.ts:216-244 covers the reopen path and asserts the warning is kept, which contradicts the help text. Please make the help match that test, or show the route where the reopen emits no warning.

Could SessionStore record one exclusive close disposition in SessionState, so close teardown and failed-open cleanup read the same stored decision? The per-open answer is exclusive, but the two optional fields in the stored state can still express both owning a stop and warning that it was withheld.

Not verified here: tests were not re-run; the head delta is two help strings, checked against the head code by reading.

@thymikee

Copy link
Copy Markdown
Member Author

Reply to the review at 5249a56 (#4869 (comment)). Head is now bf7922cef5; it changes only the same two help strings.

Help text. Both workflow entries now read: a device that was already running when the session first opened it keeps running, without a warning; a reopen keeps an earlier boot-ownership warning until the session owns a stop. That matches session-close-foreign-boot.test.ts:216-244 (the reopen keeps the warning). There is no route where that reopen emits none; the earlier sentence was wrong for it, and I had only traced the first-open case. Lint, typecheck, check:command-docs, check:mcp-metadata, check:doc-prose, the help tests and scripts/__tests__ pass.

One exclusive close disposition in SessionState? Yes, it would be the better shape. Today the one writer keeps the pair consistent: when a write owns the stop it clears bootOwnerUnverified, so through this path the two fields are never both set. But that is a property of the writer, not of the type: bootedByOpen?: true and bootOwnerUnverified?: true can still express both. A single stored disposition (owns the stop / stop withheld as unverified / none), read by close teardown and by failed-open cleanup, would make the invalid pair unrepresentable and give both readers one decision. It is not in this head: this is the third review round and the change is the help text only. It touches SessionState, the store writer, both readers and their tests, so it fits a small follow-up PR if the maintainer wants it.

@blacksmith-sh

This comment has been minimized.

@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

One docs finding remains at bf7922c; the code changes from the earlier review (#4869 (comment)) are in place, and the 13 checks pass. The delta changes only help strings.

The new first-open condition in cli-help-workflows.ts:32 (and the matching entry at line 347) promises that a simulator already running at the session's first open keeps running on plain close. That is false on one route. Open a prebooted local simulator, let it shut down externally while the session keeps its claim, then reopen the same session after the recent boot observation expires. Apple readiness reads Shutdown and boots it (readiness/runtime.ts:67-87). The existing-session route passes that performed:true report through (session-open.ts:318-360). The daemon then records bootedByOpen (session-boot-ownership.ts:25, session-store.ts:445-455), and plain close stops the simulator (session-close-lifecycle-teardown.ts:102-117,274-289). An agent that follows either workflow can expect close to keep a simulator that the session later booted.

Please qualify the first-open sentence in both entries with "and the session has not since booted it", and refer to the boot-ownership warning there. Keep the existing sentence about retention across reopen.

Not verified here: tests were not run, and the reopen route rests on reading the code and test at that commit. The packet listed no open or resolved threads. Once the two help entries are fixed, nothing else stands in the way of merge.

@thymikee

Copy link
Copy Markdown
Member Author

Fixed at 15c8d56 (reply to #4869 (comment)). Both help entries (cli-help-workflows.ts:32 and :347) now read: "A device that was already running when the session first opened it, and that the session has not since booted, keeps running on plain close without a boot-ownership warning". The retention-across-reopen sentence is unchanged. Help schema tests pass locally (114/114); oxfmt is clean.

@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

The earlier findings at bf7922c are fixed, and one docs problem remains at 15c8d56.

The new sentence in skills/ios-simulator/SKILL.md promises boot-owner-unverified whenever an open finds a stopped simulator and another process boots it first. That does not hold on re-open. Start a session on a running simulator, shut it down externally, then re-open the same session. If an external boot wins before simctl boot, readiness reports already-booted. Existing-session selection has source session and bootOccurred false (device-selection-resolver.ts:92 and :118), so session-boot-ownership.ts:26 returns none. No prior marker exists to retain, and plain close keeps the simulator running without the promised warning. Agents that read the iOS routing card will expect a warning on a supported path that gives none. Please limit the sentence to a stopped simulator selected on the session's initial open whose boot report disproves the inferred boot, with the warning applying while the session has no boot of its own recorded.

CI is green with 14 checks and none failing. Not verified here: the help schema tests were not run locally. No other threads are open, and nothing else is needed before merge once the sentence is narrowed.

@thymikee

Copy link
Copy Markdown
Member Author

Fixed at 7c4145d (reply to #4869 (comment)). skills/ios-simulator/SKILL.md:24 now reads: "When the session's first open selected a stopped simulator and something else booted it before that open's own boot step, plain close leaves it running and warns with boot-owner-unverified until the session boots it itself." Agent-guidance contract and repo-guard tests pass locally (166/166).

@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

The earlier findings from 15c8d56 are fixed at 7c4145d, and one help claim still does not match the code. After a foreign-boot warning is recorded, remove the original iOS simulator and start a simulator with the same name in the same simulator set. Reopen an app in the existing session without an explicit device selector. The open refresh at session-open.ts:293 can fall back from the missing UDID to the same-name simulator in session-device-resolution.ts:144-165. That simulator is already running, so no boot is performed, and it has a different UDID. session-store.ts:445 and :463-465 then clear the old warning on the identity change without recording a stop. A plain close leaves the replacement running without boot-owner-unverified. The new help at cli-help-workflows.ts:32 and line 347 promises that a reopen keeps the earlier warning until the session owns a stop. Please qualify both sentences so the promise holds only while the session stays on the same device and has no boot of its own. The 14 checks are green, and the change since the last review is one docs sentence. Not verified here: the tests were not run, and the different-device reopen case was not checked against live behavior. No further action is needed once the two sentences match the code.

@thymikee

Copy link
Copy Markdown
Member Author

Fixed at 274b3c6 (reply to #4869 (comment)). Both help entries (cli-help-workflows.ts:32 and :347) now end: "a reopen of the same device keeps an earlier boot-ownership warning until the session boots it itself, and a reopen that selects a different device clears it." Help schema tests pass locally (114/114); oxfmt is clean.

@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

This is a follow-up to the earlier review of 7c4145d (#4869 (comment)). One help-text problem remains at 274b3c6. CI is green, with 14 checks and none failing. There are no conflicts.

The new help in cli-help-workflows.ts:32 says the warning clears once the session boots the simulator itself. That does not hold on one path. Start with a session that recorded an unverified boot, let the simulator shut down, and reopen the same device. If simctl boot succeeds and bootstatus returns after the startup deadline, readiness throws boot_timeout before it reports the boot, and the simulator keeps running. The existing-session path exits before completeOpenCommand, so the old marker stays. A later plain close still reports boot-owner-unverified. A caller who follows the new help expects close to stop the simulator their reopen started, but it stays running. Please make the warning clear only when a later open records that it booted the simulator, and use the same wording at cli-help-workflows.ts:347 and skills/ios-simulator/SKILL.md:24.

This path was traced by reading the code with a late successful bootstatus. Not verified here: a live device run. The delta is help text, so no live run is required.

@thymikee

Copy link
Copy Markdown
Member Author

Fixed at 56bf129 (reply to #4869 (comment)). cli-help-workflows.ts:32 and :347 and skills/ios-simulator/SKILL.md:24 now tie clearance to "a later open of the session records that it booted the simulator", so a reopen that ends in boot_timeout keeps the warning. Help schema and agent-guidance tests pass locally; oxfmt is clean.

@apex-sentinel-staging

This comment has been minimized.

Addresses review on #4864:
- a re-open that proves nothing keeps the recorded disproved boot, so a
  failed re-open cannot silence the warning for the same foreign boot
  (session-store.ts); routed and store cases pin both directions
- CloseBootOwnership is a four-member union, so owning a stop and
  reporting one withheld cannot both be represented; the publisher no
  longer duplicates the store's ownership math
- resolveSessionBootOwnership moves to the daemon session lifecycle per
  ADR 0038/R18 (contracts keeps vocabulary, not algorithms)
- the boot refusal read drops the unverified third phrase, keeping only
  CoreSimulator's own wording, pinned at both readers
- lifecycle forwarding of the boot report is pinned where it happens
- docs and help name the new warning: session-state field contract,
  cli-help-workflows (now a guarded surface), ios-simulator skill

(cherry picked from commit 96e0417)
The simulator skill contract reads the card's close paragraph as one
contiguous string. Inserting the boot-owner-unverified sentence mid-
paragraph broke that read, so the card now states the pinned guidance in
full and names the new warning after it.
Addresses non-blocking review on #4869:
- CloseBootOwnership leaves contracts. Its only consumers are in the
  daemon, so contracts had vocabulary no zone above it shared. R81
  rejects a core -> sessions type read, and core/session-store.ts
  consumes the answer, so it lands in core/session-state.ts beside the
  flags it decides, which both consumers read downward
- the iOS skill card now scopes the boot-owner-unverified warning to a
  simulator the open FOUND stopped, which is the case that can be
  disproved; the pinned contiguous paragraph is intact
- session-open-execution comment names one union answer, not a pair
@thymikee
thymikee force-pushed the fix/0.22-boot-owner-review-followup branch from 56bf129 to 6472db2 Compare November 21, 2026 11:34
@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

One docs problem remains at 6472db2; the earlier findings from #4869 (comment) are fixed. The new help sentence promises a boot-owner-unverified warning on a route that produces none.

The added warning sentence in cli-help-workflows.ts:32 and at :347 covers any open that finds a stopped simulator, loses the boot to another process, and has no earlier stop proof. Take a session that starts with a prebooted simulator, then shut the simulator down externally while the daemon still holds the claim, and reopen after the recent boot observation expires. Inventory can see Shutdown in the existing-session refresh before a concurrent boot wins. session-open.ts:293-298 then supplies existing-session selection, whose source is session and whose bootOccurred is false whatever the refreshed state is (device-selection-resolver.ts:93-99, :119). Apple readiness reports performed:false, so session-boot-ownership.ts:26-27 returns none. The session has no warning to retain, and plain close keeps the simulator running without boot-owner-unverified. The new first sentence promises the warning for that same route, while the next first-open sentence promises silence. An agent that follows either workflow entry can wait for a warning that never comes on a valid reopen.

The rule to satisfy: the stopped-simulator warning applies only to the session's first open, as the qualified sentence in the iOS skill already says. Please scope the sentence that way in both workflow entries. Keep the separate wording for retaining an earlier warning across a same-device reopen.

The code verdict is that the findings above need a fix before this is ready. The only failing check is Body rules, which validates the PR description template and not the close route this diff changes. There are no conflicts. After the docs fix, the PR body must pass the template check before merge. Not verified here: a live device run, and a line-by-line re-read of the range-diff after the rebase; the claims above come from reading the code.

@thymikee

Copy link
Copy Markdown
Member Author

Fixed at 88e564f (reply to #4869 (comment)). Both workflow entries (cli-help-workflows.ts:32 and :347) now read "...or the session's first open selected a stopped Apple simulator that something else booted before that open's own boot step (boot-owner-unverified)...", matching the iOS skill; the same-device reopen sentence is unchanged. The PR body was rewritten for scripts/check-pr-body.ts at 6472db2, and the Body rules check passes there. Help schema tests 114/114.

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 88e564f

Since the review of 6472db2: 0 new · 0 still open · 0 no longer raised

No open findings.

1 finding below minor hidden (user_settings.min_severity).

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

This PR is ready to merge at 88e564f. The delta since the earlier review (6472db2) changes only help string text, and CI is green with all 15 checks passing. No conflicts. Nothing else needs to happen before merge.

Not blocking: in cli-help-workflows.ts, any open that writes a disproved boot sets the unverified flag, not only the first open, so a reopen that selects a different stopped simulator can also report boot-owner-unverified. The help says "first open" and ends with "a reopen that selects a different device clears it", which describe only the first-open route. The sentences are not false, so these can be taken or left: say "an open" where the route applies, and add "unless that open is itself disproved" to the clearing sentence.

Not verified here: the help schema tests were not run, so this relies on green CI and the author's report.

@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 3925b05 into 0.22 Nov 21, 2026
15 checks passed
@thymikee
thymikee deleted the fix/0.22-boot-owner-review-followup branch November 21, 2026 13:17
thymikee added a commit that referenced this pull request Nov 21, 2026
…on (#4869)

* fix(close): keep a disproved boot on record and decide it in the daemon

Addresses review on #4864:
- a re-open that proves nothing keeps the recorded disproved boot, so a
  failed re-open cannot silence the warning for the same foreign boot
  (session-store.ts); routed and store cases pin both directions
- CloseBootOwnership is a four-member union, so owning a stop and
  reporting one withheld cannot both be represented; the publisher no
  longer duplicates the store's ownership math
- resolveSessionBootOwnership moves to the daemon session lifecycle per
  ADR 0038/R18 (contracts keeps vocabulary, not algorithms)
- the boot refusal read drops the unverified third phrase, keeping only
  CoreSimulator's own wording, pinned at both readers
- lifecycle forwarding of the boot report is pinned where it happens
- docs and help name the new warning: session-state field contract,
  cli-help-workflows (now a guarded surface), ios-simulator skill

(cherry picked from commit 96e0417)

* docs(skill): keep the pinned close guidance contiguous in the iOS card

The simulator skill contract reads the card's close paragraph as one
contiguous string. Inserting the boot-owner-unverified sentence mid-
paragraph broke that read, so the card now states the pinned guidance in
full and names the new warning after it.

* refactor(daemon): declare boot ownership where its consumers read it

Addresses non-blocking review on #4869:
- CloseBootOwnership leaves contracts. Its only consumers are in the
  daemon, so contracts had vocabulary no zone above it shared. R81
  rejects a core -> sessions type read, and core/session-store.ts
  consumes the answer, so it lands in core/session-state.ts beside the
  flags it decides, which both consumers read downward
- the iOS skill card now scopes the boot-owner-unverified warning to a
  simulator the open FOUND stopped, which is the case that can be
  disproved; the pinned contiguous paragraph is intact
- session-open-execution comment names one union answer, not a pair

* docs(help): scope the boot-owner-unverified close note to a simulator open found stopped

* docs(help): limit the no-warning close note to a device running at the session's first open

* docs(help): keep the first-open close note to a device the session has not since booted

* docs(skill): limit the iOS boot-owner warning note to the session's first open

* docs(help): keep the reopen warning note to the same device

* docs(help): clear the boot-owner warning only on a recorded later boot

* docs(help): scope the boot-owner warning sentence to the session's first open
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.

1 participant