Skip to content

feat: Control Plane Hardening & Mock Chaos Verification - #1

Merged
jayjz merged 7 commits into
mainfrom
feat/control-plane-hardening-mock-chaos
Jul 24, 2026
Merged

jayjz merged 7 commits into
mainfrom
feat/control-plane-hardening-mock-chaos

Conversation

@jayjz

@jayjz jayjz commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

This PR hardens the FastAPI control plane and strictly enforces the engine abstraction layer. It decouples development from the physical GPU by introducing a robust Mock engine with sticky thermal chaos, proving that the 503 circuit breakers hold under concurrent load.

Verified in this PR

  • 503 circuit breakers under Mock: Sequential and concurrent `/generate` and `/system/strategy` loads correctly bounce with 503 during simulated thermal events.
  • Contract Enforcement: `temperature` successfully wired from API payload down through the `BaseAetherEngine` contract to the LLM backend.
  • Headless Dev Mode: `AETHER_ENGINE=mock` and `AETHER_CHAOS=true` cleanly isolate developers from CUDA dependencies.

Remaining Technical Debt (Unverified - DO NOT MERGE)

  • Real LlamaEngine VRAM stability: `del self.llm` and `gc.collect()` are currently acting as theoretical memory barriers. Real CUDA allocations on the RTX 4060 may still race during Fast-Swaps.
  • Agent-level retry logic: Autonomous agents will likely interpret the newly verified 503 responses as fatal tool errors. We need to implement backoff logic in `src/agent_tool.py`.
  • Lock behavior under unlocked concurrent strategy requests: `asyncio.Lock` handles locking safely, but unlocked simultaneous strategy requests will currently queue indefinitely, risking massive timeout cascades.

jayjz added 4 commits July 23, 2026 15:13
This commit repairs the primary inference path, which was previously disconnected from the API, and removes hardcoded testing artifacts from the control plane.

Changes in LlamaEngine:
- Inherit explicitly from BaseAetherEngine to satisfy the factory contract.
- Implement missing _map_mode_to_layers() to prevent AttributeError during Fast-Swap.
- Implement missing generate() method to execute real llama-cpp-python inference and yield required telemetry (tps, generation time).

Changes in Server/Control Plane:
- Delete the inline spoofed HardwareMonitor (which hardcoded temps to 90C).
- Import and bind the real HardwareMonitor from src.hardware_monitor.
- Wire the /generate endpoint to actually invoke state.hardware_engine.generate(), closing the loop between the API and physical execution.

Why:
The API was previously routing requests perfectly but failing at the final execution step due to an incomplete engine contract. Additionally, the leftover Cold Burn-In spoof trapped the server in a permanent Emergency Thermal Lockout state.
…rify 503 circuit breakers under Mock

- Enforced BaseAetherEngine contract across all muscle implementations (added temperature).
- Added AETHER_ENGINE and AETHER_CHAOS toggles for headless development.
- Verified sticky thermal 503 lockouts against concurrent API load in Mock mode.
- Restored missing /system/tools and /system/cache endpoints.
…rs and swap matrix

- Validates system discovery endpoints (/cache, /metrics, /tools)
- Asserts Economic Gatekeeper ROI routing for strategy swaps
- Codifies thermal 503 protection enforcement for both /generate and /system/strategy
@jayjz

jayjz commented Jul 23, 2026

Copy link
Copy Markdown
Owner Author

test: add comprehensive hypervisor test suite covering circuit breakers and swap matrix

  • Validates system discovery endpoints (/cache, /metrics, /tools)
  • Asserts Economic Gatekeeper ROI routing for strategy swaps
  • Codifies thermal 503 protection enforcement for both /generate and /system/strategy

@jayjz jayjz changed the title feat: Control Plane Hardening & Mock Chaos Verification" --body "### Summary This PR hardens the FastAPI control plane and strictly enforces the engine abstraction layer. It decouples development from the physical GPU by introducing a robust Mock engine with sticky thermal chaos, proving that the 503 circuit breakers hold under concurrent load. feat: Control Plane Hardening & Mock Chaos Verification Jul 23, 2026
jayjz and others added 3 commits July 24, 2026 17:49
- Restored missing generate() method and temperature propagation.
- Added basic emergency teardown sequence (del -> GC).
- Added aggressive_quant fallback on load failure.
- Note: Fast-Swap VRAM barriers remain unproven on 8GB cards. DO NOT run in production without process isolation.
- Replaced brittle print() statements with robust logging.
- Created stdout (console), ops (aetherforge.log), and safety (hardware_safety.log) streams.
- Added log rotation (10MB limit) to prevent SSD bloat.
- Ops log now successfully captures live TPS and Gatekeeper math routing.
@jayjz
jayjz merged commit 3344005 into main Jul 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant