feat: cap-aware auto-consolidation + docs sweep (B4 step 2) - #245
Merged
Merged
Conversation
…nobs, side-call events
Long-lived serve/REPL sessions never hit the session-end consolidation trigger, so facts fossilize near the cap for the life of the process. Crossing consolidate_at_cap_pct (*int, default 80, explicit 0 disables) of a fact file's cap now fires ONE background consolidation per crossing (per-target in-flight guard). Lock discipline: the LLM call never runs under the facts flock — the pass snapshots entries flock-free, merges in a temp clone (PreviewConsolidation), and ApplyConsolidation takes the flock only for the verified snapshot swap, conflicting instead of overwriting concurrent writes. Best-effort: errors logged, never surfaced to AddFact callers. Pinned RED-first in internal/memory/cap_consolidation_test.go (fires on crossing, disabled at 0, in-flight guard, best-effort). internal/memory + internal/memory/extended + full cmd/odek green under -race.
- consolidate_at_cap_pct wired through internal/config loader (the JSON key was silently ignored — HIGH, all judges) and added to introspect - 10-minute cooldown between cap-triggered passes: adds hovering at the threshold can no longer churn LLM consolidation calls (cost-attack surface contained) - guard scope corrected: one pass per manager, both targets share it - size calculation reuses facts.sizeOf - MEMORY.md contradictions with the feature removed; cap-triggered pass documented with its safety properties (re-scan, verified snapshot swap, no silent deletes) internal/memory, internal/config, full cmd/odek green under -race.
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
consolidate_at_cap_pct(*int, default 80, explicit 0 disables) of a fact file's cap fires ONE background LLM consolidation per crossing — long-lived serve/REPL sessions never hit the session-end trigger, so facts otherwise fossilize near the cap for the process lifetime.Review-found fixes (3-judge panel)
Test plan