Agent/global codex hooks - #23
Open
huang-daniel wants to merge 10 commits into
Open
Conversation
Adds the supervision kernel that will guarantee exactly one healthy long-lived collector process per data root. Primitives only — nothing in the hook, the CLI, or the server calls them yet, so event delivery is unchanged. - observe-env.sh: data-root and runtime path resolution, unsafe-root rejection, shared config defaults. Resolution is side-effect free so read-only callers never create state. - observe-process.sh: process identity (PID + start time + executable) plus a stable entrypoint marker, so a reused PID or an unrelated live process is never mistaken for the collector. Signals are addressed by identity, never by pattern. - observe-lock.sh: atomic lock claims and identity-based abandonment. Age is never evidence that a lock is abandoned. - observe-heartbeat.sh: heartbeat age/freshness bound to the lock's instanceId, and the canonical health predicate. - observe-health.sh: read-only diagnostic with four output shapes and three exit codes. It never signals, reclaims, or creates anything. Lock claims are gated in two stages: mkdir for the directory, then an O_EXCL (noclobber) write of the pid file inside bash. The second stage is load-bearing — Ubuntu 25.10's uutils coreutils 0.8.0 mkdir reports success to several concurrent creators of the same directory, so a singleton resting on the host mkdir binary is not a guarantee. The race test in test/hooks/scripts/supervision covers this. Contract and invariants: docs/collector-supervision.md Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
… supervision vars/tests
feat(supervision): add collector supervision primitives
huang-daniel
force-pushed
the
agent/global-codex-hooks
branch
from
July 26, 2026 14:13
9e9bbdb to
41a605e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.