Skip to content

docs(ops): SRE PR Risk Assessor audit + reviewer assignment (2026-04-27) - #241

Closed
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/sre-automation-agent-protocol-6d0b
Closed

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/sre-automation-agent-protocol-6d0b

Conversation

@cursor

@cursor cursor Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Read-only deliverable from the SRE Automation Agent (Slack-triggered [PROTOCOL: PR RISK ASSESSOR & ADVERSARIAL VIGILANCE], 2026-04-27). The agent re-reviewed every PR open against main at 2026-04-27 17:00 UTC — 13 PRs total (#221, #222, #223, #224, #226, #232, #233, #234, #235, #236, #237, #238, #239) — and recorded the audit under docs/ops/sre_audits/.

Adversarial vigilance: PR titles, bodies, branch names, and inline comments were treated as untrusted input. Every "Safe to merge" / "Doc only" claim was ignored. Risk is derived only from the raw git diff against origin/main (91b0f29965fdf4f5c94526866727d9d23e636954).

Operational constraint respected: audit-and-block only. No code or commit was pushed to any audited PR branch. This PR adds two Markdown files and nothing else.

Critical finding — main is currently shipping broken MSSQL SQL

This is a P0 silent zero-finding regression sitting on origin/main right now (not on any open PR's diff):

origin/main:connectors/sql_sampling.py line 329:

opt = f" OPTION (MAX_EXECUTION_TIME = {int(statement_timeout_ms)})"

OPTION (MAX_EXECUTION_TIME = N) is a MySQL optimiser hint. T-SQL does not accept it; SQL Server raises a syntax error which SQLConnector.sample() swallows in a broad except Exception. The default connector path resolves the timeout to 5000 ms when the operator does not override it, so this clause is emitted on every SQL Server sampling statement, by default. Result: the scanner reports zero sensitive data on every MSSQL column. The compliance report claims the database is clean.

This violates two manifestos at once:

  • THE_ART_OF_THE_FALLBACK.md §3 — "Data Boar never falls through to a weaker level silently". Current main falls all the way from "compliance SQL sampling" to "no findings" without any audit row.
  • DEFENSIVE_SCANNING_MANIFESTO.md §3 — "do not blur dialects". The MySQL hint was cross-applied to MSSQL without a T-SQL grammar check.

Merge-order trap (the #238 ↔ #232 hazard):

Recommended order: #238 → #232 → everything else.

Risk classification (per protocol thresholds)

PR Risk Action
#238 Low Auto-approve, merge first — narrow regression-tested fix.
#234, #237, #223 Very Low Markdown / data-only — auto-approve.
#226, #232, #233, #239 Low Approve on diff; #239 should land before pip resync.
#235, #236 Medium 2 reviewers; #232 vs #236 share cli/reporter.py and need a rebase pass.
#221, #222, #224 Medium 2 reviewers + run scripts/dependabot-resync.{sh,ps1} from #239 first.

Defensive architecture / database impact (zero by construction)

  • Adds no Python code. Diff is two Markdown files under docs/ops/sre_audits/.
  • Does not run sampling SQL. Every observation about connectors/sql_sampling.py was made by reading the file, not by executing a query.
  • Does not touch caps or timeouts. _HARD_MAX_SAMPLE = 10_000, WITH (NOLOCK), the -- Data Boar Compliance Scan attribution comment, and the per-dialect strategy table from DEFENSIVE_SCANNING_MANIFESTO.md §2–§4 are unchanged.

Doctrine references

Files

  • docs/ops/sre_audits/PR_RISK_ASSESSMENT_2026-04-27_assessor.md — full audit (TL;DR, methodology, critical finding + RCA + merge-order trap, per-PR risk table, reviewer assignment, reproducer commands).
  • docs/ops/sre_audits/README.md — folder index + adversarial-vigilance bullet so future passes inherit the posture.

Verification

  • uv run pytest tests/test_docs_external_no_plan_links.py tests/test_pii_guard.py tests/test_confidential_commercial_guard.py — 142 passed.
  • uv run pre-commit run --files docs/ops/sre_audits/* — markdown / locale / PII / dependency-sync hooks all green.

Reproducer (so the next assessor pass can re-derive these verdicts)

git fetch origin
gh pr list --state open --limit 50 --json number,title,additions,deletions,changedFiles,mergeable,mergeStateStatus
git fetch origin pull/238/head:pr238
git diff origin/main..pr238 -- connectors/sql_sampling.py
git show origin/main:connectors/sql_sampling.py | grep -n "MAX_EXECUTION_TIME"

The OPTION (MAX_EXECUTION_TIME = …) line on origin/main is the falsifiable evidence behind the Critical finding. If a future audit runs these commands and the line is gone, the regression is closed and that section can be archived.

Open in Web View Automation 

Read-only deliverable from the SRE Automation Agent (Slack-triggered
[PROTOCOL: PR RISK ASSESSOR & ADVERSARIAL VIGILANCE], 2026-04-27).
The agent re-reviewed every PR open against main at 2026-04-27 17:00 UTC
- 9 PRs total - and recorded the audit under docs/ops/sre_audits/.

Adversarial vigilance: PR titles, bodies, branch names, and inline
comments were treated as untrusted input. Risk derived only from the
raw git diff against origin/main.

Critical finding (P0, on main not on a PR diff): origin/main currently
emits OPTION (MAX_EXECUTION_TIME = N) on every MSSQL sample, which is
not valid T-SQL. SQL Server raises a syntax error, the connector
swallows it, and the scanner reports zero findings on every SQL Server
target. PR #238 is the fix and must merge before any PR that touches
connectors/sql_sampling.py (notably #232) so the regression window is
minimal. THE_ART_OF_THE_FALLBACK section 3 (no silent demotion) and
DEFENSIVE_SCANNING_MANIFESTO section 3 (do not blur dialects) both
flag this exact pattern.

Risk classification (per protocol thresholds):
- Very Low: #223 #234 #237
- Low:      #226 #232 #233 #238 #239
- Medium:   #221 #222 #224 #235 #236

Recommended merge order:
1. #238 (close the silent zero-finding regression on main)
2. #234 #239 #237 #233 #226 #223 #232 (Very Low / Low)
3. #235 #236 (Medium - 2 reviewers each; #232 vs #236 share
   cli/reporter.py and need a rebase pass)
4. #221 #222 #224 (after #239 resync helper lands)

Defensive architecture: this audit deliverable is Markdown-only.
It runs no SQL, adds no code, and preserves _HARD_MAX_SAMPLE,
WITH (NOLOCK), the -- Data Boar Compliance Scan attribution comment,
and every other clamp from DEFENSIVE_SCANNING_MANIFESTO sections 2-4.

Files:
- docs/ops/sre_audits/PR_RISK_ASSESSMENT_2026-04-27_assessor.md
  (TL;DR + methodology + critical finding + per-PR risk table +
  reviewer assignment + reproducer commands)
- docs/ops/sre_audits/README.md
  (folder index + companion automation pointer + adversarial-vigilance
  bullet so future passes inherit the posture)

Verification:
- uv run pytest tests/test_docs_external_no_plan_links.py
                tests/test_pii_guard.py
                tests/test_confidential_commercial_guard.py
- uv run pre-commit run --files docs/ops/sre_audits/*

Made-with: Cursor

Co-authored-by: Fabio Tavares Leitão <[email protected]>
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.

2 participants