Skip to content

feat(harness): enable tool-mirror hook + live activity in inspector drawer (issue #84) - #101

Merged
robercano-ghbot merged 1 commit into
mainfrom
feat/issue-84-tool-mirror-activity
Jul 9, 2026
Merged

feat(harness): enable tool-mirror hook + live activity in inspector drawer (issue #84)#101
robercano-ghbot merged 1 commit into
mainfrom
feat/issue-84-tool-mirror-activity

Conversation

@robercano-ghbot

Copy link
Copy Markdown
Collaborator

Closes #84.

Decision: ENABLE the tool-mirror hook by default

Evaluated the log-worker-tool.sh spike (PostToolUse hook mirroring worker Bash/Edit/Write calls to .claude/state/worker-tools.jsonl) and decided to enable it always-on. Full evaluation evidence is posted as a comment on issue #84. Summary: readable Bash summaries, correct oldest-first rotation at the 2000-line cap, ~1,200 lines/hour under a ~4-worker fan-out (well within budget), zero agent tokens (harness-side), never-block contract intact.

Changes (all under .claude/)

  • settings.json — new PostToolUse Bash|Edit|Write entry wiring log-worker-tool.sh (existing Edit|Write→lint hook, Stop, PreToolUse all preserved).
  • scripts/log-worker-tool.sh — header status reframed from "SPIKE / disabled by default" to enabled-by-default (behavior unchanged; comment-only diff).
  • scripts/log-worker-tool.test.sh — header note updated to match.
  • scripts/cockpit-serve.shGET /api/worker/<role>/<task> gains an activity field: worker-tools records under the worker's worktree path, newest first, capped to 20; [] when the log file or worktree is absent (never throws). CLAUDE_WORKER_TOOLS_FILE env override plumbed into the node reader for testability. Drawer gains a "Live activity (newest first)" section rendered via textContent only (same XSS contract as the rest of the drawer).
  • scripts/cockpit.test.sh — new coverage for the activity field: presence + array + newest-first ordering + cross-worktree exclusion, and the no-log-file case (activity: [], endpoint still 200 with timeline/worktree intact).

Gates & review

  • GATES_FILE=.claude/self/gates.json gate.sh build|lint|test all green (cockpit.test.sh 57 checks, log-worker-tool.test.sh 17 checks, smoke-fanout end-to-end pass).
  • Reviewed through correctness (approve) and tests (approve) lenses, consensus all.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EXQ49ycXNDBzi8x15n2jsc

…rawer (issue #84)

Enable log-worker-tool.sh's PostToolUse mirror by default (issue #71 spike
concluded: go) and extend the worker inspector (/api/worker/<role>/<task>)
with an `activity` array read from the mirror log, filtered to the
worker's worktree and capped to the most recent 20, newest first. The
drawer gains a "Live activity" section, rendered via textContent only.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EXQ49ycXNDBzi8x15n2jsc
@robercano-ghbot
robercano-ghbot merged commit 9849642 into main Jul 9, 2026
9 checks passed
@robercano-ghbot
robercano-ghbot deleted the feat/issue-84-tool-mirror-activity branch July 9, 2026 18:04
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.

Cockpit 3c follow-up: evaluate the tool-mirror spike and feed worker-tools.jsonl into the inspector drawer

2 participants