Skip to content

[P2][Testing] Increase test coverage for critical paths #18

@aWN4Y25pa2EK

Description

@aWN4Y25pa2EK

Summary

Only 3 test files exist for 65 TypeScript files (~5% coverage by file count). Critical paths lack unit tests.

Source

Code Reviewer Assessment

Current Test Files

  • impl/mvp/src/holons/root.test.ts
  • impl/mvp/src/holons/e2e-pipeline.test.ts
  • impl/mvp/src/blackboard/redis-blackboard.test.ts

Missing Test Coverage

  1. Response Parser - JSON extraction edge cases, malformed JSON recovery
  2. Decomposition Verifier - DAG cycle detection, criterion coverage calculation
  3. Config Validation - Corner cases, env var parsing
  4. Root Holon - Retry logic, budget enforcement, error recovery paths
  5. Token Budget - Calculation accuracy, budget exceeded scenarios
  6. Failure Categorization - Pattern matching edge cases
  7. Linear Client - API error handling, retry scenarios
  8. ADK Runner - Session cleanup, timeout handling

Impact

  • Regressions go undetected
  • Refactoring is risky
  • Edge cases not covered
  • Confidence in changes is low

Severity

Medium | Likelihood: High (every change is risky)

Recommended Test Plan

Priority 1 (Critical Paths)

// response-parser.test.ts
describe('parseDecomposition', () => {
  it('handles valid JSON', () => {});
  it('recovers from malformed JSON', () => {});
  it('rejects invalid structures', () => {});
  it('normalizes acceptance_criteria array', () => {});
  it('limits array lengths', () => {});
});

// decomposition-verifier.test.ts  
describe('verifyDecomposition', () => {
  it('detects circular dependencies', () => {});
  it('detects self-loops', () => {});
  it('calculates criterion coverage', () => {});
  it('validates subtask count by complexity', () => {});
});

Priority 2 (Error Paths)

// root.test.ts
describe('execute retry logic', () => {
  it('retries on NEEDS_REVISION', () => {});
  it('fails after max retries', () => {});
  it('tracks token budget correctly', () => {});
  it('handles budget exceeded', () => {});
});

Generated by HCA Architecture Assessment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions