rein-aharness/tests
tegwick 6c4f00e2c2 Add real-time per-tool-call audit streaming (HARNESS-WP-0002-T03)
Claude Code executes its own tools internally in --print mode -- there
is no way for a caller to externally dispatch individual tool calls
without abandoning that self-contained agent model. What
--output-format stream-json --include-hook-events does allow: observing
each tool_use/tool_result/hook event in real time.

- adapter.py: AgenticClaudeCodeAdapter gains an optional on_tool_event
  callback; streaming mode (Popen + background reader thread) is used
  only when set, blocking subprocess.run path is unchanged otherwise.
- runner.py: run_task gains emit_tool_events/on_tool_event, collecting
  events onto RunResult.tool_events and posting a tool_call hub event
  per tool when reporting is enabled.
- cli.py: --stream-tool-events flag on `run`, prints each event as a
  tagged JSON line ahead of the unchanged final result block.

Live-verified against the real claude CLI: 5 real tool events streamed
correctly (2x Bash, 1x Write) plus Stop hook lifecycle events, real
commit landed, final result block unchanged. 13 new tests
(test_adapter.py + 2 in test_runner.py), all passing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-26 14:49:36 +02:00
..
test_adapter.py Add real-time per-tool-call audit streaming (HARNESS-WP-0002-T03) 2026-07-26 14:49:36 +02:00
test_brief_daily.py Rename package, CLI, and deploy artifacts to rein-aharness (HARNESS-WP-0002-T02) 2026-07-26 14:22:18 +02:00
test_intake.py Rename package, CLI, and deploy artifacts to rein-aharness (HARNESS-WP-0002-T02) 2026-07-26 14:22:18 +02:00
test_mail_triage.py Rename package, CLI, and deploy artifacts to rein-aharness (HARNESS-WP-0002-T02) 2026-07-26 14:22:18 +02:00
test_mailscan.py Rename package, CLI, and deploy artifacts to rein-aharness (HARNESS-WP-0002-T02) 2026-07-26 14:22:18 +02:00
test_manifest.py Rename package, CLI, and deploy artifacts to rein-aharness (HARNESS-WP-0002-T02) 2026-07-26 14:22:18 +02:00
test_metrics.py Rename package, CLI, and deploy artifacts to rein-aharness (HARNESS-WP-0002-T02) 2026-07-26 14:22:18 +02:00
test_runner.py Add real-time per-tool-call audit streaming (HARNESS-WP-0002-T03) 2026-07-26 14:49:36 +02:00
test_smoke.py Rename package, CLI, and deploy artifacts to rein-aharness (HARNESS-WP-0002-T02) 2026-07-26 14:22:18 +02:00