Private
Public Access
0
0

conductor(tracks): mark test_batching_refactor_20260606 as completed

This commit is contained in:
2026-06-08 01:18:20 -04:00
parent 50bd894f8d
commit fb6b4bd3eb
+3 -2
View File
@@ -161,8 +161,9 @@ User review surfaced five outstanding UI issues, each previously attempted witho
*3 post-shipping bugfix commits: 8c4791d0 (real bug: _ensure_gemini_client UnboundLocalError + test_discussion_compression deepseek mock adaptation); 88fc42bb (spec convention: 7 sites in src/ai_client.py use _require_warmed('google.genai') + .types parent lookup instead of leaf); 52ea2693 (conftest: use AppController.wait_for_warmup(timeout=60.0) instead of direct import google.genai — user-corrected jank workaround).*
*Pre-existing test failures (unrelated, user will address): test_api_generate_blocked_while_stale (ui_global_preset_name AttributeError); test_rag_large_codebase_verification_sim (RAG retrieval).*
0c. [~] **Track: Test Batching Refactor** `[track-created: b7a97374]`
*Link: [./tracks/test_batching_refactor_20260606/](./tracks/test_batching_refactor_20260606/), Spec: [./tracks/test_batching_refactor_20260606/spec.md](./tracks/test_batching_refactor_20260606/spec.md), Plan: [./tracks/test_batching_refactor_20260606/plan.md](./tracks/test_batching_refactor_20260606/plan.md) (to be authored by writing-plans skill)*
0c. [x] **Track: Test Batching Refactor** `[track-created: b7a97374] [COMPLETE 2026-06-08] [phase-1-done: 57285d04] [phase-2-skipped: no-CI] [phase-3-done: 5252b6d7] [phase-4-done: 50bd894f] [archived: 50bd894f]`
*Link: [./tracks/archive_completed_tracks_20260603/test_batching_refactor_20260606/](./tracks/archive_completed_tracks_20260603/test_batching_refactor_20260606/), Spec: [./tracks/archive_completed_tracks_20260603/test_batching_refactor_20260606/spec.md](./tracks/archive_completed_tracks_20260603/test_batching_refactor_20260606/spec.md), Plan: [./tracks/archive_completed_tracks_20260603/test_batching_refactor_20260606/plan.md](./tracks/archive_completed_tracks_20260603/test_batching_refactor_20260606/plan.md)*
*Adaptations: (a) library modules moved from scripts/ to tests/ per user directive; (b) auto-inference uses AST scan (not regex) per user "FUCK REGEX" policy + prereq spec; (c) Phase 2 (CI shadow run) skipped: no CI infrastructure in repo; manual plan-vs-actual spot-check was the equivalent verification.*
*Goal: Replace alphabetical 4-at-a-time batching in `scripts/run_tests_batched.py` with fixture-class-isolated tiers: 0 (opt-in: clean_install/docker, gated on env var + --include-opt-in flag), 1 (unit, grouped by subsystem batch_group, pytest-xdist), 2 (mock_app, grouped), 3 (live_gui, all in one pytest invocation to amortize 15s startup), H (headless), P (performance, last). Hybrid classification: auto-infer from filename + AST fixture scan, hand-curated `tests/test_categories.toml` overrides for cross-cutting and ambiguous files. Opt-in per-test order control via `[[files.X.test_order]]` sub-tables, gated on a conftest-loaded pytest plugin (no-op without entries). Priority: B (process isolation) > A (subsystem diagnostic) > C (speed). 4 phases: library+dry-run, shadow run, switch default, cleanup.*
*Goal: Reduce `sloppy.py` startup time by ~2000-2400ms. **Main Thread Purity Invariant**: main thread (entering `immapp.run()`) never imports a module heavier than `imgui_bundle` + lean `gui_2` skeleton. **No-prefetch rule**: heavy SDKs (`google.genai` 955ms, `anthropic` 430ms, `openai` 445ms, `fastapi` 470ms) are lazy-only — paid once on first use, on the asyncio thread, not in the background. **No-new-threads rule**: all background work goes through `AppController._io_pool` (4-thread `ThreadPoolExecutor`, named `controller-io-N`); zero new `threading.Thread(...)` calls in `src/`. **Enforcement**: static `scripts/audit_main_thread_imports.py` CI gate + runtime `tests/test_main_thread_purity.py` (`sys.addaudithook` test). 9 phases, 57 tasks. Target: `import src.ai_client` < 50ms (from ~1800ms), `import src.gui_2` < 500ms (from ~3000ms), `live_gui.wait_for_server(timeout=15)` no longer times out.*