Skip to content

DM delivery as a mechanism, not compliance (v0.7.0) - #3

Merged
convenientlymike merged 1 commit into
mainfrom
feat/delivery-backbone
Sep 5, 2026
Merged

convenientlymike merged 1 commit into
mainfrom
feat/delivery-backbone

Conversation

@convenientlymike

Copy link
Copy Markdown
Owner

Closes the "live-but-unmonitored agent silently misses DMs" gap by making delivery a guaranteed mechanism for any active agent.

What

  • Fold DM delivery into heartbeat.sh (PostToolUse) via hookSpecificOutput.additionalContext JSON — bare PostToolUse stdout is not injected (verified against the hooks docs), so the JSON path is required. awareness.sh (UserPromptSubmit, stdout) covers prompt turns; heartbeat.sh covers long autonomous tool turns. Union: no unread DM survives a turn boundary on an active agent — zero arming, zero daemon, zero tokens.
  • Canonical inbox codepath — fleet_unread_scan + _fleet_seen_set (lib.sh) shared by both hooks. .seen is now atomic (tmp+mv) + monotonic (a racing writer can't skip a DM) and advances only after an actual emit. PostToolUse delivery throttled (FLEET_PULL_THROTTLE_S=45s) — guards noise, not correctness.
  • Fix settings drift — checked-in .claude/settings.json was missing PostToolUse:heartbeat + the SessionStart wake nudges (the repo dogfooded a config that didn't deliver). Regenerated to installer-canonical; a selftest control now bites on re-drift.

Honest scope

Delivery to an active agent is now GUARANTEED. Waking an idle window stays best-effort via the Monitor — a hook physically can't arm it; the pull delivers on the next turn, it doesn't wake. That's the platform floor, stated exactly.

Verified

selftest-collateral.sh DELIVERY + neg-control + throttle-hold + settings-drift controls all pass; shellcheck --severity=warning clean. Delivery byproofed end-to-end (valid additionalContext JSON carries the DM, seen advances only on emit, throttled DM not lost + delivered once window passes).

🤖 Generated with Claude Code

Makes cross-agent message delivery a guaranteed mechanism for any ACTIVE
agent, closing the "live-but-unmonitored agent silently misses DMs" gap.

- Fold unread-DM delivery into heartbeat.sh (PostToolUse) via
  hookSpecificOutput.additionalContext JSON (bare PostToolUse stdout is NOT
  injected — verified vs the hooks docs). awareness.sh (UserPromptSubmit,
  stdout) covers prompt turns; heartbeat covers long autonomous tool turns.
  Union: no unread DM survives a turn boundary on an active agent — zero
  arming, zero daemon, zero tokens. (Waking an IDLE window stays best-effort
  via the Monitor; a hook can't arm it — pull delivers on next turn.)
- Canonical inbox codepath: fleet_unread_scan + _fleet_seen_set (lib.sh),
  shared by both hooks. .seen is now atomic (tmp+mv) + monotonic (a racing
  writer can't skip a DM) and advances ONLY after an actual emit. PostToolUse
  delivery throttled (FLEET_PULL_THROTTLE_S=45s) — guards noise, not correctness.
- Fix settings drift: checked-in .claude/settings.json was missing
  PostToolUse:heartbeat + the SessionStart wake nudges (dogfooded a config
  that didn't deliver). Regenerated to installer-canonical; a selftest control
  now bites on re-drift.

Verified: selftest-collateral DELIVERY + neg-control + throttle + settings
controls pass; shellcheck --severity=warning clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@convenientlymike
convenientlymike merged commit 925e472 into main Sep 5, 2026
2 checks passed
@convenientlymike
convenientlymike deleted the feat/delivery-backbone branch September 5, 2026 18:20
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