Skip to content

Recovery launcher: land #142 - #154

Open
krishhgg wants to merge 6 commits into
integration/wave1-basefrom
integration/recovery-launcher
Open

krishhgg wants to merge 6 commits into
integration/wave1-basefrom
integration/recovery-launcher

Conversation

@krishhgg

@krishhgg krishhgg commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Login Items now shows Insomnia, not an unnamed shell script. The recovery agent that undoes an abandoned session runs a small native launcher inside the app, pinned by its code signature, which checks the bundle and then runs the sealed backstop script.

This lands #142 by @ilya-the-frog at bf8a75a. The commit is merged here unchanged, so GitHub marks #142 merged when this one merges and its author keeps the credit. #142 conflicts with #146 (the session command line), which lands first, so it can't merge as it is.

To @ilya-the-frog: please don't push to your branch now. A new commit on it isn't in this pull request, so #142 would stay open instead of showing as merged.

The base is integration/wave1-base: main with #146 and #147 (which carry #145) merged, as main will be once they land. When #147 merges, this pull request's base changes to main and nothing else changes.

Conflicts resolved

Maintainer commits

  • 38b0ef6: the packaging tests run the intact, edited-script and wrong-build cases through the shell verifier as well as the native command. The plist still falls back to the shell verifier for an older bundle, a requirement without cdhashes and SIP that is not known to be enabled, and install.sh writes the same fallback, but since Show Insomnia in Login Items with a pinned native recovery launcher #142 no test ran it. Breaking the verifier three ways (no requirement check, exit 0 on refusal, no verification) fails the new run.

Tests

The full suite at this head, 38b0ef6: 1408 tests, 0 failures, on macOS 26.2 on the maintainer's MacBook. Hosted CI runs on macOS 26 and 27.

Review

The merge is clean at 0981a6a, the same tree as f0f183e; only commit messages changed. That review checked the command order in main.swift, that an install, an interrupted install or an uninstall cannot leave the recovery agent running something unpinned, and that the release checklist still covers Login Items, the launcher's spawn constraint and recovery after a restart. 38b0ef6 had its own review with no findings: the shell run executes the exact ProgramArguments the plist writes, and it checks what main's test checked before #142.

Evidence

To run on the owner's MacBook at the final head: install, Login Items shows Insomnia, the recovery agent's launcher carries the expected spawn constraint, and after one restart the agent runs and recovers a session journal.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge, with the previous coverage gap fixed and no new actionable issues found.

Summary

The PR gives the recovery agent a native --backstop launcher so Login Items can identify Insomnia.

  • Eligible recovery agents start as Insomnia with launchd checking the pinned executable.
  • Insomnia verifies its bundle before running the sealed recovery script.

No new actionable issues or mounted-rule violations were found. macOS tests were not run in this Linux environment.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Install or arm recovery] --> B{Native command, cdhash requirement and SIP enabled?}
  B -->|Yes| C[launchd checks SpawnConstraint]
  C --> D[Insomnia --backstop verifies bundle]
  B -->|No| E[System shell verifies bundle]
  D --> F{Bundle passes?}
  E --> F
  F -->|Yes| G[Run sealed backstop.sh]
  F -->|No| H[Log refusal and exit]
Loading

Reviews (2) · Last reviewed commit: "Packaging tests: run the agent cases thr..." · Reviewed by Greptile

ilya-the-frog and others added 5 commits October 23, 2026 15:54
…y launcher

Conflicts: Info.plist keeps both keys; main.swift answers --backstop first, then resume-frozen and the session command; releasing.md keeps both sides' checks.

# Conflicts:
#	Resources/Info.plist
#	Sources/Insomnia/main.swift
#	docs/releasing.md
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T11:24:20.430645Z f0f183e PR opened
🔒 Security Review ✅ Completed 2026-10-27T11:26:19.030907Z f0f183e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Since the native --backstop command landed, runAgent only ran that
command, so no test executed LaunchdBackstop.agentProgram any more. The
plist still uses that shell verifier for an older bundle, a requirement
without cdhashes and SIP that is not known to be enabled, and install.sh
writes the same fallback. Its remaining tests only read the program text
or the plist.

The intact, edited-script and wrong-build cases now live in one helper
that runs twice: once with the native command, as before, and once with
the ProgramArguments plistDictionary writes for a target without a native
executable, run with HOME in the scratch tree. The shell run checks the
exit status, whether the sealed script ran, and the one-line refusal in
~/Library/Logs/Insomnia/insomnia.log with codesign's reason, as main's
test did. The native assertions are unchanged.

Checked by breaking agentProgram three ways and running the shell test:
dropping the -R requirement fails it 4 times (the wrong build runs the
script, exits 0 and logs nothing), exiting 0 on refusal fails it 2
times, and skipping verification fails it 3 times. The native test
passed with the requirement dropped. swift build and swift test --filter
PackagingTests pass, 29 tests, 0 failures.
@krishhgg

Copy link
Copy Markdown
Owner Author

The full suite at 38b0ef6, this head, passes on macOS 26.2 on the maintainer's MacBook: 1408 tests, 0 failures, in 31 minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants