From 1b75ef843b843b23214170422b411820090341e4 Mon Sep 17 00:00:00 2001 From: Chris Huber Date: Sun, 30 Aug 2026 19:36:56 -0400 Subject: [PATCH] Decouple DMC guidance from Homeboy --- inc/Runtime/AgentsMdSections.php | 6 +++--- tests/smoke-agents-md-sections.php | 22 +++++++++++++++++++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/inc/Runtime/AgentsMdSections.php b/inc/Runtime/AgentsMdSections.php index 02ad4eb8..66ed7b21 100644 --- a/inc/Runtime/AgentsMdSections.php +++ b/inc/Runtime/AgentsMdSections.php @@ -81,7 +81,7 @@ private static function register_datamachine_section( string $wp ): void { return <<`, or `{$wp} datamachine-code workspace hygiene` @@ -99,7 +99,7 @@ private static function register_datamachine_section( string $wp ): void { MD; }, array( 'label' => 'Data Machine Code', - 'description' => 'Authoritative workspace routing, lifecycle, and safety guidance.', + 'description' => 'Data Machine Code workspace lifecycle, GitHub, and safety guidance.', 'owner' => 'data-machine-code', 'freshness' => 'snapshot', 'conditions' => 'Always registered when Data Machine Code and composable memory section registration are available.', @@ -108,7 +108,7 @@ private static function register_datamachine_section( string $wp ): void { } private static function render_workspace_policy_intro( string $workspace_path ): string { - $default = "All code changes happen in Data Machine Code worktrees. The controller workspace root is `{$workspace_path}`. "; + $default = "When using Data Machine Code to manage code changes, work in a Data Machine Code worktree. The controller workspace root is `{$workspace_path}`. "; /** * Filters the site-owned workspace policy sentence rendered before DMC command facts. diff --git a/tests/smoke-agents-md-sections.php b/tests/smoke-agents-md-sections.php index 130cf18a..79ed7628 100644 --- a/tests/smoke-agents-md-sections.php +++ b/tests/smoke-agents-md-sections.php @@ -84,11 +84,27 @@ function assert_not_contains( string $needle, string $haystack, string $message $default = $render(); assert_contains( - 'All code changes happen in Data Machine Code worktrees. The controller workspace root is `unavailable; run datamachine-code workspace path to diagnose`.', + 'Data Machine Code provides repository, primary-checkout, worktree, and GitHub workspace management.', + $default, + 'DMC standalone capabilities missing' + ); + assert_contains( + 'When using Data Machine Code to manage code changes, work in a Data Machine Code worktree. The controller workspace root is `unavailable; run datamachine-code workspace path to diagnose`.', $default, 'default workspace policy intro changed' ); - assert_contains('DMC owns authoritative repository, primary-checkout, worktree, and GitHub workspace state. Homeboy consumes DMC-managed worktrees', $default, 'DMC/Homeboy ownership boundary missing'); + assert_not_contains('Homeboy', $default, 'DMC guidance must not couple to Homeboy'); + assert_not_contains('All code changes happen', $default, 'DMC guidance must not claim universal routing authority'); + assert_not_contains( + 'Homeboy', + json_encode($sections['datamachine-code']['metadata'], JSON_THROW_ON_ERROR), + 'DMC section metadata must not couple to Homeboy' + ); + assert_contains( + 'Data Machine Code workspace lifecycle, GitHub, and safety guidance.', + $sections['datamachine-code']['metadata']['description'], + 'DMC section metadata must describe DMC only' + ); assert_contains( '- **Primary is read-only.** Never edit `/` (no `@slug`).', $default, @@ -116,7 +132,7 @@ static function (): string { ); $filtered = $render(); - assert_contains('Use local project policy for `unavailable; run datamachine-code workspace path to diagnose`. DMC owns authoritative repository', $filtered, 'workspace policy intro filter was not applied'); + assert_contains('Use local project policy for `unavailable; run datamachine-code workspace path to diagnose`.', $filtered, 'workspace policy intro filter was not applied'); assert_contains('- **Local policy:** caller-owned workspace rules.', $filtered, 'workspace policy section filter was not applied'); assert_not_contains('- **Primary is read-only.** Never edit `/` (no `@slug`).', $filtered, 'default policy section remained after filter override'); assert_contains('**Default routing**', $filtered, 'DMC routing changed after policy filter');