Skip to content

Commit 044d4e8

Browse files
authored
Merge branch 'release/v11.2.9' into backlog/fix/ir_audit_filter
Signed-off-by: Yorjander Hernandez Vergara <99102374+Kbayero@users.noreply.github.com>
2 parents 4de5c48 + 80c844c commit 044d4e8

19 files changed

Lines changed: 317 additions & 112 deletions

File tree

.github/ai-prompts/README.md

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ this exact shape (no markdown, no code fences, no extra text):
2727
"summary": "<one line, max 200 chars>",
2828
"findings": [
2929
{
30-
"severity": "high" | "medium" | "low",
30+
"severity": "critical" | "high" | "medium" | "low",
3131
"file": "<path>",
3232
"line": <int>,
3333
"message": "<description and mitigation>"
@@ -36,22 +36,43 @@ this exact shape (no markdown, no code fences, no extra text):
3636
}
3737
```
3838

39+
### Severity drives the merge gate
40+
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.
43+
44+
- **`critical` / `high` → BLOCKING.** Something that can break: crashes, nil
45+
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.
51+
3952
### Tier semantics
4053

41-
- **Tier 1 — Approve.** The change is simple, doesn't touch critical logic,
42-
no issues detected. The approver aggregates all tiers and, if every
43-
prompt returns Tier 1, approves the PR.
44-
- **Tier 2 — Changes requested.** Minor issues the author must fix before
45-
merging: typos, small bugs, out-of-context code, noticeable style
46-
problems, incomplete mocks or tests.
47-
- **Tier 3 — Engineer review required.** The diff touches critical paths
48-
(crypto, auth, DB migrations, installer, gRPC contracts, CI/CD, secret
49-
handling) or introduces changes the model can't judge with sufficient
50-
confidence. The approver blocks the merge and @mentions the senior
51-
engineering team.
52-
53-
The approver takes the **maximum tier** across all prompts: if security
54-
returns Tier 1 but architecture returns Tier 3, the final verdict is Tier 3.
54+
`tier` is a coarse signal. The gate uses severity for blocking, **plus** Tier 3:
55+
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,
59+
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.
62+
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).
66+
67+
### Routine dependency bumps
68+
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
72+
existing modules as **Tier 1** — not an architectural/agent-breaking change
73+
and not a vulnerability — and only flag genuine anomalies (new deps, major
74+
breaking jumps, downgrades, known-vulnerable pins, suspicious `replace`
75+
directives). Don't add prompts that re-block on routine bumps.
5576

5677
### When there's nothing to report
5778

@@ -60,10 +81,9 @@ Tier 1, a brief `summary` ("No security concerns detected.") and
6081

6182
### Unparseable responses
6283

63-
If the model returns something that isn't valid JSON matching the schema,
64-
the approver treats it as **Tier 2** with a generic finding asking for
65-
manual review. Fail-safe behaviour — we'd rather block and ask for human
66-
review than let something pass without understanding it.
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.
6787

6888
## Picking a model
6989

.github/ai-prompts/architecture.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,27 @@ React/Angular frontend). Your job is to spot **architectural deviations**.
3232
**Ignore** style, naming, formatting, or refactors that don't affect
3333
structure.
3434

35+
## Routine dependency updates are not architectural changes
36+
37+
A separate **required** CI check (`go_deps` / `go-deps.sh --check`) already
38+
enforces that every Go module is on its latest version and still builds, so
39+
mass `go.mod` / `go.sum` bumps are an expected, routine part of this repo's
40+
workflow. A version bump of existing modules is **not** an architectural
41+
deviation and **not** an agent-breaking change — even when:
42+
43+
- it lands under `agent/`, `agent-manager/`, `installer/`, or a plugin (the
44+
file path alone is not a contract or wire-protocol change), or
45+
- the bumped module is security-relevant (SDKs, gRPC, protobuf, crypto).
46+
47+
A diff that is **only** dependency version bumps of existing modules is
48+
**Tier 1** — do not raise `high` findings or escalate to Tier 3 for it. Do
49+
still flag a change that is more than a routine bump: a brand-new
50+
third-party dependency, a *major* version jump documented as breaking, a
51+
**downgrade**, or a new/edited `replace` directive pointing somewhere
52+
unexpected. The critical-path and agent-breaking rules below are about
53+
**code and contract** changes (protos, wire protocol, auth, migrations), not
54+
manifest version bumps.
55+
3556
## How to assign tier
3657

3758
- **Tier 1** — No architectural deviations detected.
@@ -45,10 +66,11 @@ structure.
4566
- Installer (`installer/`).
4667
- Auth / crypto / secret handling.
4768
- GitHub Actions workflows or CI scripts.
48-
- **Agent code (`agent/`), agent-manager wire protocol, or any change
49-
that forces a synchronized agent+server upgrade.** Deployed agents
50-
in the field may be on older versions; breaking their compatibility
51-
requires senior review and a coordinated rollout plan.
69+
- **Agent code or contract** (`agent/` logic, agent-manager wire
70+
protocol — **not** a routine `go.mod`/`go.sum` version bump) **or any
71+
change that forces a synchronized agent+server upgrade.** Deployed
72+
agents in the field may be on older versions; breaking their
73+
compatibility requires senior review and a coordinated rollout plan.
5274
- Any change that breaks backwards compatibility of a public endpoint
5375
or persisted schema.
5476

.github/ai-prompts/bugs.md

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,25 +44,31 @@ You are a senior code reviewer. Review the Pull Request diff looking for
4444
rest of the diff. Even in a 100-file PR dominated by backend changes, a
4545
single misspelling in a guide or a personal name in a customer-facing
4646
doc still warrants a finding — do not skip it because "the real work is
47-
elsewhere". When you find any of these, set tier to AT LEAST 2.
47+
elsewhere". Report these as `low`/`medium` (they're warnings, not blockers).
4848

4949
**Ignore** preexisting issues on lines not touched by the diff.
5050

51-
## How to assign tier
51+
## Severity (this is what blocks the merge)
5252

53-
- **Tier 1** — No concrete bugs detected AND no user-facing string
54-
anomalies (typos, internal references, contact info leaks). The change
55-
looks correct.
56-
- **Tier 2** — Concrete but contained bugs the author must fix before
57-
merging (off-by-one, error swallowing, unclosed resources,
58-
out-of-context code). **Always Tier 2 minimum** if you find any
59-
user-facing string anomaly: typos in docs/guides/messages, personal
60-
names or internal handles in customer-facing content, internal URLs
61-
or ticket IDs leaking into public docs.
62-
- **Tier 3** — A bug that may cause data corruption, deadlock, large-scale
63-
leaks, or any issue whose impact the author shouldn't fix without a
64-
second opinion. Also applies if the diff touches DB migrations, error
65-
handling on transactional paths, or complex concurrency.
53+
Pick the lowest severity that honestly fits; don't inflate a nit.
54+
55+
- **`critical` / `high` — blocking.** A bug that will actually break behavior:
56+
nil/null deref, out-of-bounds, race/deadlock, goroutine/resource leak,
57+
unhandled error on an important path, inverted logic, malformed query, a
58+
migration that breaks existing data, out-of-context code that changes
59+
behavior. Use `critical` for data corruption, deadlock, or large-scale leaks.
60+
- **`medium` / `low` — non-blocking warning.** Real but contained: missing
61+
user feedback, inconsistent error-handling style, naming, typos in
62+
docs/guides/messages, personal names or internal handles/URLs/ticket IDs in
63+
customer-facing content.
64+
65+
## Tier
66+
67+
- **Tier 1** — no high/critical bugs (minor warnings are fine).
68+
- **Tier 2** — at least one high-severity bug to fix before merging.
69+
- **Tier 3** — could cause data corruption, deadlock, or large-scale leaks, or
70+
the diff touches DB migrations, transactional error handling, or complex
71+
concurrency and needs a second opinion.
6672

6773
## Output
6874

@@ -73,7 +79,7 @@ Respond with valid JSON ONLY (no markdown, no backticks, no extra text):
7379
"tier": 1 | 2 | 3,
7480
"summary": "<one line, max 200 chars>",
7581
"findings": [
76-
{"severity": "high"|"medium"|"low", "file": "<path>", "line": <n>, "message": "<description and how to reproduce>"}
82+
{"severity": "critical"|"high"|"medium"|"low", "file": "<path>", "line": <n>, "message": "<description and how to reproduce>"}
7783
]
7884
}
7985
```

.github/ai-prompts/security.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,25 @@ do not skip it.
3737

3838
**Ignore** preexisting issues on lines not touched by the diff.
3939

40+
## Routine dependency updates are not vulnerabilities
41+
42+
A separate **required** CI check (`go_deps`) already enforces that every Go
43+
module is on its latest version, so mass `go.mod` / `go.sum` bumps are a
44+
routine, expected part of this repo's workflow. A version bump of an
45+
existing dependency — **including** security-relevant ones (threatwinds
46+
SDK, gRPC, protobuf, gofalcon, crypto libraries) — is **not by itself a
47+
vulnerability** and does **not** count as touching a "security-critical
48+
path" below. Do not raise a finding or mark Tier 3 merely because a
49+
security-related module was bumped to a newer version.
50+
51+
A diff that is **only** dependency version bumps is **Tier 1** for the
52+
vulnerability checks (the information-disclosure check still applies to any
53+
user-facing text in the diff). Do raise a finding when a dependency change
54+
is more than a routine bump: a pin to a **known-vulnerable or yanked**
55+
version, a **downgrade** that reintroduces a fixed CVE, a new dependency
56+
from an untrusted / typosquatted source, or a `replace` directive
57+
redirecting a module somewhere unexpected.
58+
4059
## How to assign tier
4160

4261
- **Tier 1** — No vulnerabilities introduced by this diff AND no
@@ -50,7 +69,9 @@ do not skip it.
5069
secret handling, installer, token/JWT generation) or introduces a
5170
high-impact vulnerability (RCE, auth bypass, secret leak). Even if the
5271
change looks fine, if it touches these paths mark Tier 3 — human
53-
verification outweighs your individual confidence.
72+
verification outweighs your individual confidence. (A `go.mod` / `go.sum`
73+
version bump does **not** count as touching these paths — see *Routine
74+
dependency updates* above.)
5475

5576
## Output
5677

.github/scripts/ai-review.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ write_fallback() {
4747
tier: 2,
4848
summary: "AI review could not parse model response — manual review recommended.",
4949
findings: [{
50-
severity: "medium",
50+
severity: "high",
5151
file: "(n/a)",
5252
line: 0,
53-
message: $reason
53+
message: ($reason + " (fail-safe: a review that cannot run is treated as blocking).")
5454
}]
5555
}' > "$OUTPUT_FILE"
5656
echo "::warning::Wrote fallback result: $reason"
@@ -83,6 +83,19 @@ MODEL="${prompt_model:-$DEFAULT_MODEL}"
8383

8484
echo "::group::AI review — prompt: $prompt_name (model: $MODEL)"
8585

86+
# --- Nothing to review -------------------------------------------------------
87+
# The diff can be empty after upstream filtering (e.g. a PR that only touches
88+
# excluded rules/filters/definitions paths). Pass as Tier 1 instead of calling
89+
# the model with an empty diff.
90+
if [[ ! -s "$DIFF_FILE" ]] || ! grep -q '[^[:space:]]' "$DIFF_FILE"; then
91+
jq -n --arg prompt "$prompt_name" --arg model "$MODEL" \
92+
'{prompt: $prompt, model: $model, tier: 1, summary: "No reviewable changes in this diff (excluded paths only).", findings: []}' \
93+
> "$OUTPUT_FILE"
94+
echo "Empty diff — wrote Tier 1 pass."
95+
echo "::endgroup::"
96+
exit 0
97+
fi
98+
8699
# --- Build request body ------------------------------------------------------
87100

88101
prompt_body=$(tail -n "+${body_start}" "$PROMPT_FILE")

0 commit comments

Comments
 (0)