Skip to content

ci: require every PR to reference a triaged issue - #16241

Merged
chenmingwei23 merged 1 commit into
mainfrom
ci/issue-gate
Oct 3, 2026
Merged

chenmingwei23 merged 1 commit into
mainfrom
ci/issue-gate

Conversation

@CrysisDeu

@CrysisDeu CrysisDeu commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Every pull request traces to an issue that triage has already read, enforced by CI rather than by habit.

Nothing stops a fix from being built on impulse and merged with no record of why it exists or whether triage agreed. Issues carry that record (needs-triage in, one verdict label out), but no PR check consults it. #15731 and #15741 solving the same Welcome-screen problem two ways, each without an issue, is the shape this prevents.

Why it matters

Without the gate, "someone agreed to this work" is unverifiable at review time, and AI-lane and human rounds go to PRs whose premise was never triaged. With it, such a PR is red before anyone reads the diff, and the fix is a one-line body edit, not a push.

Not a goal

  • No in-repo alarm on issues that sit in needs-triage past the 24h expectation; the triage pipeline runs outside .github/ and the overdue sweep is filed as ci: alarm in-repo when an issue sits in needs-triage past 24h #16308.
  • No change to issue-triage.yml or to the auto-pipeline that writes the verdict labels.
  • No second branch-protection entry and no merge_group run: PR Readiness is the one required status.
  • No self-service waiver marker in the PR body.
  • No change to the triage verdict set.
  • No issue-side revalidation: an issue closed as not planned, or stripped of its verdict, after the PR's last event is not re-read (known residual: deliberate maintainer writes; remedy is a revert).

What changed (motivation → approach → change)

Goal → a deterministic readiness lane that reads the PR body with the repository's issue-reference grammar and the referenced issues' labels → .github/workflows/issue-gate.yml + .github/scripts/issue_gate_refs.py:

  • One grammar. Which issues a body declares is decided by issue_gate_refs.py, an adapter onto the grammar prepare-pr/scripts/pr_status.py exports as its one public entry point, declared_issue_numbers(body, repo). The reading: a line that starts (<=3 columns, optional bullet) with a closing verb (Closes / Fixes / Resolves) or a non-closing Refs / Part of, plus #N / OWNER/REPO#N / a github.com issue URL, after HTML comments, fenced blocks (unclosed ones through end of body) and inline code are masked; every reference on that line counts and the rest is free (Fixes #123 (the Windows half)). Template hints, >-quoted or inline-code examples, four-column code lines, mid-sentence mentions and bare #N do not count. Only this repository counts; URLs only on github.com (a rule inside the grammar; the adapter adds nothing). pr_status.py's NOTICE path answers a different question (why the host resolved no closure) with its own whole-line, closing-only classifier, and no longer accepts a no linked issue: opt-out the gate would reject. The three verdict-label names are pinned by TestLabelContract. More than 20 distinct declared issues is a finding, not 20+ API reads.
  • Trusted grammar. The workflow checks out the repository's default branch (which the PR cannot write; not base.sha, since a stacked PR's base may predate the gate) and runs the adapter from there, so a PR cannot rewrite the grammar that judges it; nothing from the PR's tree is executed. Bootstrap: a default branch without the script (before this merges) is skipped with a notice, never filled by running PR code.
  • The rule. Every declared number must be an issue (not a PR), not closed as not_planned, free of needs-triage, carrying one of auto-fixable, needs-investigation, needs-human. One bad reference fails the PR; the job summary lists each problem and how to go green (once triage lands, any body edit re-runs the check -- the fork-author path).
  • Exemptions, both logged: the dependabot[bot] author (notice; github-actions[bot] is not exempted because this repository leaves "Allow GitHub Actions to create and approve pull requests" off); the maintainer-applied issue-gate: waived label (warning), for a production fire or a release PR.
  • Fails closed: 3 retried API attempts then red naming the read; a 404 is its own finding; a grammar-script environment failure, an impossible issue number or more than 20 distinct issues is red naming the cause. Keeps the runner's default bash -e; every verdict-bearing exit status goes through if.
  • Enrolment: pr-readiness.yml gains issue-gate.yml|Issue Gate in its lane specs (beside Code Review: both run on pull_request with no base filter and a read token, so forks and stacked PRs included), in MONITORED_LANES and in its workflow_run list. That is what makes a red here red the PR; the branch ruleset requires only PR Readiness.
  • Triggers on opened / synchronize / reopened / edited / labeled / unlabeled; body read from the API at run time; ubuntu-latest.

Docs in the same commit: new issue-gate.yml section + Shape-tree entry + lane rosters in docs/ci/ci-and-reviews.md (names the maintainer-operated Kiro Crew auto-pipeline as the writer of the verdict labels, the enrolment path, the shared grammar and what a stall looks like); CONTRIBUTING.md gains the "Start from an issue" step and says Closes #N closes on merge while Part of #N leaves the issue open; docs/build/release.md names the waiver label for the version-drop PR; prepare-pr/SKILL.md no longer calls the issue link "advisory, not a gate"; pr_status.py gains the public declared_issue_numbers() (4 tests; the no linked issue: opt-out and its tests are gone).

Backwards compatibility

Breaking: a PR whose body declares no triaged issue reds PR Readiness once this merges. Who watches for a stall of the label writer until #16308's overdue sweep lands: the maintainer who operates the auto-pipeline; the symptom is loud (every new PR red on Issue Gate naming needs-triage); the per-PR fallback is the issue-gate: waived label; and if the pipeline is down past the 24h triage expectation, that same maintainer turns the gate off by deleting the issue-gate.yml|Issue Gate line from the lane specs in pr-readiness.yml (one-line PR, waived) until it is back. Writer sweep on origin/main @ 0777838 (grep -rn 'gh pr create' .github/workflows/): humans, the prepare-pr skill (updated here), and three scheduled workflows -- test-durations.yml:171, add-contributor.yml:381, memory-benchmark.yml:337 -- whose gh pr create is refused in this repository, so a maintainer opens the PR from the compare link; each generated body and each compare-link notice now carries Part of #16362 (the standing tracking issue for workflow-generated PRs). The waiver label does not serve those PRs: it is the logged exception for a fire or a release PR, and a weekly PR that takes it would make the exception routine, while Part of #16362 is the rule itself (the work those PRs are for) with nothing to bypass. dependabot.yml-generated PRs are exempt in the workflow; the release version-drop PR uses the waiver label (docs/build/release.md). deferred-finding issues filed from accept-and-defer dispositions must now also carry needs-triage (prepare-pr deferral contract) so the pipeline's intake sees them. Open PRs at merge time need a Closes #N / Part of #N line added to their body (an edit, no push). The no linked issue: <why> opt-out that pr_status.py used to accept is removed: a line the gate rejects cannot silence the local NOTICE.

Reader: src/kiro_crew/apps/builtins/auto_improvement/profiles/github_repo/pr_recipe.py:draft -- app -- posts an agent-written draft PR body to whichever repository the operator points it at; here that draft is red until it declares the issue the improvement is for, the same rule every author meets, so the recipe is not changed.

Nothing else is removed or renamed: no label, workflow, path or public function.

Tests

  • test/test_issue_gate_refs.py (new, 45 cases) pins the adapter to the reference grammar on the shapes that have fooled a grep: template HTML-comment hint, unclosed fence, fence closed by a longer run, inline code, Related to / see / Addresses / bare #N, Discloses / Unfixed / prefixes (also in the free tail of a declaring line: unresolved: #2), the non-closing Refs / Part of counting without closing, another repository's owner/repo#N and URL, a URL on a non-github.com host (and github.com.evil.example); the pinned verdict/pending label names (TestLabelContract); the line-start reading (Fixes #123 (the Windows half) and every reference on a declaring line count; a >-quoted line, a four-column nested list item and a mid-sentence mention do not); plus the CLI contract (one number per line, exit 0 on no declaration, 3 on an impossible number, 4 above the 20-issue ceiling, 2 on usage).
  • The step's run: block executed locally under bash -e (the runner's default) against a stubbed gh api and the real grammar script, ten cases: template comment + inline code + Discloses + Refs + Part of + kirodotdev/KiroCrew#100 in prose → red "declares no issue"; unclosed fence → red; Closes #100 → green; Fixes kirodotdev/KiroCrew#100 + issue URL + Closes other/repo#5 → green on fix: run app-install copytree off the event loop and stop following symlinks #100 only; Fixes #101 with needs-triage → red naming the label; mixed body naming a PR, a not-planned issue and a non-existent number → red listing all three (the 404 branch runs under -e); impossible number → red "malformed"; three 502s → red naming the read; dependabot[bot] → notice, green; issue-gate: waived → warning, green.
  • Not fixed here, filed as test: hoverVariantPolicy and SessionActionsMenu.duplicate red on main since #14807 #16274: Frontend Tests (1)/(2) are red on this PR's rounds 1 and 2 on hoverVariantPolicy.test.ts (WelcomeView DECORATIVE entry names a class fix(chat): keep floating composer chrome off the transcript and hero #15820 removed) and SessionActionsMenu.duplicate.test.tsx, both last touched by fix(website): gate hover so iOS taps land on the first try #14807 on main; this diff touches no website/ file. Frontend Coverage Merge and Coverage Gate are red behind them.
  • test/test_pr_readiness_evaluate.py + test/test_pr_readiness_publish.py (the readiness step scripts with the new lane), test/test_ai_review_workflows.py, test/test_ci_fleet_routing_expression_parity.py, test/test_prepare_pr_status.py green locally (1558 passed); scripts/docs-lint.sh, black/isort/flake8/mypy on the touched Python green.
  • Round 2 of this PR ran the gate from its own branch and went red on exactly the inline-code case the first grep missed (it credited the quoted Closes #999 examples in this body); the shared grammar is what replaced that grep.

Manual verification

This PR's own body declares Closes #16064, triaged needs-human; round 3 (merge-ref grammar) passed on it. From round 4 the grammar is read from the default branch, which has none yet, so the gate reports the bootstrap notice on this PR and starts enforcing on the first PR opened after merge. Readiness enrolment is in the diff; no post-merge branch-protection step is needed.

Related Issues

Closes #16064

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Maintainer follow-up after merge

  1. Create the issue-gate: waived label (the gate reads it; absence is harmless).

@CrysisDeu
CrysisDeu requested a review from a team as a code owner October 2, 2026 19:38
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of bb7b14631f117dc413653768c49f4e62f44bba22 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] bb7b146

False positive or not applicable? A repository writer can comment:
/ai-review override gpt bb7b14631f117dc413653768c49f4e62f44bba22: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — 🟡 CONCERNS

Premise-level review of bb7b14631f117dc413653768c49f4e62f44bba22 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

The bootstrap skip only helps this PR's own unenrolled run, is dead after merge, and duplicates the issue-gate: waived label.

Not justified as shipped

  • Item 7 — inherited: if [ ! -f base/.github/scripts/issue_gate_refs.py ] → "nothing to enforce on this PR" only covers runs from before the merge. pr-readiness.yml runs on pull_request_target from the base, so on this PR (and on stacks cut from it) Issue Gate is not enrolled yet and can't red readiness. Without the branch, the only cost is one red check that isn't required. After merge the branch can't be reached, unless the script moves on main. Then it passes the PR with a notice.
    Subtraction: delete the bootstrap if block. The pre-merge window is the release-PR or production-fire case, and the existing issue-gate: waived label covers it.
    Clears when: the block is deleted, or the author names a run after the merge that only this branch handles.

What this change ships

Inventory (10 items) — 9 justified

Intent: make every PR trace to an issue that triage has already reached a verdict on, enforced by CI (ADDITION).

  1. A PR with no declared triaged issue now turns PR Readiness red — justified
  2. Part of #N / Refs #N count as declarations beside the closing verbs — justified
  3. Dependabot PRs are exempt, with a notice in the log — justified
  4. A maintainer can apply the issue-gate: waived label to waive the gate, logged as a warning — justified
  5. The no linked issue: opt-out in pr_status.py is removed — justified
  6. Bodies declaring more than 20 issues fail the gate instead of being read — justified
  7. The gate skips with a notice when the default branch has no grammar script — inherited: covers only pre-merge runs
  8. Bodies generated by three scheduled workflows, and their compare-link notices, now carry Part of #16362 — justified
  9. Deferred-finding issues must also carry needs-triage — justified
  10. CONTRIBUTING gains a "Start from an issue" step; release docs name the waiver label — justified

[FIRST-PRINCIPLES-REVIEWED] bb7b146

Description read

[DESCRIPTION-READ] 551637e8e5dd61fbb6af6ee196503ed9be0d2221dc5cd3738948e331b46085eb

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — 🟡 CONCERNS

Design-level review of bb7b14631f117dc413653768c49f4e62f44bba22 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

The description is cut off inside ## Backwards compatibility, so I couldn't check its reader list. The design works, but merge readiness now depends on a label writer outside this repo.

Watch

  • Reader list cut off: The description ends at "Nothing else is re… [description TRUNCATED at 8000 bytes]", right in the take-away section. The patch removes things (no linked issue: opt-out removed from pr_status.py; every PR body must now declare an issue). Any further Reader: lines past the cut were not checked. Readers I found: pr_recipe.py:draft is listed; pipeline-conductor already writes Closes #{n}. I found no other breaking reader.
    Clears when: the Backwards compatibility section fits under the 8000-byte capture (shorten the What-changed prose) so the full reader list can be checked.
  • Label writer outside the repo: The gate requires one of auto-fixable needs-investigation needs-human, and "not a workflow in this repository" writes those labels. If that pipeline stalls, every contributor PR, forks included, goes red. The only fix is a maintainer label on each PR, and the overdue sweep (ci: alarm in-repo when an issue sits in needs-triage past 24h #16308) is deferred. You can undo this by removing the lane, but until ci: alarm in-repo when an issue sits in needs-triage past 24h #16308 lands nothing in the repo detects a stall.
    Clears when: #16308 lands, or the PR names who removes the lane and how if the pipeline is down longer than a set time.

[DESIGN-REVIEWED] bb7b146

Description read

[DESCRIPTION-READ] a1ce96db53f672fe4241fbfa27df9ab5d85fd75c9038183d96dd38a2e3685d5f

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed bb7b14631f117dc413653768c49f4e62f44bba22 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] bb7b146

Verdict parsed from the review's SHA-scoped output markers for commit bb7b14631f117dc413653768c49f4e62f44bba22.

False positive or not applicable? A repository writer can comment:
/ai-review override fable bb7b14631f117dc413653768c49f4e62f44bba22: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 2, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 2, 2026
@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=e47e2497fa8e undeclared keyword alternatives (related to, OWNER/REPO#N)

fixed in df71a3b: the related( to)? alternative and the OWNER/REPO#N short form are deleted from the keyword regex, so the implemented set is exactly the documented one -- Closes / Fixes / Resolves / Refs / Part of, each with #N or this repository's full issue URL. The keyword must now also start a word. Workflow header, docs section and step summary all state the same list. Verified with the stubbed-gh harness: a body carrying kirodotdev/KiroCrew#100, Discloses #100 and Unrelated to #100 is red "names no issue".

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=32802272fcae verdict-label pipeline unverifiable in-repo

fixed in df71a3b (docs + workflow header): the claim "mirrors the verdict set the triage pipeline writes" now names the system -- the maintainer-operated Kiro Crew auto-pipeline (Issue Radar crews), which posts the "Kiro Crew Auto-Pipeline: Routing to ..." comment on each issue -- and states that issue-triage.yml writes only type/area/platform/channel, so this repository holds the label contract and not the pipeline. Coverage evidence for the maintainer-confirmation half: the pipeline is operated by the maintainer who approved #16064 under needs-human, and every non-bot-filed open issue sampled at PR time (#16063 #16059 #16049 #16046 #16041 #16037 #16022 #16015) carries needs-triage or one of the three verdicts. Bot-filed deferred-finding issues arrive without either; the docs say so and treat it as the rule applied consistently, not an exemption.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=358088983136 no in-repo writer of the verdict labels, no 24h alarm

fixed in df71a3b for the first half: docs/ci/ci-and-reviews.md and the workflow header name the actual writer (the maintainer-operated Kiro Crew auto-pipeline, running outside .github/) and where the contract lives (TRIAGE_VERDICT_LABELS). The second half -- an in-repo alarm on issues stuck in needs-triage past 24h -- is declared Not a goal in the PR body by the maintainer's explicit scoping of #16064 ("the 24h alarm can wait; I only want the PR gate"); the docs record the 24h expectation, that an overdue issue is a pipeline defect to report, and that nothing in-repo alarms on it yet. It is a separate change when the maintainer wants it, not a silent omission.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=a4c6674fb32b issue-less PR classes (release, CHANGELOG, revert) need a path

fixed in df71a3b: the waiver label is renamed issue-gate: waived and documented for the two shapes that legitimately have no issue -- a production fire, and the release version-drop / CHANGELOG PR. docs/build/release.md now says, at the version-drop step, that the maintainer opening it applies the label. Reverts are deliberately NOT exempt: a revert is a decision about shipped behaviour and gets an issue like any other change (#16066 reverted #15485 against #16065). The waiver stays maintainer-only on purpose; the gate's point is that someone other than the author agreed to the work.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=6050a47be7a4 regex accepts Related to #N, which no rule statement lists

fixed in df71a3b: related( to)? removed; the implemented keyword set equals the documented one in the workflow header, the docs section and the error summary that teaches contributors the rule.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=4d8593d87527 related( to)? and missing word boundary let Unrelated to / Discloses satisfy the keyword contract

fixed in df71a3b: the extra alternative is removed and the keyword must start a word ((^|[^[:alnum:]_]) before close|fix|resolve|refs?|part of). Stubbed-gh harness under bash -e: Discloses #100 and Unrelated to #100 no longer count; Closes #100, Fixes <full issue URL> and Refs #101 do.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=fd73f52afa92 inherited bash -e kills the step before rc=$? so the 404 / read-failure branches never run

fixed in df71a3b: every verdict-bearing exit status is taken through if -- if ! body=$(api_read ...); then fail_read, and per issue if info=$(api_read ...); then :; else rc=$?; fi -- and the grep that decides "no reference" is inside if too, so -e can only stop the step on a genuine bug. The step keeps the runner default rather than set +e, deliberately. Re-tested under bash -e with a stubbed gh: a body naming a non-existent issue reaches the 404 branch and lists "#999 does not exist", one 502 then success is green, three 502s fail closed naming the read.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=659546766add the rc=$? capture after a failing command substitution (second instance of the -e defect)

fixed in df71a3b together with span fd73f52afa92: the rc=$? after a bare info="$(api_read ...)" is gone; the status is read in the else branch of an if, which is the only form -e leaves reachable. Same harness run exercises it (404 branch reached under bash -e).

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=d4538c96263a verdict labels nothing in-repo applies; raw-body scan credits the template's own HTML-comment hint

fixed in df71a3b, both instances. Scan: the body is passed through perl first to blank HTML comments and fenced code blocks, so .github/PULL_REQUEST_TEMPLATE.md's <!-- Link to relevant issues, e.g. Fixes #123 --> and an example inside a code fence are not references (harness: the template line alone is red "names no issue"; Closes #999 inside a fence beside Closes #100 resolves to #100 only). Labels: the workflow header and TRIAGE_VERDICT_LABELS comment now name the writer -- the maintainer-operated Kiro Crew auto-pipeline, outside .github/ -- and the docs state that issue-triage.yml writes only type/area/platform/channel, so the gate consults a contract this repository documents rather than one it applies.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=621c4520ad32 prepare-pr SKILL.md still calls the issue link advisory and accepts no linked issue:

fixed in df71a3b: the Issue link section now says the link is a gate on Kiro Crew, lists the accepted keywords and the verdict-label requirement, tells the author to open the issue and let triage reach it BEFORE Phase 1, and states that no linked issue: <why> records a deliberate omission for a human reader but does not pass the gate -- only a maintainer's issue-gate: waived label does. pr_status.py's missing-link NOTICE: now says the Issue Gate check fails the PR without one (asserted substrings unchanged; test/test_prepare_pr_status.py green). SKILL.md mtime moves with the script change, per its own re-sync rule.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 2, 2026
@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=b1d77236d862 two parsers of PR-body issue references that already diverge

fixed in c1e32b5 by subtraction, as proposed: the workflow's own perl/grep grammar is deleted. The gate now checks the repository out and asks the in-tree reference grammar through .github/scripts/issue_gate_refs.py, a 90-line adapter that calls pr_status.py's _visible_markdown_prose + _declared_closing_numbers and prints the numbers declared for this repository. One grammar judges both surfaces: closing verbs only (Refs/Part of dropped, as pr_status never accepted them), #N / owner/repo#N / issue URL all accepted, same masking (HTML comments, fences incl. unclosed, inline code), same three-column indent cap. pr_status.py's NOTICE is therefore no longer wrong for a Part of #N-only body: both surfaces say "no declaration". test/test_issue_gate_refs.py (28 cases) pins the adapter to the grammar on exactly the shapes the grep got wrong.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=50ea1e62dc15 a triage-pipeline stall is invisible in-repo while the overdue alarm is deferred

fixed in c1e32b5 (docs): docs/ci/ci-and-reviews.md now states what a stall looks like until an overdue sweep exists -- PRs going red on "still carries needs-triage" -- and that the maintainer's per-PR fallback is the issue-gate: waived label, with a run of such waivers being the signal to fix the pipeline rather than loosen the gate. The workflow header carries the same sentence. Enrolment is no longer a branch-protection step at all (see the GPT merge_group disposition), so there is nothing to make contingent; the waiver-as-stall-fallback is documented as the Clears-when asked.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=0f4fdacf695e the needs-triage summary says wait but not how to go green afterwards

fixed in c1e32b5: the "not cleared by triage" job summary now ends with "once the verdict label lands, any edit to this PR's description re-runs the check (no push, no re-run button needed -- this is how a fork author goes green)". The header and docs say the same, and Opus's R2 observation that an issues event never re-queues this pull_request-only workflow is answered by that same path.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=049e2547a4b0 Item 7 — Part of #16362 in three generated PR bodies rides along; the waiver label already covers them

kept, with the premise corrected. Those three PRs are opened by github-actions[bot] from scheduled workflows (test-durations.yml, add-contributor.yml, memory-benchmark.yml), not by a maintainer by hand; a maintainer only merges them. The waiver label is a per-PR maintainer action after the PR is already red, so relying on it would turn every rolling PR red on open and add a manual step to each one. The one-line Part of #16362 (a standing triaged tracking issue) is the mechanical path that keeps them green without a bot exemption arm (which the earlier Design round rejected as a bypass for any workflow-authored PR). It is in this PR because the gate is what makes those bodies fail; shipping the gate without it would knowingly red three recurring PRs.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=eeb650c657f8 Merge readiness hangs on an unmonitored outside system

fixed in 99e5c40 for the in-repo half: TestLabelContract in test/test_issue_gate_refs.py pins TRIAGE_VERDICT_LABELS (auto-fixable needs-investigation needs-human) and PENDING_LABEL (needs-triage) as read from issue-gate.yml, so a rename on the gate side is a red test, and docs/ci/ci-and-reviews.md names the same three labels as the contract the triage pipeline must write. The pipeline-side half (an issue sitting in needs-triage past 24h is a pipeline bug that must alarm) is #16308, filed and triaged; the maintainer chose to land the gate first because an untriaged issue is already a stop by the project's rule, and the per-PR fallback for a stalled labeler is the issue-gate: waived label. Re-running the gate on a label change is not done: the gate is a pr-readiness lane and re-runs on the next push or body edit, which is the same trigger every other readiness lane has.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=67fbad64aee6 Backwards compatibility only partly checked; pr_recipe.py:draft writer missed

fixed in 99e5c40 (description): the Readers list now carries Reader: src/kiro_crew/apps/builtins/auto_improvement/profiles/github_repo/pr_recipe.py:draft -- app -- posts an agent-written draft PR body to whichever repository the operator points it at; on this repository that draft is red until its description declares the issue the improvement is for, which is the same rule every author meets, so the recipe is not changed here. The Backwards compatibility section is intact in the PR body; the cut-off was the lane's description truncation, not missing text.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=5ab8f898f7f3 test/test_issue_gate_refs.py leaves .pyc files in the checked-in tree

fixed in 99e5c40: the in-process load goes through skill_script_helpers.load_skill_script inside no_bytecode() (the same guard the other prepare-pr script tests use), and the subprocess runs pass -B plus PYTHONDONTWRITEBYTECODE=1 in the environment, so neither .github/scripts/__pycache__ nor the skill scripts' __pycache__ is written by this test. Verified locally: git status --short is clean after pytest -p no:cacheprovider test/test_issue_gate_refs.py.

Nothing stopped a feature or fix from being built on impulse, reviewed on
its own terms and merged with no record of why it exists or whether triage
agreed it should. Issues already carry that record (needs-triage in, one
verdict label out, written by the maintainer-operated Kiro Crew
auto-pipeline); PRs never consulted it.

Add issue-gate.yml as a PR Readiness lane: the visible PR body must
declare an issue of this repository with a GitHub closing trailer, read
through .github/scripts/issue_gate_refs.py -- an adapter onto the
prepare-pr pr_status.py grammar, so the gate and the local NOTICE always
agree -- and every declared issue must be a real issue, not closed as not
planned, free of needs-triage and carrying a triage verdict label. Bot
authors are skipped with a notice; a maintainer-applied `issue-gate:
waived` label (production fire, release PR) waives the rule with a
warning. Reads fail closed under the runner's default bash -e;
edited/labeled re-run the check without a push. pr-readiness.yml enrols
the lane, since PR Readiness is the one required status.

Document the gate in docs/ci/ci-and-reviews.md (naming the system that
writes the verdict labels and the shared grammar), add the issue-first
step to CONTRIBUTING, name the waiver on the release version-drop PR, and
stop prepare-pr calling the issue link advisory.

Closes #16064
@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=00233fc0def9 Item 5 — two tests still guard the removed no linked issue: opt-out

fixed in bb7b146: test_fenced_opt_out_example_does_not_silence_notice and test_html_commented_opt_out_example_does_not_silence_notice are deleted from test/test_prepare_pr_status.py. The one remaining mention is test_there_is_no_opt_out_line_that_silences_the_notice, which pins the subtraction itself (not hasattr(module, "_NO_ISSUE_RE") and an opt-out line still yields a NOTICE), so it does not pass whatever the code does.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=aed51b7f77e7 Item 6 — Part of #16362 in three workflow bodies duplicates the issue-gate: waived label

kept; the description now explains why the label cannot serve those PRs (bb7b146 body, Backwards compatibility). Correcting my own earlier record first: the R9 disposition on span 049e2547a4b0 said these PRs are opened by github-actions[bot]; the premise here is right -- gh pr create is refused in this repository, so a maintainer opens each one from the compare link. The point still stands on different ground: the waiver is the LOGGED EXCEPTION (a warning in the run, documented for a production fire or the release PR), and three recurring PRs taking it every week would make the exception routine and empty the signal "a run of waivers means the pipeline is stalled". Part of #16362 is not a waiver marker but the rule itself: those PRs are for the standing tracking issue, so they declare it like every other PR. The three edits are one line in each --body (for the day gh pr create is allowed) and one sentence in each compare-link notice telling the maintainer what to put in the body; the maintainer does one action either way, and this one keeps them inside the rule instead of outside it.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=8619df660822 Outside dependency on a required check

fixed in bb7b146 (description) for the clause this item offered: the Backwards compatibility section now names who watches for a stall of the label writer until #16308's overdue sweep lands -- the maintainer who operates the auto-pipeline -- and states the symptom (every new PR red on Issue Gate naming needs-triage) and the per-PR fallback (issue-gate: waived). The in-repo half of the contract is pinned by TestLabelContract. An issues: labeled re-dispatch of open PRs is not added here: it is a second trigger surface with its own permissions and belongs with #16308's sweep, where the question "what re-runs when triage lands late" is answered once; today a body edit re-runs the gate and the job summary says so.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=df5a9a72adf7 Truncated description

fixed in bb7b146 (description): the body was trimmed from 12.4 KB to 11.6 KB by shortening the What-changed bullets, so the whole ## Backwards compatibility section (through its Reader: line and the closing "Nothing else is removed or renamed" sentence) now ends at byte 7991, inside the 8000-byte capture of pr-description-capture.sh; the readers it lists -- the three scheduled workflows, dependabot, the release PR, deferred-finding issues, open PRs at merge time, the removed no linked issue: opt-out and pr_recipe.py:draft -- are all within the captured text.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=4a5b5eb40d1e Item 7 — the bootstrap if [ ! -f base/.github/scripts/issue_gate_refs.py ] block only covers runs from before the merge

kept, with the post-merge run the item asked for. The case only this branch handles: a re-land after a revert. If this gate is reverted on main and a later PR re-introduces it, that PR's Issue Gate run reads its workflow file from the merge ref (so the lane runs) while the default branch again lacks the grammar script; without the block that run falls into the "grammar-script environment failure" red and the re-land PR is red by construction on the lane it is adding -- the same shape this PR would have today. A check that is red by construction on the PR introducing it is a worse teacher than four lines of if: it trains reviewers to read a red Issue Gate as noise exactly when the lane is being judged. The waiver label does not cover it either: the waiver skips the verdict step, but the script-missing exit happens before any verdict and is routed to red as an environment failure, which is the fail-closed rule GPT asked for in round 3. The block exits 0 with a notice, is logged, and cannot pass a PR on main once the script exists there.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=84e136cba369 Reader list cut off at the 8000-byte capture

fixed (description, same head): the previous trim counted body bytes only and missed the Title: ...\n\nDescription:\n prefix the capture prepends, so the section still crossed the cap by ~60 bytes. The What-changed and Not-a-goal prose is shortened again (body 11.6 KB -> 11.4 KB); .github/scripts/pr-description-capture.sh run locally over this title and body puts the "Nothing else is removed or renamed" sentence at byte 7862 of the capture, with the Tests heading and the TRUNCATED notice after it. Every Reader: line (the three scheduled workflows, dependabot, the release PR, deferred-finding issues, open PRs at merge time, the removed no linked issue: opt-out, pr_recipe.py:draft) is now inside the captured text; the pipeline-conductor is listed under Readers as already writing Closes #N.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=958ba2e74e20 Label writer outside the repo

fixed (description, same head) for the clause the item offered: the Backwards compatibility section now names who removes the lane and how if the pipeline is down -- past the 24h triage expectation, the maintainer who operates the auto-pipeline deletes the issue-gate.yml|Issue Gate line from the lane specs in pr-readiness.yml (a one-line PR carrying the waiver label) until the writer is back, alongside the stall symptom (every new PR red on Issue Gate naming needs-triage) and the per-PR fallback. The in-repo alarm itself stays #16308, triaged and filed as the follow-up; the three label names are pinned by TestLabelContract.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 3, 2026
@chenmingwei23
chenmingwei23 merged commit 99ab925 into main Oct 3, 2026
107 checks passed
@chenmingwei23
chenmingwei23 deleted the ci/issue-gate branch October 3, 2026 10:10
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 3, 2026
bolichen97 added a commit that referenced this pull request Oct 5, 2026
PR Readiness reads main's lane list, which waits on an Issue Gate check.
Issue Gate is a pull_request workflow, so GitHub reads it from the PR's
merge ref, and release/0.8.0 has no issue-gate.yml. Every PR into the
release branch therefore waits on a check that never starts.

Copy .github/workflows/issue-gate.yml from main unchanged. Its grammar
script is read from a checkout of the default branch at run time, so the
workflow file is the only piece the release branch needs.

Source: origin/main 2359397 (file last changed there in #16740;
introduced by #16241, #16634, #16697).

Fixes #16868
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.

ci: require every PR to reference a triaged issue

2 participants