Skip to content

fix(labels): per-issue audit scope, and an issues-disabled class that is not a failure - #319

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix/label-tooling-gaps
Nov 23, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
fix/label-tooling-gaps

Conversation

@aitrawog

Copy link
Copy Markdown
Contributor

fix(labels): per-issue audit scope, and an issues-disabled class that is not a failure

Closes #318 and #315.

#318 — one issue at a time, one parser. audit gains --issue owner/repo#N: it narrows the
repo set to that repo, reads its issues, and evaluates ONLY that number — so a form answer is
applied by the SAME mapping the full audit uses (no second parser), one repo read instead of
446. label-audit.yml gains an issues: [opened, edited, reopened] trigger calling it, so an
issue in THIS repo is labelled at creation under the same LABELS_AUDIT_APPLY policy.

The org-wide limit is now stated in the workflow: the org ruleset activates its required
workflow on pull_request events only, so an issues trigger in this repo cannot fire in
other repositories. Org-wide the daily full-org audit remains the applier; this repo gets the
immediate path as its own first consumer.

#315 — "has disabled issues" is a property, not a failure. api_error_class returns a new
class 2 for the '<repo>' repository has disabled issues (a repository property, not an API
refusal); cmd_retire treats it as count=0 and names it ONCE per repo instead of emitting
request failed per retired label. Measured on the 2026-11-23 retirement: nine request failed: Qwen3-TTS warnings for one issues-disabled repo, all unactionable.

Tests (scripts/labels-test.sh, now 24 arms):

  • audit --issue opencharly/repo1#10 --apply applies exactly the issue's form answer and
    touches no other issue; a form-less issue is reported and applies nothing; a malformed
    --issue dies.
  • a repo with issues disabled: retire --dry-run exits 0, names the state ONCE, never prints
    request failed, and still plans the deletion.

Head: eb3009a45518bca1549893e61abbedd79254a54a.
Diff: 4 files, 77 insertions, 7 deletions against origin/main (c5b1a4b).

How tested

Change class: code + config/script (one shell tool, its test, one workflow).

$ bash scripts/labels-test.sh
...
ok   audit --issue scopes to one issue and applies only its form answer
ok   an issues-disabled repo is a named property, not a request failure
PASS: the label taxonomy tool syncs, audits (forbidden prefixes + the retired gate), classifies and applies, samples (tested-fixture recording + --n), retires, renders, verifies close, handles the quota/permission classes in every verb, and classifies by the issue text alone (never the repo name)

Live, against GitHub:

$ bash scripts/labels.sh audit --issue opencharly/charly#1245
audit: repos=1 issues=1 findings=0 missing=0 multi=0 forbidden=0 unknown=0 applied=0 failed=0

Both arms fail without the change: --issue is an unknown flag (the audit dies), and an
issues-disabled repo still prints request failed (the negative assertion).

Rulebook compliance

  • R0 — repo-setup and git-workflow were loaded before the change.
  • R1 — the two findings come from the post-backfill retirement and the plan check; both are root-caused and fixed here, with arms that discriminate.
  • R2 — the single-issue mode reuses the audit's ONE form-answer mapping; the classifier stays the ONE api_error_class.
  • R3 — no retry or suppression; the class names the cause instead of hiding it.
  • R4 — the documented verbs work with the shipped script.
  • R5 — no legacy; the request failed path for this state is removed.
  • R6 — git status was clean before the work; no destructive action; PR-only.
  • R7 — both arms fail on the pre-change script.
  • R8 — the live --issue run is against real GitHub; the mock only covers the refusal classes.
  • R9 — no binary involved.
  • R10 — config/script class: the 24-arm suite + the live run; no bed applies.
  • R11 — no DESIGN surface.

Change classification

Tooling + workflow; not breaking (a new optional flag, a new classifier class, a new trigger).
Rollback: revert this commit.

Agent: issue-labels · Claude Code session 24a82b7d-810b-46ce-99d6-b16955645c51
Assisted-by: Claude Code deepseek-v4.1-flash:cloud (fully tested and validated)

… is not a failure

Closes #318 and #315.

audit gains --issue owner/repo#N: it narrows to that repo and evaluates ONLY that
number, so a form answer is applied by the SAME mapping the full audit uses.
label-audit.yml gains an issues (opened, edited, reopened) trigger for it; the
org-wide limit (the ruleset activates required workflows on pull_request events
only) is stated in the workflow.

api_error_class returns class 2 for "has disabled issues"; retire treats it as
count=0 and names it ONCE per repo instead of "request failed" per label.

Tests: two new arms (the single-issue scope; the issues-disabled property).

*Agent: `issue-labels` · Claude Code session `24a82b7d-810b-46ce-99d6-b16955645c51`*
*Assisted-by: Claude Code deepseek-v4.1-flash:cloud (fully tested and validated)*
@github-actions

Copy link
Copy Markdown
Contributor

Review — PASS

Head SHA: eb3009a45518bca1549893e61abbedd79254a54a (branch: fix/label-tooling-gaps)

Security screen: PASS
Checklist: All applicable rules PASS or NA.

Tool-limited (read-only, no re-run): split_item/--issue filter, the 24-arm suite, and the live audit --issue output are cross-checked only for internal consistency against the diff — they are coherent (new arms 6e/6f discriminate on the changed paths, handle_api_class suppresses the warning for class 2 before the caller names it, ordering of the has disabled issues predicate after 404/rate-limit is consistent with the body's measured pre-fix request failed class). The Assisted-by model string is unverifiable here. Non-blocking note: cmd_audit's consumption of the new class 2 is not shown in the diff nor covered by an arm — the PR's "property, not failure" framing should hold there too; confirm it does not fall through to a failure count (no defect demonstrable from the provided diff).

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

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.

label-audit runs only daily, so a form-filed issue is unlabelled until 06:17 UTC — wire the per-issue trigger

1 participant