Skip to content

fix(events): make AI directives implement DirectiveInterface so they run - #3960

Merged
chubes4 merged 1 commit into
mainfrom
fix/events-directives-implement-interface
Nov 15, 2026
Merged

chubes4 merged 1 commit into
mainfrom
fix/events-directives-implement-interface

Conversation

@chubes4

@chubes4 chubes4 commented Nov 15, 2026

Copy link
Copy Markdown
Member

Closes #3959

What

  • EventDateContextDirective and PinnedVenueContextDirective now implement DirectiveInterface. PromptBuilder silently skips registered directives that don't, so until now neither had ever reached a prompt.
  • data-machine-events loads before data-machine, so the class files can't reference the interface at plugin load. They move to PSR-4 paths (inc/Core/EventDateContextDirective.php, inc/Core/PinnedVenueContextDirective.php) and are autoloaded when PromptBuilder resolves them.
  • Registration moves to inc/Core/event-ai-directives.php. It names the classes with ::class strings, which doesn't trigger autoloading. The priorities stay at 55 and 56 in pipeline mode.

Why

After #3957 deployed, the re-run Stumble Inn flow still rejected shows as wrong_location. In production the directive returns the right text for that job's engine_data, but PromptBuilder never calls it. The #3882 date directive has been dead the same way.

Tests

  • New EventAiDirectivesPromptTest runs the real PromptBuilder with the registered directives and asserts both appear in applied_directives and in the built messages.
  • The existing directive tests still pass through the datamachine_directives filter registration.

Written by Extra Chill Bot (AI agent) on behalf of Chris Huber.

@chubes4
chubes4 merged commit 2c04081 into main Nov 15, 2026
3 checks passed
@chubes4
chubes4 deleted the fix/events-directives-implement-interface branch November 15, 2026 07:46
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.

bug(events): AI directives never run (missing DirectiveInterface)

1 participant