feat(memory): wire five_signal consolidation daemon, Prometheus metrics, and causal goal entity#4418
Merged
Merged
Conversation
This was
linked to
issues
May 18, 2026
67bfc4d to
da08349
Compare
…cs, and causal goal entity #4402: register ConsolidationHandler with zeph-scheduler at bootstrap under TaskKind::Custom("five_signal_consolidation") when memory.five_signal.consolidation_daemon.enabled = true. Previously the daemon was fully implemented but never scheduled, making FR-010/FR-011/FR-012 dead code. #4404: export FiveSignalMetrics to Prometheus via spawn_metrics_sync_with_five_signal. Adds four counters (five_signal_recall_total, consolidation_daemon_runs_total, consolidation_promoted_total, consolidation_demoted_total) with delta tracking to prevent double-counting. Requires prometheus feature. #4405: thread goal_entity_id from call sites through recall_routed, recall_routed_async, recall_merge_and_rank, and apply_five_signal_scoring to CausalDistanceComputer::compute. Previously hardcoded None meant the causal distance signal was always zero regardless of config. Existing call sites pass None; future callers supply TurnContext.current_goal_entity_id per FR-006. Closes #4402, #4404, #4405
85c356b to
4246fac
Compare
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
ConsolidationHandleris now registered withzeph-schedulerat bootstrap underTaskKind::Custom("five_signal_consolidation"). Previously the daemon was fully implemented but never scheduled, so FR-010/FR-011/FR-012 were silently not satisfied —consolidation_daemon.enabled = truedid nothing.FiveSignalMetricscounters are now wired to the Prometheus registry viaspawn_metrics_sync_with_five_signal. Four counters added:zeph_five_signal_recall_total,zeph_five_signal_consolidation_daemon_runs_total,zeph_five_signal_consolidation_promoted_total,zeph_five_signal_consolidation_demoted_total. Requiresprometheusfeature.goal_entity_idis now threaded from call sites throughrecall_routed→apply_five_signal_scoring→CausalDistanceComputer::compute. Previously hardcodedNonemeant the causal distance signal was always zero. Existing call sites passNone; future callers supplyTurnContext.current_goal_entity_idper FR-006.Test plan
cargo nextest run --workspace --features desktop,ide,server,chat,pdf,scheduler --lib --bins)sync_five_signal_exports_counters,sync_five_signal_no_double_count,compute_none_goal_returns_empty_mapcargo +nightly fmt --checkcleancargo clippy -p zeph-memory -p zeph --features desktop,ide,server,chat,pdf,scheduler -- -D warningscleanRUSTFLAGS="-D warnings" cargo check --workspace --features fullcleanCloses #4402, #4404, #4405