Skip to content

feat: observer CLI — canonicalization, boundaries, hooks, setup - #816

Open
davidmiuraactualai wants to merge 10 commits into
mainfrom
feat/observer-setup
Open

feat: observer CLI — canonicalization, boundaries, hooks, setup#816
davidmiuraactualai wants to merge 10 commits into
mainfrom
feat/observer-setup

Conversation

@davidmiuraactualai

Copy link
Copy Markdown

Summary

  • Phase 1C: actual observe subcommand with 8 hook types, deterministic canonicalization via AEWO event codes, JSONL session journal at ~/.actualai/actual/sessions/, typed hook payloads
  • Phase 4A: Evaluation boundary detection (PreToolUse Edit/Write, PostToolUseFailure, Stop). Hook output builder for Claude Code's hook contract (silent→{}, inform/warn/block→hookSpecificOutput.additionalContext)
  • Phase 4C: actual observe setup — additive hook installation into .claude/settings.json (preserves existing hooks, idempotent, atomic writes). actual observe status for hook state reporting

Test plan

  • 12 boundary detection tests
  • 12 canonicalization tests
  • 10 hook output tests
  • 5 journal tests
  • 5 types tests
  • 7 setup tests (including idempotency, existing hook preservation)
  • cargo test all green
  • cargo clippy clean

🤖 Generated with Claude Code

davidmiuraactualai and others added 10 commits August 2, 2026 22:13
Introduces an ephemeral OAuth flow that authenticates without storing a
refresh token, then calls POST /repos/onboard-public to queue a public
repository for architecture analysis.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…es 1C, 4A, 4C)

Phase 1C: `actual observe` subcommand with 8 hook types (session-start,
prompt, pre-tool, post-tool, post-tool-failure, stop, session-end,
pre-compact). Deterministic canonicalization, JSONL session journal,
typed hook payloads.

Phase 4A: Evaluation boundary detection — PreToolUse(Edit|Write),
PostToolUseFailure, Stop are boundaries. Hook output builder for
silent/inform/warn/block dispositions with Claude Code hook contract.

Phase 4C: `actual observe setup` installs 8 hooks into
.claude/settings.json additively (preserves existing hooks, idempotent).
`actual observe status` reports hook installation state.

50 tests across boundary, canonicalize, hook_output, journal, types,
and setup modules.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude Code validates hooks as {matcher, hooks: [{type, command}]},
not flat {type, command} entries. Fixes settings validation error
on session start.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
At evaluation boundaries (file edits, tool failures, session stops),
the observer now loads stored credentials, reads journal events, and
POSTs to the advisor intervention API. Non-boundary hooks remain
zero-latency. Any error degrades silently to empty hook output.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a JSONL line fails to parse, print a warning to stderr with the
line number and error before skipping, so users know an event was lost.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The advisor intervention endpoint requires the observe:events scope,
but the CLI login flow only requested adr:query and adr:review. Without
this scope, observer boundary evaluations get 403 from the API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add app_url parameter to loopback server success page
- Thread base_url from config to both login_with and login_ephemeral
- Show styled "Open web app" button on the signed-in callback page
- Add reset command stub and CLAUDE.md updates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The API only accepts HTTPS URLs, but users naturally pass SSH URLs
(git@github.com:owner/repo.git). Convert at the CLI boundary so both
formats work seamlessly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The API's onboard-public endpoint now handles SSH URLs directly, so
the CLI passes the user's URL as-is.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Checks service ports (Supabase, Temporal, Redis, API, Next.js), env
files, .next cache health, Python venv, and key env vars. Outputs
numbered copy-paste fix commands for any failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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