Skip to content

docs(runbook): describe the host tick that starts the session with /bin/sh - #62

Merged
twoimo merged 1 commit into
mainfrom
docs/launchd-runbook-host-tick
Nov 23, 2026
Merged

twoimo merged 1 commit into
mainfrom
docs/launchd-runbook-host-tick

Conversation

@twoimo

@twoimo twoimo commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Why

The goal is to leave twoimo/alden with no open PRs or issues, each one resolved on its merits. PR #60 recorded one known doc gap: the launchd runbook describes a launch path that the code no longer uses. Operators and agents follow this runbook when they install, check or disable the KakaoTalk auto-reply host. A wrong launch chain sends them looking for the wrong TCC grants and the wrong process.

What was stale

docs/auto-reply-launchd-supervision.md said the session monitor starts the pinned .command with /usr/bin/open -g -b com.apple.Terminal, that Terminal is the TCC trust boundary, and that the plist runs auto-reply-session-monitor.py. The code does something else:

  • The plist that scripts/prepare-auto-reply-session-runtime.py writes runs <stable openkakao-cli> auto-reply-host --tick --manifest … --state-root ….
  • run_tick in src/commands/auto_reply_host.rs clears quarantine, takes session-monitor.lock, honors the disable sentinel, returns while the watchdog or supervisor owner lock is held, applies the 60 s cooldown and the 3-per-15-minute circuit, and then spawns /bin/sh <pinned-command> with a cleared environment.
  • Full Disk Access and Automation are approved on the stable binary at <state-root>/../bin/openkakao-cli (_stage_stable_binary), not on Terminal.

Changes

  • The artifact table names auto-reply-host --tick as the current host and marks auto-reply-session-monitor.py as retired (still staged, never run by the plist).
  • The persistence section describes the tick's steps, the /bin/sh launch, AbandonProcessGroup, why the Terminal path was dropped, and which path holds the TCC grants.
  • The representative .command and the plist description match what the packager generates. The example ends in exit "$status", which the packager writes again once fix(packager): end the session command with exit "$status" #61 merges.
  • launch_requested and open_failed are defined by the spawn result. The uninstaller renames the plist to <plist>.disabled.<unix-time>.<pid>, which is what uninstall-auto-reply-session-monitor.sh does.
  • ARCHITECTURE.md drops its note that the runbook is stale.

Verification

An independent reviewer (Opus) checked each claim against the code at the first revision and gave PASS+NOTES. It confirmed the lock order, the numbers, the child environment, the plist keys and the stable path. Its notes are applied: the Accessibility grant guidance, the uninstaller rename, and the exit "$status" gap, which is fixed as a bug in #61. python3 ~/.agents/skills/project-onboard/scripts/check_docs.py . prints OK .. Docs only, so no CI step reads these files.

🤖 Generated with Claude Code

…in/sh

The runbook said the session monitor opens the pinned .command with
`open -g -b com.apple.Terminal`. The plist that
prepare-auto-reply-session-runtime.py writes runs
`openkakao-cli auto-reply-host --tick`, and the tick starts the pinned
command with `/bin/sh` (src/commands/auto_reply_host.rs). Describe that
chain, its locks, cooldown and circuit, the stable binary that holds the
Full Disk Access grant, and the plist keys the packager sets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@twoimo

twoimo commented Nov 23, 2026

Copy link
Copy Markdown
Owner Author

Decision: merge.

Evidence:

  • An independent reviewer (Opus) checked every new claim against src/commands/auto_reply_host.rs, scripts/prepare-auto-reply-session-runtime.py, the uninstaller and the status scripts, and gave PASS+NOTES. It confirmed the lock order and early returns, the 60 s cooldown and the 3-per-15-minute circuit, the cleared child environment, every plist key, and the stable binary path.
  • Its notes are applied in b80671a. The text now says to put the Accessibility grant on the stable binary as well, and that the uninstaller renames the plist. The .command example's final exit "$status" line is true now that fix(packager): end the session command with exit "$status" #61 has merged (a6fa8d2).
  • check_docs.py . prints OK .. Docs only, so no CI step reads these files. GitHub-hosted Actions are blocked by billing, so the zero-step check failures are infra state.

@twoimo
twoimo merged commit b4bd454 into main Nov 23, 2026
4 checks passed
@twoimo
twoimo deleted the docs/launchd-runbook-host-tick branch November 23, 2026 04:07
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