aboutsummaryrefslogtreecommitdiff
path: root/scripts/tests/install-ai.bats
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-13 16:06:13 -0500
committerCraig Jennings <c@cjennings.net>2026-07-13 16:06:13 -0500
commit6cd3aa32b9f3b033c3890f08ab430e757696e5e3 (patch)
tree763dcb361796935330dc7e8afa98c0e427ed2966 /scripts/tests/install-ai.bats
parent0ee94abca7dde8356709d712b2dbf735b029f2b8 (diff)
downloadrulesets-6cd3aa32b9f3b033c3890f08ab430e757696e5e3.tar.gz
rulesets-6cd3aa32b9f3b033c3890f08ab430e757696e5e3.zip
feat(runtime): add the thin-pointer AGENTS.md agent entry file
claude-templates/AGENTS.md points any harness at protocols.org, the rules locations, and the /name-to-file resolution rule, and tells it to degrade per each rule's documented fallback instead of skipping gates. make install links it to ~/.codex/AGENTS.md (new CODEX_DIR stanza) and install-ai.sh seeds a project-owned copy at bootstrap, never overwriting an existing one. The rulesets root carries a tracked symlink as dogfood. Five new bats tests cover the link idiom and the seeding. This resolves the generic-instruction-file blocker from the runtime spec, and velox picks up the global link on its next session's make install.
Diffstat (limited to 'scripts/tests/install-ai.bats')
-rw-r--r--scripts/tests/install-ai.bats23
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/tests/install-ai.bats b/scripts/tests/install-ai.bats
index 8e91770..a7eb3c0 100644
--- a/scripts/tests/install-ai.bats
+++ b/scripts/tests/install-ai.bats
@@ -149,3 +149,26 @@ EOF
[ -d "$TEST_HOME/code/pickme/.ai" ]
[ ! -d "$TEST_HOME/code/skipme/.ai" ]
}
+
+@test "install-ai: seeds AGENTS.md at the project root" {
+ mkdir -p "$TEST_HOME/code/fresh"
+ (cd "$TEST_HOME/code/fresh" && git init -q)
+
+ run bash "$INSTALL_AI" --gitignore "$TEST_HOME/code/fresh"
+
+ [ "$status" -eq 0 ]
+ [ -f "$TEST_HOME/code/fresh/AGENTS.md" ]
+ grep -q "protocols.org" "$TEST_HOME/code/fresh/AGENTS.md"
+}
+
+@test "install-ai: never overwrites an existing AGENTS.md" {
+ mkdir -p "$TEST_HOME/code/fresh"
+ (cd "$TEST_HOME/code/fresh" && git init -q)
+ echo "project-owned entry file" > "$TEST_HOME/code/fresh/AGENTS.md"
+
+ run bash "$INSTALL_AI" --gitignore "$TEST_HOME/code/fresh"
+
+ [ "$status" -eq 0 ]
+ grep -q "project-owned entry file" "$TEST_HOME/code/fresh/AGENTS.md"
+ ! grep -q "protocols.org" "$TEST_HOME/code/fresh/AGENTS.md"
+}