Skip to content

Add capture modules, auto-summaries, and documentation updates#7

Merged
bburda merged 4 commits intomainfrom
feat/capture-modules
Feb 10, 2026
Merged

Add capture modules, auto-summaries, and documentation updates#7
bburda merged 4 commits intomainfrom
feat/capture-modules

Conversation

@bburda
Copy link
Owner

@bburda bburda commented Feb 10, 2026

Summary

Complete the autonomous memory lifecycle by adding CI capture, discussion capture, and the auto-summaries planner detector — the final pieces of the v0.3.0 implementation plan (62/62 items done).

This PR enables AI agents to:

  • Extract memories from CI/test logs — test failures, compiler errors, deprecation warnings, timeouts, CMake errors
  • Extract memories from conversation transcripts — classifies into decisions, facts, preferences, risks, goals, and questions
  • Auto-detect memory consolidation opportunities — groups old observations by topic and proposes summarization into facts

Changes

New Features

CI Capture (capture.py)

  • capture_from_ci(log_text) — parses CI/test log output using pattern matching
  • Detects 5 signal types: test failures (FAILED/ERROR), compiler errors, deprecation warnings, timeout errors, CMake configuration errors
  • Returns structured MemoryCandidate objects with confidence levels and source attribution

Discussion Capture (capture.py)

  • capture_from_discussion(transcript) — classifies conversation lines into memory candidates
  • Recognizes 6 patterns: decisions ("let's use", "we should"), facts ("is at", "uses"), preferences ("prefer", "always"), risks ("risk", "fragile"), goals ("goal", "milestone"), questions ("should we", "how do")
  • Deduplicates overlapping matches, keeps highest-confidence per line

Auto-Summaries Detector (planner.py)

  • detect_auto_summaries(needs, min_count=5, min_age_days=60) — groups active mem entries by topic: tag
  • When ≥5 observations on a single topic are older than 60 days, proposes a SUPERSEDE action to consolidate them into one fact
  • Collects all tags from the group for the consolidated entry
  • Registered as the 7th planner check in ALL_CHECKS and _DETECTORS

MCP Tools (mcp_server.py)

  • memory_capture_ci — expose CI capture via MCP (log_text input)
  • memory_capture_discussion — expose discussion capture via MCP (transcript input)
  • Total MCP tools: 11 → 13

CLI Commands (cli.py)

  • memory capture ci --input <file> — reads from file or stdin
  • memory capture discussion --input <file> — reads from file or stdin
  • Both support --auto-add and --rebuild flags

Documentation

  • README.md — added memory doctor to CLI reference table

Tests

  • 38 new tests across 2 files:
    • test_capture.py — 30 tests: CI capture (test failures, compiler errors, deprecation warnings, timeouts, CMake errors, multi-signal, empty input) + discussion capture (decisions, facts, preferences, risks, goals, questions, deduplication, empty input)
    • test_planner.py — 8 tests: auto-summaries detection (finds candidates, includes all IDs, collects tags, skips below threshold, skips recent entries, skips non-mem types, skips deprecated, custom thresholds)
  • Updated test_mcp_server.py assertion: 11 → 13 tools

- capture_from_ci(): parse test failures, compiler errors, deprecation
  warnings, timeouts, and CMake errors from CI log text
- capture_from_discussion(): classify conversation statements into
  decisions, facts, preferences, risks, goals, and questions
- CLI: 'memory capture ci' and 'memory capture discussion' subcommands
  with --input (file/stdin), --source-label, --extra-tags
- MCP: memory_capture_ci and memory_capture_discussion tools (13 total)
- README: autonomous workflow, build-as-guardian, human role sections;
  updated CLI reference, MCP tools table, project structure
- 37 new tests covering both capture modules (242 total passing)
detect_auto_summaries() finds topics with ≥5 mem entries older than
60 days and proposes consolidating them into a single fact.

Configurable via min_count and min_age_days parameters.
Registered in ALL_CHECKS and _DETECTORS as 'auto_summaries'.
8 new tests (250 total passing).
Copilot AI review requested due to automatic review settings February 10, 2026 08:23
@bburda bburda changed the title Feat/capture modules Add capture modules, auto-summaries, and documentation updates Feb 10, 2026
@bburda bburda review requested due to automatic review settings February 10, 2026 08:25
@bburda bburda self-assigned this Feb 10, 2026
@bburda bburda requested a review from Copilot February 10, 2026 09:24
Copy link

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

Completes the “autonomous memory lifecycle” v0.3.0 plan by adding capture pipelines for CI logs and discussion transcripts, plus a planner detector that proposes consolidation of older observations into summarized facts.

Changes:

  • Add CI and discussion capture logic (with new CLI + MCP entrypoints) to generate MemoryCandidates and optionally auto-add them to a workspace.
  • Add detect_auto_summaries planner check to propose SUPERSEDE actions for consolidating many old mem entries by topic: tag.
  • Expand documentation and tests to cover the new capture modes, MCP tool registrations, and planner behavior.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/ai_memory_protocol/capture.py Adds CI log parsing + discussion transcript classification to generate memory candidates.
src/ai_memory_protocol/cli.py Extends memory capture to support ci and discussion sources plus auto-add workflow.
src/ai_memory_protocol/planner.py Adds detect_auto_summaries and registers it as a planner check.
src/ai_memory_protocol/mcp_server.py Adds MCP tools + handlers for CI/discussion capture.
tests/test_capture.py Adds CI/discussion capture unit tests.
tests/test_planner.py Adds unit tests for detect_auto_summaries.
tests/test_mcp_server.py Updates MCP tool-count expectations and required tool names.
README.md Documents new CLI commands, MCP tools, and the autonomous workflow.

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

- Add 'auto_summaries' to memory_plan MCP tool schema enum
- Filter empty strings from extra_tags split in CLI (ci + discussion)
- Use set instead of list for by_topic in detect_auto_summaries to
  prevent duplicate IDs when a need has the same topic tag twice
- Evaluate all matching patterns in _classify_statement and return
  highest-confidence classification instead of first match
@bburda bburda merged commit 7d399b3 into main Feb 10, 2026
6 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