Skip to content

refactor(intake): stop writing queue-state labels in apply-verdict and refine - #13995

Merged
kyle-sexton merged 4 commits into
mainfrom
refactor/13486-sweep-status-label-writes
Nov 7, 2026
Merged

kyle-sexton merged 4 commits into
mainfrom
refactor/13486-sweep-status-label-writes

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Refs: #13486

Summary

Part of #13486 done-when 3 ("No .github or plugin code writes an issue status label"), outside Lane 5's core: intake's apply-verdict and refine stop writing queue-state labels and record the state through the Work status field only.

Fix

  • .github/scripts/intake-triage/apply-verdict.mjs: the label DELETEs of the queue-state labels status: ready, status: confirmed and needs-triage are removed (filtered by QUEUE_LABELS, :540 and :713). writeState() (:718) already sets Work status; the plan, waits and the state calculation are unchanged.
  • .github/scripts/intake-triage/refine.mjs: the inexact branch's status: ready and status: confirmed DELETEs are removed; its existing setStatus(number, "needs-owner-decision") now also runs when a person's needs-info or needs-spec is a label only over an unset field (99c9a8c), so the field hides the stale queue label while the hold label still holds; a person's hold on the field itself is still left alone. And the parked-at-confirmed status: confirmed DELETEs by retriage(), which sets needs-triage (:792, :842).

Verification

  • 14 changed tests assert the field write and that no queue-state label is deleted; all 14 fail on the old code.
  • intake-triage 1261 tests, resolve-config 1015, maintenance-monitor-signals 142, graphql-operations 7: 0 failures.
  • Changelog fragment checks pass (only .github changed, so none is required).

Remaining

These stay for Lane 5 (#13486's holder), since removing them now would break a reader:

  • Hold-label removals (status: needs-decision, needs-human, status: needs-info) in apply-verdict's refused and given-way holds and refine.mjs:799 and :886: read-status.mjs:42-53 still keeps hold labels on top of the field, and the triage model still adds them as plain labels (intake-triage.yml:289-300).
  • The agent-ready DELETEs in maintenance-monitor-signals/monitor.mjs:127 and maintenance-audit-lane-runs/file-findings.mjs:186: read-status.mjs:23-24, :52-53 and work-unblock/label-unblocked.mjs:626, :1296 still read the label.
  • The closing PR for done-when 3 is Lane 5's S4 slice, once those readers move to the field.

Related

session: automation-lanes

🤖 Generated with Claude Code

kyle-sexton and others added 3 commits November 7, 2026 12:19
apply-verdict and refine no longer take the queue-state labels
(status: ready, status: confirmed, needs-triage) off an issue. The Work
status field write in the same branch replaces them, and the status
reader drops a queue-state label once the field is set.

Hold-label removals (status: needs-decision, needs-human,
status: needs-info) stay: the reader keeps a hold label on top of the
field, and the triage run still applies them as raw labels. The
agent-ready removals in the monitor and audit-lane digests stay until
the readers move off the agent-ready label.

Refs: #13486

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 7, 2026 18:02
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-07T18:02:45.840724Z
We couldn’t complete this review. Comment @codex review to try again.
4bd7197 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 99c9a8cff55e5749d4ad2c6591b15410946a21f1: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #13995, incremental (4bd7197 → 99c9a8c)

I found no security issues in this push.

critical-findings: 0

Scope. This was an incremental review. I read every hunk of both files in the incremental list: .github/scripts/intake-triage/refine.mjs and .github/scripts/intake-triage/refine.test.mjs. Neither file matches a trusted-path glob. The push changes no workflow, token request, trusted-actor list, kill switch, merge-hold script or plugin manifest. It deletes no standing instruction. This lane already reviewed an earlier head, so the review was blocking only: it reports CRITICAL and IMPORTANT findings only.

What changed. In applyRefinement's inexact branch, the App now writes needs-owner-decision to the Work status field in one more case. That case is a person's status: needs-info or needs-spec that exists only as a label, while the field has no trusted state (refine.mjs:828-833). This is the fix for the earlier advisory thread, which is now settled.

What I checked.

  • The person's hold still holds. The write goes to the field only, and no label is deleted. statusLabels keeps hold labels on top of the field state, so the person's label-only hold still applies after the App's write.
  • A later exact refinement does not lift that hold. It can treat the App's own needs-decision as its own, retriage it and call removeLabel(NEEDS_DECISION) (refine.mjs:876-893). It never removes the person's status: needs-info or needs-spec label, so the issue stays held until that person lifts the label.
  • A hold on the field itself is still left alone. When statusOf.state(number) returns a trusted state, fieldHeld is true and nothing is written.
  • A failed read fails closed. A failed statusOf.state read throws StatusReadError, as statusReader documents, so nothing is written.
  • When there is no reader, the behaviour is the same as before the PR. With no statusOf, fieldHeld is false and the call is the plain setStatus.

Owner threat model. Even if this push had weakened a person-approval hold, that would be a named friction hold under the throughput phase, not a finding. It does not weaken one: as above, the person's label still holds on top of the App's field write.

Settled threads. The single settled thread (refine.mjs, stale queue label when no field write happens) is marked lines changed since resolution: no, and this push is its fix. I did not raise it again.

Embedded text. Nothing in the PR context or the settled threads reads as an instruction to the lane.

Spend. None. The change starts no new runs and touches no billing.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on 4bd719708f28969d4db87d9b787e11700e3845f0; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 99c9a8cff55e5749d4ad2c6591b15410946a21f1: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Code review (incremental, blocking only): PR #13995 at 99c9a8cf

Scope. I read every hunk of both files on the incremental list: .github/scripts/intake-triage/refine.mjs and .github/scripts/intake-triage/refine.test.mjs. I also read the unchanged code the new line calls: statusReader / labels.state / statusLabels in .github/actions/resolve-config/read-status.mjs, and the production entry point at refine.mjs:1173-1174.

This lane already reviewed an earlier head (blocking only: yes), so this pass reports blocking findings only. Advisory points are left out.

The fix to the earlier finding holds up. The settled thread is about the inexact branch skipping its Work-status write when a person's hold is present.

  • The new guard at refine.mjs#L830 skips the write only when the Work status field already has a trusted state.
  • If the field is unset, labels.state returns null, so setStatus(number, "needs-owner-decision") runs.
    • statusLabels then drops the stale status: ready/status: confirmed queue label and keeps the person's status: needs-info/needs-spec hold label on top.
    • When the person lifts the hold, the issue reads as needs-decision, not ready.
  • labels.state reuses the state that the statusOf(number, own) call at L762 cached. labels.events leaves that cache alone, so the new check makes no extra field read.
  • A failed read throws StatusReadError before any write, so nothing is lifted.
  • In production statusOf is always passed (L1173). The no-reader path, which now writes, only runs in tests.

Tests. The new test covers the earlier finding's repro. It runs two cases: a reader whose field state is empty, and no reader at all. It asserts the needs-owner-decision write and that no label is deleted. The field-hold case is still covered by the existing test at refine.test.mjs:537. I did not run any tests. The "408 of 408 pass" figure is the author's claim and I have not checked it.

Other notes.

  • No closing issue: the PR only says Refs: #13486, so there are no acceptance criteria to check.
  • Neither changed file is on the trusted-paths list, and no plugin manifest changed.
  • The settled thread and the PR body contain no instructions aimed at this lane.

An inexact refinement skipped its Work status write whenever a person
held the issue at needs-info or needs-spec. With the hold on a label
alone and the field unset, the reader returns the labels unchanged, so a
stale status: ready stayed live and won once the person lifted the hold.

The refinement now writes needs-owner-decision when the person's hold is
a label only and the field holds no trusted state: the field write hides
the stale queue label, and the hold label still holds on top of it. A
person's hold on the field itself is still left alone, since an App
needs-decision there would let a later exact refinement lift it as the
App's own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KeBVgc4pJaXmFWFcgoa4NW
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 7, 2026
Merged via the queue into main with commit 2a2bd92 Nov 7, 2026
49 checks passed
@kyle-sexton
kyle-sexton deleted the refactor/13486-sweep-status-label-writes branch November 7, 2026 19:15
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 6, survived 1, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 86%; mutation score 86%.

File Killed Survived Timeout No coverage Invalid Not run
.github/scripts/intake-triage/apply-verdict.mjs 3 1 0 0 0 0
.github/scripts/intake-triage/refine.mjs 3 0 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
.github/scripts/intake-triage/apply-verdict.mjs:754 other productive no-assertion

The run's summary has the full report.

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