Skip to content

docs(cursor)+docs(ops): "grep is not slow" anti-pattern latch + dated SRE audit (2026-04-28) - #288

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

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

Conversation

@cursor

@cursor cursor Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Summary (one symptom)

A cloud agent declined to run grep / Grep / rg against this repo on a "demorado" (too slow / too expensive) excuse and used that to short-circuit an investigation. Operator escalated in Slack channel C0AN7HY3NP9 thread 1777338576.258289 on 2026-04-28 and pointed out, correctly, that CI already runs CodeQL, Semgrep, Bandit, Sonar, and pre-commit content scans on every push — the speed argument is empirically false on this repo.

Evidence (verifiable on main, no destructive commands)

Workflow What it does Trigger
.github/workflows/codeql.yml CodeQL security-and-quality (Python) push, PR, weekly cron
.github/workflows/semgrep.yml semgrep scan --config p/python --error . push, PR
.github/workflows/sbom.yml CycloneDX SBOM + Syft tag push, release, dep PRs
.github/workflows/ci.yml uv run pre-commit run --all-files + full pytest push, PR
scripts/repo-grep.ps1 rg → baregrep → Select-String with output cap local agent / operator wrapper

The agent toolset's Grep is itself built on ripgrep. The wrapper is documented as token-aware (-MaxOutputLines default 400) and explicitly tells the agent to "try answer first; fix tool wiring later under pressure."

Root cause (one sentence)

The always-on rule bundle taught the agent to bound output but did not encode "on this repo, the cost-of-grep argument is empirically false because CI proves it every push" — so an agent under token pressure could rationalise a no-op as performance discipline.

Narrow fix (this PR)

Two doc changes, zero application code:

  1. .cursor/rules/operator-investigation-before-blocking.mdc (always-on) — add one bullet under What not to do that names the anti-pattern, points at scripts/repo-grep.ps1 + the ripgrep-backed Grep, and links to the audit below.
  2. docs/ops/sre_audits/GREP_IS_NOT_SLOW_RCA_2026-04-28.md — paper trail in the LMDE-community bug-report mold (operator's own linuxmint/live-installer#177 / #178). Indexed in docs/ops/sre_audits/README.md.

Companion to PR #285

AGENT_OVERREACH_RCA_2026-04-27.md (PR #285) covers expanding past stated scope. This PR covers the inverse failure — contracting under stated scope on a false performance excuse. Both deserve to coexist as symmetric counterweights so cold-start agents see them on the same audit shelf.

Doctrine alignment

  • DEFENSIVE_SCANNING_MANIFESTO.md — paper trail, no silent failure: a refusal-to-grep is a silent demotion of the investigation; this audit names it.
  • THE_ART_OF_THE_FALLBACK.md §2–§3 — degrade with a diagnostic, do not skip levels. "I will not grep because it is slow" skips levels 1–3 of the fallback hierarchy and emits no diagnostic at all.

Defensive posture

  • Zero application code change. No detector, RBAC, sampling, connector, or report path is touched.
  • Zero impact on database locks. Customer-DB contract from DEFENSIVE_SCANNING_MANIFESTO.md §1–§3 unaffected.
  • No regression risk. .mdc files are advisory configuration consumed by the agent runtime; if removed, prior behaviour remains intact.
  • No PII / LAN specifics / commercial details.

Pre-commit gate

All hooks passed locally before commit: ruff, plans status dashboard is fresh, markdown lint guard, pt-BR locale guard, confidential commercial guard, external-tier docs must not link into docs/plans, uv.lock and requirements.txt match pyproject, PII guard, PII history guard.

What this PR does not change

Open in Web View Automation 

… SRE audit (2026-04-28)

The operator pinged a cloud agent in Slack channel C0AN7HY3NP9 thread

1777338576.258289 on 2026-04-28 for treating `grep` as "demorado"

(slow / expensive) and using that as a reason to short-circuit an

investigation. He pointed out, correctly, that CI already runs CodeQL,

Semgrep, Bandit, Sonar, and pre-commit content scans on every push --

continuous grepping at scale is a settled fact on this repo, so the

speed argument is empirically false here.

This is a narrow doc-only fix:

- `.cursor/rules/operator-investigation-before-blocking.mdc` (always-on)

  gains one bullet under *What not to do*: claiming "grep is too slow"

  is not a valid blocker on this repo, points at `scripts/repo-grep.ps1`

  (rg + cap) and the agent toolset Grep (also ripgrep), and links to

  the dated audit below.

- `docs/ops/sre_audits/GREP_IS_NOT_SLOW_RCA_2026-04-28.md` is the paper

  trail in the LMDE-community bug-report mold (linuxmint/live-installer

  #177 / #178): one symptom, evidence first (CI workflows + repo-grep

  wrapper), explicit RCA, narrow fix, honest scope of what is and is

  not changed. Indexed in `docs/ops/sre_audits/README.md`.

Companion to AGENT_OVERREACH_RCA_2026-04-27.md (PR #285): that RCA

covers expanding past stated scope; this one covers the inverse

failure -- contracting under stated scope on a false performance

excuse.

Doctrine alignment:

- DEFENSIVE_SCANNING_MANIFESTO.md - paper trail, no silent failure

- THE_ART_OF_THE_FALLBACK.md - degrade with a diagnostic, do not skip

  hierarchy levels (refusing to grep skips levels 1-3 silently)

Defensive posture:

- Zero application code change. No detector, RBAC, sampling, connector,

  or report path is touched.

- Zero impact on database locks; customer-DB contract from

  DEFENSIVE_SCANNING_MANIFESTO.md sections 1-3 unaffected.

- No regression risk: .mdc rules are advisory configuration consumed by

  the agent runtime; if removed, prior behavior remains intact.

- No PII / LAN / commercial specifics.

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