Skip to content

Add Hook Daemon SPEC.md with acceptance criteria#1277

Draft
agentydragon wants to merge 3 commits intodevelfrom
claude/hook-daemon-spec-y6b5s
Draft

Add Hook Daemon SPEC.md with acceptance criteria#1277
agentydragon wants to merge 3 commits intodevelfrom
claude/hook-daemon-spec-y6b5s

Conversation

@agentydragon
Copy link
Copy Markdown
Owner

Summary

Introduce a high-level, user-facing specification for the Claude Code hook daemon that documents what behaviors and guarantees are provided to every session, along with observable acceptance criteria for validation.

Key Changes

  • New devinfra/claude/hook_daemon/SPEC.md: Comprehensive specification covering:

    • Overview of the hook daemon's role in making sessions consistent across CLI and web environments
    • Common behaviors guaranteed in all sessions (credentials, Bazel/BuildBuddy integration, pre-commit hooks, tracing, MCP servers, observability)
    • CLI profile specifics (git safety shim, direnv bridge, no proxy/tmpfs/idle-shutdown)
    • Web profile specifics (managed credentials, Kubernetes access, GitHub fork remote, container runtime, tmpfs caching, idle shutdown)
    • Observable acceptance criteria for both common and profile-specific behaviors that serve as runnable tests
  • Updated AGENTS.md: Added new "SPEC.md — High-level component specifications" section documenting:

    • Purpose of SPEC.md files as user-facing specifications separate from implementation details
    • Guidelines for what belongs in SPEC.md vs. README.md/code comments
    • Requirement to update SPEC.md when high-level requirements change
  • Updated skills/web_selfcheck/SKILL.md: Added "What 'Healthy' Means — the Hook Daemon SPEC" section clarifying:

    • This skill is the runnable acceptance test for the hook daemon SPEC
    • The SPEC is the source of truth for expected behaviors
    • Guidance for keeping skill checks and SPEC in sync
  • Updated devinfra/claude/README.md: Added "Specification" section directing readers to SPEC.md for high-level behavior documentation before diving into implementation details

  • Updated devinfra/claude/hook_daemon/bes_interceptor.py: Added TODO comment noting that the BES interceptor nudge behavior is experimental and not yet committed in SPEC.md

Notable Details

The SPEC establishes a clear contract between the hook daemon and the agent, with explicit acceptance criteria that can be validated by the /web_selfcheck skill. This creates a single source of truth for what behaviors are guaranteed vs. implementation details.

https://claude.ai/code/session_01MV6VtGgEB5HF5Ws1zS8mgL

claude added 3 commits April 13, 2026 22:15
Introduce devinfra/claude/hook_daemon/SPEC.md describing what the hook
daemon guarantees to every Claude Code session (common / CLI-only /
web-only), with observable acceptance criteria that /web_selfcheck runs
against a live session. Add a repo-level SPEC.md convention in
AGENTS.md, point the claude README and web_selfcheck skill at the SPEC
as the source of truth for a healthy session, and leave a TODO on the
BES interceptor noting its --remote_executor nudge is experimental and
deliberately not in SPEC yet.

BAZEL_TEST_INVOCATIONS=none: documentation-only change (new SPEC.md
plus markdown edits to AGENTS.md, README.md, SKILL.md, and a docstring
TODO in bes_interceptor.py); no source code behavior changes to test.

https://claude.ai/code/session_01MV6VtGgEB5HF5Ws1zS8mgL
Frame web_selfcheck as the runnable acceptance test for the hook daemon
SPEC: read SPEC.md, then run one concrete check per numbered criterion
(C1-C8 common, CLI1-4, W1-5). Drop prose that restated the SPEC, drop
verbose "Fix" recipes (the fix is always "tell the user, daemon broken"),
and collapse the old SOPS decryption narrative into the live API tests
that already verify the credentials end-to-end.

Keep the out-of-SPEC diagnostics that catch real-world failure modes the
SPEC does not codify (web_setup.sh freshness, claude-hooks pin
staleness, bbr runner recycling, origin URL reachability for bbr) under
a clearly-marked Diagnostics section so they can not be confused with
SPEC violations.

Net: 657 -> 372 lines (-43%).

BAZEL_TEST_INVOCATIONS=none: documentation-only change to a single
skill markdown file; no source code changes.

https://claude.ai/code/session_01MV6VtGgEB5HF5Ws1zS8mgL
Move the bbr runner-recycling / analysis-cache check from web_selfcheck
out-of-SPEC diagnostics into SPEC.md as a best-effort guarantee: a
second bbr invocation with identical inputs should usually land on a
warm runner with the Bazel analysis cache already populated, so the
second build is substantially faster than a cold one. Explicitly scope
this as best-effort (runners are shared across concurrent sessions
today, so transient cold hits are acceptable) rather than a hard
guarantee, since we do not yet tag snapshots per session.

Add Common acceptance criterion C9 to SPEC.md and the matching check to
web_selfcheck SKILL.md; drop the old D3 and renumber the D-check table.

BAZEL_TEST_INVOCATIONS=none: documentation-only change to SPEC.md and
web_selfcheck SKILL.md; no source code changes.

https://claude.ai/code/session_01MV6VtGgEB5HF5Ws1zS8mgL
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