Skip to content

Board: batch Ask lead button (5 a click, shows waiting count) - #35

Merged
iamwhatever merged 1 commit into
mainfrom
feat/ask-lead-batch
Oct 5, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
feat/ask-lead-batch

Conversation

@iamwhatever

Copy link
Copy Markdown
Owner

Summary

On the Board, asking the Radar Lead about investigated items was one click per row. This adds one batch button in the Needs-you header: Ask Lead (5 of 23 waiting). Each click hands the Lead the next 5 oldest waiting items in one turn; click again until it reads Nothing waiting for Lead. The per-row Ask lead stays.

Why it was per-item: no deliberate reason. Each row has one primary button, so the row sent its own key. The route behind it, /items/reanalyze, already takes 1–20 keys in ONE Lead turn and refuses a second send (409 reanalyze_in_flight) while an earlier ask has not moved. So no new route and no KiroCrew core change.

  • backend/needs.py: /needs gains ask_lead {keys, total, in_flight}. awaits_lead = open, unhandled, investigated bug-report/feature-request, no draft, no hand-off, no dispatch, never asked (reanalyze_requested_at unset). Oldest-posted first, capped at ASK_LEAD_BATCH = 5. A sent item is stamped and never joins the batch again; a refused send clears the stamp, so it comes back.
  • ui/src/App.tsx: the header button shares the Re-analyze controller, so it reads Lead thinking… and is disabled while either is busy or in flight (no double-send). Errors show inline with Try again.
  • README (both halves), desk/CONTRACT.md, app 0.9.9.

The Needs-you header with Ask Lead (5 of 23 waiting)

Tested

  • tests/test_ask_lead_batch.py (new, 5 tests): oldest first and at most 5; only waiting items count; repeated clicks send 12 → 7 → 2 → 0 with no item twice; the batch is held while the Lead has not moved; the route sends one batch and answers 409 on a second send while in flight. Revert check: dropping the never-asked rule fails 4 of the 5.
  • pytest tests/test_ask_lead_batch.py tests/test_row_actions.py tests/test_stale_drafts.py tests/test_needs.py tests/test_agents.py: 68 passed.
  • npm run build: committed ui/dist matches the source (HEAD source rebuilds to HEAD dist).
  • Screenshot harness: new DOM check ask-lead-batch passes (label Ask Lead (5 of 23 waiting), one post with the 5 oldest keys, then Lead thinking…, disabled, second click sends nothing); all existing checks pass.

Ask lead was one click per row only because each row has one primary
button; /items/reanalyze already takes up to 20 keys in one Lead turn
and refuses a second send while the first is in flight. So the batch
needs no new route and no core change.

/needs gains ask_lead {keys, total, in_flight}: the open, unhandled,
investigated bug reports and feature requests with no draft, no
hand-off, no dispatch and no reanalyze_requested_at (needs.awaits_lead),
oldest-posted first, keys capped at ASK_LEAD_BATCH = 5. A sent item is
stamped and never joins the batch again; a refused send clears the
stamp, so it comes back.

The Needs-you header shows "Ask Lead (5 of 23 waiting)". One click posts
/items/reanalyze once with those keys through the same controller as
Re-analyze, so it reads "Lead thinking…" and stays disabled while
either is in flight; with nothing left it reads "Nothing waiting for
Lead". The row's own Ask lead stays.

Tests: tests/test_ask_lead_batch.py (oldest first, at most N, none sent
twice, count goes down, in-flight hold, route 409 on a second send).
Screenshot harness: a DOM check for the button and ask-lead-batch.png.
README (both halves) and CONTRACT updated; app 0.9.9.
@iamwhatever
iamwhatever merged commit 3b76b48 into main Oct 5, 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.

1 participant