Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions inc/Runtime/AgentsMdSections.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ private static function register_auto_generated_marker( string $wp ): void {
}, array(
'label' => 'Auto-generated marker',
'description' => 'HTML-comment header signalling that AGENTS.md is composed from registered sections.',
'owner' => 'data-machine-code',
'freshness' => 'generated',
'conditions' => 'Always registered when Data Machine Code and composable memory section registration are available.',
)
);
}
Expand Down Expand Up @@ -138,6 +141,9 @@ private static function register_datamachine_section( string $wp ): void {
}, array(
'label' => 'Data Machine',
'description' => 'Memory, automation, workspace, and system operations.',
'owner' => 'data-machine-code',
'freshness' => 'snapshot',
'conditions' => 'Always registered when Data Machine Code and composable memory section registration are available.',
)
);
}
Expand All @@ -149,6 +155,9 @@ private static function register_workspace_inventory_section( string $wp ): void
}, array(
'label' => 'Workspace Inventory',
'description' => 'Live snapshot of cloned repos + active worktrees in the workspace.',
'owner' => 'data-machine-code',
'freshness' => 'snapshot',
'conditions' => 'Registered when Data Machine Code is active; content is omitted when no workspace inventory is available.',
)
);
}
Expand All @@ -166,6 +175,9 @@ private static function register_abilities_section(): void {
}, array(
'label' => 'Abilities',
'description' => 'WordPress Abilities API discovery.',
'owner' => 'data-machine-code',
'freshness' => 'static',
'conditions' => 'Always registered when Data Machine Code and composable memory section registration are available.',
)
);
}
Expand All @@ -185,6 +197,9 @@ private static function register_wordpress_source_section(): void {
}, array(
'label' => 'WordPress Source',
'description' => 'Pointers to WordPress source directories.',
'owner' => 'data-machine-code',
'freshness' => 'static',
'conditions' => 'Always registered when Data Machine Code and composable memory section registration are available.',
)
);
}
Expand All @@ -208,6 +223,9 @@ private static function register_multisite_section( string $wp ): void {
}, array(
'label' => 'Multisite',
'description' => 'Multisite-specific WP-CLI guidance.',
'owner' => 'data-machine-code',
'freshness' => 'static',
'conditions' => 'Only registered on multisite installs.',
)
);
}
Expand Down
25 changes: 25 additions & 0 deletions tests/smoke-agents-md-marker.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
$expected_inventory_refresh = 'datamachine memory compose AGENTS.md{$agent_suffix}';
$expected_abilities_note = 'does not currently register a WP-CLI abilities discovery command';
$stale_abilities_cli = 'help abilities';
$expected_section_owner = "'owner' => 'data-machine-code'";
$expected_snapshot_fresh = "'freshness' => 'snapshot'";
$expected_static_fresh = "'freshness' => 'static'";
$expected_generated_fresh = "'freshness' => 'generated'";
$expected_multisite_cond = "'conditions' => 'Only registered on multisite installs.'";

$assert(
'auto-generated marker uses memory compose command',
Expand Down Expand Up @@ -110,6 +115,26 @@
'GitSync guidance distinguishes compact sync family',
str_contains($source, $expected_gitsync_cli)
);
$assert(
'AGENTS.md sections declare Data Machine Code ownership',
6 === substr_count($source, $expected_section_owner)
);
$assert(
'AGENTS.md sections declare generated freshness for compose marker',
str_contains($source, $expected_generated_fresh)
);
$assert(
'AGENTS.md sections declare snapshot freshness for dynamic workspace guidance',
2 === substr_count($source, $expected_snapshot_fresh)
);
$assert(
'AGENTS.md sections declare static freshness for stable guidance',
3 === substr_count($source, $expected_static_fresh)
);
$assert(
'multisite section documents its registration condition',
str_contains($source, $expected_multisite_cond)
);
$assert(
'plugin entrypoint delegates AGENTS.md section registration',
str_contains($entrypoint, 'DataMachineCode\\Runtime\\AgentsMdSections')
Expand Down
Loading