diff --git a/Justfile b/Justfile index 2c2096ad0..106725076 100644 --- a/Justfile +++ b/Justfile @@ -115,8 +115,12 @@ assail: # VALIDATION # ═══════════════════════════════════════════════════════════════════════════════ +# Reject legacy directive paths in satellite batches already migrated under #117. +validate-bot-directives: + @bash hooks/validate-bot-directives.sh + # Validate RSR compliance -validate-rsr: +validate-rsr: validate-bot-directives #!/usr/bin/env bash echo "=== RSR Compliance Check ===" MISSING="" diff --git a/affinescript-ecosystem/affinescript-vite/.machine_readable/agent_instructions/README.adoc b/affinescript-ecosystem/affinescript-vite/.machine_readable/bot_directives/README.adoc similarity index 88% rename from affinescript-ecosystem/affinescript-vite/.machine_readable/agent_instructions/README.adoc rename to affinescript-ecosystem/affinescript-vite/.machine_readable/bot_directives/README.adoc index 6e5c81cfd..9d26fc85f 100644 --- a/affinescript-ecosystem/affinescript-vite/.machine_readable/agent_instructions/README.adoc +++ b/affinescript-ecosystem/affinescript-vite/.machine_readable/bot_directives/README.adoc @@ -1,6 +1,6 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) {{CURRENT_YEAR}} hyperpolymath (hyperpolymath) -= Agent Instructions += Bot Directives :toc: preamble Methodology-aware configuration for AI agents. Read by any AI agent @@ -32,8 +32,7 @@ Methodology-aware configuration for AI agents. Read by any AI agent == Relationship to Other Files * `AGENTIC.a2ml` says WHAT agents can do (permissions, gating) -* `agent_instructions/` says HOW agents should work (methodology) -* `bot_directives/` says what the gitbot-fleet does (fleet-specific) +* `bot_directives/` says HOW agents should work (methodology) * `CLAUDE.md` says how Claude specifically should work (Claude-specific) == Reference diff --git a/affinescript-ecosystem/affinescript-vite/.machine_readable/agent_instructions/coverage.a2ml b/affinescript-ecosystem/affinescript-vite/.machine_readable/bot_directives/coverage.a2ml similarity index 100% rename from affinescript-ecosystem/affinescript-vite/.machine_readable/agent_instructions/coverage.a2ml rename to affinescript-ecosystem/affinescript-vite/.machine_readable/bot_directives/coverage.a2ml diff --git a/affinescript-ecosystem/affinescript-vite/.machine_readable/agent_instructions/debt.a2ml b/affinescript-ecosystem/affinescript-vite/.machine_readable/bot_directives/debt.a2ml similarity index 100% rename from affinescript-ecosystem/affinescript-vite/.machine_readable/agent_instructions/debt.a2ml rename to affinescript-ecosystem/affinescript-vite/.machine_readable/bot_directives/debt.a2ml diff --git a/affinescript-ecosystem/affinescript-vite/.machine_readable/agent_instructions/methodology.a2ml b/affinescript-ecosystem/affinescript-vite/.machine_readable/bot_directives/methodology.a2ml similarity index 100% rename from affinescript-ecosystem/affinescript-vite/.machine_readable/agent_instructions/methodology.a2ml rename to affinescript-ecosystem/affinescript-vite/.machine_readable/bot_directives/methodology.a2ml diff --git a/affinescript-ecosystem/affinescriptiser/.machine_readable/agent_instructions/README.adoc b/affinescript-ecosystem/affinescriptiser/.machine_readable/bot_directives/README.adoc similarity index 88% rename from affinescript-ecosystem/affinescriptiser/.machine_readable/agent_instructions/README.adoc rename to affinescript-ecosystem/affinescriptiser/.machine_readable/bot_directives/README.adoc index 1cc7487ed..c1c7026df 100644 --- a/affinescript-ecosystem/affinescriptiser/.machine_readable/agent_instructions/README.adoc +++ b/affinescript-ecosystem/affinescriptiser/.machine_readable/bot_directives/README.adoc @@ -1,6 +1,6 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) -= Agent Instructions += Bot Directives :toc: preamble Methodology-aware configuration for AI agents. Read by any AI agent @@ -32,8 +32,7 @@ Methodology-aware configuration for AI agents. Read by any AI agent == Relationship to Other Files * `AGENTIC.a2ml` says WHAT agents can do (permissions, gating) -* `agent_instructions/` says HOW agents should work (methodology) -* `bot_directives/` says what the gitbot-fleet does (fleet-specific) +* `bot_directives/` says HOW agents should work (methodology) * `CLAUDE.md` says how Claude specifically should work (Claude-specific) == Reference diff --git a/affinescript-ecosystem/affinescriptiser/.machine_readable/agent_instructions/coverage.a2ml b/affinescript-ecosystem/affinescriptiser/.machine_readable/bot_directives/coverage.a2ml similarity index 100% rename from affinescript-ecosystem/affinescriptiser/.machine_readable/agent_instructions/coverage.a2ml rename to affinescript-ecosystem/affinescriptiser/.machine_readable/bot_directives/coverage.a2ml diff --git a/affinescript-ecosystem/affinescriptiser/.machine_readable/agent_instructions/debt.a2ml b/affinescript-ecosystem/affinescriptiser/.machine_readable/bot_directives/debt.a2ml similarity index 100% rename from affinescript-ecosystem/affinescriptiser/.machine_readable/agent_instructions/debt.a2ml rename to affinescript-ecosystem/affinescriptiser/.machine_readable/bot_directives/debt.a2ml diff --git a/affinescript-ecosystem/affinescriptiser/.machine_readable/agent_instructions/methodology.a2ml b/affinescript-ecosystem/affinescriptiser/.machine_readable/bot_directives/methodology.a2ml similarity index 100% rename from affinescript-ecosystem/affinescriptiser/.machine_readable/agent_instructions/methodology.a2ml rename to affinescript-ecosystem/affinescriptiser/.machine_readable/bot_directives/methodology.a2ml diff --git a/affinescript-ecosystem/rattlescript/.machine_readable/agent_instructions/README.adoc b/affinescript-ecosystem/rattlescript/.machine_readable/bot_directives/README.adoc similarity index 88% rename from affinescript-ecosystem/rattlescript/.machine_readable/agent_instructions/README.adoc rename to affinescript-ecosystem/rattlescript/.machine_readable/bot_directives/README.adoc index 664bf5abb..fa37c7a3c 100644 --- a/affinescript-ecosystem/rattlescript/.machine_readable/agent_instructions/README.adoc +++ b/affinescript-ecosystem/rattlescript/.machine_readable/bot_directives/README.adoc @@ -1,6 +1,6 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) {{CURRENT_YEAR}} Jonathan D.A. Jewell (hyperpolymath) -= Agent Instructions += Bot Directives :toc: preamble Methodology-aware configuration for AI agents. Read by any AI agent @@ -32,8 +32,7 @@ Methodology-aware configuration for AI agents. Read by any AI agent == Relationship to Other Files * `AGENTIC.a2ml` says WHAT agents can do (permissions, gating) -* `agent_instructions/` says HOW agents should work (methodology) -* `bot_directives/` says what the gitbot-fleet does (fleet-specific) +* `bot_directives/` says HOW agents should work (methodology) * `CLAUDE.md` says how Claude specifically should work (Claude-specific) == Reference diff --git a/affinescript-ecosystem/rattlescript/.machine_readable/agent_instructions/coverage.a2ml b/affinescript-ecosystem/rattlescript/.machine_readable/bot_directives/coverage.a2ml similarity index 100% rename from affinescript-ecosystem/rattlescript/.machine_readable/agent_instructions/coverage.a2ml rename to affinescript-ecosystem/rattlescript/.machine_readable/bot_directives/coverage.a2ml diff --git a/affinescript-ecosystem/rattlescript/.machine_readable/agent_instructions/debt.a2ml b/affinescript-ecosystem/rattlescript/.machine_readable/bot_directives/debt.a2ml similarity index 100% rename from affinescript-ecosystem/rattlescript/.machine_readable/agent_instructions/debt.a2ml rename to affinescript-ecosystem/rattlescript/.machine_readable/bot_directives/debt.a2ml diff --git a/affinescript-ecosystem/rattlescript/.machine_readable/agent_instructions/methodology.a2ml b/affinescript-ecosystem/rattlescript/.machine_readable/bot_directives/methodology.a2ml similarity index 100% rename from affinescript-ecosystem/rattlescript/.machine_readable/agent_instructions/methodology.a2ml rename to affinescript-ecosystem/rattlescript/.machine_readable/bot_directives/methodology.a2ml diff --git a/hooks/validate-bot-directives.sh b/hooks/validate-bot-directives.sh new file mode 100755 index 000000000..31e74cbb8 --- /dev/null +++ b/hooks/validate-bot-directives.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: MPL-2.0 + +set -euo pipefail + +readonly DEFAULT_TARGETS=( + "affinescript-ecosystem/affinescript-vite" + "affinescript-ecosystem/affinescriptiser" + "affinescript-ecosystem/rattlescript" +) + +validate_targets() { + local failed=0 + local target + local machine_readable + + for target in "$@"; do + machine_readable="${target}/.machine_readable" + + if [[ -d "${machine_readable}/agent_instructions" ]]; then + printf 'ERROR: legacy directive directory remains: %s\n' \ + "${machine_readable}/agent_instructions" >&2 + failed=1 + fi + + if [[ ! -d "${machine_readable}/bot_directives" ]]; then + printf 'ERROR: canonical directive directory is missing: %s\n' \ + "${machine_readable}/bot_directives" >&2 + failed=1 + fi + + if rg --hidden --glob '!**/.git/**' --quiet 'agent_instructions' "$target"; then + printf 'ERROR: legacy agent_instructions reference remains under %s\n' \ + "$target" >&2 + rg --hidden --glob '!**/.git/**' --line-number \ + 'agent_instructions' "$target" >&2 + failed=1 + fi + done + + return "$failed" +} + +self_test() { + local fixture + fixture="$(mktemp -d /tmp/validate-bot-directives.XXXXXX)" + trap 'rm -rf -- "$fixture"' RETURN + + mkdir -p "${fixture}/.machine_readable/agent_instructions" + if validate_targets "$fixture" >/dev/null 2>&1; then + echo "ERROR: validator accepted a planted legacy directory" >&2 + return 1 + fi + + mv "${fixture}/.machine_readable/agent_instructions" \ + "${fixture}/.machine_readable/bot_directives" + validate_targets "$fixture" + echo "Bot-directives validator self-test passed." +} + +if [[ "${1:-}" == "--self-test" ]]; then + self_test + exit +fi + +if (( $# > 0 )); then + validate_targets "$@" +else + validate_targets "${DEFAULT_TARGETS[@]}" +fi + +echo "Bot-directives migration validation passed."