fix(evolution): pipeline bugs - dedup, procedures, backup, model/metrics#15
Merged
electronicBlacksmith merged 2 commits intomainfrom Apr 8, 2026
Merged
Conversation
… onboarding Fix 1: Use JUDGE_API_KEY for dedicated judge client cost isolation. Fix 2: applyDelta() now filters duplicate lines on append instead of blindly appending. Returns null for no-op appends so version is not bumped. compressUserProfile() added to consolidation with size gate. Fix 3: buildCritiqueFromObservations() now routes domain_fact, error, tool_pattern, and success observations to their respective config files instead of silently dropping them. affected_files from judge output is preserved through the pipeline with path traversal validation. Fix 4: markOnboardingComplete() called after evolution version >= 2, clearing the onboarding prompt that was re-injecting every restart.
- Fix procedural memory bug: consolidateSessionWithLLM() counted detected procedures but never stored them. Add storage loop after facts extraction. - Add post-evolution config backup to data/config-backups/vN with 5-version retention. - Surface model mismatch: warn when env overrides yaml model, add model + model_source to /health endpoint and phantom status. - Add evolution observability: session_count, sessions_since_consolidation, session_log_depth in health/status. Add Evolution Pipeline doctor check. - Fix default model to claude-opus-4-6 across config, schema, and init.
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
Fixes from the config audit (issues 1-4 in first commit, 5-8 in second):
Medium-priority fixes (commit 2)
consolidateSessionWithLLM()counted detected procedures but never calledstoreProcedure(). Added storage loop with correctProcedureshape, seeding success/failure counts from session outcome.backupConfig()toEvolutionEnginethat copiesphantom-config/todata/config-backups/vNafter successful evolution, retaining last 5 versions.model_sourcefield to config, log warning when env overrides yaml model, surface model + source in/healthandphantom status. Fixed default model toclaude-opus-4-6across config, schema, and init.session_count,sessions_since_consolidation,session_log_depthto health endpoint and status output. AddedEvolution Pipelinehealth check tophantom doctor.Earlier fixes (commit 1)
Test plan
docker exec phantom ls /app/data/config-backups/curl localhost:3100/health | jq .modelphantom statusshows model and evolution metrics