Skip to content

feat: explicit decay disable flag (spec 29)#50

Merged
DarlingtonDeveloper merged 5 commits into
mainfrom
feat/spec-29-decay-disable-flag
Apr 11, 2026
Merged

feat: explicit decay disable flag (spec 29)#50
DarlingtonDeveloper merged 5 commits into
mainfrom
feat/spec-29-decay-disable-flag

Conversation

@DarlingtonDeveloper
Copy link
Copy Markdown
Contributor

Summary

  • Adds DecayConfig.enabled field (default true) with with_enabled() builder and early return in apply_decay() — when disabled, no iteration, no weight changes, no pruning
  • Adds decay_enabled to AutoLinkerTomlConfig (TOML-facing), wired through to DecayConfig via auto_linker_config()
  • Adds --template legal to cortex init — disables edge decay, score decay, and retention TTL; configures legal-specific briefing roles (legal-precedent, regulation, case, filing, deposition, ruling, etc.)
  • Startup log message when decay is disabled
  • Updates cortex.example.toml and docs/concepts/decay-and-memory.md

Tests

  • Unit (cortex-core): test_decay_skipped_when_disabled — year-old edge weight unchanged; test_decay_still_works_when_enabled — regression
  • Config unit (cortex-server): TOML parsing with decay_enabled=false, backward compat (missing field defaults true), wiring through auto_linker_config() both directions
  • Integration (cortex-server): test_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)
  • Legal template: test_legal_template_roles, test_legal_template_unknown_falls_back_to_default
  • All 538 existing tests pass unchanged

Test plan

  • cargo test --workspace --lib --tests — 538 passed, 0 failed
  • Manual: cortex init --template legal produces config with decay_enabled = false
  • Manual: verify startup log shows decay disabled message

🤖 Generated with Claude Code

DarlingtonDeveloper and others added 5 commits April 11, 2026 19:18
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>
@DarlingtonDeveloper DarlingtonDeveloper merged commit c5561ab into main Apr 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant