Skip to content

feature: honour the prompt header keys the ranker is documented to act on - #217

Merged
Jammy2211 merged 1 commit into
mainfrom
claude/automind-task-planning-8wk4ag
Aug 10, 2026
Merged

feature: honour the prompt header keys the ranker is documented to act on#217
Jammy2211 merged 1 commit into
mainfrom
claude/automind-task-planning-8wk4ag

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

PyAutoMind REFERENCE.md states the contract:

The Intake (Conception) Agent writes these automatically … sourcing Difficulty: from the shared sizing faculty the Feature Agent also uses — so the value shown up front is the one the Feature Agent later acts on.

It was not acted on. _feature.py mentioned Difficulty exactly once, where it printed its own re-derived score, and read no header key at all — not Difficulty:, not Status:, not Priority:, not Blocked-by: / Closes-when:.

The visible failure: feature select recommended draft/feature/autonomy/10_scheduled_runs.md as the next task to start — a prompt declaring Status: blocked, Priority: low and an explicit Blocked-by: gate whose body reads "Do not start before the queue runner has completed several supervised interactive runs cleanly."

Prompt: PyAutoMind:draft/bug/pyautobrain/feature_ranker_ignores_header_keys.md

Where the parsing lives

In the sizing faculty, beside the derivation it overrides — so declared and derived stay in one place, and the bug / refactor conductors (which share parse_prompt) get the same reading for free.

declared_header() reads the five keys and skips fenced blocks. That skip is load-bearing, not tidiness: the bug prompt driving this fix quotes the offending header in a ```-block, so without it the bug report would declare itself blocked. Same rule and same reason as PyAutoMind/lifecycle.py:draft_gate_refs.

Two smaller traps handled: trailing # note comments are stripped by splitting on " #" so a Repo#123 ref survives intact (the live backlog has both on one line), and an unrecognised Difficulty: value is ignored rather than trusted.

What the ranker now does

Key Effect
Difficulty: Overrides the derived level; the disagreement is reported, not silently resolved — the gap is evidence about the heuristic.
Priority: Orders the shortlist, above the difficulty term.
Status: blocked / unresolved Blocked-by: Sinks the prompt below everything; never the recommended pick, and next_action says do not start.

Blocked prompts stay listed in their own labelled band so a human can see and override.

declared_blocked() is deliberately conservative: this agent is offline and cannot tell whether a gate has since closed, so an unresolved Blocked-by: reads as blocked and the output points at lifecycle.py issues --drafts, which does resolve refs against GitHub. Being wrongly held back is cheap and visible; being wrongly recommended is the failure this exists to stop.

Measured on the live backlog

Verification

289 passed (was 279; the 2 test_skill_install.py failures are pre-existing and environment-only — they do not occur in CI).

New tests are hermetic and pin the regression by the offending prompt's header shape, not the live file, so fixing the backlog cannot silently retire them. Confirmed they actually bite: reverting only _feature.py fails 7 of the 10 (the 3 survivors are pure declared_header unit tests, which is coherent). Fixtures use invented repo names, so the file adds no tenant-firewall instance facts — verified against repos_sync.py --check.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WSCA1h6cSKMNwFmWEsxuCL


Generated by Claude Code

…t on

PyAutoMind REFERENCE.md states the contract: Intake persists Difficulty: from
the shared sizing faculty "so the value shown up front is the one the Feature
Agent later acts on". It was not acted on. _feature.py mentioned Difficulty
once, where it PRINTED its own re-derived score, and read no header key at all
— not Difficulty:, not Status:, not Priority:, not Blocked-by:/Closes-when:.

The visible failure: `feature select` recommended a prompt declaring
Status: blocked, Priority: low AND an explicit Blocked-by: gate whose body says
"do not start before the queue runner has run cleanly".

Parsing lands in the sizing faculty, beside the derivation it overrides, so
declared and derived stay in one place and the bug/refactor conductors get the
same reading for free:

- declared_header() reads Difficulty/Status/Priority/Blocked-by/Closes-when,
  skipping fenced blocks. That skip is load-bearing, not tidiness: the bug
  prompt driving this fix QUOTES the offending header in a ```-block, so
  without it the bug report would declare itself blocked. Same rule and same
  reason as PyAutoMind lifecycle.py:draft_gate_refs.
- trailing `# note` comments are stripped, splitting on " #" so a Repo#123 ref
  survives intact (the live backlog has both forms on one line).
- an unrecognised Difficulty: value is ignored rather than trusted.

The ranker then honours them: declared difficulty overrides derived (with the
disagreement REPORTED, not silently resolved — the gap is evidence about the
heuristic); Priority: orders the shortlist above the difficulty term; and a
prompt declaring Status: blocked or an unresolved Blocked-by: sinks below
everything and can never be the recommended pick. It stays listed in its own
labelled band so a human can see and override, and next_action says do not
start.

declared_blocked() is deliberately conservative: this agent is offline and
cannot tell whether a gate has since closed, so an unresolved Blocked-by: reads
as blocked and the output points at `lifecycle.py issues --drafts`, which does
resolve refs against GitHub. Being wrongly held back is cheap and visible;
being wrongly recommended is the failure this exists to stop.

Measured on the live backlog: the blocked prompt drops from rank 1 to last of
27, correctly labelled, and two further blocked prompts surface that had not
been noticed by hand. draft_staleness_detection_signals moves from too-large
#26 to medium #5 — it derived too-large purely on file length, and length is a
bad size proxy because a prompt grows as it accumulates findings.

New tests are hermetic and pin the regression by the offending prompt's HEADER
SHAPE rather than the live file, so fixing the backlog cannot silently retire
them. Verified they actually bite: reverting only _feature.py fails 7 of the
10. Fixtures use invented repo names, so the file adds no tenant-firewall
instance facts.

Prompt: PyAutoMind draft/bug/pyautobrain/feature_ranker_ignores_header_keys.md

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WSCA1h6cSKMNwFmWEsxuCL
@Jammy2211
Jammy2211 merged commit e099383 into main Aug 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants