Implements the missing pieces of the Sovereignty Loop governing architecture:
## New Modules
- **auto_crystallizer.py** (#961): Extracts durable local rules from LLM
reasoning chains. Regex-based pattern extraction for threshold checks,
comparisons, choice-reason patterns. RuleStore with JSON persistence,
confidence tracking, and success-rate gating.
- **sovereignty_loop.py**: Core orchestration implementing the canonical
pattern: check cache → miss → infer → crystallize → return. Provides
sovereign_perceive(), sovereign_decide(), sovereign_narrate() wrappers
and a @sovereignty_enforced decorator for general use.
- **graduation.py**: Five-condition graduation test runner evaluating
perception/decision/narration independence, economic independence
(sats earned > spent), and operational independence (24h uptime).
Generates markdown reports and persists to JSON.
- **graduation.py route**: Dashboard API endpoint for running graduation
tests via GET /sovereignty/graduation/test.
## Enhanced Modules
- **perception_cache.py** (#955): Replaced placeholder crystallize_perception()
with a working implementation that extracts OpenCV templates from VLM
bounding-box responses. Added .npy image persistence, bbox tracking,
metadata support, and robust error handling.
- **__init__.py**: Updated docstring and exports to document the full
sovereignty subsystem.
## Tests (60 new/updated, all passing)
- test_auto_crystallizer.py: 17 tests covering rule extraction, RuleStore
CRUD, persistence, confidence tracking, and matching
- test_sovereignty_loop.py: 9 tests covering all three layers + decorator
- test_graduation.py: 11 tests covering conditions, reports, persistence
- test_perception_cache.py: Updated 3 tests for new image persistence
## Documentation
- docs/SOVEREIGNTY_INTEGRATION.md: Integration guide with code examples
for all sovereignty modules, module map, and API reference
Fixes#953