feat(memory): add lifecycle controls#144
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds memory lifecycle controls (retention defaults, expiry, redaction, deletion) for hosted/local memory, plus an operator-facing coven-code memory CLI surface and documentation, to meet the retention/deletion requirements in #109.
Changes:
- Introduces typed
RetentionClassand derives effective expiry fromcreated_atwhenexpires_atis absent (with inclusive expiry handling in core). - Adds core helpers to expire/delete/redact memory files while preserving generated memory IDs in tombstones and guarding legal-hold entries behind
--force. - Adds
coven-code memoryadmin subcommands (list/expire/redact/delete/ledger) and documents retention defaults and operator workflows.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src-rust/crates/core/src/memdir.rs | Adds expire/delete/redact helpers, legal-hold guard, and tombstone ID preservation. |
| src-rust/crates/core/src/claudemd.rs | Adds RetentionClass, effective expiry derivation, and a frontmatter upsert helper; updates hosted filtering to use effective expiry. |
| src-rust/crates/cli/src/memory_admin.rs | Implements coven-code memory operator commands, filtering, and tombstone-only ledger export. |
| src-rust/crates/cli/src/main.rs | Wires a fast-path memory subcommand to the new admin handler. |
| docs/src/content/configuration.js | Documents retention classes and operator commands on the docs site. |
| docs/configuration.md | Adds retention defaults table and detailed operator control documentation. |
| docs/commands.md | Adds memory to the command reference list. |
| docs/advanced.md | Notes hosted invariants and the new operator memory lifecycle controls. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+296
to
+309
| let effective_expires_at = effective_memory_expires_at(&file.frontmatter) | ||
| .map(|date| date.format("%Y-%m-%d").to_string()); | ||
| let status = if file.frontmatter.deleted_at.is_some() { | ||
| MemoryStatus::Deleted | ||
| } else if file.frontmatter.redacted_at.is_some() { | ||
| MemoryStatus::Redacted | ||
| } else if effective_memory_expires_at(&file.frontmatter) | ||
| .map(|date| date < chrono::Local::now().date_naive()) | ||
| .unwrap_or(false) | ||
| { | ||
| MemoryStatus::Expired | ||
| } else { | ||
| MemoryStatus::Active | ||
| }; |
Comment on lines
+116
to
+126
| fn handle_redact(args: &[String]) -> anyhow::Result<()> { | ||
| let (target, reason, _force, dirs) = parse_target_reason_args( | ||
| args, | ||
| "usage: coven-code memory redact <id-or-path> --reason <text>", | ||
| )?; | ||
| let entry = resolve_for_operation(&target, dirs)?; | ||
| redact_memory_file(&entry.path, &reason) | ||
| .with_context(|| format!("failed to redact {}", entry.path.display()))?; | ||
| println!("redacted {}", entry.id); | ||
| Ok(()) | ||
| } |
9 tasks
BunsDev
added a commit
that referenced
this pull request
Jul 8, 2026
#145) Ports the team-memory conflict inspection and resolution operations from PR #142 onto the coven-code memory operator surface that landed in #144: - coven-code memory conflicts [--dir <team-memory-path>] [--json] lists unresolved pull conflicts (key, kind, reason) - coven-code memory resolve-conflict <key> [--dir <path>] removes the persisted conflict record after validating the key against traversal closes #142 Co-authored-by: romgenie <5861166+romgenie@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
14 tasks
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
coven-code memoryoperator controls for list, expire, redact, delete, scoped hosted deletion, and tombstone ledger export.Context
Changes
retention_classinto a typedRetentionClassand derives effective expiry fromcreated_atwhen no explicitexpires_atexists.--forcefor legal hold expiry/deletion.crates/cli/src/memory_admin.rsand a fast-pathmemorysubcommand with human and JSON output.[REDACTED: ...]/[DELETED: ...]reason stubs are exported, never arbitrary tombstoned body content.Validation
Record exact commands and outcomes. Mark items N/A with a reason when they do not apply.
git diff --check— passed with exit 0.cargo fmt --all— passed with exit 0.CARGO_INCREMENTAL=0 cargo check --workspace— passed with exit 0.CARGO_INCREMENTAL=0 cargo clippy --workspace --all-targets -- -D warnings— passed with exit 0.cargo test --workspace— not run; targeted tests cover changed core and CLI surfaces per issue scope.CARGO_INCREMENTAL=0 cargo test --package claurst-core -- claudemd memdir team_memory --quiet— 105 passed, 0 failed.CARGO_INCREMENTAL=0 cargo test --package claurst -- memory_admin --quiet— 5 passed, 0 failed.code-reviewsubagent reviewed the uncommitted implementation; identified ledger leakage, admin scan cap, inclusive expiry, and tombstone id preservation; fixes were implemented and re-verified.PR Readiness