Files
serverAppConfigs/tests/docs_completeness.bats
T
Frank 5976ad0550 refact(docs): compose-era sweeps retire with the last compose file
rank 7 tail. dankserver/compose.yaml (a parallel inventory whose mounts
had diverged from the quadlets) and its .env.example live in
dankserver/.AGENTTRASH/20261013-compose-retire/; the retired ik chat
template joined scripts/.AGENTTRASH/. No target has a compose file now:
- service-map drops the compose selection rule, compose file claim, and
  check_compose (the check list is schema/units/ownership/config/drift);
- deploy-remote's compose fallback is a loud failure, not a WARN-and-
  nothing for dankserver;
- compose_validity.bats goes to tests/.AGENTTRASH (it was sweeping only
  the trash file); env_consistency sheds its two compose sweeps;
- docs_completeness's compose sweep skips .AGENTTRASH so retired
  services cannot resurrect, and a revived compose stays covered;
- Testing Policy drops the Compose validity row.
2026-10-13 22:35:28 -07:00

48 lines
2.2 KiB
Bash

#!/usr/bin/env bats
# Seam: documentation completeness.
# (compose era retired 2026-10-13; the sweep below now skips trash so a
# revived compose file stays covered without resurrecting retired services)
# Every service defined in a compose.yaml must have a matching documentation
# page in serverAppConfigs-docs/ and must be reachable from the index. This is the "docs first"
# contract of this repo: no service ships without documentation.
load helpers
@test "every compose service has a docs page" {
while IFS= read -r f; do
while IFS= read -r svc; do
# service name is the docs slug: RomM -> serverAppConfigs-docs/Dankserver/RomM.md
# matched case-insensitively (vault uses Title Case)
local doc
doc=$(find "$REPO_ROOT/serverAppConfigs-docs" -iname "${svc}.md" 2>/dev/null | head -1)
if [ -z "$doc" ]; then
echo "service '$svc' (from $f) has no docs page: expected serverAppConfigs-docs/**/${svc}.md"
return 1
fi
done < <(services_in "$f")
done < <(find "$REPO_ROOT" -name 'compose.yaml' -not -path '*/.git/*' -not -path '*/.AGENTTRASH/*' | sort)
}
@test "docs index links every docs page" {
local index="$REPO_ROOT/serverAppConfigs-docs/index.md"
[ -f "$index" ] || { echo "missing $index"; return 1; }
while IFS= read -r page; do
local base
base=$(basename "$page" .md)
grep -qF "[[$base]]" "$index" || {
echo "docs page $base is not linked from $index"
return 1
}
done < <(find "$REPO_ROOT/serverAppConfigs-docs" -name '*.md' -not -name 'index.md' -not -path '*/.obsidian/*' | sort)
}
@test "no unresolved links in the docs vault" {
# A wikilink to a page that does not exist is a promise the repo cannot
# keep. Fixing the three that were dangling (2026-09-16) also meant
# retiring a reference to dankclaw/compose.yaml, which no longer exists.
# The checker models Obsidian's resolution rules; see its docstring for
# the three false-positive classes a naive version produces.
run "$REPO_ROOT/scripts/check-vault-links.py" "$REPO_ROOT/serverAppConfigs-docs"
[ "$status" -eq 0 ] || { echo "$output"; false; }
}