Shared scaffold for CircuitForge products
- C1: Remove _reserved_vram decrement from _scheduler_loop reaper; sole responsibility now belongs to _batch_worker's finally block, eliminating the double-decrement race that could drive _reserved_vram negative. - C2: Move TaskScheduler construction (including VRAM detection httpx call) outside _scheduler_lock in get_scheduler(); lock is now only held for the final singleton assignment, preventing 2s lock contention on first call. - I1: Add RunTaskFn type alias (Callable[...]) and use it in __init__ and get_scheduler() instead of bare Callable. - I2: Replace namedtuple TaskSpec with typed NamedTuple class. - I3: Parameterize _queues annotation as dict[str, deque[TaskSpec]]. - I4: Wrap _queues read in start() with self._lock. - I5: Replace time.sleep() ordering assertion in test_vram_budget_blocks_second_type with event-based synchronization using type_a_started/type_b_started events. - M2: Use sqlite3.connect() as context manager in _load_queued_tasks. - M3: Strengthen weak assertion in test_enqueue_returns_false_when_queue_full. - M4: Add test_reserved_vram_zero_after_task_completes to catch C1 regression. |
||
|---|---|---|
| circuitforge_core | ||
| tests | ||
| .gitignore | ||
| pyproject.toml | ||
| README.md | ||
circuitforge-core
Shared scaffold for CircuitForge products.
Modules
circuitforge_core.db— SQLite connection factory and migration runnercircuitforge_core.llm— LLM router with fallback chaincircuitforge_core.tiers— Tier system with BYOK and local vision unlockscircuitforge_core.config— Env validation and .env loadercircuitforge_core.vision— Vision router stub (v0.2+)circuitforge_core.wizard— First-run wizard base class stubcircuitforge_core.pipeline— Staging queue stub (v0.2+)
Install
pip install -e .
License
BSL 1.1 — see LICENSE