sandcastle: preflight-triage.sh doesn't exclude ready-for-session — every triage run re-surfaces already-triaged session tickets #555

Closed
opened 2026-08-15 01:02:07 +00:00 by ben · 4 comments
Owner

What breaks

preflight-triage.sh's exclusion list (the zero-token gate run-triage.sh uses to decide whether there's any work for /triage) checks an issue's labels against: ready-for-agent, ready-for-human, needs-design, needs-info, wontfix, no-triage, agent-blocked, deferred, and wayfinder:*. It does not exclude ready-for-session (minted by ADR 0174, accepted 2026-08-14).

Every issue a human or session relabels ready-for-session under ADR 0174 therefore keeps showing up in preflight-triage.sh's "still untriaged" list forever — even though it already carries a valid, reasoned state label. Observed live in this 2026-08-15 triage run: 11 of 14 issues surfaced as "untriaged" already carried ready-for-session with a full ruling recorded in comments (e.g. #543, #541, #540, #537, #531, #525, #506, #474, #467, #425, #319) — every one needed re-reading and re-verifying for no label change at the end, and run-triage.sh's before/after human_gated() diff (which itself correctly greps for ready-for-human/needs-design only) never even looks at these, so the wasted work produces no compensating signal either.

Cause

preflight-triage.sh's label-exclusion jq filter was written before ready-for-session existed and was never updated when ADR 0174 introduced it.

Fix

Add ready-for-session to the any(...) exclusion list in preflight-triage.sh (the same list that already excludes ready-for-human/needs-design/etc.), matching that role's status per docs/agents/triage-labels.md as a legitimate terminal-ish triage state (swept and reclassified separately, per ADR 0174 rule 5 — not something /triage's own state machine should keep re-visiting on every run).

Proof

After the fix, preflight-triage.sh on this repo's current issue set returns only genuinely unlabeled/needs-triage issues — none of the 11 ready-for-session issues named above appear in its output.

Found during the 2026-08-15 headless /triage CI run while triaging #553/#551/#550.

## What breaks `preflight-triage.sh`'s exclusion list (the zero-token gate `run-triage.sh` uses to decide whether there's any work for `/triage`) checks an issue's labels against: `ready-for-agent`, `ready-for-human`, `needs-design`, `needs-info`, `wontfix`, `no-triage`, `agent-blocked`, `deferred`, and `wayfinder:*`. It does **not** exclude `ready-for-session` (minted by ADR 0174, accepted 2026-08-14). Every issue a human or session relabels `ready-for-session` under ADR 0174 therefore keeps showing up in `preflight-triage.sh`'s "still untriaged" list forever — even though it already carries a valid, reasoned state label. Observed live in this 2026-08-15 triage run: 11 of 14 issues surfaced as "untriaged" already carried `ready-for-session` with a full ruling recorded in comments (e.g. #543, #541, #540, #537, #531, #525, #506, #474, #467, #425, #319) — every one needed re-reading and re-verifying for no label change at the end, and `run-triage.sh`'s before/after `human_gated()` diff (which itself correctly greps for `ready-for-human`/`needs-design` only) never even looks at these, so the wasted work produces no compensating signal either. ## Cause `preflight-triage.sh`'s label-exclusion `jq` filter was written before `ready-for-session` existed and was never updated when ADR 0174 introduced it. ## Fix Add `ready-for-session` to the `any(...)` exclusion list in `preflight-triage.sh` (the same list that already excludes `ready-for-human`/`needs-design`/etc.), matching that role's status per `docs/agents/triage-labels.md` as a legitimate terminal-ish triage state (swept and reclassified separately, per ADR 0174 rule 5 — not something `/triage`'s own state machine should keep re-visiting on every run). ## Proof After the fix, `preflight-triage.sh` on this repo's current issue set returns only genuinely unlabeled/`needs-triage` issues — none of the 11 `ready-for-session` issues named above appear in its output. Found during the 2026-08-15 headless `/triage` CI run while triaging #553/#551/#550.
Author
Owner

This was generated by AI during triage.

Redundancy check: searched .sandcastle/preflight-triage.sh and docs/agents/triage-labels.md for any existing ready-for-session exclusion — none found; confirmed live by running the script this session (it returned 11 issues that already carried ready-for-session).

Agent Brief

Category: bug
Summary: preflight-triage.sh's label-exclusion filter is missing ready-for-session, so already-triaged session tickets are re-surfaced as "untriaged" on every /triage run.

Current behavior:
preflight-triage.sh lists open issues whose labels contain none of a fixed set of "already triaged" outcome labels. That set omits ready-for-session. Any issue relabelled ready-for-session (the ADR 0174 state for work needing an interactive session's standing, not Ben) keeps appearing in the script's output indefinitely.

Desired behavior:
preflight-triage.sh treats ready-for-session the same as the other outcome labels already in its exclusion set — an issue carrying it is not "still untriaged" and is left out of the script's output.

Key interfaces:

  • The label-exclusion list inside preflight-triage.sh's jq filter — gains ready-for-session alongside the existing entries.

Acceptance criteria:

  • preflight-triage.sh no longer lists an open issue whose only relevant label is ready-for-session.
  • Issues carrying none of the exclusion labels (genuinely unlabeled or needs-triage) still appear, unchanged.
  • Existing exclusions (ready-for-agent, ready-for-human, needs-design, needs-info, wontfix, no-triage, agent-blocked, deferred, wayfinder:*) are unaffected.

Out of scope:

  • run-triage.sh's separate human_gated() before/after diff (used for the Mattermost digest) — that already greps only ready-for-human/needs-design and needs no change.
  • Any change to when/how ready-for-session issues get swept and reclassified — that's ADR 0174's separate concern, not this script.

Why session, not agent: the target file lives under .sandcastle/, a protected path (#445) — a swarm worker's edit would be rolled back.

> *This was generated by AI during triage.* **Redundancy check:** searched `.sandcastle/preflight-triage.sh` and `docs/agents/triage-labels.md` for any existing `ready-for-session` exclusion — none found; confirmed live by running the script this session (it returned 11 issues that already carried `ready-for-session`). ## Agent Brief **Category:** bug **Summary:** `preflight-triage.sh`'s label-exclusion filter is missing `ready-for-session`, so already-triaged session tickets are re-surfaced as "untriaged" on every `/triage` run. **Current behavior:** `preflight-triage.sh` lists open issues whose labels contain none of a fixed set of "already triaged" outcome labels. That set omits `ready-for-session`. Any issue relabelled `ready-for-session` (the ADR 0174 state for work needing an interactive session's standing, not Ben) keeps appearing in the script's output indefinitely. **Desired behavior:** `preflight-triage.sh` treats `ready-for-session` the same as the other outcome labels already in its exclusion set — an issue carrying it is not "still untriaged" and is left out of the script's output. **Key interfaces:** - The label-exclusion list inside `preflight-triage.sh`'s `jq` filter — gains `ready-for-session` alongside the existing entries. **Acceptance criteria:** - [ ] `preflight-triage.sh` no longer lists an open issue whose only relevant label is `ready-for-session`. - [ ] Issues carrying none of the exclusion labels (genuinely unlabeled or `needs-triage`) still appear, unchanged. - [ ] Existing exclusions (`ready-for-agent`, `ready-for-human`, `needs-design`, `needs-info`, `wontfix`, `no-triage`, `agent-blocked`, `deferred`, `wayfinder:*`) are unaffected. **Out of scope:** - `run-triage.sh`'s separate `human_gated()` before/after diff (used for the Mattermost digest) — that already greps only `ready-for-human`/`needs-design` and needs no change. - Any change to when/how `ready-for-session` issues get swept and reclassified — that's ADR 0174's separate concern, not this script. **Why session, not agent:** the target file lives under `.sandcastle/`, a protected path (#445) — a swarm worker's edit would be rolled back.
Author
Owner

This was generated by AI during triage.

Reproduced live, this run (2026-08-15 headless /triage, CI mode). preflight-triage.sh surfaced 9 "untriaged" issues: #555 itself, #543, #541, #537, #531, #525, #506, #474, #467. Checked each — every one of the other 8 already carries exactly one category label (bug/enhancement) and ready-for-session with a full ruling recorded in comments (several already carry a prior triage pass's "added the missing category label; state left as-is" note). None needed a label change.

Per this ticket's own diagnosis, re-touching them would only reproduce the wasted-work pattern — so this run applied no label changes to any of the 8, and is leaving #555 itself as-is too (already bug + ready-for-session, agent brief already posted). Recording this as the compensating signal the issue named as currently missing.

No new action needed here beyond what's already on the ticket — surfacing this as confirmation the bug is still live and the fix (ready-for-session added to preflight-triage.sh's exclusion list) is still outstanding, for whichever session picks up the protected-path edit.

> *This was generated by AI during triage.* **Reproduced live, this run (2026-08-15 headless `/triage`, CI mode).** `preflight-triage.sh` surfaced 9 "untriaged" issues: #555 itself, #543, #541, #537, #531, #525, #506, #474, #467. Checked each — every one of the other 8 already carries exactly one category label (`bug`/`enhancement`) **and** `ready-for-session` with a full ruling recorded in comments (several already carry a prior triage pass's "added the missing category label; state left as-is" note). None needed a label change. Per this ticket's own diagnosis, re-touching them would only reproduce the wasted-work pattern — so this run applied **no label changes to any of the 8**, and is leaving #555 itself as-is too (already `bug` + `ready-for-session`, agent brief already posted). Recording this as the compensating signal the issue named as currently missing. No new action needed here beyond what's already on the ticket — surfacing this as confirmation the bug is still live and the fix (`ready-for-session` added to `preflight-triage.sh`'s exclusion list) is still outstanding, for whichever session picks up the protected-path edit.
Author
Owner

This was generated by AI during triage.

Bumping to priority. This is now the third distinct headless /triage run to document hitting this exact bug live: 01:02 UTC (agent brief posted), 04:13 UTC (reproduced, explicitly declined to re-touch the 8 affected issues to avoid the wasted-work loop this ticket describes), and now 06:56 UTC (same 8 issues re-surfaced again, same no-op outcome). The :05,:35 * * * * cron means this has likely repeated many more times in between without anyone commenting. Each cycle spends a full claude -p invocation re-reading and re-verifying 8 already-triaged issues for zero label change — real token/CI cost, recurring every ~30 minutes, for a fix this ticket already scoped as a one-line jq filter addition.

Per this run's own diagnosis (matching the 04:13 run): no label changes applied to #555 itself beyond this bump, and no re-touching of #543/#541/#537/#531/#525/#506/#474 — they're already correctly bug|enhancement + ready-for-session, and re-confirming them again would only add to the noise this ticket is about.

State unchanged (ready-for-session — still correctly blocked on a session touching the protected .sandcastle/ path).

> *This was generated by AI during triage.* **Bumping to `priority`.** This is now the third distinct headless `/triage` run to document hitting this exact bug live: 01:02 UTC (agent brief posted), 04:13 UTC (reproduced, explicitly declined to re-touch the 8 affected issues to avoid the wasted-work loop this ticket describes), and now 06:56 UTC (same 8 issues re-surfaced again, same no-op outcome). The `:05,:35 * * * *` cron means this has likely repeated many more times in between without anyone commenting. Each cycle spends a full `claude -p` invocation re-reading and re-verifying 8 already-triaged issues for zero label change — real token/CI cost, recurring every ~30 minutes, for a fix this ticket already scoped as a one-line `jq` filter addition. Per this run's own diagnosis (matching the 04:13 run): no label changes applied to #555 itself beyond this bump, and no re-touching of #543/#541/#537/#531/#525/#506/#474 — they're already correctly `bug|enhancement` + `ready-for-session`, and re-confirming them again would only add to the noise this ticket is about. State unchanged (`ready-for-session` — still correctly blocked on a session touching the protected `.sandcastle/` path).
Author
Owner

Ruled by agent under ADR 0174 — veto anytime.

Ruling: two-way door. This is a one-line jq filter change in
.sandcastle/preflight-triage.sh (a repo-tracked script, no host/live-infra
touch), revertible with a commit, and provable by an offline test with no
network dependency. No credentials, security-posture widening, or
member-facing trust surface is involved — none of the ADR 0174 one-way-door
categories apply.

What landed (9dd57a0fc8ca465baa579823bd67a6a67413006e, pushed to main):

  • .sandcastle/preflight-triage.sh: added . == "ready-for-session" to the
    any(...) exclusion filter (alongside ready-for-agent, ready-for-human,
    needs-design, needs-info, wontfix, no-triage, agent-blocked,
    deferred, wayfinder:*), matching its role in
    docs/agents/triage-labels.md as a state already ruled under ADR 0174 and
    swept/reclassified separately — not something /triage's preflight gate
    should keep resurfacing.
  • .sandcastle/tests/preflight-triage-test.sh: new offline scenario — a fixed
    5-issue batch carrying ready-for-session, ready-for-human,
    wayfinder:map, deferred, and one genuinely unlabeled issue. Confirmed
    RED against the pre-fix script (ready-for-session wrongly surfaced
    alongside the unlabeled issue), then GREEN after the fix (only the unlabeled
    issue surfaces).
  • STATUS.md: header + milestone-log entry.

Proof:

$ bash .sandcastle/tests/preflight-triage-test.sh
preflight-triage: 3 scenarios passed

Confirmed run-triage.sh's own human_gated() before/after diff (which the
ticket correctly notes only greps ready-for-human/needs-design) needed no
change — it was never part of the bug.

Commit: 9dd57a0 — sandcastle: #555 preflight-triage.sh's exclusion list now excludes ready-for-session

Ruled by agent under ADR 0174 — veto anytime. **Ruling:** two-way door. This is a one-line `jq` filter change in `.sandcastle/preflight-triage.sh` (a repo-tracked script, no host/live-infra touch), revertible with a commit, and provable by an offline test with no network dependency. No credentials, security-posture widening, or member-facing trust surface is involved — none of the ADR 0174 one-way-door categories apply. **What landed** (`9dd57a0fc8ca465baa579823bd67a6a67413006e`, pushed to `main`): - `.sandcastle/preflight-triage.sh`: added `. == "ready-for-session"` to the `any(...)` exclusion filter (alongside `ready-for-agent`, `ready-for-human`, `needs-design`, `needs-info`, `wontfix`, `no-triage`, `agent-blocked`, `deferred`, `wayfinder:*`), matching its role in `docs/agents/triage-labels.md` as a state already ruled under ADR 0174 and swept/reclassified separately — not something `/triage`'s preflight gate should keep resurfacing. - `.sandcastle/tests/preflight-triage-test.sh`: new offline scenario — a fixed 5-issue batch carrying `ready-for-session`, `ready-for-human`, `wayfinder:map`, `deferred`, and one genuinely unlabeled issue. Confirmed RED against the pre-fix script (`ready-for-session` wrongly surfaced alongside the unlabeled issue), then GREEN after the fix (only the unlabeled issue surfaces). - `STATUS.md`: header + milestone-log entry. **Proof:** ``` $ bash .sandcastle/tests/preflight-triage-test.sh preflight-triage: 3 scenarios passed ``` Confirmed `run-triage.sh`'s own `human_gated()` before/after diff (which the ticket correctly notes only greps `ready-for-human`/`needs-design`) needed no change — it was never part of the bug. Commit: 9dd57a0 — sandcastle: #555 preflight-triage.sh's exclusion list now excludes ready-for-session
ben closed this issue 2026-08-15 07:33:02 +00:00
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#555
No description provided.