Skip to content

docs(ops): SRE re-audit addendum — Rust memory safety + CI sequencing (2026-04-27) - #257

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

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

Conversation

@cursor

@cursor cursor Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Slack-triggered re-evaluation of the merged 2026-04-27 Dependency Guardian ledger (PR #242) under a sharper lens: Rust memory safety and complex CI logic. Adds a single dated addendum under docs/ops/sre_audits/. Verdicts on the five Dependabot PRs (#221/#222/#223/#224/#226) are unchanged; what's new is the explicit booking of three reasoning gaps the original ledger did not enumerate.

The addendum is filed as a separate dated file (not a v2 of the ledger) per the folder's README.md rule that dated decisions are immutable snapshots — same posture as THE_ART_OF_THE_FALLBACK.md §4 diagnostic-on-fall: append, don't overwrite.

Why this re-audit, in plain terms (Julia Evans style)

The original ledger correctly called PR #226 (pyo3 0.23.5 → 0.24.1) a MERGE. The reasoning was thin in one place: it leaned on "we don't call PyString::from_object" as the safety case. That's necessary but not sufficient for a CPython extension that lives on the detector hot path.

Three things were under-examined:

# Gap Severity Vehicle
A1 Memory-safety case did not enumerate the Bound<'py, T> API surface vs our usage. Low This addendum (§1.1). Verdict on #226 unchanged: MERGE.
A2 Send + Sync posture under freethreaded CPython 3.13t not stated for FastFilter. Low–Med Follow-up: #[pyclass(frozen)] opt-in after PR #255 lands.
A3 No cargo test / cargo clippy on main at audit time — every Rust-bump green signal came from Python-side jobs only. Medium Already in flight: PR #255 (ci(rust): GitHub Actions for boar_fast_filter + unit tests).

A1 inspected the actual call sites (#[pymodule] fn boar_fast_filter(_py: Python<'_>, m: &Bound<'_, PyModule>), Vec<String> in / Vec<usize> out, no Py<PyModule>/&PyModule deprecated path, regex compile errors mapped to PyRuntimeError before the pyclass materialises, zero unsafe blocks). pyo3 0.24's tightened Bound-API rules and the PyString::from_object UB advisory both miss our paths.

A2 noted that FastFilter is semantically immutable (regex compiled once in #[new], only &self methods after) but the type system does not record that intent. Without #[pyclass(frozen)], PyO3 inserts a RefCell-equivalent borrow check on every &self call — small CPython 3.13t hot-path overhead worth tightening once we have a Rust CI baseline to measure against.

A3 is the complex-CI-logic axis. The original ledger called PR #226 "all green (Test 3.12 / 3.13 / Lint / Bandit / Semgrep / CodeQL / SonarQube / Dependency audit / SBOM / Analyze)" — true, but every one of those workflows is Python-side. There is no rust-ci.yml on main today. PR #255 fixes that.

Recommended sequence (re-ordered vs the original §4)

  1. Land PR ci(rust): GitHub Actions for boar_fast_filter + unit tests #255 first — additive workflow + test-only Rust refactor, costs nothing on main, converts every future Rust bump from "Python-side smoke only" to "real Rust evidence".
  2. Then merge PR chore(deps): bump pyo3 from 0.23.5 to 0.24.1 in /rust/boar_fast_filter in the cargo group across 1 directory #226 — verdict unchanged, but the basis will include real cargo test + cargo clippy --all-targets --all-features -- -D warnings.
  3. The cryptography / chardet / tzdata / pip-group order from the original ledger §4 is unchanged — none of them touch the Rust crate.

Defensive-architecture statement (mandatory protocol gate)

Per the trigger ("ZERO impact on database locks; no regressions"):

DEFENSIVE_SCANNING_MANIFESTO.md §1 clauses 1–4 still hold for every PR re-audited.

Note on the trigger's model request

The Slack message asked for "Claude 3.5 Opus or your highest tier model." The runtime cannot self-select a different model mid-task — this re-evaluation runs on Claude Opus 4.7 (highest tier currently exposed to this automation). The technical re-audit underneath the request is what this PR delivers; called out in the Slack reply for transparency.

Files

  • docs/ops/sre_audits/RUST_MEMORY_SAFETY_AND_CI_ADDENDUM_2026-04-27.md — full addendum (TL;DR, memory-safety re-audit per call site, Send + Sync posture, CI evidence sequencing, defensive-architecture re-statement, provenance).
  • docs/ops/sre_audits/README.md — folder index updated with the new dated row.

Verification

  • uv run pytest tests/test_markdown_lint.py tests/test_docs_pt_br_locale.py tests/test_confidential_commercial_guard.py tests/test_pii_guard.py tests/test_docs_external_no_plan_links.py → 145 passed.
  • All pre-commit hooks pass on the touched files (Ruff legacy / format / plans-stats / markdown / pt-BR / commercial / external plan links / dependency-artifacts sync / PII / PII history).

Operational constraint

Audit-and-block respected. No commit pushed to any of the audited Dependabot branches (#221, #222, #223, #224, #226). The maintainer keeps full control of when to merge each.

Doctrine references

  • docs/ops/inspirations/DEFENSIVE_SCANNING_MANIFESTO.md §1 clauses 1–4 — acceptance gate.
  • docs/ops/inspirations/THE_ART_OF_THE_FALLBACK.md §4 — diagnostic-on-fall applied to the documentation surface itself (append, don't overwrite the dated ledger).
  • docs/ops/sre_audits/DEPENDENCY_GUARDIAN_VERDICT_LEDGER_2026-04-27.md — the dated ledger this addendum extends.
  • ADR 0005 — audit-and-block posture.
Open in Web View Automation 

… (2026-04-27)

Slack-triggered re-evaluation of the 2026-04-27 Dependency Guardian ledger
under a Rust-memory-safety + complex-CI lens. Verdicts unchanged; this
addendum books the reasoning gaps the original ledger did not enumerate:

- A1 (Low): Bound<'py, T> API surface vs FastFilter usage — confirmed
  pyo3 0.24 migration is mechanical, not semantic. PR #226 still MERGE.
- A2 (Low-Med): Send + Sync posture under freethreaded CPython 3.13t
  not stated for #[pyclass] FastFilter — proposes #[pyclass(frozen)]
  follow-up *after* PR #255 lands the cargo test baseline.
- A3 (Medium): no Rust workflow on main at audit time — every CI green
  signal on a Cargo bump came from Python-side jobs only. Mitigation
  already in flight as PR #255 (cargo check + test + clippy -D warnings).

Recommended sequence (handed back to maintainer): land #255 first, then
#226 with real Rust evidence. Original ledger merge order otherwise
unchanged. Audit-and-block respected — no commit pushed to any audited
Dependabot branch.

Doctrine: DEFENSIVE_SCANNING_MANIFESTO §1 clauses 1-4 still hold (Cargo
path; zero DB connector touch). THE_ART_OF_THE_FALLBACK §4 diagnostic-
on-fall applied to the documentation surface itself — append, do not
overwrite the dated ledger.

Co-authored-by: Fabio Tavares Leitão <[email protected]>
@cursor
cursor Bot deleted the cursor/sre-agent-protocol-4053 branch April 28, 2026 10:10
@FabioLeitao
FabioLeitao force-pushed the main branch 2 times, most recently from ae0da8d to b5c995c Compare May 3, 2026 17:52
@FabioLeitao FabioLeitao closed this May 3, 2026
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