Skip to content

feat(workflow,docs): dependabot-resync helper + SRE Dependency Guardian audit (2026-04-27) - #239

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

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

Conversation

@cursor

@cursor cursor Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Slack-triggered SRE Dependency Guardian pass on the five Dependabot PRs open against main on 2026-04-27 — #221 (pip-minor-patch group, 35 pkgs), #222 (chardet 5.2.0 → 7.4.3), #223 (tzdata 2025.3 → 2026.2), #224 (cryptography 46.0.7 → 47.0.0), #226 (pyo3 0.23.5 → 0.24.1, Cargo). Audit-and-block posture preserved: no commit pushed to any audited Dependabot branch.

The systemic Medium finding from the earlier audit (PR #234) is unchanged: every Dependabot pip PR breaks tests/test_dependency_artifacts_sync.py because the bot does not run uv lock / uv export, so the project's single-source-of-truth guard (pyproject ↔ uv.lock ↔ requirements.txt) is red on #221, #222, #223, #224. CI on #226 (Cargo path) is fully green.

This PR ships the concrete companion fix: a paired helper the maintainer can run on a checked-out Dependabot pip branch to make the guard turn green in five seconds, plus the audit folder anchored on main so future passes have an index.

Findings (per Dependency Guardian rule — Medium+ only)

Action taken (this PR)

  • scripts/dependabot-resync.sh + scripts/dependabot-resync.ps1 — paired Linux/macOS + Windows helper (per docs/ops/SCRIPTS_CROSS_PLATFORM_PAIRING.md). Runs uv lock, then uv export --no-emit-package pyproject.toml -o requirements.txt with the exact flags the guard expects, then re-runs tests/test_dependency_artifacts_sync.py -v -W error. Diagnostic-on-fall: prints actionable next steps pointing at .cursor/skills/dependabot-recommendations/SKILL.md before exiting non-zero (THE_ART_OF_THE_FALLBACK.md clause: never silent fallback). Flags: --check (read-only verify), --commit / -Commit (stage + commit with chore(deps): resync uv.lock + requirements.txt after Dependabot bump).
  • docs/ops/sre_audits/README.md — anchors the audit folder on main (the prior audit on PR docs(ops): SRE security audit of open PRs (2026-04-27) #234 lives only on its own branch and would be lost if closed without merge). Index of audit deliverables.
  • docs/ops/sre_audits/PR_SECURITY_AUDIT_2026-04-27_dependency_guardian.md — full per-PR audit (TL;DR, methodology, systemic finding RCA, per-PR sections with caller maps, action items, doctrine references).

Operator workflow (after this lands):

gh pr checkout 224                         # cryptography 47.0.0
./scripts/dependabot-resync.sh --commit    # regen + commit chore(deps)
git push                                   # CI turns green
gh pr checkout 224
.\scripts\dependabot-resync.ps1 -Commit
git push

Recommended next moves (handed back to the maintainer)

  1. P2 — merge 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. Cargo path is independent of §2.1; CI is green; pyo3 0.24 is a documented compatible bump and the upstream RUSTSEC fix (PyString::from_object) is defense-in-depth (this repo does not call that API today).
  2. Run the resync helper on each pip Dependabot PR branch (start with deps(pip): bump cryptography from 46.0.7 to 47.0.0 #224 cryptography, then deps(pip): bump chardet from 5.2.0 to 7.4.3 #222 chardet, then deps(pip): bump the pip-minor-patch group across 1 directory with 35 updates #221 / deps(pip): bump tzdata from 2025.3 to 2026.2 #223). The --commit flag handles the regen commit; git push flips CI green.
  3. P1 follow-up (out of scope for this PR): a pull_request_target workflow that runs dependabot-resync.sh --check on every Dependabot pip PR and posts the regen diff as a PR comment. Captured in the audit doc; needs permissions: pull-requests: write plus a strict actor check (dependabot[bot] head only).

Doctrine references

  • docs/ops/inspirations/DEFENSIVE_SCANNING_MANIFESTO.md (NASA SEL · Cloudflare · Steve Gibson — guest in customer DB; no surprise side effects). An inconsistent lockfile is the supply-chain equivalent of clause 3.
  • docs/ops/inspirations/THE_ART_OF_THE_FALLBACK.md (no silent failure; diagnostic-on-fall — encoded directly in the helper's failure path).
  • docs/ops/inspirations/SUPPLY_CHAIN_AND_TRUST_SIGNALS.md (SBOM ↔ wheel alignment).
  • .cursor/skills/dependabot-recommendations/SKILL.md (operator workflow that this helper makes mechanical).

Files

  • scripts/dependabot-resync.sh (executable, Linux/macOS).
  • scripts/dependabot-resync.ps1 (Windows pair, ASCII-safe per tests/test_scripts.py::test_powershell_scripts_ascii_safe).
  • docs/ops/sre_audits/README.md (folder anchor + index).
  • docs/ops/sre_audits/PR_SECURITY_AUDIT_2026-04-27_dependency_guardian.md (full audit).

Verification

  • bash scripts/dependabot-resync.sh --check — uv lock --check returns zero, dependency-artifacts pytest passes.
  • uv run pytest tests/test_dependency_artifacts_sync.py 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 -q — 147 passed locally.
  • uv run ruff check . and uv run ruff format --check . — clean.
  • pre-commit hooks (Ruff / plans-stats / markdown / pt-BR / commercial / external plan links / dependency-artifacts sync / PII / PII history) — all Passed at commit time.
  • tests/test_scripts.py::test_powershell_scripts_ascii_safe — passed.
  • (The pwsh-parse pytest tests in tests/test_scripts.py cannot run in this Linux container without pwsh; those failures are environmental and pre-exist this branch — full CI on GitHub Actions runs them with pwsh.)

Operational constraint

Audit-and-block respected. No commit was pushed to #221, #222, #223, #224, or #226. The maintainer keeps full control of when to run the helper on each Dependabot PR.

Open in Web View Automation 

…udit (2026-04-27)

Slack-triggered SRE Dependency Guardian pass on the five open PRs against
main on 2026-04-27 (#221 / #222 / #223 / #224 / #226). One systemic Medium
finding stays unchanged from the earlier audit on #234: every Dependabot
pip PR breaks tests/test_dependency_artifacts_sync.py because the bot
edits requirements.txt without running 'uv lock' / 'uv export'.

Concrete companion fix shipped here (audit-and-block: no push to any
audited Dependabot branch):

- scripts/dependabot-resync.sh / .ps1 -- paired Linux/macOS + Windows
  helper the operator runs on a checked-out Dependabot pip PR. Runs
  'uv lock', then 'uv export --no-emit-package pyproject.toml -o
  requirements.txt' with the exact flags
  tests/test_dependency_artifacts_sync.py expects, then re-runs the
  pytest. Prints diagnostic-on-fall guidance pointing at
  .cursor/skills/dependabot-recommendations/SKILL.md when the guard
  still fails (THE_ART_OF_THE_FALLBACK doctrine: never silent fallback).
  --commit flag stages and commits with 'chore(deps): resync uv.lock +
  requirements.txt after Dependabot bump'.

- docs/ops/sre_audits/README.md -- anchors the audit folder on main
  (the prior audit lives only on PR #234's branch and would be lost if
  that PR is closed without merge). Indexes the new audit file.

- docs/ops/sre_audits/PR_SECURITY_AUDIT_2026-04-27_dependency_guardian.md
  -- per-PR notes (#226 safe to merge; #224 cryptography 47.0.0 manual
  review with caller map at core/licensing/verify.py; #222 chardet 7.4.3
  manual review on the encoding fallback path; #221 / #223 info, blocked
  by 2.1 only). Decision rule: applied locally is safer than rage-merge.

Doctrine references applied (per Slack-triggered protocol):

- DEFENSIVE_SCANNING_MANIFESTO.md -- no surprise side effects when we
  touch the supply chain (an inconsistent lockfile would be the
  equivalent of a 'guest in customer DB' violation).
- THE_ART_OF_THE_FALLBACK.md -- diagnostic on fall: helper prints next
  steps before exiting non-zero, never swallows the error.
- SUPPLY_CHAIN_AND_TRUST_SIGNALS.md -- SBOM <-> wheel alignment.

Verification:
- bash scripts/dependabot-resync.sh --check passes on this branch.
- uv run pytest tests/test_dependency_artifacts_sync.py passes.
- uv run ruff check / ruff format --check / pt-BR / commercial / PII /
  external-plan-links guards all pass.
- ASCII-safety guard for the new .ps1 passes.

Operational constraint respected: no commit pushed to #221, #222, #223,
#224, or #226. The helper is the safe local fix the maintainer can run
per branch.

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