feat: explicit decay disable flag (spec 29)#50
Merged
Conversation
Add `enabled` field to `DecayConfig` and `decay_enabled` to TOML config so legal/compliance/archival deployments can explicitly disable edge weight decay. When disabled, `apply_decay()` returns immediately — no iteration, no weight changes, no pruning. - DecayConfig.enabled (default true) with with_enabled() builder - Early return in DecayEngine::apply_decay() when disabled - decay_enabled field in AutoLinkerTomlConfig, wired through - Legal template (cortex init --template legal) disables decay, score decay, and retention TTL - Startup log when decay is disabled - cortex.example.toml and docs/concepts/decay-and-memory.md updated - 11 new tests: unit, config parsing, integration, legal template Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The warren feature was removed from dependencies but cfg guards remained, causing clippy to fail. Remove the warren feature flag, the src/nats/ warren adapter wrapper module, and the warren-gated NATS startup code in serve.rs. The generic ingest/nats adapter is unaffected. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The decay disable feature is purely config-driven (decay_enabled=false in cortex.toml). Remove the legal-specific template with hardcoded briefing roles — users configure their own roles and decay settings without domain-specific coupling. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix examples to use cortex_memory_core instead of cortex_core - Fix doctests in api.rs and client lib.rs for renamed crates - Remove hardcoded legal template from cortex init (decay disable is generic config, not domain-specific) 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
DecayConfig.enabledfield (defaulttrue) withwith_enabled()builder and early return inapply_decay()— when disabled, no iteration, no weight changes, no pruningdecay_enabledtoAutoLinkerTomlConfig(TOML-facing), wired through toDecayConfigviaauto_linker_config()--template legaltocortex init— disables edge decay, score decay, and retention TTL; configures legal-specific briefing roles (legal-precedent, regulation, case, filing, deposition, ruling, etc.)cortex.example.tomlanddocs/concepts/decay-and-memory.mdTests
test_decay_skipped_when_disabled— year-old edge weight unchanged;test_decay_still_works_when_enabled— regressiondecay_enabled=false, backward compat (missing field defaults true), wiring throughauto_linker_config()both directionstest_decay_config_with_enabled_builder,test_decay_disabled_full_graph_integration(18-month-old edge preserved, then decays when re-enabled),test_decay_disabled_multiple_cycles_no_change(10 cycles, weight stable)test_legal_template_roles,test_legal_template_unknown_falls_back_to_defaultTest plan
cargo test --workspace --lib --tests— 538 passed, 0 failedcortex init --template legalproduces config withdecay_enabled = false🤖 Generated with Claude Code