Skip to content

A rewritten brief returns a stalled item to the queue - #179

Merged
thedancingdeveloper merged 1 commit into
mainfrom
fix/rewritten-brief-revives-the-item
Aug 5, 2026
Merged

A rewritten brief returns a stalled item to the queue#179
thedancingdeveloper merged 1 commit into
mainfrom
fix/rewritten-brief-revives-the-item

Conversation

@thedancingdeveloper

Copy link
Copy Markdown
Contributor

Closes #178. Found by iterating on rdpapp R7.

#174 let an agent say "this cannot be done as written" and have it recorded as work needing a person. This is the half that acts on the person having looked: a human rewrote the brief, adopt reported R7 -> pending and then left it failed, and the next run said nothing to do.

revives() is deliberately narrow — only failed/blocked, only the brief, compared stripped so a moved newline is not a rewrite. done is never revived. last_error is cleared with the state, since the refusal is about wording the next attempt cannot reproduce; the attempt count stays, because what changed is the question, not the fact it was attempted.

The report line no longer says -> pending and state stays failed two lines apart.

Nine tests. One existing adoption test seeded an item with no brief, so the plan supplying one counted as a rewrite — reseeded with the plan's brief so it tests the unchanged re-sync its name claims, and the revive case is pinned separately rather than the original assertion loosened.

All four gates green locally.

🤖 Generated with Claude Code

The other half of the loop #174 opened. An agent can now say "this item cannot
be done as written" and have that recorded as work needing a person — and until
this, the person acting on it changed nothing:

    R7 -> pending  [already failed in the queue]
        applied refresh queue row item R7 in project rdpapp:
          update title, brief and dependencies; state stays failed

The heading is the proposal and the line below it is what happened. The brief
updated, the item stayed unclaimable, and the next run said `nothing to do`.

Not resetting state on a refresh is the right instinct — `adopt` must not
silently un-fail work, and an item that failed its checks five times should not
become pending because someone fixed a typo in its title. But a changed
**brief** is a different item in the only sense that matters: the attempt that
failed was made against wording that no longer exists, so keeping the verdict
records a decision about a question nobody is asking.

So `revives()` is deliberately narrow:

- only `failed` and `blocked`. `done` is not stalled, and editing the
  description of finished work does not un-finish it;
- only the brief. A changed title, label or dependency moves nothing;
- compared stripped, so re-parsing a plan cannot revive an item because a
  newline moved.

`last_error` is cleared with the state. The next attempt is told what the
previous one was refused for, and that refusal is about wording it can no
longer reproduce. The attempt *count* is untouched: what changed is the
question, not the fact that it was once attempted.

The report line no longer contradicts itself two lines apart — it says either
"state returns to pending from failed" or "state stays failed", whichever is
about to be true.

One existing test seeded an item with no brief at all and then adopted a plan
that supplied one, which is a rewrite under this rule. Reseeded with the plan's
brief so it tests the unchanged re-sync its name claims, with the revive case
pinned separately rather than the original assertion loosened.

Closes #178.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@thedancingdeveloper
thedancingdeveloper merged commit 6231e85 into main Aug 5, 2026
2 checks passed
@thedancingdeveloper
thedancingdeveloper deleted the fix/rewritten-brief-revives-the-item branch August 5, 2026 03:57
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.

adopt: reports an item as 'pending' while leaving it failed, so a rewritten brief never runs

1 participant