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
6 changes: 3 additions & 3 deletions inc/Runtime/AgentsMdSections.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private static function register_datamachine_section( string $wp ): void {
return <<<MD
## Data Machine Code

{$workspace_policy_intro}DMC owns authoritative repository, primary-checkout, worktree, and GitHub workspace state. Homeboy consumes DMC-managed worktrees for agent execution, deterministic gates, promotion, evidence, and publication.
Data Machine Code provides repository, primary-checkout, worktree, and GitHub workspace management. {$workspace_policy_intro}

**Default routing**
- Inspect workspace state: `{$wp} datamachine-code workspace list`, `{$wp} datamachine-code workspace show <repo>`, or `{$wp} datamachine-code workspace hygiene`
Expand All @@ -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.',
Expand All @@ -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.
Expand Down
22 changes: 19 additions & 3 deletions tests/smoke-agents-md-sections.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<workspace>/<repo>` (no `@slug`).',
$default,
Expand Down Expand Up @@ -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 `<workspace>/<repo>` (no `@slug`).', $filtered, 'default policy section remained after filter override');
assert_contains('**Default routing**', $filtered, 'DMC routing changed after policy filter');
Expand Down
Loading