From 315b6789ac767abf991446ff8f37ebae4d3b70af Mon Sep 17 00:00:00 2001 From: Paul Calnon Date: Wed, 6 May 2026 00:38:02 -0500 Subject: [PATCH] ci(async-audit): wire async-route audit hook in disabled state (Phase 1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a ``ruff-async-audit`` pre-commit hook scoped to the Phase 0 ASYNC ruleset (3 violations enumerated in juniper-ml/notes/ASYNC_ROUTE_VIOLATIONS_2026-05-06.md). ``stages: [manual]`` keeps it from firing on regular commits; on-demand via: pre-commit run --hook-stage manual ruff-async-audit Used as a Phase-2 stepping stone — Phase 2 will flip ``stages: [pre-commit, manual]`` and add a soft-fail CI lane so PRs see violations as annotations without blocking merge. Phase 4 hard-fails. The ``--exit-zero`` flag means violations are reported but don't fail the hook in Phase 1; that's the disabled-state contract. This is the first of four Phase 1 wiring PRs (one per in-scope repo). Order per the migration plan: data → cascor → canopy → worker. Plan: notes/ASYNC_ROUTE_AUDIT_HOOK_MIGRATION_PLAN.md (juniper-ml) §4 Phase 1. Co-Authored-By: Claude Opus 4.7 (1M context) --- .pre-commit-config.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7a3b77c..65c0512 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -96,6 +96,20 @@ repos: - id: ruff-format name: Format with Ruff files: ^juniper_data/.*\.py$ + # ───────────────────────────────────────────────────────────────────── + # Async-route audit (Phase 1 wiring — disabled state). + # See juniper-ml notes/ASYNC_ROUTE_AUDIT_HOOK_MIGRATION_PLAN.md. + # `stages: [manual]` keeps this from firing on regular commits. + # Run on demand via: pre-commit run --hook-stage manual ruff-async-audit + # Phase 2 flips this to `stages: [pre-commit, manual]` and adds a + # CI lane (continue-on-error: true) so PRs see violations as + # annotations without blocking merge. Phase 4 is hard-fail. + - id: ruff + alias: ruff-async-audit + name: Async-route audit (BUG-JD-10 class) + args: [--select, ASYNC, --exit-zero] + files: ^juniper_data/.*\.py$ + stages: [manual] # ═══════════════════════════════════════════════════════════════════════════ # Python Type Checking - MyPy