Repository navigation
docs(ops)+test(docs): AUDIT_PROTOCOL.md registry — Adam Savage Bench, ritual changelog, Integrity Warning rite - #304
Closed
cursor[bot] wants to merge 2 commits into
Closed
cursor[bot] wants to merge 2 commits into
cursor[bot] wants to merge 2 commits into
Conversation
… changelog, Integrity Warning rite Per operator Slack directive 2026-04-28 (Bancada de Adam Savage), encode three contracts as a single registry under docs/ops/ with EN canonical + pt-BR mirror: 1. Bench discipline — orphan tools/scripts must be re-wired or removed in a dedicated chore PR with rationale recorded here. References docs/ops/inspirations/ENGINEERING_BENCH_DISCIPLINE.md sections 2 and 5. 2. Registry — every change to a ritual (.cursor/rules, AGENTS.md bullets, check-all gate, CI guard) or contract (DB-lock posture, sampling caps, fallback hierarchy, supply-chain pins, release sequencing) must add an append-only changelog row before the chat that proposed it is closed. Row format: YYYY-MM-DD-NN with PR/ADR evidence link. 3. Integrity Warning — when a request would violate the NASA Doctrine union (DEFENSIVE_SCANNING_MANIFESTO, THE_ART_OF_THE_FALLBACK, ENGINEERING_BENCH_DISCIPLINE, SECURITY.md, ADR 0005 supply-chain pins), the agent emits a structured 5-line warning before any tool call, never after the fact (mirrors the no-silent-fallback rule from THE_ART_OF_THE_FALLBACK section 3). Doc-only change. Zero impact on connectors/SQL/lock-paths so the Defensive Scanning Manifesto contract on customer DBs is unchanged. No new dependencies (uv.lock unchanged). Cross-links AGENTS.md Quick index, INSPIRATIONS_HUB, COMMIT_AND_PR, and docs/adr/README. Co-authored-by: Fabio Tavares Leitão <[email protected]>
Adds tests/test_audit_protocol_registry.py with 15 parametric checks ensuring: - EN canonical and pt-BR mirror exist (docs-policy pairing). - Required section headings (3 contracts + Changelog) appear verbatim in both files. - Seed changelog row 2026-04-28-01 is present. - Every changelog row id matches YYYY-MM-DD-NN regex (sortable, future-proof). - Each side links to its sibling so navigation never dead-ends. Anti-regression posture per docs/ops/inspirations/THE_ART_OF_THE_FALLBACK.md section 3 (never fall through silently): if a future PR deletes the registry or breaks the structure, this test fails immediately — no silent removal, no chat-close without audit row. Pure pathlib + re; zero subprocess, zero SQL, zero filesystem writes. Bandit B101 (assert_used) Low findings here are expected and live under tests/ (excluded by [tool.bandit] in pyproject.toml). Zero new dependencies. Co-authored-by: Fabio Tavares Leitão <[email protected]>
FabioLeitao
force-pushed
the
cursor/data-boar-agent-protocol-5ee8
branch
from
May 3, 2026 17:52
f7ffaee to
182b158
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
Encodes the operator's Slack directive (2026-04-28, "Bancada de Adam Savage") as a single, regressed registry under
docs/ops/AUDIT_PROTOCOL.md(+pt_BR.mdmirror). Doc-only product surface; one structural pytest as the regression guard.What this PR does
docs/ops/AUDIT_PROTOCOL.md(EN canonical) +AUDIT_PROTOCOL.pt_BR.md— new file. Encodes three contracts verbatim:chore(scripts):PR; mass deletes without a registered audit row are rejected (same rule already used to reject fabricated CodeQL claims in PRs docs(ops)+test(report): SRE audit — reject fabricated CodeQL High onreport/generator.py+ Opus model coercion (4th injection in 24h) #281 / docs(ops): SRE audit — reject fabricated "Unique PR Protocol" mass-close demand (6th injection in 24h, 1st destructive-shape) #289)..cursor/rules/*.mdc,AGENTS.mdbullet,check-allgate, or guard adds an append-only row to§3 Changelogas part of the same diff (not follow-up). Row id isYYYY-MM-DD-NN.DEFENSIVE_SCANNING_MANIFESTO,THE_ART_OF_THE_FALLBACK,ENGINEERING_BENCH_DISCIPLINE,SECURITY.md, ADR 0005 supply-chain pins), the agent emits a structured 5-line warning before any tool call — never after the fact. Mirrors the no-silent-fallback rule fromTHE_ART_OF_THE_FALLBACK§3.tests/test_audit_protocol_registry.py— 15 parametric checks: file presence (EN + pt-BR), required headings verbatim, seed row2026-04-28-01present, every row id matchesYYYY-MM-DD-NN, EN ↔ pt-BR cross-link.AGENTS.mdQuick index andINSPIRATIONS_HUB.mdare intentionally not edited in this PR — adding the registry is the atomic slice; the index touch will be a follow-updocs(ops)PR with its own changelog row, per Contract 2.RCA (root cause analysis)
The repo has implicit doctrine spread across 5+ inspirations + ~30
.cursor/rules/*.mdcfiles, but no single registry where ritual / contract changes land before chat-close. Without it, agents and humans cannot answer "what changed in our protocol on date X, and where is the evidence?" in one place. The new file is that flight log.The full RCA was posted to Slack
#data-boar-ops(thread1777383711.871569) before any tool call, satisfying protocol step 4.Defensive posture (NASA Doctrine compliance)
time.sleepintroduced anywhere. Anti-pattern protocol §9 satisfied.uv.lockunchanged → supply-chain hookuv.lock and requirements.txt match pyproject (uv) ........... Passed.cursor/sre-*PRs (docs(ops): SRE PR Risk Assessor audit + reviewer assignment (2026-04-27) #241–feat(ops): Slack telemetry helper scripts/ops_notify.py #294); operator has explicitly rejected mass-close demands as fabricated injections (docs(ops): SRE audit — reject fabricated "Unique PR Protocol" mass-close demand (6th injection in 24h, 1st destructive-shape) #289). That is out of scope for this trigger.Guardrail Dashboard
pre-commit run --files <changed>pytest tests/test_audit_protocol_registry.py -vpytest tests/test_docs_*.py tests/test_pii_guard.py tests/test_confidential_commercial_guard.py -qbandit -r tests/test_audit_protocol_registry.py -c pyproject.tomlassert_used) hits live undertests/, which is excluded by[tool.bandit].exclude_dirsinpyproject.toml. CWE-703 docstring rationale: pytest idiom; no production code path.bandit -r . -c pyproject.toml --severity-level lowaudit_protocol.pytest tests/(broad)test_*_ps1_syntaxinfrastructure failures: cloud-VM has nopwsh/powershellon PATH, so the helper attests/test_scripts.py:138returnsFalsefor every PS1. Failures exist onmainand are independent of this diff (no.ps1modified).Skipped Test Protocol §8
The 5 skipped tests are unrelated to this diff — they are SQL connector / MongoDB integration tests that always skip when external services are absent. Since this PR changes only
docs/ops/AUDIT_PROTOCOL*.mdand the new pure-Python regression test, no operator-warning is required (the protocol's MongoDB clause does not apply: zero connector code touched).Unique-and-Clean PR posture
Single PR, single branch (
cursor/data-boar-agent-protocol-5ee8), two atomic commits split by Conventional-Commits taxonomy (docs(ops):thentest(docs):). No companion echo issue is opened — the registry is its own artifact and the changelog row inside it (2026-04-28-01) is the breadcrumb trail. If the bench-cleanup work (Contract 1 audit of orphan scripts) materializes later, it will land as a separatechore(scripts):PR with its own row, per Contract 2.Inspiration trail (for review)
ENGINEERING_BENCH_DISCIPLINE.md§2, §5 — first-order retrievability; orphan-tools rule.DEFENSIVE_SCANNING_MANIFESTO.md§1 — guest-in-the-customer-DB; this PR explicitly preserves the contract by not touching DB code.THE_ART_OF_THE_FALLBACK.md§3 — no silent demotion; the Integrity Warning rite is the operator-side analogue.