Skip to content

Commit 49cb16c

Browse files
Merge branch 'release/v12.0.0' into backlog/v12_parsing_filters
2 parents 8e3f15f + 173cbbc commit 49cb16c

98 files changed

Lines changed: 2336 additions & 2493 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ai-prompts/README.md

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# AI review prompts
22

3-
Each `*.md` (except this `README.md`) defines a **prompt** that the
4-
`AI review` job runs in parallel against the PR diff. Discovery is by glob:
5-
to add a new review dimension just drop another `.md` here — no YAML
6-
changes needed.
3+
Each `*.md` (except this `README.md`) defines a **prompt** that `pr-checks.yml`
4+
runs against the PR diff, one at a time in a loop (see the "Run AI review"
5+
step). Discovery is by glob: to add a new review dimension just drop another
6+
`.md` here — no YAML changes needed.
77

88
## File format
99

1010
```markdown
1111
---
1212
name: short-name # optional, defaults to filename without extension
13-
model: gemini-3-flash-lite # optional, defaults to workflow's AI_REVIEW_MODEL
13+
model: gemini-3-flash-lite # optional, defaults to ai-review.sh's built-in default
1414
---
1515

1616
<instructions for the model>
@@ -36,39 +36,48 @@ this exact shape (no markdown, no code fences, no extra text):
3636
}
3737
```
3838

39-
### Severity drives the merge gate
39+
### Severity drives the comment, not the merge
4040

41-
The approver blocks the merge based on **severity**, not on how many findings
42-
there are. Pick the lowest severity that honestly fits — don't inflate a nit.
41+
The AI review is **informational only** — severity/tier decide how a finding
42+
is presented in the sticky comment, never whether the PR can merge. Only
43+
`release/**` targets get this comment (see the main
44+
`.github/workflows/README.md` → "AI review policy"); `pr-checks.yml` doesn't
45+
even trigger for PRs into `v10`/`v11`/`v12`. Pick the lowest severity that
46+
honestly fits — don't inflate a nit.
4347

44-
- **`critical` / `high` → BLOCKING.** Something that can break: crashes, nil
48+
- **`critical` / `high`** Something that can break: crashes, nil
4549
dereferences, data loss/corruption, races/deadlocks, broken or unsafe DB
46-
migrations, security holes, breaking API/proto/contract changes. These stop
47-
auto-merge.
48-
- **`medium` / `low` → non-blocking WARNING.** Real but contained: missing
49-
user feedback, inconsistent patterns, naming, typos in docs/strings, style.
50-
Reported as warnings; the PR can still merge.
50+
migrations, security holes, breaking API/proto/contract changes. Flagged
51+
prominently (🛑) — the author decides whether to fix before merging.
52+
- **`medium` / `low`** Real but contained: missing user feedback,
53+
inconsistent patterns, naming, typos in docs/strings, style. Reported as
54+
minor findings.
5155

5256
### Tier semantics
5357

54-
`tier` is a coarse signal. The gate uses severity for blocking, **plus** Tier 3:
58+
`tier` is a coarse signal that only affects the comment's wording/urgency —
59+
it never blocks:
5560

56-
- **Tier 1**fine to merge; no high/critical issues (minor warnings allowed).
57-
- **Tier 2** — at least one high-severity bug that should be fixed.
58-
- **Tier 3**engineer review required / could break. Critical paths (crypto,
61+
- **Tier 1** — no high/critical issues (minor findings allowed).
62+
- **Tier 2** — at least one high-severity bug worth a look.
63+
- **Tier 3**sensitive area, extra care recommended. Critical paths (crypto,
5964
auth, DB migrations, installer, gRPC contracts, CI/CD, secret handling) or
60-
changes the model can't judge confidently. Always blocks and @mentions the
61-
team.
65+
changes the model can't judge confidently. Flagged in the comment only —
66+
nobody is @mentioned.
6267

63-
**The merge is blocked if** any finding is `high`/`critical`, **or** any prompt
64-
returns Tier 3, **or** no review ran. Otherwise the approver approves the PR
65-
(any medium/low findings ride along as warnings).
68+
**Nothing here blocks the merge or @mentions anyone.** The comment exists
69+
purely so the author knows what to fix. `pr-checks.yml` has no
70+
team-membership check at all — whoever has write access to the repo can
71+
merge `release/**` PRs; see `.github/workflows/README.md` → "Release policy".
6672

6773
### Routine dependency bumps
6874

69-
A separate required check (`go_deps`) already enforces that Go modules are on
70-
their latest version, so mass `go.mod` / `go.sum` bumps are routine and
71-
expected. The `architecture` and `security` prompts treat a version bump of
75+
`pr-checks.yml` already reports outdated Go modules as its own "Go
76+
dependencies" section in the sticky comment (see
77+
`.github/workflows/README.md` → "AI review policy") — that's informational
78+
too, so a dependency bump is expected to still show up there, not something
79+
these prompts need to flag separately. The `architecture` and `security`
80+
prompts treat a version bump of
7281
existing modules as **Tier 1** — not an architectural/agent-breaking change
7382
and not a vulnerability — and only flag genuine anomalies (new deps, major
7483
breaking jumps, downgrades, known-vulnerable pins, suspicious `replace`
@@ -81,9 +90,10 @@ Tier 1, a brief `summary` ("No security concerns detected.") and
8190

8291
### Unparseable responses
8392

84-
If the model returns something that isn't valid JSON matching the schema, the
85-
approver treats it as a blocking `high` finding. Fail-safe behaviour — we'd
86-
rather hold for a human than let something pass without understanding it.
93+
If the model returns something that isn't valid JSON matching the schema,
94+
`ai-review.sh` writes a fallback: Tier 2 with a `high` finding saying "manual
95+
review recommended". Still informational only — flagged prominently in the
96+
comment, but it does not block the merge.
8797

8898
## Picking a model
8999

.github/scripts/ai-review.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ set -euo pipefail
55
#
66
# Reads a prompt file (with optional YAML frontmatter that can override the
77
# model), appends the PR diff, calls the model, and writes the parsed JSON
8-
# verdict to OUTPUT_FILE. Does NOT post PR comments — the approver job
9-
# consolidates all prompt results and decides what to comment.
8+
# verdict to OUTPUT_FILE. Does NOT post PR comments — pr-checks.yml runs this
9+
# once per prompt file and then calls post-ai-review-comment.sh to build and
10+
# post the single sticky comment from all the resulting JSON files.
1011
#
1112
# Always exits 0 (data-producer role). If parsing fails the output JSON has
1213
# tier=2 with a generic "review manually" finding (fail-safe).
@@ -50,7 +51,7 @@ write_fallback() {
5051
severity: "high",
5152
file: "(n/a)",
5253
line: 0,
53-
message: ($reason + " (fail-safe: a review that cannot run is treated as blocking).")
54+
message: ($reason + " (fail-safe fallback — flagged for manual attention, does not block the merge).")
5455
}]
5556
}' > "$OUTPUT_FILE"
5657
echo "::warning::Wrote fallback result: $reason"

0 commit comments

Comments
 (0)