Library test coverage — OutputManager integration, cyclic deps, serialization, filekit fallback
Problem
core_lib and plan_lib shipped with solid unit tests (33 + 50 = 83 tests), but six areas identified during implementation remain untested:
-
OutputManager + renderer integration — THAC0 level filtering through the plan renderer is untested. render_plan() calls print_*() functions but no test verifies that verbosity levels actually filter plan output.
-
Cyclic dependency detection — Action.depends_on supports dependency chains, and _resolve_execution_order() handles them, but no test exercises a cycle (A→B→A). The handler exists but is unverified.
-
Serialization round-trip — Action and Plan are dataclasses with .asdict() support, but no test verifies asdict() → JSON → reconstruct for the "saved plans" promise.
-
dazzle_filekit fallback — plan_lib's file_ops.py has a conditional import for dazzle_filekit with a stdlib fallback. No test verifies the fallback path works when dazzle_filekit isn't installed.
-
Large plan stress — No test exercises plans with 50+ actions to verify performance of dependency resolution and rendering at scale.
-
ANSI rendering correctness — The renderer uses ANSI escape codes for terminal output, but no test verifies the output matches expected formatting (could use snapshot testing).
These gaps were identified in the 2026-03-02__18-33-23 gap analysis during the core_lib/plan_lib implementation session.
Proposed solution
A focused test module for each gap area:
# tests/test_lib_integration.py
class TestOutputManagerRendererIntegration:
"""Verify THAC0 level 0 shows summary, level 2 shows full details"""
class TestCyclicDependency:
"""Verify A→B→A raises CyclicDependencyError with clear message"""
class TestSerializationRoundTrip:
"""Verify Action/Plan survive asdict() → JSON → reconstruct"""
class TestFileKitFallback:
"""Verify plan_lib works without dazzle_filekit installed"""
class TestLargePlanPerformance:
"""Verify 100-action plan resolves and renders in <1 second"""
class TestANSIRendering:
"""Snapshot test for renderer output format"""
Implementation approach
These can be built incrementally — each test class is independent:
- Phase A (high value): Cyclic deps + serialization round-trip — these catch real bugs
- Phase B (medium value): OutputManager + renderer integration + filekit fallback — these catch integration gaps
- Phase C (low priority): Large plan stress + ANSI rendering — these catch edge cases
Acceptance criteria
Related issues
Analysis
See 2026-03-02__20-16-20__full-postmortem_core-lib-plan-lib-and-session-discoveries.md for the gap identification during implementation.
See 2026-03-02__21-48-45__dev-workflow-process_missing-issues-and-plan-gaps.md for gap analysis (Gap 4).
Library test coverage — OutputManager integration, cyclic deps, serialization, filekit fallback
Problem
core_lib and plan_lib shipped with solid unit tests (33 + 50 = 83 tests), but six areas identified during implementation remain untested:
OutputManager + renderer integration — THAC0 level filtering through the plan renderer is untested.
render_plan()callsprint_*()functions but no test verifies that verbosity levels actually filter plan output.Cyclic dependency detection —
Action.depends_onsupports dependency chains, and_resolve_execution_order()handles them, but no test exercises a cycle (A→B→A). The handler exists but is unverified.Serialization round-trip —
ActionandPlanare dataclasses with.asdict()support, but no test verifiesasdict() → JSON → reconstructfor the "saved plans" promise.dazzle_filekit fallback — plan_lib's
file_ops.pyhas a conditional import fordazzle_filekitwith a stdlib fallback. No test verifies the fallback path works whendazzle_filekitisn't installed.Large plan stress — No test exercises plans with 50+ actions to verify performance of dependency resolution and rendering at scale.
ANSI rendering correctness — The renderer uses ANSI escape codes for terminal output, but no test verifies the output matches expected formatting (could use snapshot testing).
These gaps were identified in the
2026-03-02__18-33-23gap analysis during the core_lib/plan_lib implementation session.Proposed solution
A focused test module for each gap area:
Implementation approach
These can be built incrementally — each test class is independent:
Acceptance criteria
Action→asdict()→ JSON string → dict → verify all fields preservedfile_ops.pyworks when import failsRelated issues
Analysis
See
2026-03-02__20-16-20__full-postmortem_core-lib-plan-lib-and-session-discoveries.mdfor the gap identification during implementation.See
2026-03-02__21-48-45__dev-workflow-process_missing-issues-and-plan-gaps.mdfor gap analysis (Gap 4).