Private
Public Access
0
0
Commit Graph

44 Commits

Author SHA1 Message Date
ed 52ea2693cf test(conftest): use AppController.wait_for_warmup() to fix library import race
The google-genai library has a known circular-import bug in its
__init__.py chain:
  google.genai/__init__.py:21: from .client import Client
    -> from ._api_client import BaseApiClient
      -> from .types import HttpOptions
When loaded fresh in a pytest process, the chain collides with
itself and leaves google.genai in a 'partially initialized' state.

Per the user spec (startup_speedup_20260606 spec.md:2.2 Layer 3):
  "the app controller should post to test clients or the user
  when its threads are warmed up with imports — that way the user
  knows 'hey you have the ui first, but now you have all the
  functionality.'"

This is exactly what the warmup notification system does.
Phase 2 (commit 1354679e) added the WarmupManager + _io_pool,
and the warmup list (state.toml) already includes 'google.genai'.
The AppController.__init__ submits the warmup jobs to the _io_pool
background thread. When the warmup completes, _warmup_done_event
is set and registered on_warmup_complete callbacks fire.

The previous conftest fix imported 'google.genai' DIRECTLY at
conftest module load. That bypassed the whole notification
mechanism. This commit fixes the oversight:

  - Reverts the direct `import google.genai`
  - Creates an AppController at conftest load time
  - Calls `wait_for_warmup(timeout=60.0)` to block until the
    background warmup completes
  - google.genai ends up in sys.modules via the warmup's
    `importlib.import_module` call (same end state, but now via
    the documented mechanism)

The conftest's `from src.gui_2 import App` at line 27 is also
a heavy synchronous import chain that runs in-process. By the
time that line executes, the warmup is already in progress on
the _io_pool. The wait_for_warmup() call after that line ensures
the warmup completes before any test collects.

The AppController is session-scoped (one per pytest process).
If another fixture (e.g. live_gui) creates its own AppController
that also runs warmup, the second controller's wait_for_warmup
returns immediately because the modules are already in
sys.modules.

Cost: 60s timeout worst-case (typically completes in ~3s based on
the baseline measurement). One-time per pytest process.

Earlier alternatives I tried and rejected:
- Direct `import google.genai` in conftest: bypasses the
  notification mechanism. User feedback: "you are falling back
  to your jank."
- Source-level `genai = _require_warmed('google.genai')` + `.types`:
  fails the same way (the library bug is in the PARENT's
  __init__.py, not the leaf). The parent's __init__.py never
  completes in a fresh process; once it's in the "partially
  initialized" state in sys.modules, no caller pattern can fix it.
- Revert the conftest change and skip these tests: not viable,
  the tests are real and important.
2026-06-06 19:23:52 -04:00
ed b3b9baf91f test: Implement comprehensive workspace isolation to protect user projects
- Add isolate_workspace autouse fixture in conftest.py.
- Monkeypatch SLOP_CONFIG and preset paths to point to a temporary test directory.
- Update test_history_management.py to use dynamic paths.get_config_path().
- Prevents tests from accidentally reading or modifying the active project.toml or config.toml.
2026-06-02 01:27:32 -04:00
ed b5e512f483 feat(sdm): inject structural dependency mapping tags across codebase
Adds [C: caller] tags to functions/methods and [M: mutation] / [U: usage] tags to class variables based on cross-module call analysis.
2026-05-13 22:35:52 -04:00
ed 4c5e719be4 feat(ai-server): Add AIProxyClient queue communication layer 2026-05-13 08:58:58 -04:00
ed 8c06c1767b refactor(sdm): Global pass with refined 'External Only' SDM tags. Pruned redundant internal references and fixed indentation logic in injector. Verified full project compilation. 2026-05-09 15:00:35 -04:00
ed 93f6bcbd67 test(conftest): Add VSCode config to live_gui fixture, update external editor tests
- conftest.py: Include tools.text_editors.vscode in live_gui workspace config
- gui_2.py: Add btn_open_external_editor to _clickable_actions
- test_external_editor_gui.py: Tests for external editor GUI integration

Note: Due to process boundaries (GUI runs in subprocess), full VSCode launch
verification requires manual testing. The test infrastructure verifies config,
command format, and button wiring. Manual verification recommended.
2026-05-07 20:50:05 -04:00
ed befb480285 feat(conductor): Archive External MCP, Project-Specific Conductor, and GUI Path Config tracks 2026-03-12 20:10:05 -04:00
ed 8bc6eae101 wip: fixing more path resolution in tests 2026-03-12 19:28:21 -04:00
ed dcc13efaf7 chore(conductor): Mark track 'Saved Tool Presets' as complete 2026-03-10 01:23:57 -04:00
ed e2a403a187 checkpoint(Saved system prompt presets) 2026-03-09 22:27:40 -04:00
ed fde0f29e72 ok 2026-03-08 23:24:33 -04:00
ed cb57cc4a02 STILL FIXING 2026-03-06 22:03:59 -05:00
ed f65e9b40b2 WIP: Regression hell 2026-03-06 21:22:21 -05:00
ed f580165c5b feat(conductor): Implement configurable paths and mark track 'Conductor Path Configuration' as complete 2026-03-06 16:43:11 -05:00
ed 1fb6ebc4d0 idk why these weren't committed 2026-03-06 12:48:02 -05:00
ed 5e69617f88 WIP: I HATE PYTHON 2026-03-05 13:55:40 -05:00
ed 35480a26dc test(audit): fix critical test suite deadlocks and write exhaustive architectural report
- Fix 'Triple Bingo' history synchronization explosion during streaming

- Implement stateless event buffering in ApiHookClient to prevent dropped events

- Ensure 'tool_execution' events emit consistently across all LLM providers

- Add hard timeouts to all background thread wait() conditions

- Add thorough teardown cleanup to conftest.py's reset_ai_client fixture

- Write highly detailed report_gemini.md exposing asyncio lifecycle flaws
2026-03-05 01:42:47 -05:00
ed 45b716f0f0 fix(tests): resolve 3 test failures in GUI decoupling track
- conftest.py: Create workspace dir before writing files (FileNotFoundError)
- test_live_gui_integration.py: Call handler directly since start_services mocked
- test_gui2_performance.py: Fix key mismatch (gui_2.py -> sloppy.py path lookup)
2026-03-04 22:00:00 -05:00
ed 2d92674aa0 fix(controller): Add stop_services() and dialog imports for GUI decoupling
- Add AppController.stop_services() to clean up AI client and event loop
- Add ConfirmDialog, MMAApprovalDialog, MMASpawnApprovalDialog imports to gui_2.py
- Fix test mocks for MMA dashboard and approval indicators
- Add retry logic to conftest.py for Windows file lock cleanup
2026-03-04 20:16:16 -05:00
ed 88aefc2f08 fix(tests): Sandbox isolation - use SLOP_CONFIG env var for config.toml 2026-03-04 17:12:36 -05:00
ed 01b3c26653 Botched: Need to do a higher reaosning model to fix this mess. 2026-03-04 12:32:14 -05:00
ed f2b25757eb refactor(tests): Update test suite and API hooks for AppController architecture 2026-03-04 11:38:36 -05:00
ed c102392320 feat(src): Resolve imports and create sloppy.py entry point 2026-03-04 10:01:55 -05:00
ed fe2114a2e0 feat(types): Complete strict static analysis and typing track 2026-03-04 09:46:02 -05:00
ed 1be6193ee0 chore(tests): Final stabilization of test suite and full isolation of live_gui artifacts 2026-03-04 01:05:56 -05:00
ed 966b5c3d03 wow this ai messed up. 2026-03-04 00:01:01 -05:00
ed 3203891b79 wip test stabalization is a mess still 2026-03-03 23:53:53 -05:00
ed 51f7c2a772 feat(tests): Route VerificationLogger output to tests/logs 2026-03-02 23:24:40 -05:00
ed 5a0ec6646e fix(tests): Enhance event loop cleanup in app_instance fixture 2026-03-02 23:05:58 -05:00
ed 35822aab08 chore(test): Centralize app_instance and mock_app fixtures in conftest.py 2026-03-02 20:54:25 -05:00
ed 21496ee58f test(stabilization): Implement high-signal live_gui telemetry and update plan 2026-02-28 20:36:31 -05:00
ed ece46f922c test(stabilization): Resolve run_linear API drift and implement vlogger high-signal reporting 2026-02-28 20:18:05 -05:00
ed cc806d2cc6 refactor(tests): Add strict type hints to fifth batch of test files 2026-02-28 19:24:02 -05:00
ed 60396f03f8 refactor(types): auto -> None sweep across entire codebase
Applied 236 return type annotations to functions with no return values
across 100+ files (core modules, tests, scripts, simulations).
Added Phase 4 to python_style_refactor track for remaining 597 items
(untyped params, vars, and functions with return values).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 11:16:56 -05:00
ed d36632c21a checkpoint: massive refactor 2026-02-28 09:06:45 -05:00
ed 3b2d82ed0d feat(mma): Finalize Orchestrator Integration and fix all regressions 2026-02-27 18:31:14 -05:00
ed 8bb72e351d chore(conductor): Mark track 'MMA Core Engine Implementation' as complete and verify with Phase 6 tests 2026-02-26 21:34:28 -05:00
ed c952d2f67b feat(testing): stabilize simulation suite and fix gemini caching 2026-02-25 01:44:46 -05:00
ed fb80ce8c5a feat(gui): Add auto-scroll, blinking history, and reactive API events 2026-02-25 00:41:45 -05:00
ed ea84168ada checkpoint post gui2_parity 2026-02-24 22:02:06 -05:00
ed c4c47b8df9 feat(gui): Rename gui.py to gui_legacy.py and update references 2026-02-24 20:36:04 -05:00
ed a85293ff99 feat(gui2): Implement missing GUI hook handlers 2026-02-24 19:37:58 -05:00
ed 8bd280efc1 feat(simulation): stabilize IPC layer and verify full workflow 2026-02-23 19:53:32 -05:00
ed db251a1038 conductor(checkpoint): Checkpoint end of Phase 1: Infrastructure & Core Utilities 2026-02-23 15:53:16 -05:00