Skip to content

fix(neural): the learning cycle crashed on every run — retune and first real training - #925

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/neural-learning-cycle
Oct 15, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
fix/neural-learning-cycle

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

What this changes

The neural layer has been untrained since March — the health snapshot from 2026-03-06 records 6,914 outcomes processed with zero confidence updates, and data/verisim/neural-states/ was empty. Two defects, both found by running the system and reading its own logs:

  1. The scheduler crashed on every learning cycle. run_learning_cycle's state update uses %{state | total_strategy_shifts: …} — a map update raises KeyError on a missing key even when the value expression uses Map.get/3. init never set total_strategy_shifts (nor proof_model_retrain_count), so the GenServer died on each :poll and restarted. Both keys now exist in init.
  2. The training data path was machine-specific. config.exs baked in ~/Documents/hyperpolymath-repos/... (the old Mac), so TrainingPipeline found no outcomes and no pattern registry. Migrated the same way as fix(config): require HYPATIA_VERISIM_URL / HYPATIA_ECHIDNABOT_URL, no localhost defaults #918: HYPATIA_VERISIM_DATA_PATH / HYPATIA_FLEET_PATH env overrides with repo-relative defaults (data/verisim, ../gitbot-fleet).

How to run its tests

mix compile
mix run -e 'Application.ensure_all_started(:hypatia); Hypatia.LearningScheduler.run_now(); Process.sleep(30000); IO.inspect(Hypatia.Neural.Coordinator.health_report())'

Verified (2026-10-15)

After both fixes, the cycle completes end to end:

  • 6,964 outcomes ingested; 2 Bayesian confidence updates — the first since March
  • RBF trained: 20 centers, 8 inputs, MSE 0.019 (9 real + 30 synthetic vectors)
  • ESN trained: 3,656 time steps
  • Graph of Trust: 292 nodes / 45,814 edges (25,126 cross-repo), 18 repos flagged for attention
  • neural-states/ now carries persisted trained state for all networks
  • recipe-shell-quote-vars annealed to stage veteran (outcome_count 18,640, success rate 1.0, max_tier auto_execute)

The refreshed health snapshot, updated recipe confidences, and the persisted neural states are committed with the fix — verisim-data is the git-backed store.

Note: the commit is unsigned (the signing key's passphrase is unavailable to the session); amend to sign if required.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe vibe@mistral.ai

…st real training

Two defects kept the neural layer untrained since March (health
snapshot 2026-03-06: 6914 outcomes processed, 0 confidence updates,
neural-states/ empty):

1. LearningScheduler.run_learning_cycle crashed at the state map
   update: %{state | total_strategy_shifts: …} raises KeyError on a
   missing key even though the value used Map.get/3 — the update
   itself is the guard, and init never set the key (same for
   proof_model_retrain_count). The scheduler died on each :poll and
   restarted, so no cycle ever completed. Both keys now exist in
   init.

2. config.exs baked in a machine-specific verisim path
   (~/Documents/hyperpolymath-repos/...), so TrainingPipeline found
   no outcomes and no pattern registry anywhere else. Same migration
   as #918: HYPATIA_VERISIM_DATA_PATH / HYPATIA_FLEET_PATH env
   overrides, repo-relative defaults (data/verisim, ../gitbot-fleet).

With both fixed, the cycle runs end to end (verified 2026-10-15):
6964 outcomes ingested, 2 Bayesian confidence updates landed,
RBF trained on 39 vectors (9 real + 30 synthetic, MSE 0.019),
ESN trained on 3656 time steps, Graph of Trust built 292 nodes /
45814 edges (25126 cross-repo, 18 repos needing attention), and
neural-states/ carries persisted trained state for all networks for
the first time. The refreshed health snapshot and updated recipe
confidences are committed with it, as verisim-data is git-backed.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 54 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: eb4a5fcc-7344-41d0-8d94-220b80f984f6
📥 Commits

Reviewing files that changed from the base of the PR and between 5f86909 and 53f8096.

📒 Files selected for processing: 13
  • config/config.exs
  • data/verisim/health/hypatia.json
  • data/verisim/neural-states/esn.json
  • data/verisim/neural-states/gnn.json
  • data/verisim/neural-states/lsm.json
  • data/verisim/neural-states/moe.json
  • data/verisim/neural-states/rbf.json
  • data/verisim/neural-states/sequence.json
  • data/verisim/neural-states/trust.json
  • data/verisim/neural-states/vae.json
  • data/verisim/recipes/recipe-remove-believe-me.json
  • data/verisim/recipes/recipe-shell-quote-vars.json
  • lib/learning_scheduler.ex
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hyperpolymath
hyperpolymath merged commit 99e282a into main Oct 15, 2026
87 of 90 checks passed
@hyperpolymath
hyperpolymath deleted the fix/neural-learning-cycle branch October 15, 2026 19:50
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