Skip to content

fix(ai): devops ai test-gen stops reporting presence-only tests as synthesized unit tests #856

Closed

Description

@dan-petty

Context & Rationale

ai/test_gen.py:70-82 emits assert hasattr(module, name) for each public function, plus assert <module> is not None. commands/ai.py:1929-1931 then prints 'Synthesized N unit test(s)'. The MCP tool ai_test_gen (ai/mcp/server.py:1076) offers the same output to agents.

#601 measured such a test passing against a multiply() that returned x + y (ROADMAP.md:546). It relabelled the status UNEXECUTED (config/defaults.py:542) but kept the templates.

None of this repo's own tests came from the command. The problem is that a shipped tool overstates what it produced.

Scope & Deliverables

  • Deliverable: choose one.
    • (a) Scaffolds:
      • every generated test ends with pytest.fail('expected behaviour of <function> not written');
      • no presence assertions are emitted;
      • the CLI and MCP wording says 'scaffold'.
    • (b) Delete the command and the MCP tool, with a CHANGELOG Removed entry.
    • In both cases, regenerate CLI_REFERENCE.md and MCP_TOOLS.md.
  • Acceptance criteria:
    • For (a):
      • the generated code parses;
      • every test function contains pytest.fail and no presence assertion;
      • a pytester run reports every generated test as failed;
      • no output says 'Synthesized'.
    • For (b): the command and the tool are gone, and the CHANGELOG lists them.
    • devops docs check passes, and the new tests take at most 1 s.
  • Key questions:
  • Constraint: No new dependency.

Strategic Alignment

  • Milestone: Backlog
  • Depends on: none

Owner decisions (2026-10-01)

From the agentic quality assessment (https://claude.ai/artifact/K7S7AkKJymFydhjwexigiN), decided by the owner. These replace any matching proposed answer above.

  • D8, the fix. devops ai test-gen and its MCP tool emit scaffolds that fail until someone writes a real assertion. They stop reporting presence-only tests as 'Synthesized N unit test(s)'. The command is kept, not deleted.

Activity

  1. added
    type/bug
    scope/ai
    priority/p2-medium
    on Oct 1, 2026
  2. added this to the v0.2.36 milestone on Oct 14, 2026
  3. dan-petty commented on Oct 14, 2026

    @dan-petty
    OwnerAuthor

    Moved to v0.2.36: v0.2.36 started with fewer than its 16 items and was topped up to 16 from Ready items, critical fixes and P0 features first. (devops roadmap reprioritize)

  4. dan-petty commented on Oct 16, 2026

    @dan-petty
    OwnerAuthor

    What changed

    #1584, merged into release/v0.2.36 as f35d338.

    Closes #856

    11 file(s) changed.

    How it was verified

    Check runs at 57c4be0:

    • Prune PR DevContainer Images: pass
    • Audit Defect PR Hardening: skipping
    • devops-cli: pass
    • bandit: pass
    • CodeQL: pass
    • Changed-Test Independence: pass
    • Tests & Coverage: pass
    • Analyze (python): pass
    • Analyze (actions): pass
    • Static Analysis: pass
    • DevContainer Image: skipping
    • Service Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-856-ai-test-gen-scaffolds.md:

    • The generated code parses (tests/test_ai_test_gen.py::test_test_gen_emits_failing_scaffolds_without_presence_assertions).
    • Every test function contains pytest.fail and no presence assertion (tests/test_ai_test_gen.py::test_test_gen_emits_failing_scaffolds_without_presence_assertions).
    • A pytester run reports every generated test as failed (tests/test_ai_test_gen.py::test_test_gen_emits_failing_scaffolds_without_presence_assertions).
    • No output says 'Synthesized' (tests/test_ai_test_gen.py::test_test_gen_emits_failing_scaffolds_without_presence_assertions).
    • devops docs check passes, and the new tests take at most 1 s.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p2-mediumscope/aitype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions