Conversation
added 3 commits
February 24, 2026 05:45
Consolidates AgentSoulDirective, AgentMemoryDirective (and the new AgentUserDirective) into a single CoreMemoryFilesDirective backed by the datamachine_memory_files WordPress filter. - One directive loads all core memory files (SOUL.md, USER.md, MEMORY.md) - Files registered via filter with internal priority ordering - Plugins/themes can add, remove, or reorder files via the same filter - No deletion protection — all memory files are equal - Migration creates USER.md with default template on upgrade - Removes 2 directive classes, adds 1 — net reduction in code
Extracts memory file registration into a dedicated MemoryFileRegistry class with register/deregister/is_registered/get_all/get_filenames API. - Registry is a pure empty container — no hardcoded files - Default files (SOUL.md, USER.md, MEMORY.md) register in bootstrap through the same API any plugin or theme would use - CoreMemoryFilesDirective simplified to just read from the registry - MemoryFileRegistry autoloads via Composer PSR-4 (no require_once)
Legacy migration from DB to files and default file seeding are no longer needed. The directive skips missing files gracefully — users create memory files when they're ready. No auto-creation, no hardcoded filenames bypassing the registry.
chubes4
commented
Feb 24, 2026
Member
Author
chubes4
left a comment
There was a problem hiding this comment.
Clean refactor. Two classes → one directive + MemoryFileRegistry with filter-driven extensibility. USER.md as a default is smart.
One issue: AgentMemoryMigration.php is deleted entirely. That handles first-run creation of SOUL.md and MEMORY.md for new installs. Without it, a fresh DM install gets no default files on disk. MemoryFileRegistry::register() just registers filenames — it doesn't create files. You need a bootstrap/ensure step somewhere, even if simpler than the old migration class.
Also: the AgentPing::register() line in data-machine.php is missing indentation and leading backslash — looks like bleed from #309, not this PR.
Fresh installs need starter SOUL.md and MEMORY.md templates. The removed AgentMemoryMigration handled this — replace with a lightweight function in the activation hook. Existing files are never overwritten. USER.md intentionally omitted (user-created).
All three registered memory files should get starter templates — no reason to treat USER.md differently from SOUL.md and MEMORY.md.
- Remove agent_soul and global_system_prompt from SettingsAbilities (schema, response, save logic) — nothing reads these for AI injection since the migration was removed - Remove 3 related tests for dead settings fields - Fix use statement in bootstrap.php to fully qualified names - Fix stale '5-tier' reference in SiteContextDirective description
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the individual
AgentSoulDirectiveandAgentMemoryDirectivewith a singleCoreMemoryFilesDirectivebacked by a WordPress filter registry. AddsUSER.mdas a new default memory file. Removes deletion protection — all memory files are equal.Before → After
Design
datamachine_memory_filesfilter — the single registry for all core memory filesfile(filename) andpriority(sort order)What changed
CoreMemoryFilesDirective.phpAgentSoulDirective.phpAgentMemoryDirective.phpbootstrap.phpAgentMemoryMigration.phpFileAbilities.phpExtensibility example
Net: -164 lines, +214 lines (includes new USER.md template + ensure method). Removes 2 classes, adds 1.