Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 39 additions & 1 deletion .github/scripts/issue_format.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,42 @@
"""Validate a GitHub issue body against the fleet AGENT_ISSUE_FORMAT contract."""
"""Validate a GitHub issue body against the fleet's AGENT_ISSUE_FORMAT contract.

Synced to every consumer repo by `maint-68-sync-consumer-repos.yml`. This is the
single definition of "agent-processable" for the whole fleet — do not fork it
per repo.

Why it exists: every automated lane reaches an issue through a LABEL. An issue
filed with no label and no Tasks/Acceptance block is invisible to the entire
pipeline — nothing validates it, nothing optimises it, nothing claims it. Local
automation that files *findings* rather than *work orders* therefore produces
issues no agent can ever pick up: good evidence, permanently unactionable.
(Observed in Fine-Art-Archive #406-409: four well-evidenced audit findings, zero
labels, no Tasks section between them.)

Used at both ends:
* `agents-issue-format-guard.yml` validates every issue on open/edit and, on
failure, applies `agents:format` — the label the existing Agents Issue
Optimizer already listens for — so a bad issue is ROUTED to the machinery
that repairs it rather than merely flagged;
Comment on lines +16 to +19

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Qualify the issue-routing behavior

This description is false for several events handled by the named workflow: .github/workflows/agents-issue-format-guard.yml:42-45,54 skips validation for durable/wontfix, bot-authored, and explicitly non-coding issues, while its route step at line 85 suppresses agents:format and optimizer dispatch for issues carrying agents:auto-pilot-pause or needs-human. Because this docstring is intended to preserve the workflow rationale across consumers, saying that every issue is validated and every failure is routed obscures the hold/exemption contract added by the preceding change; qualify this as non-exempt, unheld issues.

Useful? React with 👍 / 👎.

Comment on lines +7 to +19

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Keep the validation and routing claims consistent in both module docstrings.

The docstring says at Line 16 that agents-issue-format-guard.yml validates every issue, but at Line 8 it says that nothing validates an unlabeled issue. Clarify that the missing behavior is downstream routing, or narrow the scope of “pipeline.”

  • .github/scripts/issue_format.py#L7-L19: update the authoritative wording.
  • templates/consumer-repo/.github/scripts/issue_format.py#L7-L19: apply the identical wording to preserve synchronization.
📍 Affects 2 files
  • .github/scripts/issue_format.py#L7-L19 (this comment)
  • templates/consumer-repo/.github/scripts/issue_format.py#L7-L19
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/scripts/issue_format.py around lines 7 - 19, Update the module
docstring wording at `.github/scripts/issue_format.py` lines 7-19 to distinguish
issue validation from downstream pipeline routing, so it no longer claims
unlabeled issues are unvalidated; apply the identical wording at
`templates/consumer-repo/.github/scripts/issue_format.py` lines 7-19 to keep
both synchronized.

* any local script that files issues can pre-flight with
`python .github/scripts/issue_format.py <body-file>` and refuse to file junk
(non-zero exit means unfit).

Rules mirror docs/AGENT_ISSUE_FORMAT.md rather than inventing a parallel
standard: Tasks and Acceptance Criteria are REQUIRED; Why / Scope /
Implementation Notes / Non-Goals are recommended; and at least one acceptance
criterion must name a real test, runnable command, or observable verification
gate.
Comment on lines +24 to +28

`_headings()` skips fenced code blocks, and that is load-bearing rather than
cosmetic. Without it a body whose ONLY "Tasks" and "Acceptance Criteria" lines
sit inside a ```bash fence validates as conforming — a false negative that lets
an unactionable issue through the guard. Well-written issues quote commands and
expected output in fences constantly, so this is the common case, not an edge
one. Any change to heading detection must keep a fenced-heading case in
tests/scripts/test_issue_format.py.

Pure stdlib on purpose — it must run on a bare runner with no install step.
"""

from __future__ import annotations

Expand Down
40 changes: 39 additions & 1 deletion templates/consumer-repo/.github/scripts/issue_format.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,42 @@
"""Validate a GitHub issue body against the fleet AGENT_ISSUE_FORMAT contract."""
"""Validate a GitHub issue body against the fleet's AGENT_ISSUE_FORMAT contract.

Synced to every consumer repo by `maint-68-sync-consumer-repos.yml`. This is the
single definition of "agent-processable" for the whole fleet — do not fork it
per repo.

Why it exists: every automated lane reaches an issue through a LABEL. An issue
filed with no label and no Tasks/Acceptance block is invisible to the entire
pipeline — nothing validates it, nothing optimises it, nothing claims it. Local
automation that files *findings* rather than *work orders* therefore produces
issues no agent can ever pick up: good evidence, permanently unactionable.
(Observed in Fine-Art-Archive #406-409: four well-evidenced audit findings, zero
labels, no Tasks section between them.)

Used at both ends:
* `agents-issue-format-guard.yml` validates every issue on open/edit and, on
failure, applies `agents:format` — the label the existing Agents Issue
Optimizer already listens for — so a bad issue is ROUTED to the machinery
that repairs it rather than merely flagged;
* any local script that files issues can pre-flight with
`python .github/scripts/issue_format.py <body-file>` and refuse to file junk
(non-zero exit means unfit).

Rules mirror docs/AGENT_ISSUE_FORMAT.md rather than inventing a parallel
standard: Tasks and Acceptance Criteria are REQUIRED; Why / Scope /
Implementation Notes / Non-Goals are recommended; and at least one acceptance
criterion must name a real test, runnable command, or observable verification
gate.
Comment on lines +24 to +28

`_headings()` skips fenced code blocks, and that is load-bearing rather than
cosmetic. Without it a body whose ONLY "Tasks" and "Acceptance Criteria" lines
sit inside a ```bash fence validates as conforming — a false negative that lets
an unactionable issue through the guard. Well-written issues quote commands and
expected output in fences constantly, so this is the common case, not an edge
one. Any change to heading detection must keep a fenced-heading case in
tests/scripts/test_issue_format.py.

Pure stdlib on purpose — it must run on a bare runner with no install step.
"""

from __future__ import annotations

Expand Down
Loading