Agents API Extraction Map

This map classifies Data Machine’s current agent/runtime surface for the Agents API extraction. The in-repo module phase is complete: Data Machine now consumes the standalone extra-chill/agents-api package/plugin for public contracts while keeping Data Machine product adapters in this repository.

Parent issue: Explore splitting Agents API out of Data Machine

Strategy update: Agents API blocker: update extraction docs around in-repo module strategy

Related blockers: standalone extraction umbrella, standalone skeleton plan (docs), in-repo module boundary, candidate relocation, wp-ai-client dependency contract, built-in loop ownership, backend-only boundary, agent category/capability metadata, REST surface decision, registration lifecycle, core-shape readiness checklist, one-shot AI boundary, and ai-http-client removal.

Namespace Map

Public contracts inside agents-api/ use neutral AgentsAPI... namespaces. Data Machine imports these contracts as a consumer; no compatibility alias ladder is maintained while Data Machine remains pre-1.0.

Former Data Machine namespaceAgents API namespace
DataMachineEngineAIAgentMessageEnvelopeAgentsAPIAIAgentMessageEnvelope
DataMachineEngineAIAgentConversationResultAgentsAPIAIAgentConversationResult
DataMachineEngineAIToolsRuntimeToolDeclarationAgentsAPIAIToolsRuntimeToolDeclaration
DataMachineCoreDatabaseChatConversationTranscriptStoreInterfaceAgentsAPICoreDatabaseChatConversationTranscriptStoreInterface
DataMachineCoreFilesRepositoryAgentMemoryStoreInterfaceAgentsAPICoreFilesRepositoryAgentMemoryStoreInterface
DataMachineCoreFilesRepositoryAgentMemoryScopeAgentsAPICoreFilesRepositoryAgentMemoryScope
DataMachineCoreFilesRepositoryAgentMemoryReadResultAgentsAPICoreFilesRepositoryAgentMemoryReadResult
DataMachineCoreFilesRepositoryAgentMemoryWriteResultAgentsAPICoreFilesRepositoryAgentMemoryWriteResult
DataMachineCoreFilesRepositoryAgentMemoryListEntryAgentsAPICoreFilesRepositoryAgentMemoryListEntry

Current Strategy

The first phase built Agents API as an in-repo module:

text
data-machine/
  agents-api/
    agents-api.php
    inc/
    tests/
  inc/
    ...Data Machine pipelines/product code...

Data Machine now treats the standalone extra-chill/agents-api package/plugin as that substrate:

  • agents-api must not import Data Machine product namespaces.
  • Data Machine may import and consume agents-api as product code.
  • agents-api owns runner interfaces, value objects, and generic contracts first; Data Machine keeps AIConversationLoop and the built-in compatibility runner while they still carry Data Machine job, flow, handler, logging, transcript, and legacy result-shape assumptions.
  • Data Machine keeps flows, pipelines, jobs, handlers, queues, retention, pending actions, content operations, and admin UI.
  • agents-api is backend-only and invisible by default: no admin menus, screens, human CRUD forms, React apps, or Data Machine product UI.
  • Data Machine and other product consumers own any admin/product UI they build on top of the substrate.
  • Standalone extraction means the bounded module now lives in its own plugin/repo with plugin bootstrap, release, dependency, and distribution ceremony.
  • ai-http-client is not future architecture. It is only packaging precedent for bundled-then-extracted code.
  • The future provider primitive is wp-ai-client, not Agents API. ai-http-client dies as part of #1027 / #1633.
  • One-shot AI operations call wp-ai-client directly. Durable agent runs use Agents API, and Agents API provider code consumes wp-ai-client directly inside that runtime.
  • Data Machine pipeline AI steps should not move to Agents API solely for provider dispatch. They only need Agents API when the product needs durable runtime semantics such as sessions, locks, memory composition, event sinks, multi-turn tool loops, or portable agent declarations.
text
Abilities API  -> actions and tools
wp-ai-client   -> provider/model prompt execution
Agents API     -> durable agent runtime behavior
Data Machine   -> automation product built on those substrates

Target Vocabulary

Mirror the WordPress Abilities API shape instead of importing Data Machine product names or host-specific implementation names into the public contract.

Current Data Machine surfacePossible Agents API vocabularyNotes
wp_register_agent()wp_register_agent()Same declarative pattern as Abilities API-style registration; no DB reconciliation side effects in the public helper.
WP_Agent / WP_Agents_RegistryWP_Agent / WP_Agents_RegistryRegistry collects definitions. Persistence/adoption remains Data Machine adapter territory.
wp_agents_api_initwp_agents_api_initCore-shaped init hook mirrored in-place while Data Machine hosts the substrate.
Agent categoriesNo v1 registry#1669 decides against WP_Agent_Category parity for v1. Future metadata/annotations may describe agents but must not grant permission or visibility.
AgentMessageEnvelopeWP_Agent_Message or same class nameContract is generic and now uses Agents API-shaped vocabulary in place.
ConversationTranscriptStoreInterfaceWP_Agent_Conversation_Transcript_Store_InterfaceTranscript CRUD is the first extractable storage contract. Keep chat-product listing/read-state/reporting separate.
AgentMemoryStoreInterfaceWP_Agent_Memory_Store_InterfaceGeneric identity tuple needs naming review; Data Machine scaffolding/abilities stay outside the store contract.
RuntimeToolDeclarationWP_Agent_Tool_DeclarationShould stay ability-native and run-scoped.
LoopEventSinkInterfaceWP_Agent_Run_Event_Sink_InterfaceUseful for logs, streaming, chat UIs, and async workers.
REST datamachine/v1 agent routesREST wp-agents/v1 deferred#1670 reserves the namespace but defers public REST controllers from the first standalone extraction. Data Machine product routes stay under datamachine/v1.

Registration Lifecycle

wp_agents_api_init intentionally mirrors the Abilities API registration window where practical: the module wires registry initialization to WordPress init, callbacks register definitions only while the public hook is running, and reads after initialization do not replay the hook.

Lifecycle concernAbilities API shapeAgents API in-repo shape
Bootstrap hookWordPress fires wp_abilities_api_init during init.agents-api/agents-api.php hooks WP_Agents_Registry::init() to init, which fires wp_agents_api_init.
Registration helper timingwp_register_ability() is valid only during wp_abilities_api_init.wp_register_agent() is valid only during wp_agents_api_init; calls before or after the hook return null and emit _doing_it_wrong().
Pre-init readsRegistry access before init is invalid.WP_Agents_Registry::get_instance() returns null before init and emits _doing_it_wrong(); public getters return empty/null/false.
Lazy readsReads do not reopen the registration window after the hook has fired.wp_get_agents(), wp_get_agent(), and Data Machine reconciliation read the initialized registry without refiring wp_agents_api_init.
MaterializationAbilities are registered definitions; consumers decide how to use them.Agent definitions are registered definitions; Data Machine materializes rows at init priority 15 after registration has completed.
DivergenceAbilities are executable REST-discoverable units with categories.Agents stay backend-only in v1: no category registry, no public wp-agents/v1 routes, and no persistence side effects in wp_register_agent().

The remaining intentional divergence is product ownership, not hook timing: Data Machine owns today’s materializer, tables, agent directories, access rows, scaffolding, and admin/CLI product surfaces while standalone Agents API owns only backend registration vocabulary and generic runtime contracts.

Boundary Rules

Use these checks before moving anything:

  • If a plugin can use it without knowing about flows, pipeline steps, handlers, queues, jobs, or Data Machine content operations, it is an Agents API candidate.
  • If it translates Data Machine concepts into runtime concepts, it is a Data Machine adapter.
  • If it owns flows, jobs, queues, handlers, scheduled automation, retention, admin UI, or content ops, it stays Data Machine product.
  • If it uses host-specific provider, storage, or implementation vocabulary directly, treat that code as source material only until normalized behind WordPress-shaped contracts.
  • If it only needs to execute a single prompt/model request, it should use wp-ai-client directly instead of introducing Agents API.
  • If it needs durable agent runtime behavior, it should use Agents API and let that runtime call wp-ai-client directly for provider execution.

Backend-Only UI Boundary

Agents API is a generic WordPress-shaped substrate. It should be usable by any plugin that wants to register, run, persist, or observe agents without adopting Data Machine as a product.

agents-api may own backend contracts and implementations for:

  • registration vocabulary and registries.
  • runtime request/result/message contracts.
  • memory, transcript, tool, event, and permission-ceiling contracts.
  • direct public WordPress APIs such as Abilities API and wp-ai-client.
  • durable agent runtime behavior built above those public APIs.

agents-api must not own product/admin surfaces:

  • admin menus, screens, list tables, settings forms, or React admin apps.
  • human agent CRUD screens or workflows.
  • Data Machine flow, pipeline, chat, bundle, queue, job, retention, or content-operation UI.

Substrate CRUD is allowed when it is backend-only and generic: interfaces/services for definitions, sessions, memories, transcripts, tools, and run state. Product CRUD belongs to consumers: screens, forms, routes, workflows, and opinionated management UX. Data Machine may provide those product surfaces while consuming agents-api; the dependency direction must not reverse.

Category And Metadata Boundary

Abilities API categories are not copied into Agents API v1.

Core’s Abilities API uses categories because abilities are many small executable actions. Category registration validates ability definitions, powers REST category discovery, and lets clients filter GET /wp-abilities/v1/abilities by action class. Agents are different: an agent is a runtime definition whose executable surface is its abilities/tool declarations, memory policy, run request, and permission ceiling.

The v1 boundary is therefore:

  • No WP_Agent_Category, WP_Agent_Categories_Registry, or wp_register_agent_category() in the first standalone module.
  • No category-based permission, tool policy, memory policy, or REST visibility.
  • Data Machine UI grouping stays Data Machine product behavior.
  • Future WP_Agent metadata can carry descriptive fields such as type, capabilities, or annotations, but those fields are non-authoritative unless a later issue gives them explicit semantics.

If a future REST or UI consumer proves category parity is needed, it should be added with Abilities API-style registration timing and validation instead of inferred from free-form metadata.

REST Boundary

wp-agents/v1 is reserved for a future backend substrate REST namespace, but the first standalone extraction should ship without public REST controllers.

Reasons:

  • The PHP contracts are the extraction target; REST would freeze unsettled persistence, visibility, run-state, session, transcript, and permission decisions.
  • Data Machine already owns product REST for flows, pipelines, jobs, chat/session switcher, agent files, bundles, and automation UI under datamachine/v1.
  • A generic run endpoint must use AgentConversationRunnerInterface and generic request/result schemas, not Data Machine Action Scheduler jobs or pipeline execution vocabulary.

Reserved future shape:

RouteStatusNotes
GET /wp-agents/v1/agentsDeferredLists explicitly visible registered definitions only. Requires a visibility decision before implementation.
GET /wp-agents/v1/agents/{slug}DeferredReads one visible definition. Must not expose private memory, owner state, tokens, or mutable config by default.
POST /wp-agents/v1/agents/{slug}/runsDeferredExecutes a generic run request. Needs permission ceiling, sync/async, event sink, transcript, and provider error contracts first.
Transcript, memory, session, async run-state routesDeferred separatelyThese are not implied by the namespace. Each needs its own storage and visibility decision.

Standalone skeleton docs should state that wp-agents/v1 is intentionally absent in v1. Adding REST later requires route schemas, permission callbacks, visibility flags, and non-goals that keep Data Machine product REST out of the substrate.

Bucket Summary

BucketMeaningCurrent examples
Agents API public candidateGeneric WordPress-shaped contract or value object.Message envelopes, transcript store interface, memory store interface, runtime tool declaration validation, agent registration vocabulary.
Agents API implementation candidateGeneric implementation, but naming or assumptions need cleanup first.Built-in loop, request assembly, tool executor, guideline memory store, directive renderer.
Data Machine adapterGlue that turns flows/jobs/pipelines into generic runtime inputs.AIStep, pipeline tool-policy args, transcript persistence policy, adjacent handler tools.
Data Machine productData Machine automation/product layer.Jobs, flows, pipelines, handlers, queues, retention, content abilities, admin UI.
Intelligence domainIntelligence plugin concerns, not Data Machine or Agents API.Wiki, briefings, digests, domain brains.
Host-specific source materialUseful precedent only.Provider/storage implementations that must be normalized behind WordPress-shaped contracts before they can inform Agents API.

Current EngineAI Namespace Split

The current namespace is intentionally mixed while extraction stays in place. Treat DataMachineEngineAI as a staging namespace, not as an extraction boundary. Grep for the class or subnamespace below before assuming a file is part of the future Agents API runtime.

Current namespace/surfaceBucketBoundary decision
AgentsAPIAIAgentMessageEnvelope, AgentsAPIAIAgentConversationResult, plus DataMachineEngineAIAgentConversationRequest, AgentConversationRunnerInterface, AgentConversationCompletionPolicyInterface, AgentConversationTranscriptPersisterInterface, LoopEventSinkInterfaceAgents API public candidateGeneric contracts/value objects. AgentMessageEnvelope and AgentConversationResult now live in the in-repo agents-api/ module under neutral namespaces. AgentConversationRequest keeps Data Machine job/flow/pipeline/handler/transcript fields in adapter context rather than the generic runtime payload, so it remains outside until that compatibility shape is gone.
DataMachineEngineAIBuiltInAgentConversationRunner, AIConversationLoop, RequestBuilder, RequestInspector, RequestMetadata, ConversationManagerAgents API implementation candidateRuntime implementation candidates, but still hosted by Data Machine and still carrying compatibility/provider/logging assumptions. Future provider primitive is direct wp-ai-client; ai-http-client is removal work, not an Agents API runtime layer.
AgentsAPIAIToolsRuntimeToolDeclaration, plus DataMachineEngineAIToolsExecutionToolExecutionCore, ToolsToolSourceRegistry, ToolsPolicyToolPolicyFilter, ToolsToolResultFinderMixed runtime candidateRuntimeToolDeclaration now lives in the in-repo agents-api/ module under a neutral namespace. The remaining generic-looking pieces still sit next to Data Machine adapters and should move only after their source-provider, policy, and execution boundaries are proven generic.
DataMachineEngineAIToolsSourcesDataMachineToolRegistrySource, ToolsSourcesAdjacentHandlerToolSource, ToolsPolicyDataMachineAgentToolPolicyProvider, ToolsPolicyDataMachineMandatoryToolPolicy, ToolsPolicyDataMachineToolAccessPolicy, ToolsToolManager, ToolsToolPolicyResolver, ToolsToolParameters payload mergingData Machine adapter/productThese translate Data Machine handler, pipeline, queue, permission, persisted-agent, and legacy tool registry concepts into runtime inputs. They stay Data Machine.
DataMachineEngineAIToolsGlobal*Data Machine productCurated product/site-ops tools. Individual capabilities may move to abilities later, but the bundle is not the Agents API registry.
DataMachineEngineAISystem* and SystemTasks*Data Machine productSystem tasks, task prompts, retention cleanup, and scheduled maintenance stay in Data Machine. A future Agents API may provide a task contract, not these tasks.
DataMachineEngineAIActions*Data Machine productPending-action storage, approval policy, and action-resolution abilities stay Data Machine. Generic approval can be designed later without inheriting these tables/routes.
DataMachineEngineAIMemory*, MemoryFileRegistry, SectionRegistry, ComposableFileGenerator, ComposableFileInvalidationData Machine adapter/productMemory policy artifacts and file composition are Data Machine’s operator/product layer around the generic memory store contract.
PipelineTranscriptPolicy, DataMachinePipelineTranscriptPersister, DataMachineHandlerCompletionPolicyData Machine adapterPipeline/job metadata and adjacent-handler completion are normalized for the runtime through collaborator interfaces, but the implementations stay Data Machine.

Exit rule for this in-place phase: do not physically move broad namespaces just because they sit under EngineAI. Move only once a class is generic by dependency direction, vocabulary, and tests; otherwise document it as a Data Machine adapter or product surface.

Built-In Loop Ownership Decision

The standalone agents-api package does not own Data Machine’s built-in loop implementation yet. Its current ownership line is the generic contract surface: runner interfaces, request/result value objects, message envelopes, runtime tool declarations, and collaborator contracts that a loop can depend on without knowing Data Machine product concepts.

Data Machine keeps AIConversationLoop and BuiltInAgentConversationRunner until the compatibility loop no longer needs Data Machine-owned assumptions. The loop must stay outside agents-api while it knows about or directly preserves any of these product concerns:

  • job, flow, pipeline, flow-step, handler, or queue payload keys.
  • Data Machine logging and transcript metadata.
  • adjacent-handler completion semantics.
  • historical AIConversationLoop::execute() result normalization.
  • ai-http-client / chubes_ai_* provider compatibility.

Future extraction can move a generic loop only after those concerns are pushed behind collaborators such as completion policy, transcript persister, provider caller, request assembler, event sink, and Data Machine adapters. Until then, the enforceable boundary is: agents-api defines the contract shape; Data Machine owns the built-in compatibility loop that implements it for existing pipelines and chat callers.

Agents API Public Candidate

These are closest to generic public contracts. Most should be extracted as contracts/value objects before services.

SurfaceCurrent locationWhy it fitsTarget notes
AgentMessageEnvelopeagents-api/inc/AI/AgentMessageEnvelope.phpJSON-friendly canonical message envelope independent of flows/jobs.Lives at AgentsAPIAIAgentMessageEnvelope. Review whether a future standalone extraction keeps this class name or adopts WP_Agent_Message.
AgentConversationResultagents-api/inc/AI/AgentConversationResult.phpValidates result arrays from any runtime runner.Lives at AgentsAPIAIAgentConversationResult. Future standalone extraction can rename to WP_Agent_Run_Result or split into result value object plus validator.
AgentConversationCompletionPolicyInterfaceinc/Engine/AI/AgentConversationCompletionPolicyInterface.phpGeneric runtime collaborator for deciding whether a tool result completes a run.Keep Data Machine handler semantics in adapter implementations, not in the loop contract.
AgentConversationTranscriptPersisterInterfaceinc/Engine/AI/AgentConversationTranscriptPersisterInterface.phpGeneric runtime collaborator for optional transcript persistence.Future extraction should pair this with the transcript store contract and keep job/flow metadata in Data Machine adapters.
LoopEventSinkInterfaceinc/Engine/AI/LoopEventSinkInterface.phpTransport-neutral event sink for logs, streaming, CLI, REST, or chat UIs.Make event vocabulary public and provider-neutral before extraction.
NullLoopEventSinkinc/Engine/AI/NullLoopEventSink.phpGeneric no-op implementation for optional event sinks.Implementation can move with the interface.
RuntimeToolDeclarationagents-api/inc/AI/Tools/RuntimeToolDeclaration.phpValidates run-scoped client/runtime tool declarations without Data Machine state.Lives at AgentsAPIAIToolsRuntimeToolDeclaration. Future standalone extraction can rename around WP_Agent_Tool_Declaration; keep executor/source/scope vocabulary generic.
AgentMemoryStoreInterfaceagents-api/inc/Core/FilesRepository/AgentMemoryStoreInterface.phpGeneric memory persistence seam consumed by the Data Machine agents_api_memory_store resolver hook.Lives at AgentsAPICoreFilesRepositoryAgentMemoryStoreInterface. Keep CAS/hash behavior.
AgentMemoryScopeagents-api/inc/Core/FilesRepository/AgentMemoryScope.phpEncodes memory identity independently of disk/database implementations.Review layer, user_id, agent_id, filename as the public model before standalone extraction.
AgentMemoryReadResultagents-api/inc/Core/FilesRepository/AgentMemoryReadResult.phpStore-neutral read result.Lives at AgentsAPICoreFilesRepositoryAgentMemoryReadResult.
AgentMemoryWriteResultagents-api/inc/Core/FilesRepository/AgentMemoryWriteResult.phpStore-neutral write result with hash/bytes/error shape.Lives at AgentsAPICoreFilesRepositoryAgentMemoryWriteResult.
AgentMemoryListEntryagents-api/inc/Core/FilesRepository/AgentMemoryListEntry.phpStore-neutral list entry.Lives at AgentsAPICoreFilesRepositoryAgentMemoryListEntry.
ConversationTranscriptStoreInterfaceagents-api/inc/Core/Database/Chat/ConversationTranscriptStoreInterface.phpTranscript CRUD is generic conversation persistence.Lives at AgentsAPICoreDatabaseChatConversationTranscriptStoreInterface; do not require chat UI listing/read-state/reporting for transcript-only backends.
ConversationSessionIndexInterfaceinc/Core/Database/Chat/ConversationSessionIndexInterface.phpSession listing can be generic for UIs, but it is not required for transcript persistence.Treat as optional until Agents API adopts an identity/listing model. Data Machine chat switcher uses it today.
ConversationReadStateInterfaceinc/Core/Database/Chat/ConversationReadStateInterface.phpRead-state is generic UI behavior, not transcript CRUD.Optional interface at most. Data Machine chat unread state keeps consuming it.
ConversationRetentionInterfaceinc/Core/Database/Chat/ConversationRetentionInterface.phpCleanup methods can be backend-generic, but retention policy/scheduling is product behavior.Data Machine retention tasks stay product; future Agents API may expose only optional backend cleanup.
ConversationReportingInterfaceinc/Core/Database/Chat/ConversationReportingInterface.phpMetrics/reporting reads are useful but product-shaped today.Optional interface at most. Data Machine daily memory and retention CLI keep consuming it.
ConversationStoreInterfaceinc/Core/Database/Chat/ConversationStoreInterface.phpAggregate Data Machine chat-product compatibility contract.Do not extract as the default public contract unless Agents API deliberately wants the full aggregate. Prefer the transcript interface first.
ConversationStoreFactory::get_transcript_store()inc/Core/Database/Chat/ConversationStoreFactory.phpNarrow resolver for runtime transcript persistence.Current implementation reuses the Data Machine aggregate filter for compatibility; future Agents API can own a transcript-specific resolver/filter.
datamachine_conversation_store filterConversationStoreFactory::get()Existing Data Machine aggregate store swap seam.Keep while code lives in Data Machine. A future Agents API filter should not force chat UI/listing/read-state/reporting responsibilities onto transcript-only backends.
agents_api_conversation_runner filterAIConversationLoop::run()Runner replacement seam is generic.Renamed in place from datamachine_conversation_runner; do not mirror the old hook under a runtime alias.
datamachine_guideline_updated actionGuidelineAgentMemoryStoreLogical memory/guideline change event is generic.Target event must not assume Data Machine option names or storage.
wp_register_agent() helperagents-api/inc/register-agents.phpDeclarative agent registration is core-shaped.Public helper contributes definitions only; persistence reconciliation is not part of the helper contract.
wp_agents_api_init actionagents-api/inc/class-wp-agents-registry.phpRegistration collection hook is generic.Keep as the in-place Agents API-shaped hook while Data Machine hosts the substrate.
datamachine_registered_agent_reconciled actionAgentRegistry::reconcile()Useful lifecycle event, but current name includes persistence behavior.Public API should define lifecycle events separately from Data Machine DB reconciliation.

Agents API Implementation Candidate

These are plausibly generic implementations, but should not move until naming and Data Machine assumptions are removed.

SurfaceCurrent locationWhy it is not public-ready yetExtraction direction
AIConversationLoopinc/Engine/AI/AIConversationLoop.phpName says AI and still carries the compatibility facade/result shape, but handler completion and transcript persistence now route through runtime collaborators.Keep shrinking the compatibility adapter by extracting provider request assembly and Data Machine logging policy next.
ProviderRequestAssemblerinc/Engine/AI/ProviderRequestAssembler.phpNormalizes messages, tools, model, and caller-selected directives without dispatching, logging, or discovering Data Machine directives.Good in-place request assembly candidate once prompt/directive vocabulary is settled.
RequestBuilderinc/Engine/AI/RequestBuilder.phpData Machine adapter around provider assembly: discovers/directive-policies datamachine_directives, emits datamachine_log, applies request-size guardrails, maps Data Machine’s request array onto the wp-ai-client public API, and still carries Data Machine response compatibility.Keep as Data Machine adapter while those product concerns remain. Do not move pipeline AI steps to Agents API solely to reach provider dispatch; one-shot/pipeline requests should consume wp-ai-client directly unless they need durable agent runtime semantics.
RequestMetadatainc/Engine/AI/RequestMetadata.phpGeneric inspection/size metadata.Move after field names are checked against Agents API message/tool vocabulary.
RequestInspectorinc/Engine/AI/RequestInspector.phpGeneric debugging/inspection value, likely useful across runtimes.Rename away from Data Machine only if public debug surface is desired.
PromptBuilderinc/Engine/AI/PromptBuilder.phpGeneric system-message composition engine, but wired to Data Machine directives.Extract lower-level composer after directive contract is settled.
DirectiveInterfaceinc/Engine/AI/Directives/DirectiveInterface.phpGeneric system prompt directive contract.Rename around guidelines/context providers; remove provider/step_id coupling if too narrow.
DirectiveRendererinc/Engine/AI/Directives/DirectiveRenderer.phpGeneric renderer for directive outputs.Candidate implementation after output shape is stabilized.
DirectiveOutputValidatorinc/Engine/AI/Directives/DirectiveOutputValidator.phpGeneric shape validation.Candidate implementation after naming cleanup.
DirectivePolicyResolverinc/Engine/AI/Directives/DirectivePolicyResolver.phpGeneric allow/deny policy idea, current inputs include Data Machine modes/agent config.Extract after mode and agent policy contracts move.
MemoryFilesReaderinc/Engine/AI/Directives/MemoryFilesReader.phpGeneric memory-to-prompt reader.Move only after memory registry/store vocabulary is generic.
CoreMemoryFilesDirectiveinc/Engine/AI/Directives/CoreMemoryFilesDirective.phpGeneric default memory injection, but file names and layers are Data Machine conventions today.Needs Agents API memory/guideline convention decision.
AgentModeDirectiveinc/Engine/AI/Directives/AgentModeDirective.phpGeneric mode-context directive idea.Needs generic agent-mode vocabulary or stays Data Machine.
ClientContextDirectiveinc/Engine/AI/Directives/ClientContextDirective.phpGeneric client-provided context injection.Candidate if sanitized context contract is public.
CallerContextDirectiveinc/Engine/AI/Directives/CallerContextDirective.phpGeneric caller metadata injection.Candidate if caller context becomes part of Agents API run input.
ConversationManagerinc/Engine/AI/ConversationManager.phpFormats tool call/result messages and conversation artifacts.Split message formatting helpers from Data Machine transcript details.
ToolExecutorinc/Engine/AI/Tools/ToolExecutor.phpExecutes ability-native and legacy tools with policy staging.Extract only the ability-native execution path; leave Data Machine post tracking and pending-action glue behind.
RuntimeToolDeclaration validators in teststests/runtime-tool-declaration-smoke.phpTests generic declaration shape.Move with the declaration contract.
ToolPolicyFilterinc/Engine/AI/Tools/Policy/ToolPolicyFilter.phpGeneric allow/deny/category/capability filter that takes adapter callbacks for access and mandatory-tool preservation.Move only with a generic access callback contract; Data Machine permission and handler preservation stay in adapters.
ToolSourceRegistryinc/Engine/AI/Tools/ToolSourceRegistry.phpSource-provider composition is generic, but the default providers are Data Machine adapters.Extract the source registry contract separately from DataMachineToolRegistrySource and AdjacentHandlerToolSource.
DataMachineToolRegistrySourceinc/Engine/AI/Tools/Sources/DataMachineToolRegistrySource.phpAdapts Data Machine’s legacy/product datamachine_tools registry into source-provider composition.Keep in Data Machine; Ability-native tool declarations should inform Agents API instead.
ToolManagerinc/Engine/AI/Tools/ToolManager.phpData Machine registry/normalization is based on datamachine_tools, legacy class/method tools, handler wrappers, configuration, and UI status.Keep as Data Machine adapter/product layer; do not make it the public Agents API registry.
ToolParametersinc/Engine/AI/Tools/ToolParameters.phpParameter merge helper is useful, but payload includes job/flow/packet fields.Keep generic parameter validation; move Data Machine payload merge rules to adapter.
ToolResultFinderinc/Engine/AI/Tools/ToolResultFinder.phpGeneric enough if it only finds tool result envelopes.Verify it does not rely on handler result naming before moving.
BaseToolinc/Engine/AI/Tools/BaseTool.phpUseful base class for built-in tools, but public API should favor abilities.Do not make base-tool inheritance the primary Agents API extension point.
GuidelineAgentMemoryStoreinc/Core/FilesRepository/GuidelineAgentMemoryStore.phpGeneric implementation for wp_guideline, but Data Machine does not own that substrate.Agents API can ship it as optional implementation guarded by post_type_exists().
DiskAgentMemoryStoreinc/Core/FilesRepository/DiskAgentMemoryStore.phpGeneric self-hosted implementation, but path conventions are Data Machine runtime conventions.Extract only if Agents API deliberately supports disk memory.
AgentMemoryStoreFactoryinc/Core/FilesRepository/AgentMemoryStoreFactory.phpResolver is still Data Machine-owned because its behavior-preserving default constructs DiskAgentMemoryStore.Preserve agents_api_memory_store as the active hook; move a factory later only after the default-store provider is dependency-clean.
WP_Agent / WP_Agents_Registry / AgentRegistryagents-api/inc/class-wp-agent.php, agents-api/inc/class-wp-agents-registry.php, inc/Engine/Agents/AgentRegistry.phpGeneric declarative registry now has WordPress-shaped facade; Data Machine reconciliation is delegated to AgentMaterializer.Extract facade/registry contract first; keep Data Machine materializer as consumer.
Agents, AgentAccess, AgentTokens repositoriesinc/Core/Database/Agents/Generic identity/access/token data model, but table names and permissions are Data Machine-owned.Extract only after deciding whether Agents API owns persistence tables or just contracts.
AgentAbilities, AgentTokenAbilities, AgentRemoteCallAbilities, AgentCallAbilitiesinc/Abilities/Ability shapes are generic candidates, but slugs and permission helpers are Data Machine-specific.Re-register as wp-agents/v1/Agents API abilities after permission model settles.

Data Machine Adapter

These should stay in Data Machine as compatibility glue if a generic runtime plugin appears.

SurfaceCurrent locationAdapter responsibility
AIStepinc/Core/Steps/AI/AIStep.phpConverts flow-step config, data packets, queue prompt head, image engine data, adjacent steps, job snapshot, and transcript policy into a runtime run.
PipelineToolPolicyArgsinc/Core/Steps/AI/ToolPolicy/PipelineToolPolicyArgs.phpTranslates FlowStepConfig enabled/disabled tool fields into generic resolver args. This is a Data Machine pipeline adapter.
ToolPolicyResolverinc/Engine/AI/Tools/ToolPolicyResolver.phpOrchestrates Data Machine source gathering, persisted agent policy lookup, mandatory adjacent-handler preservation, and permission adapters around the generic policy filter.
PipelineTranscriptPolicyinc/Engine/AI/PipelineTranscriptPolicy.phpReads flow/pipeline config and site option to decide transcript persistence. Generic runtime receives the normalized decision through DataMachinePipelineTranscriptPersister.
ToolSourceRegistry::SOURCE_ADJACENT_HANDLERSinc/Engine/AI/Tools/ToolSourceRegistry.phpData Machine-specific source that exposes publish/upsert handler tools next to AI steps.
ToolSourceRegistry::SOURCE_STATIC_REGISTRY / DataMachineToolRegistrySourceinc/Engine/AI/Tools/Sources/DataMachineToolRegistrySource.phpData Machine-specific source that adapts the curated datamachine_tools registry into runtime tool resolution.
FlowStepConfig::getAdjacentRequiredHandlerSlugsForAi() consumersAIStep and tool policy codeConverts pipeline topology into handler completion requirements.
QueueableTrait prompt consumption in AIStepinc/Core/Steps/AI/AIStep.phpData Machine flow queue semantics (static, drain, loop) feeding a runtime user-message slot.
DataMachinePipelineTranscriptPersisterinc/Engine/AI/DataMachinePipelineTranscriptPersister.phpAdapts a pipeline job run to the transcript store. Generic runtime calls the transcript persister contract and does not own job metadata.
DataMachineHandlerCompletionPolicyinc/Engine/AI/DataMachineHandlerCompletionPolicy.phpAdapts adjacent-handler completion rules into a runtime completion policy. Generic runtime calls the policy contract and does not own pipeline handler semantics.
SystemAgentServiceProvider task registrationinc/Engine/AI/System/SystemAgentServiceProvider.phpRegisters Data Machine system tasks into Data Machine scheduling. The generic runtime may supply a task interface, not these tasks.
AgentCallTaskinc/Engine/AI/System/Tasks/AgentCallTask.phpBridges scheduled/system tasks into the agent-call primitive.
AgentBundler and bundle CLI adaptersinc/Core/Agents/AgentBundler.php, inc/Cli/Commands/AgentBundleCommand.phpConvert Data Machine pipelines/flows into portable agent bundle artifacts. Bundle primitives may split, but flow/pipeline import/export remains adapter/product.
ApiAgents, ApiAgentFiles, ApiAgentPinginc/Api/Current REST routes are Data Machine API shape. They can adapt to future wp-agents/v1 contracts.
AgentsCommand, MemoryCommandinc/Cli/Commands/Operator CLI wrapping current Data Machine repositories and abilities. Generic WP-CLI commands should be designed separately.

Conversation Storage Boundary

Conversation storage is split in place, but only the narrow transcript surface is ready to treat as a generic Agents API candidate.

LayerCurrent surfaceBoundary decision
Generic transcript CRUDConversationTranscriptStoreInterface, ConversationStoreFactory::get_transcript_store()The interface now lives in agents-api/; Data Machine’s factory remains the product adapter. Runtime persistence should depend on this surface when it only needs complete transcript sessions.
Data Machine compatibility aggregateConversationStoreInterface, ConversationStoreFactory::get(), datamachine_conversation_storeStays in Data Machine for now so chat UI, REST, CLI, retention, and reporting keep one behavior-preserving resolver.
Chat UI/session switcherConversationSessionIndexInterface, chat REST/abilities/UI callersProduct behavior today. It may become an optional Agents API UI contract later, but transcript-only backends should not implement it by default.
Read stateConversationReadStateInterfaceOptional UI behavior. Not part of transcript persistence.
RetentionConversationRetentionInterface, retention system tasks/CLIBackend cleanup methods may be generic, but scheduling and retention policy are Data Machine product.
ReportingConversationReportingInterface, daily memory/retention status readersProduct-shaped metrics today. Keep separate from transcript CRUD.

Do not decide an agents_session CPT, host-specific conversation storage, or a new Agents API filter name in this in-place clarification. The current goal is only to make the dependency direction obvious: Data Machine chat product consumes transcript persistence; transcript persistence does not require Data Machine chat product behavior.

Data Machine Product

These should stay in Data Machine. They may consume Agents API later, but should not move into it.

SurfaceCurrent locationWhy it stays
Flow and pipeline step systeminc/Core/Steps/**, inc/Engine/Actions/**This is Data Machine’s automation engine.
AIStep product behaviorinc/Core/Steps/AI/AIStep.phpThe step is a Data Machine pipeline step even if it calls a generic runner.
Fetch, publish, upsert, webhook gate, system task, agent ping step typesinc/Core/Steps/**, inc/Engine/AI/System/**Product workflow primitives, not generic agent runtime.
Handler registration and handler toolsdatamachine_handlers, datamachine_tools handler callbacksData Machine source/destination plugin model.
Jobs and parent/child orchestrationinc/Core/Database/Jobs/**, job abilities/commandsData Machine execution tracking.
Queue modes and config patch queuesflow queue abilities, QueueableTraitData Machine scheduling/backfill behavior.
Retention tasksinc/Engine/AI/System/Tasks/Retention/**, RetentionCommandProduct cleanup for Data Machine tables/files/Action Scheduler state.
Content operationspost, taxonomy, block, alt text, meta description, image, link, IndexNow abilitiesData Machine content automation.
Pending actions store and approval workflowsinc/Engine/AI/Actions/**Generic approval may exist later, but current implementation is product storage/policy.
Admin UI and React pipeline editorsrc/, inc/Core/Admin/**Data Machine product UI.
Global tools for site opsWebFetch, WordPressPostReader, analytics/search console/page speed/image toolsSome tools can become abilities, but the curated Data Machine tool bundle is product.
Agent memory CLI command behaviorMemoryCommandProduct/operator surface; generic API should define contracts first.

Intelligence Domain

Data Machine should not absorb Intelligence-specific vocabulary during extraction.

SurfaceOwnerNotes
Wiki create/read/update/maintain behaviorIntelligenceIf exposed through Data Machine today, treat it as a consumer/domain tool, not runtime substrate.
Briefings and digestsIntelligenceDomain workflows built on top of runtime and search abilities.
Domain brains and generated/shared wikisIntelligenceProduct/domain policy, not Agents API.
Intelligence memory policy additionsIntelligenceMay consume generic memory contracts, but policy names and wiki roots stay outside Agents API.

Host-Specific Source Material

These are reference points only. Do not expose them as public Data Machine or Agents API vocabulary.

SourceHow to use it
Host message DTOsReference for message object semantics. Normalize behind WP_Agent_Message or neutral envelopes.
Host agent runtime classesReference for run-loop integration and provider routing. Do not require inheritance from host runtime classes.
Host agent storesReference for persistence/adoption semantics. Do not leak storage names into public API.
Host conversation storageReference for compaction/resilience. Keep Data Machine/Agents API conversation store contracts portable and site-owned unless explicitly swapped.
Host agent UX precedentsReference for WordPress-hosted agent UX and memory injection, not a dependency or target vocabulary.

Hook Name Map

This map records the in-place hook vocabulary while Data Machine still hosts the Agents API substrate. Generic runtime seams should use Agents API-shaped names; Data Machine product and compatibility seams keep Data Machine names. Hard-cut hook renames assume active cross-repo consumers are updated in lockstep; this slice’s known companion is the Intelligence tier-3 runner adapter update in Automattic/intelligence#285.

Previous hook/filterCurrent hook/filterDecision
datamachine_conversation_runneragents_api_conversation_runnerHard-cut rename. Generic runtime replacement seam.
datamachine_tool_sourcesagents_api_tool_sourcesHard-cut rename. Generic source-provider composition seam; Data Machine sources remain providers.
datamachine_tool_sources_for_modeagents_api_tool_sources_for_modeHard-cut rename. Generic mode-to-source ordering seam.
datamachine_memory_storeagents_api_memory_storeAlready renamed in place; old hook is intentionally not mirrored.
wp_agents_api_initwp_agents_api_initAlready WordPress-shaped registration hook.
datamachine_conversation_storedatamachine_conversation_storeKeep. This swaps Data Machine’s aggregate chat store; a future Agents API transcript hook must be narrower.
datamachine_guideline_updateddatamachine_guideline_updatedKeep for this slice. Event payload and external projection consumers need a narrower Agents API memory-event decision.
datamachine_registered_agent_reconcileddatamachine_registered_agent_reconciledKeep. This is Data Machine materialization/persistence lifecycle, not pure declarative registration.
datamachine_toolsdatamachine_toolsKeep. Legacy/product tool registry; Agents API should prefer ability-native runtime declarations.

Hook And Filter Classification

Hook/filterBucketNotes
agents_api_conversation_runnerAgents API public candidateGeneric runtime replacement seam. Renamed in place from datamachine_conversation_runner.
datamachine_conversation_storeData Machine compatibility seam todayExisting aggregate store swap seam. A future Agents API transcript-store filter should be narrower instead of carrying Data Machine chat product responsibilities.
wp_agents_api_initAgents API public candidateRegistration hook is now WordPress-shaped in-place; Data Machine still fires the legacy hook while it hosts the substrate.
agents_api_memory_storeAgents API public candidateGeneric memory persistence swap seam. Renamed in place from datamachine_memory_store; do not mirror the old hook under a runtime alias.
datamachine_registered_agent_reconciledAgents API implementation candidateLifecycle event is useful, current reconciliation semantics are Data Machine implementation.
datamachine_guideline_updatedAgents API public candidateGeneric memory/guideline change event after naming review.
agents_api_tool_sourcesAgents API implementation candidateGeneric source-provider idea; current defaults include Data Machine adjacent handlers as Data Machine providers.
agents_api_tool_sources_for_modeAgents API implementation candidateGeneric mode policy idea; mode names need Agents API contract.
datamachine_toolsData Machine product todayCurrent registry includes legacy Data Machine handler/class shapes. Ability-native subset can inform Agents API.
datamachine_directivesAgents API implementation candidateGeneric prompt/guideline provider idea, but current directive classes use Data Machine modes.
datamachine_pre_ai_step_checkData Machine adapterPipeline AI-step skip hook.
datamachine_logData Machine productProduct logging surface. Generic runtime events should use loop event sinks.
chubes_ai_requestLegacy provider bridge to deleteLegacy ai-http-client provider-dispatch filter. Do not carry this into Agents API public vocabulary or architecture; removal belongs to #1027 / #1633.
RequestBuilder::wpAiClientUnavailableReason()Data Machine adapter todayProduct-level wp-ai-client capability gate. Missing support is surfaced as a request error; no ai-http-client fallback belongs in Agents API.

Test Coverage Map

These tests currently pin the substrate most relevant to extraction.

TestCoversExtraction signal
tests/ai-message-envelope-smoke.phpAgent message envelope normalization/projection and result validation.Move with message/result contracts.
tests/agent-conversation-result-smoke.phpConversation result shape validation.Move with runner result contract.
tests/agent-conversation-runtime-policy-smoke.phpRuntime completion and transcript collaborator seams.Split generic policy/persister contracts from Data Machine handler/transcript adapter assertions during extraction.
tests/conversation-store-contracts-smoke.phpSplit store interfaces, transcript-only method boundary, and factory return types.Move transcript CRUD coverage with the generic contract; keep aggregate/product assertions with Data Machine.
tests/guideline-agent-memory-store-smoke.phpOptional guideline-backed memory implementation.Move or duplicate if Agents API ships memory store implementations.
tests/daily-memory-store-seam-smoke.phpDaily memory through memory store seam.Data Machine product consuming generic memory store.
tests/agent-memory-events-smoke.phpMemory/guideline change events.Move event contract after naming review.
tests/memory-bundle-policy-smoke.phpBundle-aware self-memory policy.Mixed: memory contract candidate plus bundle/product policy.
tests/tool-source-registry-smoke.phpTool source providers.Split generic source registry from Data Machine adjacent-handler provider.
tests/tool-executor-ability-native-smoke.phpAbility-native tool execution.Good Agents API implementation signal.
tests/runtime-tool-declaration-smoke.phpRuntime tool declaration validation.Move with runtime tool declaration contract.
tests/tool-policy-resolver-adjacency-smoke.phpPipeline adjacency and handler protection.Data Machine adapter/product behavior.
tests/pipeline-tool-policy-*.phpPipeline tool policy surfaces.Data Machine adapter tests.
tests/react-pipeline-tool-policy-contract-smoke.phpReact/API contract for pipeline tool policy.Data Machine product.
tests/system-task-agent-context-smoke.phpAgent context propagation through system tasks.Data Machine adapter/product.
tests/agent-call-migration-smoke.phpAgent-call migration.Agent-call primitive may inform Agents API; migration stays Data Machine.
tests/agent-bundle-*.phpBundle format, artifact store, upgrade planner, portable update.Split pure manifest/auth/template artifacts from flow/pipeline file adapters.
tests/ai-request-inspector-smoke.phpProvider request assembly without dispatch plus Data Machine request inspection surface.Split generic ProviderRequestAssembler assertions from Data Machine RequestBuilder directive-policy assertions during extraction.
tests/wp-ai-client-runtime-gate-smoke.phpwp-ai-client capability gate and no chubes_ai_request runtime fallback.Move with provider runtime boundary if Agents API owns provider dispatch.

First Seams To Make Boring

  1. Consume extra-chill/agents-api as the standalone package/plugin boundary before moving broad code into that repository.
  2. Split pipeline policy translation out of ToolPolicyResolver so the resolver no longer imports or reads FlowStepConfig.
  3. Split AgentRegistry into a pure registry and a Data Machine reconciler that creates database rows, access rows, directories, and scaffold files.
  4. Rename and stabilize message/result/store interfaces in place before moving namespaces.
  5. Split provider request assembly from RequestBuilder so Data Machine directives/logging stay adapter behavior and provider dispatch targets wp-ai-client, not ai-http-client.
  6. Split ToolExecutor into ability-native runtime execution plus Data Machine product hooks for pending actions and post-origin tracking.
  7. Decide whether Agents API owns persistence tables or only contracts plus optional stores.
  8. Keep host-specific provider and storage classes behind adapters. No public contract should require implementation-specific message, agent, or conversation-storage DTOs.

Non-Goals

  • Do not move files as part of this map.
  • Do not move broad runtime implementations into the standalone repository until their dependency direction, vocabulary, and tests prove they are generic substrate rather than Data Machine adapters.
  • Do not rename runtime classes before the target contracts are settled.
  • Do not make Data Machine or Agents API depend on host-specific provider or storage vocabulary.
  • Do not make Agents API depend on ai-http-client; that package is only a packaging precedent and a removal target.
  • Do not move Data Machine flows, pipelines, jobs, handlers, queues, retention, content ops, or admin UI into Agents API.
  • Do not move Intelligence wiki/briefing/domain-brain vocabulary into Data Machine or Agents API.