Conversation
Add pytest test suite with conftest fixtures (tmp_workspace, sample_needs, needs_json_file) and tests for all core modules: - test_config: type file mappings, ID prefix generation, labels - test_engine: workspace discovery, needs loading, search, graph traversal - test_formatter: brief, compact, context, full output formats - test_rst: directive generation, RST append/update, tag operations - test_scaffold: workspace initialization, conf.py, idempotency - test_cli: integration tests for CLI subcommands Add pytest-cov dependency, integration test markers, and Makefile with install/test/lint targets.
Add 4-job CI workflow on Ubuntu 24.04 with Python 3.12: - lint: ruff check + ruff format --check - test-unit: pytest with integration marker exclusion - test-integration: Sphinx build-dependent tests - test-mcp: MCP server tool tests Triggers on push to main and pull requests.
Add 'memory doctor' command that validates the installation environment: - CLI entry point availability and version - Workspace directory detection - sphinx-build discoverability - needs.json loadability and memory count - MCP SDK installation status - MCP server instantiation - RST file integrity in memory directory Reports pass/fail status for each check with actionable fix suggestions.
Add read-only analysis engine that detects maintenance issues: - Duplicate detection via fuzzy title matching (SequenceMatcher >= 0.8) combined with tag overlap (>= 50% Jaccard similarity) - Missing tag detection (entries without topic: or repo: tags) - Stale entry detection (expired or review-overdue memories) - Conflict detection (unlinked decisions on the same topic) - Tag normalization (case-insensitive deduplication) - Split file detection (RST files exceeding 50 entries) Generates Action dataclass objects describing recommended fixes. Includes run_plan() orchestrator and format_plan() for human/JSON output.
Add action execution engine that applies planner-generated actions: - RETAG: add/remove tags on existing memories - SUPERSEDE: replace old memory with new, linking via supersedes field - DEPRECATE: mark memories as deprecated with optional replacement - UPDATE: modify arbitrary fields (status, confidence, etc.) - PRUNE: remove entries from RST files - SPLIT_FILE: informational — notes files needing split Safety features: - Pre-validation with circular supersede chain detection - Git stash/pop rollback on Sphinx rebuild failure - Optional auto-commit after successful execution - ExecutionResult with applied/failed/skipped tracking
Add git log analysis that generates memory candidates from commit history: - Conventional commit classification: fix->mem, feat->fact, refactor->dec, BREAKING->risk, style->pref, docs->fact - Scope extraction from conventional commit format (e.g., feat(api): ...) - Tag inference from commit scope and changed file paths - Related commit grouping by file overlap (Jaccard >= 0.3) - Deduplication against existing memories using fuzzy title matching (SequenceMatcher >= 0.8) and tag overlap (>= 50%) Supports configurable git range (--since/--until), minimum confidence filtering, and human/JSON output formats.
Integrate planner, executor, and capture modules into the CLI: - 'memory plan': analyze memory graph and generate maintenance actions. Supports --checks filter and --format (human/json) output. - 'memory apply': execute planned actions from JSON file (--file) or by running plan inline (--plan). Supports --auto-commit, --no-rebuild, and -y/--yes for non-interactive use. - 'memory capture git': extract memory candidates from git commit history. Supports --repo, --since/--until range, --min-confidence filter, --auto-add for direct ingestion, and --format output control.
Add 3 new MCP tools for LLM agent integration (11 total): - memory_plan: analyze memory graph and return maintenance suggestions. Accepts optional checks filter and format parameter. - memory_apply: execute a list of planned actions with rollback safety. Accepts actions array and optional auto_commit flag. - memory_capture_git: extract memory candidates from git commit history. Supports repo_path, date range, confidence filter, and auto_add mode. Update MCP test assertions to verify all 11 tools are registered.
- Fix import sorting (I001) across cli.py and test files - Remove unused imports (F401) in test_engine, test_formatter, test_rst - Combine nested with statements (SIM117) in test_capture - Add noqa comments for E402 in mcp_server.py (post-try/except imports) - Rename unused loop variable (B007) in test_executor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 21 changed files in this pull request and generated 17 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- capture.py: Use record/field separators (0x1e/0x1f) for git log parsing
to handle multi-line commit bodies safely; fix since/until handling to
distinguish date expressions from ref ranges; add explanatory comment
on bare except clause
- executor.py: Check returncode in _git_stash_push before inspecting
stdout; treat build failure as unsuccessful regardless of stash state;
set success=False when any actions failed
- planner.py: Set field_changes={'status':'review'} in detect_conflicts
instead of empty dict; raise ValueError for unknown check names
- mcp_server.py: Fix pipx install syntax from 'ai_memory_protocol/[mcp]'
to '.[mcp]'
- cli.py: Remove unnecessary lambda wrappers around no-arg callables
- ci.yml: Add --cov-report=html for htmlcov/ artifact upload; add
pytest-timeout to integration test dependencies
- Run ruff format on all files to fix formatting CI failure
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.
No description provided.