Skip to content

After 1.1.0: hooks run once across a daemon restart, no Gatekeeper kill from the menu bar app, steadier tests - #87

Merged
ValentinTorassa merged 7 commits into
mainfrom
after-1.1.0
Nov 16, 2026
Merged

ValentinTorassa merged 7 commits into
mainfrom
after-1.1.0

Conversation

@ValentinTorassa

Copy link
Copy Markdown
Owner

The four follow-ups left after 1.1.0. Code, tests and words only: no version change, no build, nothing released.

1. A daemon that starts again runs no hook a second time (92a7235)

Since 1.1.0 the extension sends a daemon that registers every event still waiting, and that includes events whose hook had already exited with no answer (P5-24, result 9: four events, the hook ran twice for each). A daemon now reads the end of the event log as it starts (EndedEvents) and skips those: hooks_skipped, already_ran. An event is told by its ID and its deadline.

It still runs the hooks when the daemon's own end stopped one (daemon_stopping), when one has no end in the log, when no hook ran, and when a hook answered but the answer did not reach the extension (answer_refused with unreachable or reply_timeout). The extension resends only events whose token no answer presented, so an answer in the log of a resent event was lost; skipping it would drop a connection an agent had approved.

2. The menu bar app does not open a new build in quarantine (8ac4044, dbeda11)

The cause of the Killed: 9 after brew upgrade to 1.1.0 is in the system log: 1.0.8's menu bar app opened the new app 0.3 s before the rejection (LaunchServices.launchViaCSUA from its pid), macOS could not show its first-opening question for an app opened in the background, and killed that app and the blackice status started in the same moment. P5-24 has the lines now, next to step 3's upgrade, where the command came first and nothing was rejected.

MenuUpgrade.decide quits instead of reopening when the app on disk is another build and has com.apple.quarantine; blackice start, which every upgrade needs, opens the menu bar app as it already does. Script installs are unchanged (no quarantine).

Not shown by any run: it needs a brew upgrade from a build that has the change, so the upgrade from 1.1.0 to the next version still has the old menu bar app. docs/install.md says to run the command again if it ends with Killed: 9.

3. Tests that failed on slow CI runners (1e15da2)

Five tests failed in the last two weeks for how long a step took. Bounds that stand against a 30 s sleep or a longer timeout go from 3 to 5 s up to 15 s; the event-deadline test repeats with more room when its hook was dropped before it started; the waiting-hook test has a 4 s busy hook so the window for giving up can be 0.7 to 3 s; and the marker file of a refused program is checked only where the kernel checks launch requirements (with SIP off the program runs until the check by PID kills it).

4. The first start's question (1d726be)

"Who answers when blackice holds a connection?", in the words of the mode option before it. It was "Who answers the connections that wait?".

Checked

  • macos/test.sh: 662 tests pass (658 before), four runs in a row.
  • The new daemon test fails with the skip switched off (the hook runs again for ev-1).
  • The swift job's steps locally: build with warnings as errors, smoke, bash -n, and the dry runs of sign.sh, package.sh and fault-test.sh.

Not checked

  • Nothing ran on an installed build: no daemon restart with real events, no upgrade. A release needs its own evidence file for both.
  • The menu bar app was not opened.

The first start's question about the agent was "Who answers the connections that wait?". It now uses the words of the mode it follows, "Hold what no rule allows until an agent or you answer".
Five tests failed on CI's runners in the last two weeks for the time a step took, not for what it did: 7.4 s over a hook with a 1 s timeout, a deadline that had passed before the runner took the hook, a waiting hook given up later than 1.8 s in.

The upper bounds that stand against a 30 s sleep or a longer timeout are now 15 s (slowRunnerBound). The test of an event's deadline runs once more with more room when its hook was dropped before it started, as the daemon's already did. The busy hook of the waiting test sleeps 4 s, so that giving up before the deadline can take up to 3 s and still not be the slot coming free. With SIP off, where the kernel checks no launch requirement, a refused program may have made its file before the check by PID killed it: the file is checked only where the kernel checks.
Since 1.1.0 the extension sends a daemon that registers every event still waiting. Among them are events whose hook had ended with no answer: on 16 November a daemon that started again got four and ran the hook a second time for each (P5-24, result 9).

A daemon reads the end of the event log as it starts (EndedEvents) and skips those events, told by ID and deadline: hooks_skipped, already_ran. It still runs the hooks of an event when the daemon's own end stopped one, when one has no end in the log, when an answer did not reach the extension (the extension resends only events whose token no answer presented, so that answer was lost), and when no hook ran.
After an upgrade the menu bar app opened the app on disk at its next check. Homebrew leaves the app in quarantine, macOS asks before the first opening of such an app, and it cannot ask for one opened in the background: after brew upgrade to 1.1.0 it killed the app 1.0.8's menu bar app had opened and the blackice status started in the same moment (P5-24, result 11).

The menu bar app now quits instead, and blackice start, which every upgrade needs, opens it. The check is the running build's, so an upgrade from 1.1.0 or earlier is as before; the install guide says to run the command again. No run has this yet: it takes a brew upgrade from a build that has it.
The system log of 16 November has the menu bar app of 1.0.8 opening the new app 0.3 s before the rejection, and step 3's upgrade with the command first and no rejection.
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
blackice Ready Ready Preview Nov 16, 2026 7:43pm UTC

@ValentinTorassa
ValentinTorassa marked this pull request as ready for review November 16, 2026 21:35
@ValentinTorassa
ValentinTorassa merged commit 6d1a7fa into main Nov 16, 2026
5 checks passed
@ValentinTorassa
ValentinTorassa deleted the after-1.1.0 branch November 16, 2026 23:35
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.

1 participant