factory design: ask inbox + engage side (#613 follow-up) #614

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

Context

#613 ("factory design: incident/healer view + ask inbox + engage side", #611 follow-up) scoped both read-side screens (incident/healer view, ask inbox) plus the composition-of-existing-protocols half of engage. #613 closed on its delivered, proven slice — the Incidents tab (.sandcastle/tui/, data/healer_ledger.py) — per #607/#611'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 everything #613 named that didn't fit in that slice.

Scope

Read side (still a real gap, not a stub):

  • Ask inbox — parked ask-human.sh threads. .sandcastle/ask-human.sh posts a parking notice and times out to ready-for-human; .sandcastle/post-issue-ask.sh writes the idempotent marker (the outstanding-question check against the Mattermost thread, not a local file — confirmed by reading the script: there is no local marker file, the idempotency is entirely thread-state-derived); .sandcastle/resume-parked-asks.sh is the sweep that later consumes a reply (resume order is load-bearing: copy ruling → re-arm → consume thread LAST, per docs/agents/swarm-atlas.md §6). Unlike the Incidents tab (a local ledger-file read), this screen's data lives in Forgejo (ready-for-human issues) crossed with Mattermost thread state — needs both FORGEJO_TOKEN and Mattermost bot credentials, closer in shape to the Queue tab's network-bound read than the Fleet/Incidents tabs' local-file read.

Engage side — the composition-of-existing-protocols half only (all two-way doors under ADR 0174, agent-shaped once picked up, per #573's own ruling, carried forward unchanged by #611/#613):

  • Answer parked asks by speaking the ask-thread protocol (ask-human.sh/post-issue-ask.sh/resume-parked-asks.sh).
  • 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/#613's own slice-by-slice history: the ask inbox is the next-cheapest read-only piece, following the Queue tab's network-read pattern (data/tracker.py) rather than the Fleet/Incidents tabs' local-file pattern — a new data/ask_inbox.py module (Forgejo ready-for-human issues joined against Mattermost thread state, injectable fetch functions for both like tracker.py's _http_get seam) + a new TabbedContent pane + offline tests with faked fetches (no real network in the suite, matching test_tracker.py's posture) — live-smoke-verified on matou-workstation. The engage-side write actions (answer-ask, label writes, rearm_dispatch) are a separate slice again: each is a real write against the tracker or Mattermost, 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 read.

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

## Context #613 ("factory design: incident/healer view + ask inbox + engage side", #611 follow-up) scoped both read-side screens (incident/healer view, ask inbox) plus the composition-of-existing-protocols half of engage. #613 closed on its delivered, proven slice — the Incidents tab (`.sandcastle/tui/`, `data/healer_ledger.py`) — per #607/#611'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 everything #613 named that didn't fit in that slice. ## Scope **Read side (still a real gap, not a stub):** - **Ask inbox** — parked `ask-human.sh` threads. `.sandcastle/ask-human.sh` posts a parking notice and times out to `ready-for-human`; `.sandcastle/post-issue-ask.sh` writes the idempotent marker (the outstanding-question check against the Mattermost thread, not a local file — confirmed by reading the script: there is no local marker file, the idempotency is entirely thread-state-derived); `.sandcastle/resume-parked-asks.sh` is the sweep that later consumes a reply (resume order is load-bearing: copy ruling → re-arm → consume thread LAST, per `docs/agents/swarm-atlas.md` §6). Unlike the Incidents tab (a local ledger-file read), this screen's data lives in Forgejo (`ready-for-human` issues) crossed with Mattermost thread state — needs both `FORGEJO_TOKEN` and Mattermost bot credentials, closer in shape to the Queue tab's network-bound read than the Fleet/Incidents tabs' local-file read. **Engage side — the composition-of-existing-protocols half only (all two-way doors under ADR 0174, agent-shaped once picked up, per #573's own ruling, carried forward unchanged by #611/#613):** - Answer parked asks by speaking the ask-thread protocol (`ask-human.sh`/`post-issue-ask.sh`/`resume-parked-asks.sh`). - 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/#613's own slice-by-slice history: the ask inbox is the next-cheapest read-only piece, following the Queue tab's network-read pattern (`data/tracker.py`) rather than the Fleet/Incidents tabs' local-file pattern — a new `data/ask_inbox.py` module (Forgejo `ready-for-human` issues joined against Mattermost thread state, injectable fetch functions for both like `tracker.py`'s `_http_get` seam) + a new `TabbedContent` pane + offline tests with faked fetches (no real network in the suite, matching `test_tracker.py`'s posture) — live-smoke-verified on matou-workstation. The engage-side write actions (answer-ask, label writes, `rearm_dispatch`) are a separate slice again: each is a real write against the tracker or Mattermost, 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 read. Ruled by agent under ADR 0174 (scope split, revertible/provable, no one-way-door): filed `ready-for-session` to match #573/#607/#611/#613's own label — this is factory/dev tooling requiring the session's host standing, not Ben.
Author
Member

Close report

Ruled by agent under ADR 0174 — veto anytime. Scope split (revertible/provable, no one-way-door): this session took #614's own "Suggested next slice" (the ask inbox — a network-bound read joining two APIs) and delivered it in full; the engage-side write actions (answer-ask, label writes, rearm_dispatch) are split into a follow-up ticket, same precedent as #607/#611/#613's own slice history — a ready-for-session ticket left open across sessions scores "no progress" under this repo's session-runner rules, so closing on the delivered, proven slice rather than sitting open.

What landed (Matou/ourcloud@35cee49):

  • .sandcastle/tui/data/ask_inbox.py — new module joining Forgejo's open ready-for-human issues against their Mattermost ask-thread state. The thread-state logic (candidate-thread selection, current-question, consumed-vs-outstanding) mirrors ask-human.sh/post-issue-ask.sh/resume-parked-asks.sh's own jq exactly, in pure Python, since there is no local marker file to read instead — confirmed by reading post-issue-ask.sh: idempotency is entirely thread-state-derived, correcting what #613's body had said. Two independent injectable fetch seams (Forgejo, Mattermost), same shape as tracker.py's _http_get. Missing Mattermost config (MATTERMOST_URL/MATTERMOST_CHANNEL_ID/bot token) degrades every row to state: chat-unavailable instead of erroring the whole screen — the Forgejo half stays independently useful.
  • .sandcastle/tui/app.py — sixth TabbedContent pane, #inbox-table (number/title/state/detail), its own 30s refresh interval and inline #inbox-error panel — same network-bound shape as the Queue tab (crosses two APIs, touches no local host state), not the Fleet/Incidents tabs' local-file cadence.
  • .sandcastle/tui/README.md, STATUS.md — updated in the same commit per this repo's own rule.

Proof:

  • 30 new offline tests (20 test_ask_inbox.py, 4 test_app.py, plus 6 more from re-covering the new _app helper params), full TUI suite 102/102 green. No real network call in the suite — every test injects fake Forgejo/Mattermost fetches, same posture as test_tracker.py.
  • Live-smoke-verified two ways on matou-workstation:
    • Forgejo half, real API: ask_inbox.fetch_parked_issues() against the real git.matou.nz API with this session's FORGEJO_TOKEN — correctly returned the 8 real open ready-for-human issues (#606, #601, #506, #475, #473, #471, #425, #183).
    • Mattermost fallback, real code path: this session-runner checkout's own standing carries FORGEJO_TOKEN but not the Mattermost bot credential — the real mattermost_bot_token/MATTERMOST_URL/MATTERMOST_CHANNEL_ID live only in the swarm's own checkout/CI secrets, outside what this session was granted. So rather than reach for host files outside that grant, I ran the actual app.py end-to-end through Textual's test harness with the real Forgejo fetch and no Mattermost config — confirming the real chat-unavailable fallback path renders correctly (8 rows, all chat-unavailable), which is exactly the environment this checkout runs in. A live Mattermost thread walk (outstanding/answered-pending-sweep/idle) is covered by the offline FakeMattermostApi-based tests instead, and should get a real live-smoke pass from a session that does carry Mattermost bot standing.

Follow-up: engage-side write actions (answer-ask, label writes, rearm_dispatch) filed as #615, ready-for-session, same label as this ticket's own.

## Close report **Ruled by agent under ADR 0174 — veto anytime.** Scope split (revertible/provable, no one-way-door): this session took #614's own "Suggested next slice" (the ask inbox — a network-bound read joining two APIs) and delivered it in full; the engage-side write actions (answer-ask, label writes, `rearm_dispatch`) are split into a follow-up ticket, same precedent as #607/#611/#613's own slice history — a `ready-for-session` ticket left open across sessions scores "no progress" under this repo's session-runner rules, so closing on the delivered, proven slice rather than sitting open. **What landed** (`Matou/ourcloud@35cee49`): - `.sandcastle/tui/data/ask_inbox.py` — new module joining Forgejo's open `ready-for-human` issues against their Mattermost ask-thread state. The thread-state logic (candidate-thread selection, current-question, consumed-vs-outstanding) mirrors `ask-human.sh`/`post-issue-ask.sh`/`resume-parked-asks.sh`'s own jq exactly, in pure Python, since there is no local marker file to read instead — confirmed by reading `post-issue-ask.sh`: idempotency is entirely thread-state-derived, correcting what #613's body had said. Two independent injectable fetch seams (Forgejo, Mattermost), same shape as `tracker.py`'s `_http_get`. Missing Mattermost config (`MATTERMOST_URL`/`MATTERMOST_CHANNEL_ID`/bot token) degrades every row to `state: chat-unavailable` instead of erroring the whole screen — the Forgejo half stays independently useful. - `.sandcastle/tui/app.py` — sixth `TabbedContent` pane, `#inbox-table` (number/title/state/detail), its own 30s refresh interval and inline `#inbox-error` panel — same network-bound shape as the Queue tab (crosses two APIs, touches no local host state), not the Fleet/Incidents tabs' local-file cadence. - `.sandcastle/tui/README.md`, `STATUS.md` — updated in the same commit per this repo's own rule. **Proof:** - 30 new offline tests (20 `test_ask_inbox.py`, 4 `test_app.py`, plus 6 more from re-covering the new `_app` helper params), full TUI suite **102/102 green**. No real network call in the suite — every test injects fake Forgejo/Mattermost fetches, same posture as `test_tracker.py`. - Live-smoke-verified two ways on matou-workstation: - **Forgejo half, real API:** `ask_inbox.fetch_parked_issues()` against the real `git.matou.nz` API with this session's `FORGEJO_TOKEN` — correctly returned the 8 real open `ready-for-human` issues (#606, #601, #506, #475, #473, #471, #425, #183). - **Mattermost fallback, real code path:** this session-runner checkout's own standing carries `FORGEJO_TOKEN` but not the Mattermost bot credential — the real `mattermost_bot_token`/`MATTERMOST_URL`/`MATTERMOST_CHANNEL_ID` live only in the swarm's own checkout/CI secrets, outside what this session was granted. So rather than reach for host files outside that grant, I ran the actual `app.py` end-to-end through Textual's test harness with the real Forgejo fetch and no Mattermost config — confirming the real `chat-unavailable` fallback path renders correctly (8 rows, all `chat-unavailable`), which is exactly the environment this checkout runs in. A live Mattermost thread walk (outstanding/answered-pending-sweep/idle) is covered by the offline `FakeMattermostApi`-based tests instead, and should get a real live-smoke pass from a session that does carry Mattermost bot standing. **Follow-up:** engage-side write actions (answer-ask, label writes, `rearm_dispatch`) filed as #615, `ready-for-session`, same label as this ticket's own.
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#614
No description provided.