Skip to content

feat: add memory prune command#11

Merged
bburda merged 4 commits intomainfrom
feat/prune-command
Apr 2, 2026
Merged

feat: add memory prune command#11
bburda merged 4 commits intomainfrom
feat/prune-command

Conversation

@bburda
Copy link
Copy Markdown
Owner

@bburda bburda commented Apr 2, 2026

Summary

  • New memory prune --yes command that removes deprecated directive blocks from RST files
  • Dry run by default (shows count, requires --yes to confirm)
  • Auto-rebuilds needs.json after pruning
  • Git preserves history so no data is truly lost

Test plan

  • memory prune shows count without --yes
  • memory prune --yes removes 145 deprecated entries (924 -> 779 memories)
  • 117 unit tests pass, 18 MCP skipped (no SDK)
  • ruff lint + format clean

Copilot AI review requested due to automatic review settings April 2, 2026 15:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new CLI subcommand to remove deprecated memories from the RST source files, intended to help keep the workspace clean and then regenerate needs.json to reflect the removals.

Changes:

  • Introduces memory prune (dry-run by default; --yes to apply) and wires it into the CLI parser.
  • Adds prune_deprecated_from_rst() to scan RST files and remove directive blocks marked :status: deprecated.
  • Runs memory rebuild after pruning to regenerate needs.json.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
src/ai_memory_protocol/rst.py Adds the RST pruning implementation that removes deprecated directive blocks.
src/ai_memory_protocol/cli.py Adds the prune CLI command and integrates it with argument parsing and rebuild flow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

bburda added 3 commits April 2, 2026 17:56
…on dependency)

- 6 tests: removes only deprecated, preserves headers, handles split files,
  count_deprecated, empty workspace, zero deprecated
- count_deprecated_in_rst scans RST files directly instead of requiring needs.json
- cmd_prune no longer calls load_needs
@bburda bburda merged commit 045e8b2 into main Apr 2, 2026
6 checks passed
@bburda bburda deleted the feat/prune-command branch April 2, 2026 16:16
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.

2 participants