Skip to content

Commit eefb2c0

Browse files
committed
fix: keep Homeboy AGENTS guidance lean
1 parent 0a539a3 commit eefb2c0

4 files changed

Lines changed: 18 additions & 95 deletions

File tree

lib/agents-md-guidance.sh

Lines changed: 2 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
# agents_md_guidance_ensure_mu_plugin_file
1515
# agents_md_guidance_register <section_id> <priority> <label> <description> <content>
1616
# agents_md_guidance_unregister <section_id>
17-
# agents_md_guidance_sync_homeboy_codebox <available:true|false>
18-
# agents_md_guidance_register_homeboy_codebox
19-
# agents_md_guidance_unregister_homeboy_codebox
2017
# agents_md_guidance_sync_homeboy_cli # presence-gated on `command -v homeboy`
2118
# agents_md_guidance_register_homeboy_cli
2219
# agents_md_guidance_unregister_homeboy_cli
@@ -174,51 +171,6 @@ agents_md_guidance_unregister() {
174171
fi
175172
}
176173

177-
agents_md_guidance_sync_homeboy_codebox() {
178-
local available="${1:-false}"
179-
case "$available" in
180-
true) agents_md_guidance_register_homeboy_codebox ;;
181-
false) agents_md_guidance_unregister_homeboy_codebox ;;
182-
*)
183-
warn " agents_md_guidance_sync_homeboy_codebox: expected true or false, got '$available'"
184-
return 1
185-
;;
186-
esac
187-
}
188-
189-
agents_md_guidance_register_homeboy_codebox() {
190-
agents_md_guidance_register \
191-
"homeboy-codebox-agent-tasks" \
192-
36 \
193-
"Homeboy Codebox agent tasks" \
194-
"Homeboy-owned async coding-agent fan-out through WP Codebox sandboxes." \
195-
"$(agents_md_guidance_homeboy_codebox_content)"
196-
}
197-
198-
agents_md_guidance_unregister_homeboy_codebox() {
199-
agents_md_guidance_unregister "homeboy-codebox-agent-tasks"
200-
}
201-
202-
agents_md_guidance_homeboy_codebox_content() {
203-
cat <<'MD'
204-
**Agent tasks:** use `homeboy agent-task --help` to choose the durable agent workflow: cook, fanout, loop, lifecycle, evidence, diagnosis, promotion, and review-finalization surfaces live there when available. Use `homeboy agent-task providers` to inspect registered executor providers. Homeboy owns task plans, durable run state, queueing, concurrency, retries, logs, artifacts, and promotion back into the review workflow.
205-
206-
**Codebox executor:** use the `codebox` backend for disposable WP Codebox WordPress sandboxes. WP Codebox owns sandbox recipes, plugin/runtime overlays, agent invocation, and artifact bundles; Homeboy owns orchestration around those recipes.
207-
208-
**Workspace shape:** use the workspace selected by Homeboy: a component checkout, `homeboy worktree` task workspace, adopted `@workspace:<handle>` path, or sandbox mount supplied by an agent-task executor. Homeboy owns the task/workspace record and safety gates; workspace providers are implementation details.
209-
210-
**WP Codebox agent mode:** use sandbox mode for Codebox coding tasks. Sandbox mode exposes the bounded workspace tools needed to read, edit, and verify files.
211-
212-
**Codex provider:** Codebox Codex tasks need the OpenAI Codex provider plugin/runtime overlay and `AI_PROVIDER_OPENAI_CODEX_*` secrets passed via `secret_env`. Never print token values in logs or task instructions.
213-
214-
**Claude Code provider:** Codebox Claude Code tasks use the `ai-provider-for-claude-code` plugin carried by wp-coding-agents. It is backed by Claude Code OAuth credentials through WP AI Client / PHP AI Client, not the `claude` binary, not an Anthropic API key, and not WP AI Gateway. Provider id: `claude-code`. Provide credentials through `AI_PROVIDER_CLAUDE_CODE_REFRESH_TOKEN` and optional `AI_PROVIDER_CLAUDE_CODE_ACCESS_TOKEN` / `AI_PROVIDER_CLAUDE_CODE_EXPIRES_AT`; never pass Claude subscription/session material through task prompts or logs.
215-
216-
**Operator verbs:** `homeboy release`, `homeboy deploy`, and `homeboy ssh` are operator actions. Use them only when the user explicitly asks for that action.
217-
218-
**Chat bridges:** Kimaki, Discord, and other chat bridges display task status and results while Homeboy remains the source of truth for task state and artifacts.
219-
MD
220-
}
221-
222174
# ---------------------------------------------------------------------------
223175
# Homeboy CLI command map (issue #208)
224176
#
@@ -357,16 +309,7 @@ for name, summary in commands:
357309
lines.append("")
358310
lines.append(
359311
"Discover everything: `homeboy --help`. Drill into any command with "
360-
"`homeboy <command> --help`. Releases (`homeboy release`) and deploys "
361-
"(`homeboy deploy`) are operator actions — run them only when the user "
362-
"explicitly asks."
363-
)
364-
lines.append("")
365-
lines.append(
366-
"For component-aware work, prefer Homeboy entrypoints because they preserve "
367-
"project context, workspace records, lab routing, gates, logs, artifacts, "
368-
"and promotion evidence. Direct shell commands are still appropriate for "
369-
"narrow inspection or edits inside the selected workspace."
312+
"`homeboy <command> --help`."
370313
)
371314
372315
sys.stdout.write("\n".join(lines))
@@ -381,7 +324,7 @@ _agents_md_guidance_render_block() {
381324
AGENTS_MD_GUIDANCE_DESCRIPTION="$description" \
382325
AGENTS_MD_GUIDANCE_CONTENT="$content" \
383326
AGENTS_MD_GUIDANCE_FRESHNESS="${AGENTS_MD_GUIDANCE_FRESHNESS:-conditional}" \
384-
AGENTS_MD_GUIDANCE_CONDITIONS="${AGENTS_MD_GUIDANCE_CONDITIONS:-Registered when Homeboy Codebox agent-task tooling is available; removed when unavailable.}" \
327+
AGENTS_MD_GUIDANCE_CONDITIONS="${AGENTS_MD_GUIDANCE_CONDITIONS:-Registered by wp-coding-agents when the integration is available; removed when unavailable.}" \
385328
python3 <<'PY'
386329
import os
387330
import re

lib/homeboy.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -392,16 +392,6 @@ sync_homeboy_agents_md_guidance() {
392392
if declare -F agents_md_guidance_sync_homeboy_cli >/dev/null; then
393393
agents_md_guidance_sync_homeboy_cli
394394
fi
395-
396-
if ! declare -F agents_md_guidance_sync_homeboy_codebox >/dev/null; then
397-
return 0
398-
fi
399-
400-
if [ "${HOMEBOY_WORDPRESS_READY:-false}" = true ] || homeboy_wordpress_extension_ready; then
401-
agents_md_guidance_sync_homeboy_codebox true
402-
else
403-
agents_md_guidance_sync_homeboy_codebox false
404-
fi
405395
}
406396

407397
setup_homeboy_project() {

tests/agents-md-guidance.sh

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -96,32 +96,31 @@ assert_fails() {
9696
fi
9797
}
9898

99-
echo "==> register Homeboy Codebox guidance"
99+
echo "==> register generic guidance"
100100
(
101101
umask 077
102-
agents_md_guidance_sync_homeboy_codebox true
102+
agents_md_guidance_register "sample-guidance" 36 "Sample guidance" "Sample generated guidance." "## Sample guidance"
103103
)
104104

105105
assert_php_lint "$MU_FILE" "guidance mu-plugin parses with php -l"
106106
assert_mode_0644 "$MU_FILE" "mu-plugin mode 0644 after fresh write under umask 077"
107107

108-
if grep -q "BEGIN agents-md-guidance:homeboy-codebox-agent-tasks" "$MU_FILE"; then
109-
echo " ok Homeboy Codebox block present"
108+
if grep -q "BEGIN agents-md-guidance:sample-guidance" "$MU_FILE"; then
109+
echo " ok sample guidance block present"
110110
else
111-
echo " FAIL Homeboy Codebox block missing"
111+
echo " FAIL sample guidance block missing"
112112
FAILED=$((FAILED + 1))
113113
fi
114114

115-
echo "==> re-register Homeboy Codebox guidance (idempotent)"
115+
echo "==> re-register generic guidance (idempotent)"
116116
HASH_BEFORE=$(file_hash "$MU_FILE")
117-
agents_md_guidance_sync_homeboy_codebox true
117+
agents_md_guidance_register "sample-guidance" 36 "Sample guidance" "Sample generated guidance." "## Sample guidance"
118118
HASH_AFTER=$(file_hash "$MU_FILE")
119119
assert_eq "$HASH_AFTER" "$HASH_BEFORE" "file unchanged on re-register"
120120

121121
echo "==> invalid public API inputs fail before writing broken PHP"
122122
assert_fails "invalid section id rejected" agents_md_guidance_register "bad section" 36 "Bad" "Bad" "## Bad"
123123
assert_fails "invalid priority rejected" agents_md_guidance_register "bad-priority" "later" "Bad" "Bad" "## Bad"
124-
assert_fails "invalid sync availability rejected" agents_md_guidance_sync_homeboy_codebox maybe
125124

126125
echo "==> skip registration when Data Machine core gate is unavailable"
127126
SHIM_DISABLED="$TMP/section-shim-disabled.php"
@@ -188,30 +187,24 @@ namespace {
188187
'owner' => \$call[4]['owner'] ?? null,
189188
'freshness' => \$call[4]['freshness'] ?? null,
190189
'conditions' => \$call[4]['conditions'] ?? null,
191-
'starts_with_homeboy_style_category' => str_starts_with( \$content, '**Agent tasks:**' ),
192-
'has_agent_task_map' => str_contains( \$content, 'homeboy agent-task --help' ) && str_contains( \$content, 'durable agent workflow' ),
193-
'has_homeboy_workspace_shape' => str_contains( \$content, 'homeboy worktree' ) && str_contains( \$content, 'workspace providers are implementation details' ),
194-
'omits_dmc_workspace_shape' => ! str_contains( \$content, 'Data Machine Code worktree' ),
195-
'has_sandbox_mode' => str_contains( \$content, 'use sandbox mode for Codebox coding tasks' ),
196-
'has_operator_boundary' => str_contains( \$content, 'homeboy release' ) && str_contains( \$content, 'Use them only when the user explicitly asks' ),
197-
'has_old_workflow_comparison' => str_contains( \$content, 'instead of' ) || str_contains( \$content, 'manual chat-session fleets' ),
190+
'content' => \$content,
198191
]);
199192
}
200193
PHP
201194

202195
RESULT=$(php "$SHIM")
203-
EXPECTED='{"filename":"AGENTS.md","slug":"homeboy-codebox-agent-tasks","priority":36,"label":"Homeboy Codebox agent tasks","owner":"wp-coding-agents","freshness":"conditional","conditions":"Registered when Homeboy Codebox agent-task tooling is available; removed when unavailable.","starts_with_homeboy_style_category":true,"has_agent_task_map":true,"has_homeboy_workspace_shape":true,"omits_dmc_workspace_shape":true,"has_sandbox_mode":true,"has_operator_boundary":true,"has_old_workflow_comparison":false}'
204-
assert_eq "$RESULT" "$EXPECTED" "SectionRegistry receives Homeboy Codebox guidance section"
196+
EXPECTED='{"filename":"AGENTS.md","slug":"sample-guidance","priority":36,"label":"Sample guidance","owner":"wp-coding-agents","freshness":"conditional","conditions":"Registered by wp-coding-agents when the integration is available; removed when unavailable.","content":"## Sample guidance"}'
197+
assert_eq "$RESULT" "$EXPECTED" "SectionRegistry receives generic guidance section"
205198

206-
echo "==> unregister Homeboy Codebox guidance"
199+
echo "==> unregister generic guidance"
207200
chmod 0600 "$MU_FILE"
208-
agents_md_guidance_sync_homeboy_codebox false
201+
agents_md_guidance_unregister "sample-guidance"
209202
assert_mode_0644 "$MU_FILE" "mu-plugin mode 0644 after unregister"
210-
if grep -q "BEGIN agents-md-guidance:homeboy-codebox-agent-tasks" "$MU_FILE"; then
211-
echo " FAIL Homeboy Codebox block still present after unregister"
203+
if grep -q "BEGIN agents-md-guidance:sample-guidance" "$MU_FILE"; then
204+
echo " FAIL sample guidance block still present after unregister"
212205
FAILED=$((FAILED + 1))
213206
else
214-
echo " ok Homeboy Codebox block removed"
207+
echo " ok sample guidance block removed"
215208
fi
216209
assert_php_lint "$MU_FILE" "post-unregister file parses with php -l"
217210

tests/homeboy-agents-md.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,19 +151,16 @@ namespace {
151151
'has_status' => str_contains( \$content, '- \`homeboy status\` — Actionable component status overview' ),
152152
'has_orchestrator_intro' => str_contains( \$content, 'Homeboy is the SRE and developer orchestration CLI' ),
153153
'has_common_entrypoints' => str_contains( \$content, 'Common entrypoints:' ),
154-
'has_component_routing_footer' => str_contains( \$content, 'For component-aware work, prefer Homeboy entrypoints' ),
155-
'allows_narrow_shell_commands' => str_contains( \$content, 'Direct shell commands are still appropriate for narrow inspection' ),
156154
'drops_help_meta' => ! str_contains( \$content, 'homeboy help' ),
157155
'drops_list_meta' => ! str_contains( \$content, 'homeboy list' ),
158156
'has_discover_footer' => str_contains( \$content, 'Discover everything: \`homeboy --help\`' ),
159157
'has_per_command_footer' => str_contains( \$content, 'homeboy <command> --help' ),
160-
'has_operator_boundary' => str_contains( \$content, 'operator actions' ),
161158
]);
162159
}
163160
PHP
164161

165162
RESULT=$(php "$SHIM")
166-
EXPECTED='{"filename":"AGENTS.md","slug":"homeboy-cli","priority":34,"label":"Homeboy CLI","owner":"wp-coding-agents","freshness":"conditional","has_deploy":true,"has_release":true,"has_triage":true,"has_status":true,"has_orchestrator_intro":true,"has_common_entrypoints":true,"has_component_routing_footer":true,"allows_narrow_shell_commands":true,"drops_help_meta":true,"drops_list_meta":true,"has_discover_footer":true,"has_per_command_footer":true,"has_operator_boundary":true}'
163+
EXPECTED='{"filename":"AGENTS.md","slug":"homeboy-cli","priority":34,"label":"Homeboy CLI","owner":"wp-coding-agents","freshness":"conditional","has_deploy":true,"has_release":true,"has_triage":true,"has_status":true,"has_orchestrator_intro":true,"has_common_entrypoints":true,"drops_help_meta":true,"drops_list_meta":true,"has_discover_footer":true,"has_per_command_footer":true}'
167164
assert_eq "$RESULT" "$EXPECTED" "SectionRegistry receives generated Homeboy CLI map"
168165

169166
echo "==> re-sync with homeboy present (idempotent)"

0 commit comments

Comments
 (0)