Skip to content

Feat/bounce feedback and validate anchor - #171

Merged
rafael-adcp merged 2 commits into
mainfrom
feat/bounce-feedback-and-validate-anchor
Aug 3, 2026
Merged

Feat/bounce feedback and validate anchor#171
rafael-adcp merged 2 commits into
mainfrom
feat/bounce-feedback-and-validate-anchor

Conversation

@rafael-adcp

Copy link
Copy Markdown
Owner

No description provided.

rafael-adcp and others added 2 commits August 2, 2026 21:21
`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>
@rafael-adcp
rafael-adcp merged commit 5a07292 into main Aug 3, 2026
2 checks passed
@rafael-adcp
rafael-adcp deleted the feat/bounce-feedback-and-validate-anchor branch August 3, 2026 00:47
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.

1 participant