fix: training crash loop safety + episode synthesis quality#407
Merged
CalebisGross merged 1 commit intomainfrom Apr 14, 2026
Merged
fix: training crash loop safety + episode synthesis quality#407CalebisGross merged 1 commit intomainfrom
CalebisGross merged 1 commit intomainfrom
Conversation
The Phase C continuous learning pipeline ran 21 failed GPU training cycles overnight, crashing the PC repeatedly. Root cause: MarkExperienceUsedInTraining was never called, so untrained count never dropped and every dreaming cycle re-triggered training on the same data. Combined with Gemma 4 E2B at seq_len=2048 exceeding the 16GB VRAM budget. Training pipeline fixes: - Call MarkExperienceUsedInTraining after batch assembly (root cause) - Add e-stop sentinel file (~/.mnemonic/training.disabled) - Circuit breaker: 3 consecutive failures disables auto-trigger - Cooldown: 24h wait after failed run before retrying - Fix circuit breaker SQL to count stale "requested" runs as failures - Reduce seq_len 2048→1024 in continuous_train.sh (VRAM ~15.4GB→~8-9GB) - Add VRAM pre-flight check (abort if >1GB still in use after daemon stop) - Lower OOM abort threshold to 3 consecutive errors in train_spokes.py Episode synthesis fixes: - Simplify LLM schema from 7 fields to 4 (title, summary, concepts, salience) - Rewrite prompt: directive TASK/RULES/SCHEMA format, no placeholder values - Add logit confidence validation (MeanProb < 0.10 falls back to heuristic) - Add heuristic enrichment for emotional_tone, outcome, narrative - Add event budget truncation (bookend strategy, 6000 char limit) - Update GBNF grammar for 4-field schema with constrained salience - Reduce temperature 0.3→0.2, max_tokens 1024→256 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
MarkExperienceUsedInTraining()was never called — untrained count never dropped, causing every dreaming cycle to re-trigger training (21 failed runs overnight, crashing the PC)Test plan
go test ./...— all passgolangci-lint run— 0 issuesgo vet ./...— clean~/.mnemonic/training.disabled, verify auto-trigger skipped in logstrain_modelMCP tool respects e-stop fileCloses #391
🤖 Generated with Claude Code