Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ ignore = "0.4"
tempfile = "3.10"
parking_lot = "0.12"
log = "0.4"
tracing = "0.1"
tracing-subscriber = { version = "0.3", default-features = false, features = ["registry", "std"] }
env_logger = "0.11"
xxhash-rust = { version = "0.8", features = ["xxh3"] }

Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,15 @@ Every change stores two parallel representations:
|---------|-------------|
| `atomic agent enable` | Install agent hooks (auto-detect or `--agent claude-code`) |
| `atomic agent disable` | Remove agent hooks |
| `atomic agent status` | Show active sessions and hook status (`--json` for tooling) |
| `atomic agent status` | Show sessions, hook liveness, and failures (`--json` for tooling) |
| `atomic agent explain <id>` | Generate AI reasoning summary for a session |
| `atomic agent attest` | List and inspect attestations |

Hook health is computed from session-scoped logs, so concurrent agents retain
their own outcomes and a child's success cannot hide a parent's failure. See
[Hook Health and Session Logs](docs/hook-health.md) for diagnosis, JSON fields,
and parent-session correlation.

### Vault Commands

| Command | Description |
Expand Down
3 changes: 3 additions & 0 deletions atomic-agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ anyhow = { workspace = true }

# Logging
log = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
uuid = { workspace = true }

# Filesystem traversal (fallback watcher when Watchman unavailable)
walkdir = { workspace = true }
Expand Down
28 changes: 27 additions & 1 deletion atomic-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,33 @@ The recording workflow on each turn end:
2. **Add** — track any new files the agent created (filtering out `node_modules`, `target`, etc.)
3. **Record** — create an Atomic change with AI provenance metadata

No daemon. No Watchman required. No git. Each hook invocation is a standalone process that opens the repo, does its work, and exits. Codex is the one lifecycle-specific exception: because Codex caps `SessionEnd` hooks at three seconds, the hook hands finalization to a short-lived background worker after safely forwarding the event payload.
No Watchman or Git is required. Each hook invocation is a standalone process. Database operations use the shared service handlers: local mode runs them in-process; reactor mode calls the daemon. Codex is the one lifecycle-specific exception: because Codex caps `SessionEnd` hooks at three seconds, the hook hands finalization to a short-lived background worker after safely forwarding the event payload.

## Hook Health and Session Logs

`atomic agent status` reports the last successful hook dispatch and outstanding
failures. `--json` includes aggregate `hook_health`, session-scoped `hook_sessions`
(with parent IDs and per-verb outcomes), and `hook_health_error` when the log cannot
be loaded. A child's successful hook cannot clear its parent's failure.

Native hooks, typed `agent receive`, and the shared dispatch handler emit
structured Rust `tracing` events. The service appends immutable observations to
the session log in `.atomic/atomic.redb`, independently of provenance turn state.
Event IDs make append retries idempotent; transactional writes retain concurrent
parent/child activity. Health is projected from the log rather than a shared
`hook-health.json` snapshot. Existing plugin and git-shadow errors are also read
from the bounded tail of `hook-errors.log`.

Session IDs come from hook payloads. Bridges can explicitly carry correlation
across processes with `ATOMIC_SESSION_ID` and `ATOMIC_PARENT_SESSION_ID`; typed
dispatch forwards the resolved parent ID on the service request. Malformed input
without an identifiable session remains an unassigned diagnostic. During a
service outage, each observation is spooled to its own immutable file under
`.atomic/hook-log-pending/`; a successful append replays pending observations
idempotently. Status can report pending observations while the service is down.

See [Hook Health and Session Logs](../docs/hook-health.md) for the status JSON
fields and troubleshooting workflow.

## Agent Identity

Expand Down
Loading
Loading