-
Notifications
You must be signed in to change notification settings - Fork 0
Description
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-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
- Cyclic dependency test exists and verifies error handling
- Serialization round-trip test:
Action→asdict()→ JSON string → dict → verify all fields preserved - OutputManager integration test: renderer respects THAC0 verbosity levels
- dazzle_filekit fallback test:
file_ops.pyworks when import fails - All new tests pass alongside existing 83 tests
- At least one test per gap area from the list above
Related issues
- Refs Plan-Execute architecture — trustworthy --dry-run across all subcommands #53 — Plan-Execute epic (strengthens confidence before closing)
- Refs Plan-Execute Phase 0: core infrastructure — plan.py dataclasses and display #54 — Phase 0 core infrastructure (these are the Phase 0 test gaps)
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).