Skip to content

test: kaizen lifecycle interaction test + fix orphaned test registration (kaizen #336)#259

Merged
aviadr1 merged 1 commit intomainfrom
fix/kaizen-test-coverage-336
Mar 21, 2026
Merged

test: kaizen lifecycle interaction test + fix orphaned test registration (kaizen #336)#259
aviadr1 merged 1 commit intomainfrom
fix/kaizen-test-coverage-336

Conversation

@aviadr1
Copy link
Copy Markdown

@aviadr1 aviadr1 commented Mar 21, 2026

Summary

  • Register 3 orphaned test files in run-all-tests.sh (test-capture-worktree-context, test-enforce-kaizen-stop, test-worktree-context-integration)
  • Add test-integration-kaizen-lifecycle.sh — 35 tests covering the full kaizen reflection lifecycle across 4 hooks
  • Verify exit-before-enforcement anti-pattern (kaizen skill: add /update-nanoclaw with scipt architecture qwibitai/nanoclaw#317) is prevented
  • Total: 1035 tests, all passing (up from 957 with 3 failures)

What's tested

The new interaction test covers the complete kaizen gate lifecycle:

  1. Before PR create: no gates, stop allowed
  2. gh pr createkaizen-reflect.sh sets gate
  3. Gate active: commands blocked (enforce-pr-kaizen), stop blocked (enforce-kaizen-stop)
  4. Allowed kaizen commands pass through during gate
  5. Valid KAIZEN_IMPEDIMENTSpr-kaizen-clear.sh clears gate
  6. After clearing: everything allowed
  7. Multiple PRs: partial clearing (one cleared, still blocked by second)
  8. Failed PR create doesn't set gate
  9. Invalid/waived KAIZEN_IMPEDIMENTS don't clear gate
  10. Cross-branch isolation
  11. KAIZEN_NO_ACTION also clears gate

Test plan

  • All 1035 tests pass (bash .claude/kaizen/hooks/tests/run-all-tests.sh)
  • No orphaned test files detected
  • New interaction test verifies 35 assertions across 11 phases

Run tag: batch-260321-1108-3ef8/run-5

🤖 Generated with Claude Code

…ion (kaizen qwibitai#336)

- Register 3 orphaned test files in run-all-tests.sh:
  test-capture-worktree-context.sh, test-enforce-kaizen-stop.sh,
  test-worktree-context-integration.sh

- Add test-integration-kaizen-lifecycle.sh: 35 tests covering the full
  kaizen reflection lifecycle across 4 hooks (kaizen-reflect.sh →
  enforce-pr-kaizen.sh + enforce-kaizen-stop.sh → pr-kaizen-clear.sh)

- Tests verify exit-before-enforcement anti-pattern (kaizen qwibitai#317) is
  prevented: session stop is blocked when kaizen gate is active

- Tests cover: gate activation, command blocking, stop blocking,
  valid/invalid clearing, multi-PR partial clearing, cross-branch
  isolation, waiver rejection (#198), KAIZEN_NO_ACTION support

Total: 1035 tests, all passing (up from 957 with 3 failures)

Run tag: batch-260321-1108-3ef8/run-5

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@aviadr1 aviadr1 enabled auto-merge (squash) March 21, 2026 10:51
@aviadr1 aviadr1 merged commit e7df923 into main Mar 21, 2026
3 checks passed
@aviadr1 aviadr1 added the overnight-dent Created by overnight-dent batch automation label Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

overnight-dent Created by overnight-dent batch automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant