Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 41 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:
pip install ruff

- name: Lint with ruff
run: ruff check src/
run: ruff check src/ tests/

- name: Format check with ruff
run: ruff format --check src/
run: ruff format --check src/ tests/

test:
test-unit:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -47,8 +47,8 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install package
run: pip install -e .
- name: Install package + test deps
run: pip install -e '.[mcp]' pytest pytest-cov

- name: Verify CLI entry point
run: memory --version
Expand All @@ -61,8 +61,37 @@ jobs:
python -c "from ai_memory_protocol.formatter import format_brief"
python -c "from ai_memory_protocol.rst import generate_rst_directive"
python -c "from ai_memory_protocol.config import TYPE_FILES"
python -c "from ai_memory_protocol.mcp_server import create_mcp_server; create_mcp_server()"

- name: Run unit tests
run: pytest tests/ -v -m "not integration" --cov=ai_memory_protocol --cov-report=term-missing --cov-report=html

- name: Upload coverage
if: matrix.python-version == '3.12'
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: htmlcov/

test-integration:
runs-on: ubuntu-latest
needs: [test-unit]
steps:
- uses: actions/checkout@v4

- name: Test init + add + rebuild workflow
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install package
run: pip install -e '.[mcp]' pytest pytest-timeout

- name: Run integration tests
run: pytest tests/ -v -m integration --timeout=120
continue-on-error: true

- name: Run workflow smoke test
run: |
memory init /tmp/test-memory --name "CI Test" --install
memory --dir /tmp/test-memory add fact "CI test fact" \
Expand All @@ -74,9 +103,11 @@ jobs:
memory --dir /tmp/test-memory get FACT_ci_test_fact
memory --dir /tmp/test-memory tags
memory --dir /tmp/test-memory list
memory --dir /tmp/test-memory doctor

test-mcp:
runs-on: ubuntu-latest
needs: [test-unit]
steps:
- uses: actions/checkout@v4

Expand All @@ -86,9 +117,12 @@ jobs:
python-version: "3.12"

- name: Install package with MCP extras
run: pip install -e '.[mcp]'
run: pip install -e '.[mcp]' pytest

- name: Verify MCP server imports
run: |
python -c "from ai_memory_protocol.mcp_server import create_mcp_server; create_mcp_server()"
python -c "from ai_memory_protocol.mcp_server import TOOLS; print(f'{len(TOOLS)} MCP tools registered')"

- name: Run MCP tests
run: pytest tests/test_mcp_server.py -v
42 changes: 42 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.PHONY: install install-dev install-mcp inject-mcp test test-cov test-unit test-integration lint format doctor uninstall help

install: ## Install via pipx (CLI only)
pipx install -e .

install-mcp: ## Install via pipx with MCP support
pipx install -e '.[mcp]'

install-dev: ## Install for development (editable + dev deps)
pip install -e '.[mcp]'
pip install ruff pytest pytest-cov

inject-mcp: ## Add MCP to existing pipx install
pipx inject ai-memory-protocol mcp

test: ## Run all tests
pytest tests/ -v

test-unit: ## Run unit tests only (no Sphinx needed)
pytest tests/ -v -m "not integration"

test-integration: ## Run integration tests (requires Sphinx)
pytest tests/ -v -m integration

test-cov: ## Run tests with coverage
pytest tests/ -v --cov=ai_memory_protocol --cov-report=term-missing --cov-report=html

lint: ## Run linters
ruff check src/ tests/
ruff format --check src/ tests/

format: ## Format code
ruff format src/ tests/

doctor: ## Verify installation
memory doctor

uninstall: ## Uninstall from pipx
pipx uninstall ai-memory-protocol

help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*## ' Makefile | sort | awk 'BEGIN {FS = ":.*## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "ai-memory-protocol"
version = "0.2.0"
version = "0.3.0"
description = "AI Memory Protocol — versioned, graph-based memory for AI agents using Sphinx-Needs"
readme = "README.md"
license = { text = "Apache-2.0" }
Expand Down Expand Up @@ -44,6 +44,7 @@ memory-mcp-stdio = "ai_memory_protocol.mcp_server:main_stdio"
dev = [
"ruff>=0.8",
"pytest>=8.0",
"pytest-cov>=6.0",
"pre-commit>=4.0",
]

Expand Down Expand Up @@ -71,3 +72,7 @@ known-first-party = ["ai_memory_protocol"]

[tool.pytest.ini_options]
testpaths = ["tests"]
markers = [
"integration: marks tests that require Sphinx build (deselect with '-m \"not integration\"')",
]
addopts = "-ra --strict-markers"
2 changes: 1 addition & 1 deletion src/ai_memory_protocol/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""AI Memory Protocol — versioned, graph-based memory for AI agents."""

__version__ = "0.2.0"
__version__ = "0.3.0"
Loading