Skip to content

docs: fix drift in Testing - #267

Draft
jack-arturo wants to merge 1 commit into
mainfrom
docs/audit-development-testing-20260728
Draft

docs: fix drift in Testing#267
jack-arturo wants to merge 1 commit into
mainfrom
docs/audit-development-testing-20260728

Conversation

@jack-arturo

Copy link
Copy Markdown
Member

Automated docs-accuracy audit of docs/development/testing. Draft because several fixes rewrite code samples, not just links.

Claim Current state Fix Evidence
calculate_relevance_score(memory_id=…, importance=…, access_count=…, last_accessed=…, created_at=…) in the "Writing New Tests" sample The method takes a single memory dict plus an optional current_time; it reads id, timestamp, last_accessed, importance, confidence off that dict. The documented call raises TypeError. Rewrote the sample to pass one memory dict, matching the real test automem@8ff266e:consolidation.py#L227-L228, tests/test_consolidation_engine.py#L52-L58
FakeGraph at tests/support/fake_graph.py:35-795, linked at SHA 3ae04bf6 class FakeGraph starts at L42 and runs to the end of the 847-line file; the SHA was 4 automem releases stale Anchor → #L42-L847; refreshed all 4 automem permalinks to 8ff266e6 automem@8ff266e:tests/support/fake_graph.py#L42
Mock state read via graph.query_history, graph.deleted_nodes, graph.archived_nodes, graph.updated_scores.get(...), vector_store.deleted_ids None of those attributes exist. Real names: graph.queries (list of (query, params) tuples), graph.deleted (list of IDs), graph.archived / graph.updated_scores (lists of (id, score) tuples), vector_store.deletions (list of (collection, selector) tuples) Corrected every assertion snippet and the two apply_controlled_forgetting samples fake_graph.py#L50, #L73-L75, test_consolidation_engine.py#L19-L24, #L281-L286
sample_rows = [id, content, importance, count]; cluster_rows = [id, content, embedding]; decay_rows = list of dicts Real shapes are [id, content, type, embedding, timestamp], [id, content, embedding, type], and [id, content, last_accessed, importance, timestamp, relevance_score] — all plain List[List[Any]] rows, never dicts Corrected all three samples and noted the row convention test_consolidation_engine.py#L73-L77, #L105-L109, #L292-L295
mcp-automem CI workflow linked at blob/main Branch-pinned link Converted to a SHA permalink mcp-automem@946f9e5:.github/workflows/ci.yml

Verified against: verygoodplugins/automem@8ff266e
Verified against: verygoodplugins/mcp-automem@946f9e5

Checked and found correct, left untouched: the pytest marker table (unit/integration/live all defined in pytest.ini, AUTOMEM_ALLOW_LIVE=1 gate confirmed in tests/test_integration.py), every consolidation.py line range in the Test Architecture mermaid diagram, the FakeResult (:9-11), FakeVectorStore (:19-24) and freeze_time (:27-39) anchors, requirements-dev.txt, and the whole mcp-automem Vitest section (script names, test:all composition, continue-on-error coverage step, and the 5 CI steps in order).

Questions

  • The "Test Suite Organization" tree lists 11 of the 35 files now under tests/ and omits the tests/lab/ directory. Is that an intentional "representative sample", or should it track the real tree?

Unverified

None — every code-anchored claim on this page resolved to current source.

Follow-ups

Beyond the 5-fix cap:

  1. Stale scope prose (line 18). "Currently, the test suite focuses on consolidation logic. API endpoints and background workers are validated through manual testing and production monitoring." This contradicts the coverage table 40 lines below it (which marks Flask API endpoints as Covered) and the repo, which now has test_api_endpoints.py, test_app.py, test_service_runtime.py, and ~30 more.
  2. tests/ tree is out of date — see the question above; tests/lab/ and roughly 20 test files are missing.
  3. Coverage tables ("Coverage by Component", "Test Coverage Report") predate the current suite and were not re-derived in this pass.

Generated by Claude Code

Verified against automem@8ff266e6 and mcp-automem@946f9e5e.

- calculate_relevance_score() example used a signature that does not exist
- FakeGraph deep link pointed at the wrong line range; refreshed stale SHAs
- mock state attributes (queries/deleted/archived/deletions) were wrong
- sample_rows/cluster_rows/decay_rows column shapes were wrong
- converted the branch-pinned mcp-automem ci.yml link to a permalink

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XQCAKtAw2NRatRuYVEfDcv
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying automem-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 55be495
Status: ✅  Deploy successful!
Preview URL: https://95af2a44.automem-website.pages.dev
Branch Preview URL: https://docs-audit-development-testi-y53o.automem-website.pages.dev

View logs

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