[perplexity] feat: Sovereignty Loop core framework — auto-crystallizer, graduation test, orchestration (#953) #1331
Reference in New Issue
Block a user
Delete Branch "perplexity/issue-953"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #953
Summary
Implements the missing core components of the Sovereignty Loop governing architecture. Gemini's PRs #1154 and #1167 added documentation; this PR adds the executable framework that enforces the sovereignty protocol across all AI layers.
New Modules
auto_crystallizer.py(#961)Automatic rule extraction from LLM reasoning chains. Scans for recognizable patterns (threshold checks, state comparisons, explicit choices) and converts them into local
Ruleobjects that can preempt future LLM calls.RuleStorewith JSON persistence (data/strategy.json)sovereignty_loop.pyCore orchestration enforcing check cache → miss → infer → crystallize → return:
sovereign_perceive()— Perception layer (VLM calls)sovereign_decide()— Decision layer (LLM calls)sovereign_narrate()— Narration layer (template vs LLM)@sovereignty_enforced— General-purpose decoratorgraduation.pyFive-condition graduation test runner:
Generates markdown reports with per-condition detail.
graduation.py(route)Dashboard API:
GET /sovereignty/graduation/testEnhanced Modules
crystallize_perception()with working implementation — extracts OpenCV templates from VLM bounding-box responses, persists template images as.npyfilesTests
60 tests, all passing:
test_auto_crystallizer.py— 17 teststest_sovereignty_loop.py— 9 teststest_graduation.py— 11 teststest_perception_cache.py— 23 tests (3 updated)Full unit suite: 715 passed, 0 failed
Documentation
docs/SOVEREIGNTY_INTEGRATION.md— Integration guide with code examples for every module, the crystallization protocol, falsework checklist usage, and complete module map.