- Rule E resolves git user.name/user.email once per session; OS user as stated fallback. - Rule D: one workload file per person per day, YYYY-MM-DD_<author>_summary.md with type: session frontmatter; older files read as before. - Rule B log format gains an optional, lint-neutral **Author:** line; wiki/log.md header and ckb-upgrade example updated. - save_conversation.py records an author row (--author override); smoke fixture passes a fixed author. - ckb-project-summary and ckb-module cite the new workload name. - D-0004 records the decision; manual, READMEs and changelogs in English and Polish. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
42 lines
2.4 KiB
Bash
Executable file
42 lines
2.4 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Template smoke test: run the deterministic scripts against the fixture KB and
|
|
# compare with the golden output. Exit non-zero on any drift.
|
|
#
|
|
# tests/smoke.sh # check
|
|
# tests/smoke.sh --update # regenerate the golden files after an intended change
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
FIX=tests/fixtures/minimal-kb
|
|
TODAY=2026-09-24
|
|
LINT=.agents/skills/ckb-lint/scripts/lint_report.py
|
|
RETR=.agents/skills/ckb-retrieve/scripts/retrieve_candidates.py
|
|
SAVE=.agents/skills/ckb-add-conversation/scripts/save_conversation.py
|
|
TMP=$(mktemp -d); trap 'rm -rf "$TMP"' EXIT
|
|
|
|
QUICK=.agents/skills/ckb-lint/scripts/lint_quick.sh
|
|
( cd "$FIX" && python3 "../../../$LINT" --json --today "$TODAY" ) > "$TMP/lint.json"
|
|
# The no-Python fallback must agree with the reference on the three counts it covers.
|
|
( cd "$FIX" && python3 "../../../$LINT" --quick --today "$TODAY" || true ) > "$TMP/quick.py.txt"
|
|
( cd "$FIX" && bash "../../../$QUICK" --today "$TODAY" || true ) | sed 's/ (fallback:.*//' > "$TMP/quick.sh.txt"
|
|
python3 "$RETR" "how many times does Atlas retry a failed batch" --root "$FIX" --today "$TODAY" --json > "$TMP/retrieve.json"
|
|
# Conversation rendering must be stable: same fixture transcript, same Markdown.
|
|
mkdir -p "$TMP/conv" && python3 "$SAVE" --from tests/fixtures/conversation/session.jsonl --root "$TMP/conv" --today "$TODAY" --author "Fixture User <fixture@example.com>" > /dev/null
|
|
cp "$TMP"/conv/raw/saved-conversations/"$TODAY"/*.md "$TMP/conversation.md"
|
|
|
|
if [[ "${1:-}" == "--update" ]]; then
|
|
cp "$TMP/lint.json" tests/expected/lint.json
|
|
cp "$TMP/retrieve.json" tests/expected/retrieve.json
|
|
cp "$TMP/conversation.md" tests/expected/conversation.md
|
|
echo "golden files updated"; exit 0
|
|
fi
|
|
|
|
fail=0
|
|
for f in lint retrieve; do
|
|
if ! diff -u "tests/expected/$f.json" "$TMP/$f.json"; then echo "DRIFT: $f"; fail=1; fi
|
|
done
|
|
if ! diff -u tests/expected/conversation.md "$TMP/conversation.md"; then echo "DRIFT: conversation"; fail=1; fi
|
|
if ! diff -u "$TMP/quick.py.txt" "$TMP/quick.sh.txt"; then echo "DRIFT: lint_quick.sh disagrees with lint_report.py --quick"; fail=1; fi
|
|
top=$(python3 -c "import json;print(json.load(open('$TMP/retrieve.json'))['candidates'][0]['path'])")
|
|
[[ "$top" == "wiki/entities/atlas-retry-policy.md" ]] || { echo "retrieve: expected atlas-retry-policy first, got $top"; fail=1; }
|
|
[[ $fail -eq 0 ]] && echo "smoke: OK"
|
|
exit $fail
|