Orchestrata Ultimate › Plans › briefs › gate-affected-classify-before-infra

GATE-AFFECTED — classify before infra so pure non-code pushes skip the service stack

Source: plans/briefs/gate-affected-classify-before-infra.md at 8a2cb42ad · last changed 2026-10-21 · first committed 2026-10-21 · 62 lines.

Prose pending.

Plan text

GATE-AFFECTED — classify before infra so pure non-code pushes skip the service stack

Task #— (unassigned), build order —. Contract: the finding on ~/workspace/knowledge-wiki/projects/orchestrata-ultimate/gates/family-suite-preflight.md §4 + scripts/run_tests.py::_main (step 1 vs step 2b ordering) + RUL-040 (rulings/RUL-040-scope-measured-at-symbol-granularity-never-full-suite.md).

You are a worker. You do NOT commit. RUL-037. Never xdist.

The defect (measured 2026-10-21)

run_tests.py --affected <range> (the pre-push blast-radius gate) runs the infra preflight (_check_infra → start_test_services.py --ensure-worker-dbs=N; kernel + graph + gateway + all worker DBs, ~3 min) BEFORE it classifies the changed files (_resolve_affected → affected_tests.py, step 2b). The classification is pure git

The fix

Reorder _main so the affected classification runs BEFORE the infra preflight, and short-circuit when the changed set is entirely non-code:

  1. Move the --affected resolution block (currently step 2b, after _check_infra and _run_gates) to BEFORE _check_infra.
  2. When the verdict is entirely non-code (every changed file INERT / needs no test), skip _check_infra + _run_gates + the smoke floor, and emit a passing "non-code push — nothing to run" report (still non-authoritative and labeled).
  3. Preserve RUL-040 semantics: a refused verdict still aborts naming the missing fact; bounded/named_full on real code still runs infra + gates + the subset exactly as today.

Fence

scripts/run_tests.py                    (reorder + the all-inert short-circuit)
tests/scripts/test_run_tests.py         (extend for the reorder + short-circuit)
tests/scripts/test_run_tests_main_infra.py  (extend if it asserts the old order)
scripts/affected_tests.py               (READ-ONLY unless a new all-inert flag is needed — measure)

READ-ONLY: scripts/start_test_services.py, scripts/gate_parallel_safety.py, the five gate scripts, rulings/RUL-040-*.md, rulings/RUL-039-*.md.

Required behavior at landing

  1. A pure non-code push (only docs/, .deepchat/skills/, reports/, plans/briefs/ changes) passes the pre-push gate WITHOUT starting the service stack — no start_test_services.py --ensure-worker-dbs in the output; elapsed well under a minute.
  2. A real code change runs the full existing path (infra + gates + subset) with zero behavioral change.
  3. The reorder does not break RUL-040 refusal semantics (a refused verdict still aborts naming the missing fact; never a silent full run).
  4. Tests cover both branches (all-inert short-circuit + normal code-change path).

Open question (coordinator)

Whether an all-inert push should emit a distinct verdict label (e.g. inert) in the pre-push report, or reuse the existing non-authoritative smoke label. Propose one; do not invent a new label without a ruling.