blob: 9c968f7e862eecb8bb3960134113698f2f73dfb1 (
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
|
#!/usr/bin/env bats
# The "Colloquialisms and Expansions" convention and its "the list" before-close
# queue must stay wired into the synced template: the protocols.org reference
# section, and the wrap-it-up.org Step 1 sub-step that drains the queue before
# the Summary. Guards against either being dropped in a future edit or sync.
setup() {
REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../.." && pwd)"
PROTO="$REPO_ROOT/claude-templates/.ai/protocols.org"
WRAP="$REPO_ROOT/claude-templates/.ai/workflows/wrap-it-up.org"
PROTO_MIRROR="$REPO_ROOT/.ai/protocols.org"
WRAP_MIRROR="$REPO_ROOT/.ai/workflows/wrap-it-up.org"
}
@test "protocols.org documents the Colloquialisms and Expansions convention" {
grep -qF '* Colloquialisms and Expansions' "$PROTO"
grep -q 'the list' "$PROTO"
grep -q 'Before-Close Queue' "$PROTO"
grep -qF 'tell <project>' "$PROTO"
grep -q 'inbox-send' "$PROTO"
}
@test "the colloquialisms reference scopes the queue to the session anchor" {
grep -q 'session-context.org' "$PROTO"
# A must-outlive item is a todo.org task, not a list item.
grep -q 'must outlive the session' "$PROTO"
}
@test "wrap-it-up Step 1 works the Before-Close Queue before the Summary" {
grep -qF 'Work the Before-Close Queue' "$WRAP"
grep -q 'oldest-first' "$WRAP"
grep -q 'silent no-op' "$WRAP"
# The queue must be worked before the Summary is written, so its edits ride
# this wrap's commit. Assert it sits ahead of the first Summary sub-step.
local queue_line kb_line
queue_line=$(grep -n 'Work the Before-Close Queue' "$WRAP" | head -1 | cut -d: -f1)
kb_line=$(grep -n 'Early KB reflection' "$WRAP" | head -1 | cut -d: -f1)
[ "$queue_line" -lt "$kb_line" ]
}
@test "the convention is mirrored to the committed .ai copy" {
diff -q "$PROTO" "$PROTO_MIRROR"
diff -q "$WRAP" "$WRAP_MIRROR"
}
|