refactor: replace agent identity directives with context directives#828
Merged
refactor: replace agent identity directives with context directives#828
Conversation
The old model had each context (chat, pipeline, system) defining its own
AI persona ('you are a decisive configuration specialist', 'you are an AI
content processing agent', 'you are a system infrastructure specialist').
This competed with the agent's actual identity in SOUL.md/MEMORY.md which
is already injected via CoreMemoryFilesDirective.
New model: memory files define identity, directives provide context.
Renames:
- ChatAgentDirective → ChatContextDirective
- PipelineCoreDirective → PipelineContextDirective
- SystemAgentDirective → SystemContextDirective
Priority change: 10/15/20 → all 25 (after memory files at 20)
Content: prompts now say 'this is a chat session / pipeline step / system
task' and reference the memory files above, instead of declaring a new
persona.
Also fixes 3 directives that were silently not loading because their files
had add_filter side effects but no require_once in bootstrap.php:
- SiteContextDirective (WordPress metadata for all contexts)
- DailyMemorySelectorDirective (daily memory for pipelines)
- SystemContextDirective (system task context)
Includes system task prompt rewrites: DailyMemoryTask, AltTextTask,
MetaDescriptionTask, InternalLinkingTask — removes 'you are a system
agent' framing, references agent's own memory instead.
Homeboy Results —
|
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
The directive system had 3 "agent identity" directives that each created a competing AI persona on top of the memory files (SOUL.md, MEMORY.md) that already define who the agent is.
Old model — directives define identity:
ChatAgentDirective(priority 15): "You are a decisive configuration specialist"PipelineCoreDirective(priority 10): "You are an AI content processing agent"SystemAgentDirective(priority 20): "You are a system infrastructure specialist"These fired before memory files (priority 20), overriding the agent's real identity before it even loaded.
New model — memory files define identity, directives provide context:
ChatContextDirective(priority 25): "This is a live chat session..."PipelineContextDirective(priority 25): "This is an automated pipeline step..."SystemContextDirective(priority 25): "This is a background system task..."All at priority 25, after memory files at 20. They tell the agent what it's doing, not who it is.
Bug fix: 3 directives silently not loading
Discovered that
SiteContextDirective,DailyMemorySelectorDirective, andSystemAgentDirectivehadadd_filterside effects but norequire_oncein bootstrap.php — so their filters never registered. Added the missing requires.System task prompt rewrites
All 4 AI-using system tasks rewritten to drop "you are a system agent" framing and reference the agent's own memory instead.