factory design: engage side — answer-ask/label writes/rearm_dispatch (#614 follow-up) #615

Closed
opened 2026-08-20 04:49:12 +00:00 by matou-build-agent · 1 comment

Context

#614 ("factory design: ask inbox + engage side", #613 follow-up) scoped both the ask-inbox read screen and the composition-of-existing-protocols half of engage. #614 closed on its delivered, proven slice — the Inbox tab (.sandcastle/tui/, data/ask_inbox.py) — per #607/#611/#613's own precedent (a ready-for-session ticket left open across sessions scores "no progress" under this repo's session-runner rules) rather than sit open indefinitely. This ticket carries the engage-side write actions #614 named that didn't fit in that slice.

Scope

All two-way doors under ADR 0174 (agent-shaped once picked up, per #573's own ruling, carried forward unchanged by #611/#613/#614):

  • Answer parked asks by speaking the ask-thread protocol (ask-human.sh/post-issue-ask.sh/resume-parked-asks.sh) — the Inbox tab (#614) already surfaces which issues are outstanding vs answered-pending-sweep vs idle; this ticket is the write action that acts on that read.
  • Arm/park/prioritise = label writes via the /labels sub-endpoint (see docs/agents/issue-tracker.md — a labels field in an issue PATCH is silently ignored).
  • Re-arm = rearm_dispatch.

Explicitly NOT this ticket: cancelling a live run — already shipped, #612.

Suggested next slice

Same shape as #573/#607/#611/#612/#613/#614's own slice-by-slice history: each of these three write actions is a real write against the tracker or Mattermost, and wants its own confirm-before-fire UX design (the Cancel action's two-keypress arm/confirm, #612, is the nearest precedent) rather than being bolted onto the Inbox tab's read. Recommend picking ONE write action for the next session rather than all three at once — label writes (arm/park/prioritise) are probably the cheapest first slice: no Mattermost thread-protocol replay to get right, just a /labels POST/DELETE pair behind a two-keypress confirm, directly analogous to #612's own marker-file write.

Ruled by agent under ADR 0174 (scope split, revertible/provable, no one-way-door): filed ready-for-session to match #573/#607/#611/#612/#613/#614's own label — this is factory/dev tooling requiring the session's host standing, not Ben.

## Context #614 ("factory design: ask inbox + engage side", #613 follow-up) scoped both the ask-inbox read screen and the composition-of-existing-protocols half of engage. #614 closed on its delivered, proven slice — the Inbox tab (`.sandcastle/tui/`, `data/ask_inbox.py`) — per #607/#611/#613's own precedent (a `ready-for-session` ticket left open across sessions scores "no progress" under this repo's session-runner rules) rather than sit open indefinitely. This ticket carries the engage-side write actions #614 named that didn't fit in that slice. ## Scope All two-way doors under ADR 0174 (agent-shaped once picked up, per #573's own ruling, carried forward unchanged by #611/#613/#614): - **Answer parked asks** by speaking the ask-thread protocol (`ask-human.sh`/`post-issue-ask.sh`/`resume-parked-asks.sh`) — the Inbox tab (#614) already surfaces which issues are `outstanding` vs `answered-pending-sweep` vs `idle`; this ticket is the write action that acts on that read. - **Arm/park/prioritise** = label writes via the `/labels` sub-endpoint (see `docs/agents/issue-tracker.md` — a `labels` field in an issue PATCH is silently ignored). - **Re-arm** = `rearm_dispatch`. **Explicitly NOT this ticket:** cancelling a live run — already shipped, #612. ## Suggested next slice Same shape as #573/#607/#611/#612/#613/#614's own slice-by-slice history: each of these three write actions is a real write against the tracker or Mattermost, and wants its own confirm-before-fire UX design (the Cancel action's two-keypress arm/confirm, #612, is the nearest precedent) rather than being bolted onto the Inbox tab's read. Recommend picking ONE write action for the next session rather than all three at once — label writes (arm/park/prioritise) are probably the cheapest first slice: no Mattermost thread-protocol replay to get right, just a `/labels` POST/DELETE pair behind a two-keypress confirm, directly analogous to #612's own marker-file write. Ruled by agent under ADR 0174 (scope split, revertible/provable, no one-way-door): filed `ready-for-session` to match #573/#607/#611/#612/#613/#614's own label — this is factory/dev tooling requiring the session's host standing, not Ben.
Author
Member

Ruling — ADR 0174

Ruled by agent under ADR 0174 — veto anytime. Scope: label writes
(arm/park/prioritise via the tracker's /labels sub-endpoint) — revertible
(any label add/remove is a follow-up commit or a further label write away
from reversed), provable (offline suite + a real write against a disposable
scratch issue), no one-way door. Per this ticket's own "Suggested next
slice", picked label writes as the cheapest of the three named actions and
left the other two (answer parked asks, rearm_dispatch) for a follow-up
ticket — #617.

What landed

  • data/labels.py (new): fetch_label_ids (paginated GET /labels,
    name→id map), add_label/remove_label (the raw POST/DELETE pair), and
    three composed actions — arm (adds ready-for-agent, removes
    ready-for-human — the exact pair resume-parked-asks.sh posts on its
    own re-arm sweep), park (the reverse), set_priority (toggles the
    additive priority label). Mirrors docs/agents/issue-tracker.md's
    pinned protocol (POST adds, DELETE removes, a PATCH's labels field is
    silently ignored) rather than inventing a new one.
  • data/tracker.py: queue_snapshot now carries a priority bool per
    row so the toggle knows which direction to flip.
  • app.py: the Queue tab gets a/p/i bindings — arm / park /
    toggle-priority on the currently selected row, each its own two-keypress
    arm/confirm (LABELOP_CONFIRM_WINDOW, same shape as Cancel's
    CANCEL_CONFIRM_WINDOW from #612), scoped to the Queue tab and to the
    specific (action, issue) pair armed. Landed on Queue rather than Inbox:
    arm/park/prioritise apply to any tracker issue by triage state, not
    specifically to the Inbox's ready-for-human set.
  • README.md and STATUS.md updated in the same commits.

Proof

  • 120/120 offline tests green (17 new: 8 test_labels.py, 1
    test_tracker.py, 8 test_app.py) — no real network call in the suite,
    every test injects fake fetch/poster/deleter callables.
  • Live-smoke-verified against the real tracker: created a disposable
    scratch issue (Matou/ourcloud#616), ran data/labels.py's
    set_priority(True) → arm → park → set_priority(False) directly
    against it with the real FORGEJO_TOKEN, then read the issue back — final
    label state (ready-for-human only) matched exactly what the sequence
    predicts. Commented and closed #616 immediately after; it was never
    ready-for-agent so no queue ever saw it. Also live-verified the Queue
    tab's real read path (43 real open issues loaded through app.py itself,
    no crash) — writes were exercised at the module level against the
    disposable issue rather than replayed through the running app a second
    time, to avoid a second live write for no additional proof.
  • Commits: e724254 (the slice), 619a0dd (STATUS.md/README.md
    correction pointing the residue at #617 instead of leaving it
    un-ticketed).

Residue

Answering parked asks and rearm_dispatch remain — split into #617
(ready-for-session), same precedent as #607→#611→#613→#614→#615.

## Ruling — ADR 0174 Ruled by agent under ADR 0174 — veto anytime. Scope: label writes (arm/park/prioritise via the tracker's `/labels` sub-endpoint) — revertible (any label add/remove is a follow-up commit or a further label write away from reversed), provable (offline suite + a real write against a disposable scratch issue), no one-way door. Per this ticket's own "Suggested next slice", picked label writes as the cheapest of the three named actions and left the other two (answer parked asks, `rearm_dispatch`) for a follow-up ticket — **#617**. ## What landed - **`data/labels.py`** (new): `fetch_label_ids` (paginated `GET /labels`, name→id map), `add_label`/`remove_label` (the raw POST/DELETE pair), and three composed actions — `arm` (adds `ready-for-agent`, removes `ready-for-human` — the exact pair `resume-parked-asks.sh` posts on its own re-arm sweep), `park` (the reverse), `set_priority` (toggles the additive `priority` label). Mirrors `docs/agents/issue-tracker.md`'s pinned protocol (POST adds, DELETE removes, a PATCH's `labels` field is silently ignored) rather than inventing a new one. - **`data/tracker.py`**: `queue_snapshot` now carries a `priority` bool per row so the toggle knows which direction to flip. - **`app.py`**: the Queue tab gets `a`/`p`/`i` bindings — arm / park / toggle-priority on the currently selected row, each its own two-keypress arm/confirm (`LABELOP_CONFIRM_WINDOW`, same shape as Cancel's `CANCEL_CONFIRM_WINDOW` from #612), scoped to the Queue tab and to the specific (action, issue) pair armed. Landed on Queue rather than Inbox: arm/park/prioritise apply to any tracker issue by triage state, not specifically to the Inbox's `ready-for-human` set. - **README.md** and **STATUS.md** updated in the same commits. ## Proof - 120/120 offline tests green (17 new: 8 `test_labels.py`, 1 `test_tracker.py`, 8 `test_app.py`) — no real network call in the suite, every test injects fake fetch/poster/deleter callables. - **Live-smoke-verified against the real tracker**: created a disposable scratch issue (`Matou/ourcloud#616`), ran `data/labels.py`'s `set_priority(True)` → `arm` → `park` → `set_priority(False)` directly against it with the real `FORGEJO_TOKEN`, then read the issue back — final label state (`ready-for-human` only) matched exactly what the sequence predicts. Commented and closed #616 immediately after; it was never `ready-for-agent` so no queue ever saw it. Also live-verified the Queue tab's real read path (43 real open issues loaded through `app.py` itself, no crash) — writes were exercised at the module level against the disposable issue rather than replayed through the running app a second time, to avoid a second live write for no additional proof. - Commits: `e724254` (the slice), `619a0dd` (STATUS.md/README.md correction pointing the residue at #617 instead of leaving it un-ticketed). ## Residue Answering parked asks and `rearm_dispatch` remain — split into **#617** (`ready-for-session`), same precedent as #607→#611→#613→#614→#615.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#615
No description provided.