Skip to content

feat(plugin): update council handoff, stage, and blocker state from PostToolUse (#1368)#1417

Merged
JeremyDev87 merged 2 commits into
masterfrom
feat/1368-posttooluse-council-state
Apr 7, 2026
Merged

feat(plugin): update council handoff, stage, and blocker state from PostToolUse (#1368)#1417
JeremyDev87 merged 2 commits into
masterfrom
feat/1368-posttooluse-council-state

Conversation

@JeremyDev87

Copy link
Copy Markdown
Owner

Summary

  • Add forward-only council stage advancement heuristic to on_tool_end() (opening→reviewing→consensus→done) triggered by tool completion patterns
  • Add blocker count detection from quality-check Bash output (pytest, tsc, eslint)
  • Guard read_hud_state behind tool_name check to avoid unnecessary disk I/O on non-council tools
  • Add 43 new tests (64→107 total) covering stage transitions, blocker detection, integration, and full lifecycle

Changes

File Change
hooks/lib/hud_helpers.py Council lifecycle constants, _infer_council_advance(), _detect_blocker_count(), enhanced on_tool_end()
hooks/tests/test_hud_helpers.py 4 new test classes: TestInferCouncilAdvance, TestDetectBlockerCount, TestOnToolEndCouncilAdvancement, TestFullLifecycleWithCouncil

Test plan

  • 107 tests pass (python3 -m pytest hooks/tests/test_hud_helpers.py)
  • No regressions in existing 64 tests
  • Council stage transitions: opening→reviewing (Agent), reviewing→consensus (Edit), consensus→done (parse_mode)
  • Blocker detection: pytest failure count, tsc error count, eslint error, all-pass clears blockers
  • No stage advance when council inactive
  • Full lifecycle: init → seed → advance → blocker → clear → done → reset
  • CI checks pass: lint, format, typecheck, test:coverage, circular, build

Closes #1368

…ostToolUse (#1368)

Add council lifecycle model to on_tool_end() so PostToolUse maintains
meaningful state transitions for the request-driven council UX.

- Add forward-only stage advancement heuristic (opening→reviewing→consensus→done)
  triggered by tool completion patterns (specialist tools, edit tools, parse_mode)
- Add blocker count detection from quality-check Bash output (pytest, tsc, eslint)
- Guard read_hud_state behind tool_name check to avoid unnecessary disk I/O
- Use specific lint patterns (yarn lint, npm run lint) to prevent false positives
- Add 43 new tests (107 total) covering stage transitions, blocker detection,
  integration, and full request lifecycle

Closes #1368
@JeremyDev87 JeremyDev87 added feat sub-issue 상위 이슈의 하위 작업 priority:medium Medium priority plugin packages/claude-code-plugin wow-experience Plugin Wow Experience Design P1 Priority 1: First Impression labels Apr 7, 2026
@vercel

vercel Bot commented Apr 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
codingbuddy-landing Ready Ready Preview, Comment Apr 7, 2026 6:04am

@JeremyDev87 JeremyDev87 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Critical: 0 | High: 0 | Medium: 0 (resolved) | Low: 1 (accepted)

Code Quality

  • Clean forward-only state machine in _infer_council_advance with guard clauses
  • frozenset for O(1) tool name lookups
  • Optional[int] return from _detect_blocker_count — good semantic distinction (None = don't touch)

Performance

  • read_hud_state guarded behind tool_name in _council_tools check — no unnecessary disk I/O on non-council tools (Read/Grep/Glob etc.)

Test Coverage

  • 43 new tests (64→107 total)
  • Unit tests for pure functions (_infer_council_advance, _detect_blocker_count)
  • Integration tests for on_tool_end() council + blocker paths
  • Full lifecycle end-to-end test covering init → seed → advance → blocker → clear → done → reset

EVAL Fixes Applied

  • Import ordering (import re grouped with stdlib)
  • Specific lint patterns ("yarn lint", "npm run lint" instead of bare "lint")
  • Redundant re.IGNORECASE removed (output already lowercased)
  • Docstring updated for on_tool_end()
  • 4 additional tests (prepare_parallel_agents, None output, yarn lint, npm run lint)

CI

  • landing-security-check failure is pre-existing (vite 7.3.1, GHSA-p9ff-h696-f583), unrelated
  • All 26 other checks pass

Ship-ready. 🚢

@JeremyDev87 JeremyDev87 force-pushed the feat/1368-posttooluse-council-state branch from 2a9fd45 to 00e3193 Compare April 7, 2026 06:02
@JeremyDev87 JeremyDev87 self-assigned this Apr 7, 2026
@JeremyDev87 JeremyDev87 merged commit 590d8c3 into master Apr 7, 2026
26 checks passed
@JeremyDev87 JeremyDev87 deleted the feat/1368-posttooluse-council-state branch April 7, 2026 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat P1 Priority 1: First Impression plugin packages/claude-code-plugin priority:medium Medium priority sub-issue 상위 이슈의 하위 작업 wow-experience Plugin Wow Experience Design

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(plugin): update council handoff, stage, and blocker state from PostToolUse

1 participant