fix(neural): wire LearningScheduler→force_cycle + RBF restore at init#275
Merged
Conversation
The 8 neural organs were wired and consumed but UNFED: nothing called Coordinator.force_cycle/0 and Coordinator.init/1 never called Persistence.load_all/0 (zero callers). Networks ran on init-defaults forever and pattern_analyzer defensively ignored their untrained output -- the root cause of the token-cost/scattergun symptom. - LearningScheduler.run_learning_cycle now triggers the Neural Coordinator cycle (N6) after ingesting outcomes, so ESN/RBF train on the accumulated trajectories every poll (~5s after boot, then 5-min). Guarded + non-fatal: scheduler survives a down neural layer. - Coordinator.init now best-effort restores the RBF network from persisted state (the one cleanly-invertible learned network; trust is rebuilt per cycle, MoE/ESN/LSM train per cycle, ESN/LSM persistence is summary-only by design). Safe fallback to defaults on any mismatch. Training data was already sufficient (recipe-shell-quote-vars 166-pt series; registry.json 9 patterns) -- only the trigger was missing. Targeted tests green (neural 28, training_pipeline, cross_repo 11). Pre-existing --warnings-as-errors drift (prover_recommender:123, vcl/client:133) is unrelated and out of scope. Refs #274 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🔍 Hypatia Security ScanFindings: 13 issues detected
View findings[
{
"reason": "Issue in quality.yml",
"type": "missing_workflow",
"file": "quality.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in mirror.yml",
"type": "missing_workflow",
"file": "mirror.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in security-policy.yml",
"type": "missing_workflow",
"file": "security-policy.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "believe_me undermines formal verification (2 occurrences, CWE-704)",
"type": "believe_me",
"file": "/home/runner/work/hypatia/hypatia/src/abi/RuleEngine.idr",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "Nickel file missing SPDX-License-Identifier header (1 occurrences, CWE-1104)",
"type": "ncl_missing_spdx",
"file": "/home/runner/work/hypatia/hypatia/configs/config.ncl",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "unsafe block -- requires SAFETY comment (22 occurrences, CWE-676)",
"type": "unsafe_block",
"file": "/home/runner/work/hypatia/hypatia/clients/rust/hypatia-client/src/ffi.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "as_ptr exposes raw pointer that may dangle or alias unsafely (10 occurrences, CWE-676)",
"type": "as_ptr",
"file": "/home/runner/work/hypatia/hypatia/clients/rust/hypatia-client/src/ffi.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "expect() in hot path (1 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/hypatia/hypatia/adapters/src/codeberg.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "expect() in hot path (1 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/hypatia/hypatia/adapters/src/radicle.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause (issue #274, epic #273)
Ground-truth audit found the 8 neural organs were wired and consumed but UNFED:
Hypatia.LearningScheduler(supervised, 5-min poll) ingested outcomes but never calledHypatia.Neural.Coordinator.force_cycle/0;Coordinator.init/1never calledPersistence.load_all/0(zero callers). Networks ran on init-defaults forever andpattern_analyzerdefensively ignored their untrained output — the root cause of the token-cost/scattergun symptom.Change
learning_scheduler.ex—run_learning_cyclenow triggers the Neural Coordinator cycle (N6) after ingesting outcomes, so ESN/RBF train on accumulated trajectories every poll (~5s after boot, then every 5 min). Guarded + non-fatal.neural/coordinator.ex—init/1best-effort restores the RBF network from persisted state (the one cleanly-invertible learned network; trust rebuilt per cycle, MoE/ESN/LSM train per cycle, ESN/LSM persistence is summary-only by design). Safe fallback to defaults on any mismatch — never crashes the supervisor.Validation
Training data was already sufficient (
recipe-shell-quote-vars166-pt series ≥60;registry.json9 patterns ≥5) — only the trigger was missing. Targeted tests green: neural (28), training_pipeline, cross_repo_learning (11). Compiles cleanly.Out of scope / follow-ups
--warnings-as-errorsdrift (prover_recommender.ex:123unused default arg;vcl/client.ex:133ungroupedhandle_call/3) — unrelated, not touched.Refs #274