Skip to content

chore(loop): let a maintainer's claim label exit the waiting-human inbox - #80

Merged
Alex1990 merged 1 commit into
mainfrom
fix/77-loop-inbox-exit
Oct 21, 2026
Merged

Alex1990 merged 1 commit into
mainfrom
fix/77-loop-inbox-exit

Conversation

@Alex1990

Copy link
Copy Markdown
Owner

What / why

The loop's human inbox (waiting-human) had no exit door.

  • docs/norms/ops.md ("The claim signal") promises that a maintainer applying ready-for-agent by hand is the claim, and route() does return run(feature|bugfix) for issues.labeled.
  • But claimability() refuses waiting-human (D29), so that run logged skip: task #77 not claimable (status=waiting-human) and the task stayed in the inbox.
  • Commenting does not help either: handleInbox only re-runs for new / ready / waiting-info, so issue_comment.created on a waiting-human task is inbox-only.
  • workflow_dispatch hits the same claim check.

So on #77 both human actions — comment, then apply the claim label — were no-ops. This PR opens the one door ops.md already describes.

Change

  • shared/route.mjs: new humanClaimOf({ eventName, action, event }, status) — true only for issues.labeled, label ready-for-agent, sender OWNER/MEMBER/COLLABORATOR, and task status waiting-human.
  • entry.mjs doRun: before the claim check, that event moves the task to ready (timeline claimed, labels refreshed from the event payload, saveTask). Every other path keeps D29's guarantee: the reopen repair, start --task and PR synchronize still cannot convert an inbox item.
  • scripts/loop/README.md: D37 entry, the trigger table row, and a cross-reference from D29.

Proof

Predicate exercised directly against the real module (blocking cases are as important as the accepting one):

owner/waiting-human    "Alex1990"     <- accepted
owner/ready            null           <- already claimable, no migration
owner/waiting-merge    null           <- pr-review tasks untouched
bot/waiting-human      null           <- GITHUB_TOKEN cannot claim
comment                null           <- comments still inbox-only
route: {"action":"run","taskId":77,"kind":"issue","stage":"feature","reason":"issues.labeled ready-for-agent"}

node --check passes on both changed scripts. The real end-to-end proof is the post-merge run: after this lands, re-applying ready-for-agent on #77 must log human claim: task #77 waiting-human -> ready and then run ... started (... stage=feature).

Risk

Tier: host script only (scripts/loop/**), no package surface. If the predicate is too narrow, the symptom is the current one (task stays in the inbox); if it were too wide, an inbox task could be claimed without a human act — which is why it is limited to the claim label from a repo role, and why the other four role labels are still no-ops.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage

Metric % Covered / Total
Lines 91.73% 1121/1222
Statements 90.42% 1209/1337
Functions 92.76% 218/235
Branches 76.97% 575/747

@Alex1990
Alex1990 merged commit 5c8d725 into main Oct 21, 2026
3 checks passed
@Alex1990
Alex1990 deleted the fix/77-loop-inbox-exit branch October 21, 2026 15:32
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