Skip to content

Rule says the controller sets risk:T*, but risk-tier.yml is report-only and never writes labels #609

Closed

Description

@Birfy

Summary

The label discipline says risk:T* is set by the controller from the diff and never by hand, and that every PR carries exactly one. The mechanism does not do that consistently: on 2026-10-21 github-actions[bot] applied risk:T3 to PR #574 at 07:28:43Z, while none of #606, #610, #611, #612, #616, #617, #618 or #619 carries any risk:T* label — and the risk tier (report only) check completed successfully on all of them.

So the earlier framing ("the controller never labels; the workflow is report-only") was wrong: it labels at least once. What is missing is a rule that makes the outcome deterministic.

Evidence

Scope

Find out why the same workflow labelled #574 and nothing else, then make it deterministic. Candidate differences: the workflow file or its permissions changed after 07:28; the trigger (opened vs synchronize); the job being skipped on the later PRs; or the label step only existing in an earlier run.

Either:

  1. Make labelling deterministic — give the job pull-requests: write (keep pull_request, not pull_request_target; script keeps reading the base commit), apply exactly one risk:T* and remove other tiers. Trade-off: a write token on a workflow that is deliberately read-only today.
  2. Drop the label from the rules — state that the tier is computed and reported in the job summary only, that no component writes the label, and that risk:T* is neither a merge gate nor something anyone applies by hand; align AGENTS.md and .github/labels.json with the three merge gates (tip PASS, green CI at tip, red test without the source change).

Either way the job summary should emit one machine-readable line (risk-tier: T2 plus the files that set it) so a review can quote it instead of guessing.

Status

No PR yet. The ② direction was chosen before the #574 evidence turned up; the decision is open again because "the workflow never labels" is no longer true. agent-ready: the change is small, self-contained and testable in CI.

Activity

  1. added
    bugSomething isn't working
    needs-humanThe agent loop stopped; a person must decide (reason in the last comment)
    area:automationScheduled tasks and automation
    on Oct 21, 2026
  2. Birfy commented on Oct 21, 2026

    @Birfy
    CollaboratorAuthor

    State: needs-human — blocking = the Chief picks ① (workflow writes the label) or ② (rule text says report-only, no label, not a gate). One word is enough; his 2026-10-21 ruling favours ②. No agent should hand-write risk:T* in the meantime.

  3. Birfy commented on Oct 21, 2026

    @Birfy
    CollaboratorAuthor

    Decision: ② — the rule text matches the code; the workflow stays read-only.

    Acceptance for a PR

    1. risk-tier.yml keeps its read-only permissions (contents: read; no write token) and never labels, comments or merges.
    2. Its job summary ends with one machine-readable line — e.g. risk-tier: T2 plus the basis (the files/paths the rule matched) — so the tier is auditable in one place. The existing detail stays above the line.
    3. AGENTS.md and .github/labels.json describe risk:T* as "computed by the report-only workflow; job summary only; not a merge gate; written by the controller, never by hand or transcribed by a reviewer", and the surrounding text matches the three merge gates (tip PASS, green CI at tip, revert-turns-red).
    4. No risk:T* is ever written by automation or by hand; no other workflow is made a required check. Chief's final rule: the risk label is written by the controller only — the earlier transitional exception allowing a reviewer to transcribe it was withdrawn.
    5. Evidence: a sample job summary showing the line, the workflow diff showing permissions unchanged and pull_request (not pull_request_target), and npm run verify unaffected.

    While this is unfixed, the repo-wide handling is: leave one line on the PR — "controller has not written the label; the actual tier is in the risk-tier report" — then review and run the gates normally; it does not block.

    Out of scope: making the tier a label by hand, or a gate.

  4. added
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    and removed
    needs-humanThe agent loop stopped; a person must decide (reason in the last comment)
    on Oct 21, 2026
  5. Birfy commented on Oct 22, 2026

    @Birfy
    CollaboratorAuthor

    Boundary with #629 and its PR #663, so nobody does this twice:

    No overlap in files: #663 touches the label descriptions and the AGENTS.md label section; this one touches risk-tier.yml's summary step and the naming sentence. Still agent-ready, unchanged scope.

    Written-by: Triage

  6. Birfy commented on Oct 22, 2026

    @Birfy
    CollaboratorAuthor

    Claiming this one. Branch: fix/609-risk-tier-summary-line.

    Taking the owner decision ② already recorded above: the workflow stays read-only and never labels, and the tier becomes auditable from the job summary. Concretely I will make risk-gate.mjs end its report with one machine-readable line (risk-tier: T3 plus the paths that set it, from the same judge() call the human-readable report uses, so the two cannot drift), keep risk-tier.yml at contents: read / pull-requests: read, and align AGENTS.md and .github/labels.json with what actually happens: the workflow reports, the controller copies the label on its poll, nobody writes risk:T* by hand and no review transcribes it.

    Not in scope here: making the label appear on time (that is the cron lag in #629 / #663), and any change to which tier a path gets.

  7. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    and removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 22, 2026
  8. self-assigned this
    on Oct 22, 2026
  9. Birfy commented on Oct 22, 2026

    @Birfy
    CollaboratorAuthor

    Triage label record (2026-10-22) — #627 scope A.

    agent-working was set at 02:02:45Z (agent-ready removed). The claim comment at 02:02:44Z names fix/609-risk-tier-summary-line but carries no Written-by: / Posted-by:.

    Only the record is missing here: the label change had no comment carrying an attribution line. This makes the record readable; it does not prove authorship — with one shared GitHub identity only the write layer (#633) can.

    Written-by: Triage

  10. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:automationScheduled tasks and automationarea:docsDocumentationbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions