Private
Public Access
0
0

feat(directives): scavenge sweep 2/5 batch 1 (startup+profiling): 2 directives

This commit is contained in:
2026-07-04 01:55:23 -04:00
parent 3fcf7dccb5
commit dd153b1de1
4 changed files with 20 additions and 0 deletions
@@ -0,0 +1,9 @@
# defer_heavy_sdk_imports_to_subprocess
## v1
**Why this iteration:** Lifted from `docs/superpowers/specs/2026-05-13-ai-server-ipc-design.md` §"Architecture" + §"Startup Sequence". The spec decouples heavy AI SDK imports (google.genai, anthropic) from the GUI process via a subprocess command queue: GUI starts instantly (~0.5s) while the AI server loads (~1.2s) in the background. The audit script `scripts/audit_main_thread_imports.py` is the static gate for this rule.
**Source:** `docs/superpowers/specs/2026-05-13-ai-server-ipc-design.md:5-18 + 104-110`
---
**Lifted:** 2026-07-03 (scavenge sweep batch 2/5: docs/superpowers/specs/)
@@ -0,0 +1 @@
# Heavy SDK imports must be deferred to a subprocess so the GUI starts instantly
@@ -0,0 +1,9 @@
# graceful_optional_dependency_degradation
## v1
**Why this iteration:** Lifted from `docs/superpowers/specs/2026-05-15-profiling-system-design.md` §"Graceful Degradation" (lines 138-143) + the `tracy_integration.py` reference implementation (lines 144-197). When an optional dependency (e.g., `pytracy` for Tracy profiling) is not installed or not connected, the app must continue normally. The pattern: wrap the import in `try/except Exception`, set a module-level `_tracy_available: bool = False` flag, gate every zone call on the flag, log a startup warning. No crash, no feature breakage.
**Source:** `docs/superpowers/specs/2026-05-15-profiling-system-design.md:138-197`
---
**Lifted:** 2026-07-03 (scavenge sweep batch 2/5: docs/superpowers/specs/)
@@ -0,0 +1 @@
# Optional dependencies must degrade gracefully via try/except import + module-level flag pattern