Skip to content

Require explicit memory modes for prompt injection#1802

Merged
chubes4 merged 2 commits intomainfrom
fix-noninjectable-memory-files
May 6, 2026
Merged

Require explicit memory modes for prompt injection#1802
chubes4 merged 2 commits intomainfrom
fix-noninjectable-memory-files

Conversation

@chubes4
Copy link
Copy Markdown
Member

@chubes4 chubes4 commented May 6, 2026

Summary

  • Treat memory files without explicit modes as registered/manageable but not prompt-injected.
  • Keep prompt injection explicit by defaulting omitted modes to retrieval_policy: never and filtering non-eager files from get_for_mode().
  • Add explicit MODE_ALL opt-ins for Data Machine core memory files that should remain injected, plus regression coverage for external runtime files.

Why

AGENTS.md and similar convention files exist for external runtimes with filesystem/WP-CLI access, not for AI prompt memory. Previously, omitted modes defaulted to all, so external-only files were injected into pipeline AI requests as noise.

Testing

  • php -l inc/Engine/AI/MemoryFileRegistry.php
  • php -l inc/bootstrap.php
  • php -l tests/Unit/AI/Memory/MemoryPolicyResolverTest.php
  • homeboy test data-machine currently fails one unrelated existing test: DataMachine\\Tests\\Unit\\Abilities\\ImageGenerationPromptRefinementTest::test_refine_prompt_includes_post_context_when_provided expects Article context: but receives an empty string. The memory policy tests passed in the full run.

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenCode (GPT-5.5)
  • Used for: Root-cause tracing, implementation, and test updates; Chris reviewed the architecture and directed the explicit opt-in behavior.

@chubes4 chubes4 merged commit c0ef3b5 into main May 6, 2026
1 of 3 checks passed
@chubes4 chubes4 deleted the fix-noninjectable-memory-files branch May 6, 2026 15:43
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