blob: 03343a6c6f5eae1066be4a8b4f81b40e1b1c7143 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
#!/usr/bin/env bats
# make install must link the runtime-neutral agent entry file (AGENTS.md)
# into CODEX_DIR so Codex-style harnesses bootstrap from the same
# protocols/rules/skills the Claude side reads. The thin-pointer shape and
# the decision trail live in docs/design/2026-07-13-runtime-portability-
# inventories.org and the generic-agent-runtime task.
setup() {
REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../.." && pwd)"
TMPHOME="$(mktemp -d)"
}
teardown() {
rm -rf "$TMPHOME"
}
run_install() {
make -C "$REPO_ROOT" install \
SKILLS_DIR="$TMPHOME/skills" \
RULES_DIR="$TMPHOME/rules" \
HOOKS_DIR="$TMPHOME/hooks" \
CLAUDE_DIR="$TMPHOME/claude" \
CODEX_DIR="$TMPHOME/codex" \
LOCAL_BIN="$TMPHOME/bin"
}
@test "install links AGENTS.md into CODEX_DIR" {
run run_install
[ "$status" -eq 0 ]
[ -L "$TMPHOME/codex/AGENTS.md" ]
grep -q "protocols.org" "$TMPHOME/codex/AGENTS.md"
}
@test "install is idempotent on the agent entry (second run skips)" {
run run_install
[ "$status" -eq 0 ]
run run_install
[ "$status" -eq 0 ]
[[ "$output" == *"skip AGENTS.md (already linked)"* ]]
[ -L "$TMPHOME/codex/AGENTS.md" ]
}
@test "install warns on a non-symlink AGENTS.md collision and leaves it alone" {
mkdir -p "$TMPHOME/codex"
echo "hand-written entry" > "$TMPHOME/codex/AGENTS.md"
run run_install
[ "$status" -eq 0 ]
[[ "$output" == *"WARN AGENTS.md exists and is not a symlink"* ]]
[ ! -L "$TMPHOME/codex/AGENTS.md" ]
grep -q "hand-written entry" "$TMPHOME/codex/AGENTS.md"
}
|