Feat/bounce feedback and validate anchor - #171
Merged
Merged
Conversation
`bounced` told a worker its task was coming back but not what was asked: SKILL.md still sent it to `gh issue view --comments` to fetch the thread and judge by eye which comments were new. The program holds both halves of that derivation — §6 compares the live comment total against the record's frozen anchor — and threw the anchor away after computing the boolean. This is the residual of the design review's c1, which shipped the verdict and kept the index. `acquire_next` now returns the anchor it already had in hand, and next-action cuts the thread on it — paying the extra read only when `bounced` is true, so a fresh task costs nothing. The cut answers two questions, not one. WHERE the range starts is positional: the anchor is a comment TOTAL and every comment counts toward it (§6), so nothing may be filtered before the slice without sliding the index. WHAT inside that range is the ask excludes the machine's own comments — by the time this runs the claim's own comment is already on the thread, and an unfiltered tail handed every bounced task back its own "Claimed this task" line as though the operator had written it. A marker is exactly the signal that says worker-authored (§4), and filtering after the cut moves no index. The two empties stay distinct: `[]` says the read landed and found nothing past the anchor (the stale-anchor case §6 repairs), while an absent key says the read failed and the agent still owes the thread a look of its own. Collapsing them would tell a worker with a failed read that its operator asked for nothing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
PROTOCOL.md §3.1 has asked for this since protocol/9: a machine-authored comment posted without a lease SHOULD refresh the record's `comments` field, so its own comment does not read as an operator reply (§6). `cmd_validate` never did — the spec was right and the implementation lagged. The cost lands on the operator. §6 derives a requeue from `total > record.comments` and counts every comment, so a validation comment on a held task makes it read as bounced: the next worker claims rework nobody asked for, finds an automated nag on the thread, and — correctly, per the skill — escalates it back as a question. That is one more needs-decision entry to answer, generated by the program, paid for in the model's judgment. `re_anchored`, not `moved_to`: the anchor moves and nothing else does, so the hold, the worker, the expiry count and the delivery URL all stand. A refresh that lifted the hold would hand an answered task back to the queue. The record is read before the count because that is the cheap order for this caller: the validator fires on new and edited queue entries, and a task nobody has put down has no record at all — the common case exits having paid one ref read rather than the issue fetch as well. A failed read or write reports transport rather than swallowing the error: the comment has landed by then, so silence would leave precisely the stale anchor this exists to prevent. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.