rein-aharness/WORK-RECORDS.md
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

2.1 KiB

Work Records — rein-aharness

Generated by statehub fix-consistency (CUST-WP-0061-T04, work-record stage 3). Do not edit by hand — edit the source file/block listed for each record and re-run fix-consistency to refresh this index. Archived workplans are omitted; closed decisions/intakes/engagements stay listed so recently-resolved work is still visible. [auto]

Kind ID Status Lane Source
workplan HARNESS-WP-0001 done workplans/HARNESS-WP-0001-harness-foundation.md
workplan HARNESS-WP-0002 active workplans/HARNESS-WP-0002-rename-and-glas-harness-alignment.md
workplan REIN-A-0001 ready workplans/REIN-A-0001-statehub-bootstrap.md
task HARNESS-WP-0001-T01 done workplans/HARNESS-WP-0001-harness-foundation.md
task HARNESS-WP-0001-T02 done workplans/HARNESS-WP-0001-harness-foundation.md
task HARNESS-WP-0001-T03 done workplans/HARNESS-WP-0001-harness-foundation.md
task HARNESS-WP-0001-T04 done workplans/HARNESS-WP-0001-harness-foundation.md
task HARNESS-WP-0001-T05 done workplans/HARNESS-WP-0001-harness-foundation.md
task HARNESS-WP-0001-T06 done workplans/HARNESS-WP-0001-harness-foundation.md
task HARNESS-WP-0001-T07 done workplans/HARNESS-WP-0001-harness-foundation.md
task HARNESS-WP-0002-T01 done workplans/HARNESS-WP-0002-rename-and-glas-harness-alignment.md
task HARNESS-WP-0002-T02 progress workplans/HARNESS-WP-0002-rename-and-glas-harness-alignment.md
task HARNESS-WP-0002-T03 progress workplans/HARNESS-WP-0002-rename-and-glas-harness-alignment.md
task HARNESS-WP-0002-T04 todo workplans/HARNESS-WP-0002-rename-and-glas-harness-alignment.md
task REIN-A-0001-T01 todo workplans/REIN-A-0001-statehub-bootstrap.md
task REIN-A-0001-T02 todo workplans/REIN-A-0001-statehub-bootstrap.md
task REIN-A-0001-T03 todo workplans/REIN-A-0001-statehub-bootstrap.md