Skip to content

harden(devex): converge backend Python formatting automatically - #12448

Merged
Git-on-my-level merged 1 commit into
BasedHardware:mainfrom
Git-on-my-level:codex/backend-formatter-paved-road
Aug 31, 2026
Merged

Git-on-my-level merged 1 commit into
BasedHardware:mainfrom
Git-on-my-level:codex/backend-formatter-paved-road

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Aug 31, 2026 •

Copy link
Copy Markdown
Member

What changed and why

Make backend Python formatting converge automatically through one pinned wrapper used by pre-commit, pre-push, and CI. PR #11454 reached its final CI run with two Python files that local checks had allowed through; the exact failure is visible in Repo Checks run 32996234890.

The wrapper uses an already-installed Black 26.5.1 when available and otherwise resolves that exact version through cached uvx. This does not add a status check, approval, checklist, or deploy step; it replaces three disagreeing formatter paths in the existing workflow.

Product invariants affected

none

How it was verified

  • bash scripts/test-backend-python-format.sh — exact, stale, and missing formatter paths passed.
  • bash scripts/test-pre-commit-pinned-toolchains.sh — existing hook toolchain contracts passed.
  • bash scripts/test-pre-push-backend-test-cap.sh — existing bounded pre-push behavior passed.
  • python3 .github/scripts/test_run_checks.py — 47 manifest contract tests passed.
  • python3 .github/scripts/check_agents_md_lean.py — all nine agent guides stayed within budget.
  • actionlint -shellcheck '' .github/workflows/repo-checks.yml — workflow syntax passed.
  • OMI_PR_BODY_FILE=/tmp/omi-backend-formatter-pr-body.md make preflight — all 110 repository checks passed after rebasing onto current origin/main.
  • Bounded pre-push checks passed for formatter contracts, backend type checking (0 errors), runtime-image closure, 28 focused backend tests, OpenAPI compatibility/generation, workflow contracts, and desktop-flow lint. The unrelated desktop Swift compile was retried with PRE_PUSH_SKIP_DESKTOP_SWIFT=1 after SwiftPM's FluidAudio cache lacked commit 19600a485baa4998812e4654b70d2bab8f2c9949; this PR changes no desktop source.

Tests

scripts/test-backend-python-format.sh is the regression test: it proves all three callers delegate to the shared pin, exact local Black avoids a download, stale Black self-corrects through uvx, and a machine missing both gets the canonical uv install path.

Failure class (fixes)

Failure-Class: none

New guards (only when adding a check or ratchet)

The guard would have caught PR #11454 / run 32996234890 before its late CI formatting failure. It is a shared primitive rather than a parallel policy check: the contract test protects the single formatter executable that every existing local and CI caller now invokes.

Review in cubic

@Git-on-my-level
Git-on-my-level merged commit fbb5ade into BasedHardware:main Aug 31, 2026
32 checks passed
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.

1 participant