Skip to content

test: add directive discoverability regression tests#572

Merged
buildingjoshbetter merged 1 commit into
mainfrom
fix/568-discoverability-tests
Jun 8, 2026
Merged

test: add directive discoverability regression tests#572
buildingjoshbetter merged 1 commit into
mainfrom
fix/568-discoverability-tests

Conversation

@buildingjoshbetter

Copy link
Copy Markdown
Owner

Summary

Add 17 regression tests covering all 4 Claude-facing directive discoverability surfaces, preventing silent degradation in future PRs.

Fixes #568

Root Cause

Zero tests existed to verify that CLAUDE_TEMPLATE.md, MCP instructions, tool schemas, and session start hook correctly expose directive functionality to Claude. Any future edit to these surfaces could silently break directive discoverability.

Fix

New test file tests/test_directives_discoverability.py with 17 tests across 4 surfaces:

Surface 1 — CLAUDE_TEMPLATE.md (4 tests):

  • Template mentions directives
  • Auto-Store section has directive=True guidance
  • Template includes trigger phrases (always, never)
  • Auto-Recall section mentions directives

Surface 2 — MCP instructions (5 tests):

  • Directives section exists
  • Storing section cross-references directives
  • Trigger phrases (always do, never do, from now on)
  • Management guidance (truememory_forget)
  • Contradiction handling

Surface 3 — Tool schemas (5 tests):

  • truememory_store has directive param with default False
  • truememory_store docstring documents directive
  • truememory_directives exists and has docstring
  • truememory_forget exists
  • truememory_forget has alwaysLoad meta

Surface 4 — Session start hook (3 tests):

  • Directives block appears before context block
  • Directive content not duplicated in context block
  • Zero directives produces no directives block

Dependency Impact

  • New test file only — no production code changes
  • Tests import from truememory.mcp_server and truememory.ingest.hooks.session_start

Test Plan

  • All 17 tests pass: pytest tests/test_directives_discoverability.py → 17 passed
  • Full suite: 1061 passed, 6 skipped, 0 new failures

@buildingjoshbetter buildingjoshbetter merged commit 1dd80b4 into main Jun 8, 2026
5 of 11 checks passed
@buildingjoshbetter buildingjoshbetter deleted the fix/568-discoverability-tests branch June 11, 2026 13:29
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.

No discoverability regression tests for directives

1 participant