factory design: engage side — answer parked asks (#617 follow-up) #618

Closed
opened 2026-08-20 05:26:43 +00:00 by matou-build-agent · 2 comments

Context

#617 ("factory design: engage side — answer-asks + rearm_dispatch (#615
follow-up)") scoped both engage write actions #615 didn't fit in its slice:
answering parked asks and rearm_dispatch. #617's own "Suggested next
slice" recommended rearm_dispatch as the cheaper of the two — a single
workflow_dispatch POST with no state to track beyond firing the request,
versus answering parked asks needing ask-human.sh's
consumed-vs-outstanding thread logic replayed on the write side too. This
session delivered rearm_dispatch (the Queue tab's r binding,
.sandcastle/tui/data/rearm.py) and closed #617 on that delivered, proven
slice — per #607/#611/#613/#614/#615'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 one write action that didn't fit in that slice.

Scope

The last remaining two-way door under ADR 0174 (agent-shaped once picked
up, per #573's own ruling, carried forward unchanged by
#611/#613/#614/#615/#617):

  • 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.

Explicitly NOT this ticket: cancelling a live run (#612), arm/park/
prioritise label writes (#615), and rearm_dispatch (#617) — already
shipped.

Suggested next slice

This is the last engage write action, so there is no further "pick ONE of
several" split to weigh — the whole ticket is one slice. It still wants its
own confirm-before-fire UX design (the Cancel action's two-keypress
arm/confirm, #612, is the nearest precedent), same as every write action
before it. The harder part is the one #614/#617 both flagged: data/ ask_inbox.py (#614) already computes read-side thread state (current-
question / consumed-vs-outstanding) in pure Python mirroring ask-human.sh/
post-issue-ask.sh/resume-parked-asks.sh's own jq; the write side needs
to (a) post the operator's answer into the same Mattermost thread the way
ask-human.sh's protocol expects a human reply to arrive, and (b), per
resume-parked-asks.sh's own re-arm pair, flip the issue's labels once the
answer lands — likely composing ask_inbox.py's thread read with
labels.py's arm (#615) rather than inventing a third label-write path.

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

## Context #617 ("factory design: engage side — answer-asks + rearm_dispatch (#615 follow-up)") scoped both engage write actions #615 didn't fit in its slice: answering parked asks and `rearm_dispatch`. #617's own "Suggested next slice" recommended `rearm_dispatch` as the cheaper of the two — a single `workflow_dispatch` POST with no state to track beyond firing the request, versus answering parked asks needing `ask-human.sh`'s consumed-vs-outstanding thread logic replayed on the write side too. This session delivered `rearm_dispatch` (the Queue tab's `r` binding, `.sandcastle/tui/data/rearm.py`) and closed #617 on that delivered, proven slice — per #607/#611/#613/#614/#615'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 one write action that didn't fit in that slice. ## Scope The last remaining two-way door under ADR 0174 (agent-shaped once picked up, per #573's own ruling, carried forward unchanged by #611/#613/#614/#615/#617): - **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. **Explicitly NOT this ticket:** cancelling a live run (#612), arm/park/ prioritise label writes (#615), and `rearm_dispatch` (#617) — already shipped. ## Suggested next slice This is the last engage write action, so there is no further "pick ONE of several" split to weigh — the whole ticket is one slice. It still wants its own confirm-before-fire UX design (the Cancel action's two-keypress arm/confirm, #612, is the nearest precedent), same as every write action before it. The harder part is the one #614/#617 both flagged: `data/ ask_inbox.py` (#614) already computes read-side thread state (current- question / consumed-vs-outstanding) in pure Python mirroring `ask-human.sh`/ `post-issue-ask.sh`/`resume-parked-asks.sh`'s own jq; the write side needs to (a) post the operator's answer into the same Mattermost thread the way `ask-human.sh`'s protocol expects a human reply to arrive, and (b), per `resume-parked-asks.sh`'s own re-arm pair, flip the issue's labels once the answer lands — likely composing `ask_inbox.py`'s thread read with `labels.py`'s `arm` (#615) rather than inventing a third label-write path. Ruled by agent under ADR 0174 (scope split, revertible/provable, no one-way-door): filing `ready-for-session` to match #573/#607/#611/#612/ #613/#614/#615/#617's own label — this is factory/dev tooling requiring the session's host standing, not Ben.
Author
Member

Ruled by agent under ADR 0174 — veto anytime.

Ruling: filed as ready-for-session (factory/dev tooling requiring the
session's host standing — protected .sandcastle/tui/ paths and this
checkout's FORGEJO_TOKEN, not Ben's hands or eyes). Two-way door: the work
is a Textual TUI write action + tests, revertible with a commit, provable by
the offline suite plus the existing live-tested bash equivalent
(ask-human.sh/resume-parked-asks.sh) this ticket's write side must
compose with. Not on the ADR 0174 one-way-door list.

Ruled by agent under ADR 0174 — veto anytime. **Ruling:** filed as `ready-for-session` (factory/dev tooling requiring the session's host standing — protected `.sandcastle/tui/` paths and this checkout's `FORGEJO_TOKEN`, not Ben's hands or eyes). Two-way door: the work is a Textual TUI write action + tests, revertible with a commit, provable by the offline suite plus the existing live-tested bash equivalent (`ask-human.sh`/`resume-parked-asks.sh`) this ticket's write side must compose with. Not on the ADR 0174 one-way-door list.
Author
Member

Ruled by agent under ADR 0174 — veto anytime.

Ruling: the last remaining engage write action under ADR 0174 (per this
ticket's own scoping, carried forward unchanged since #573/#611/#613/#614/
#615/#617) — no further "pick ONE of several" split to weigh, the whole
ticket is one slice. Two-way door: revertible with a commit, provable by
the offline suite plus a disposable-scratch-issue live write. Not on the
ADR 0174 one-way-door list.

Close report:

  • New .sandcastle/tui/data/answer_ask.py — answer() composes rather
    than reinvents: labels.py's arm (#615) for the re-arm pair,
    ask_inbox.py's already-fetched thread id for the target. Four writes
    in a fixed order — durable issue comment, re-arm ready-for-agent, a
    Mattermost thread reply carrying the operator's text, closing
    :white_check_mark: last — comment+re-arm land first since they're the
    load-bearing half (the next agent session reads the issue, not chat);
    the checkmark trails last so a crash never marks a thread consumed
    without the answer actually being recorded and the issue actually being
    re-armed, the same ordering invariant resume-parked-asks.sh itself
    protects.
  • app.py's Inbox tab gains a w binding with a different confirm shape
    from the prior three write actions: answering needs free text, not a
    binary choice, so arm/confirm becomes open/submit — w on a selected
    outstanding row opens a Textual Input, Enter submits non-empty text,
    Escape cancels. No timed re-arm window: typing text and pressing Enter
    is already a deliberate two-step gesture, unlike a bare keypress that
    could be a stray repeat.
  • The reply is posted with the TUI's own bot credential (no separate
    per-operator Mattermost account exists), so by design it can never be
    picked up as a "human reply" by ask-human.sh's/resume-parked-asks.sh's
    own first_reply filter (which excludes bot authors) — this module
    performs the comment+re-arm those scripts would otherwise wait for,
    rather than leaning on that shared detection machinery.
  • 14 new offline tests (6 tests/test_answer_ask.py, 8
    tests/test_app.py) — full TUI suite 143/143 green.
  • Live-smoke-verified for the Forgejo-writing half only, same
    disposable-scratch-issue shape as #615/#616: record_ruling_comment and
    labels.arm run directly against a scratch issue created and closed
    this session (Matou/ourcloud#619) — comment landed, labels flipped
    exactly as predicted. The Mattermost-writing half (post_reply,
    consume_thread) was not live-verified: this session-runner
    checkout carries FORGEJO_TOKEN but not MATTERMOST_BOT_TOKEN (the
    same gap #614 hit), so there was no live channel to post into — the
    offline suite pins the POST shape and the four-call ordering instead.
  • STATUS.md and .sandcastle/tui/README.md updated in the same commit
    (26aeb72, pushed to main).
  • This closes #573's engage write-action scope: cancel-a-run (#612),
    arm/park/prioritise (#615), rearm dispatch (#617), and answer parked
    asks (#618) are all built. No follow-up ticket filed — nothing left to
    split.
Ruled by agent under ADR 0174 — veto anytime. **Ruling:** the last remaining engage write action under ADR 0174 (per this ticket's own scoping, carried forward unchanged since #573/#611/#613/#614/ #615/#617) — no further "pick ONE of several" split to weigh, the whole ticket is one slice. Two-way door: revertible with a commit, provable by the offline suite plus a disposable-scratch-issue live write. Not on the ADR 0174 one-way-door list. **Close report:** - New `.sandcastle/tui/data/answer_ask.py` — `answer()` composes rather than reinvents: `labels.py`'s `arm` (#615) for the re-arm pair, `ask_inbox.py`'s already-fetched thread id for the target. Four writes in a fixed order — durable issue comment, re-arm `ready-for-agent`, a Mattermost thread reply carrying the operator's text, closing `:white_check_mark:` last — comment+re-arm land first since they're the load-bearing half (the next agent session reads the issue, not chat); the checkmark trails last so a crash never marks a thread consumed without the answer actually being recorded and the issue actually being re-armed, the same ordering invariant `resume-parked-asks.sh` itself protects. - `app.py`'s Inbox tab gains a `w` binding with a different confirm shape from the prior three write actions: answering needs free text, not a binary choice, so arm/confirm becomes open/submit — `w` on a selected `outstanding` row opens a Textual `Input`, Enter submits non-empty text, Escape cancels. No timed re-arm window: typing text and pressing Enter is already a deliberate two-step gesture, unlike a bare keypress that could be a stray repeat. - The reply is posted with the TUI's own bot credential (no separate per-operator Mattermost account exists), so by design it can never be picked up as a "human reply" by `ask-human.sh`'s/`resume-parked-asks.sh`'s own `first_reply` filter (which excludes bot authors) — this module performs the comment+re-arm those scripts would otherwise wait for, rather than leaning on that shared detection machinery. - 14 new offline tests (6 `tests/test_answer_ask.py`, 8 `tests/test_app.py`) — full TUI suite 143/143 green. - Live-smoke-verified for the Forgejo-writing half only, same disposable-scratch-issue shape as #615/#616: `record_ruling_comment` and `labels.arm` run directly against a scratch issue created and closed this session (`Matou/ourcloud#619`) — comment landed, labels flipped exactly as predicted. The Mattermost-writing half (`post_reply`, `consume_thread`) was **not** live-verified: this session-runner checkout carries `FORGEJO_TOKEN` but not `MATTERMOST_BOT_TOKEN` (the same gap #614 hit), so there was no live channel to post into — the offline suite pins the POST shape and the four-call ordering instead. - `STATUS.md` and `.sandcastle/tui/README.md` updated in the same commit (`26aeb72`, pushed to `main`). - This closes #573's engage write-action scope: cancel-a-run (#612), arm/park/prioritise (#615), rearm dispatch (#617), and answer parked asks (#618) are all built. No follow-up ticket filed — nothing left to split.
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#618
No description provided.