Skip to content

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
mainfrom
cursor/data-boar-agent-protocol-5ee8
Closed

cursor[bot] wants to merge 2 commits into
mainfrom
cursor/data-boar-agent-protocol-5ee8

Conversation

@cursor

@cursor cursor Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

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.md mirror). Doc-only product surface; one structural pytest as the regression guard.

What this PR does

  1. docs/ops/AUDIT_PROTOCOL.md (EN canonical) + AUDIT_PROTOCOL.pt_BR.md — new file. Encodes three contracts verbatim:
  2. tests/test_audit_protocol_registry.py — 15 parametric checks: file presence (EN + pt-BR), required headings verbatim, seed row 2026-04-28-01 present, every row id matches YYYY-MM-DD-NN, EN ↔ pt-BR cross-link.
  3. Cross-links from AGENTS.md Quick index and INSPIRATIONS_HUB.md are intentionally not edited in this PR — adding the registry is the atomic slice; the index touch will be a follow-up docs(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/*.mdc files, 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 (thread 1777383711.871569) before any tool call, satisfying protocol step 4.

Defensive posture (NASA Doctrine compliance)

Guardrail Dashboard

Gate Result Notes
pre-commit run --files <changed> 10/10 Passed ruff, ruff format, plans-stats, markdown lint, pt-BR locale, commercial guard, external-no-plan-links, uv.lock supply-chain match, PII guard (HEAD), PII history guard.
pytest tests/test_audit_protocol_registry.py -v 15 passed, 0 failed, 0 skipped New regression guard; deterministic file-presence + regex.
pytest tests/test_docs_*.py tests/test_pii_guard.py tests/test_confidential_commercial_guard.py -q 162 passed Existing doc / PII / commercial guards unchanged.
bandit -r tests/test_audit_protocol_registry.py -c pyproject.toml 0 new findings The 9 Low B101 (assert_used) hits live under tests/, which is excluded by [tool.bandit].exclude_dirs in pyproject.toml. CWE-703 docstring rationale: pytest idiom; no production code path.
bandit -r . -c pyproject.toml --severity-level low No new findings vs. main Confirmed by grep on audit_protocol.
CodeQL (local) N/A No Python product code modified; doc + test only. CodeQL Python query packs target product surfaces (path-injection, SQL-injection, etc.), none of which exist in this diff.
pytest tests/ (broad) 960 passed, 35 failed (pre-existing), 5 skipped All 35 failures are test_*_ps1_syntax infrastructure failures: cloud-VM has no pwsh/powershell on PATH, so the helper at tests/test_scripts.py:138 returns False for every PS1. Failures exist on main and are independent of this diff (no .ps1 modified).

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*.md and 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): then test(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 separate chore(scripts): PR with its own row, per Contract 2.

Inspiration trail (for review)

  • Adam Savage / ENGINEERING_BENCH_DISCIPLINE.md §2, §5 — first-order retrievability; orphan-tools rule.
  • NASA SEL / DEFENSIVE_SCANNING_MANIFESTO.md §1 — guest-in-the-customer-DB; this PR explicitly preserves the contract by not touching DB code.
  • Usagi Electric / THE_ART_OF_THE_FALLBACK.md §3 — no silent demotion; the Integrity Warning rite is the operator-side analogue.
  • Cloudflare — public RCA with numeric evidence; the Slack RCA was posted with file paths, line numbers, and PR refs before any action.
Open in Web View Automation 

cursoragent and others added 2 commits April 28, 2026 13:47
… 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]>
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