Skip to content

fix: an empty backlog is indistinguishable from broken discovery #213

Description

@Jammy2211

Overview

Split out of #211 / #212, which fixed the broken discovery roots but deliberately left this behind as separate work.

When a conductor's selection mode finds nothing it prints a flat message — feature agent: no feature prompts found in PyAutoMind. and siblings. That is consistent with two very different situations: the backlog genuinely holds no prompts of that work-type, or discovery is pointed somewhere wrong (a bad PYAUTO_MIND, a non-Mind checkout, a layout the discoverer has not learned).

Case two is what #211 was. Three conductors reported an empty backlog for four weeks while sitting on 87 prompts, and nobody noticed — because the message a broken root produces is the message an empty backlog produces. That ambiguity, not the one-line wrong path, is why the bug survived. Diagnosing the empty case is the signal it lacked.

Plan

  • Teach the sizing faculty to explain an empty discovery result against the Mind it was pointed at.
  • Draw the three distinctions that matter: not a Mind checkout / no such work-type / genuinely empty backlog.
  • Have the three conductors print that reason instead of the flat sentence, keeping their exit codes.
  • Lock the three causes as mutually distinguishable in tests.
Detailed implementation plan

Affected Repositories

  • PyAutoBrain (primary, and only)

Branch Survey

Repository Current Branch Dirty?
./PyAutoBrain claude/automind-task-planning-tj0sdn (restarted from origin/main f4e9341) clean

Suggested branch: claude/automind-task-planning-tj0sdn (session-designated)

Implementation Steps

  1. agents/faculties/sizing/_sizing.py — add empty_discovery_reason(mind, work_type) beside discover_prompts. Classifies an empty result:

    • path is not a directory → bad path
    • directory has neither draft/ nor active.md → not a Mind checkout, name PYAUTO_MIND
    • no draft/<work-type>/ and no legacy flat root → no such work-type, and list the work-types that do exist
    • roots exist but hold no prompts → genuinely empty backlog

    Diagnosis only — callers keep their own exit codes, and discover_prompts keeps its signature and result.

  2. The three conductors print the reason on their empty paths: _feature.py, _bug.py, _refactor.py.

  3. tests/test_conductor_discovery.py — six new tests, including one asserting the three causes produce three distinct strings, and one covering a freshly-spawned Mind (has active.md, no draft/ yet) which must read as an empty backlog rather than a bad path.

Key Files

  • agents/faculties/sizing/_sizing.py — gains empty_discovery_reason
  • agents/conductors/{feature,bug,refactor}/ — call sites
  • tests/test_conductor_discovery.py — extended

Scope

Message-and-diagnosis only. No change to discovery behaviour, ranking, or exit codes; the end-to-end non-empty assertions from #212 must keep passing unchanged.

Testing

pytest tests/ plus manual exercise of all three empty causes against fixture Minds, and confirmation the populated case is byte-identical.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions