Skip to content

test: lifecycle callback edge cases#36

Draft
Koan-Bot wants to merge 1 commit into
masterfrom
koan.atoomic/test-lifecycle-callbacks
Draft

test: lifecycle callback edge cases#36
Koan-Bot wants to merge 1 commit into
masterfrom
koan.atoomic/test-lifecycle-callbacks

Conversation

@Koan-Bot

@Koan-Bot Koan-Bot commented Apr 21, 2026

Copy link
Copy Markdown
Collaborator

What

Add 22 tests covering lifecycle callback contracts that aren't exercised by existing test files.

Why

The existing tests verify individual callback behaviors, but several edge cases around their interactions were untested:

  • _before_build / _after_build return values are silently ignored (unlike _before_* attribute hooks) -- this contract was undocumented by tests
  • Accessor hooks fire normally when called from _after_build and build() callbacks
  • _before_build sees all constructor args including unknown ones (before strict constructor rejects them)
  • Constructor args overwrite values set by _before_build
  • Exception propagation from all three lifecycle phases

Testing

All 22 new tests pass. Full suite passes across all existing test files.

🤖 Generated with Claude Code


Quality Report

Changes: 1 file changed, 227 insertions(+)

Code scan: clean

Tests: passed (OK)

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

Cover contracts and interactions for _before_build, build(),
_after_build that aren't tested elsewhere: return value semantics,
hook firing during callbacks, exception propagation, and constructor
arg visibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant