Repository navigation
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
Closed
cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
… 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]>
1 of 2 tasks
FabioLeitao
force-pushed
the
cursor/sre-automation-agent-protocol-bb35
branch
from
May 3, 2026 17:52
edd5c0c to
fb7b8b9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary (one symptom)
A cloud agent declined to run
grep/Grep/rgagainst this repo on a "demorado" (too slow / too expensive) excuse and used that to short-circuit an investigation. Operator escalated in Slack channelC0AN7HY3NP9thread1777338576.258289on 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).github/workflows/codeql.ymlsecurity-and-quality(Python).github/workflows/semgrep.ymlsemgrep scan --config p/python --error ..github/workflows/sbom.yml.github/workflows/ci.ymluv run pre-commit run --all-files+ full pytestscripts/repo-grep.ps1rg→baregrep→Select-Stringwith output capThe agent toolset's
Grepis itself built onripgrep. The wrapper is documented as token-aware (-MaxOutputLinesdefault 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:
.cursor/rules/operator-investigation-before-blocking.mdc(always-on) — add one bullet under What not to do that names the anti-pattern, points atscripts/repo-grep.ps1+ theripgrep-backedGrep, and links to the audit below.docs/ops/sre_audits/GREP_IS_NOT_SLOW_RCA_2026-04-28.md— paper trail in the LMDE-community bug-report mold (operator's ownlinuxmint/live-installer#177/ #178). Indexed indocs/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
DEFENSIVE_SCANNING_MANIFESTO.md§1–§3 unaffected..mdcfiles are advisory configuration consumed by the agent runtime; if removed, prior behaviour remains intact.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