diff --git a/docs/architecture/scripts/doc-claims.sh b/docs/architecture/scripts/doc-claims.sh index 3c8be57..9b60cc8 100755 --- a/docs/architecture/scripts/doc-claims.sh +++ b/docs/architecture/scripts/doc-claims.sh @@ -236,6 +236,7 @@ resolves() { missing=0 checked=0 +notes=0 for file in "${FILES[@]}"; do [ -f "$file" ] || continue @@ -253,6 +254,28 @@ for file in "${FILES[@]}"; do resolves "$token" "$file" && continue + # A bare filename is a weaker claim than a path, and is reported without + # failing the run. + # + # `docs/qa/ClaudeReport.md` asserts something about THIS repository. But + # `release.sh` in prose is usually a reference to a script the template + # offers and this project may not have adopted yet -- scaffold.sh + # deliberately ships no scripts, and TOOLS.md says so: "the table is a menu + # rather than an inventory here". Treating those as failures made every + # freshly scaffolded project start with a red guard, over documents that + # were correct, and a gate that is red from day one is one nobody reads. + # + # The strictness that matters is untouched. The finding this script was + # written for -- a comment claiming `tests/notice-security.test.ts` pinned a + # security rule, for a file that had never existed -- is a path, and paths + # still fail. + case "$token" in + */*) ;; + *) printf '%s: mentions %s, which is not in this repository (yet)\n' "$file" "$token" + notes=$((notes + 1)) + continue ;; + esac + printf '%s: names %s, which does not exist\n' "$file" "$token" missing=$((missing + 1)) done < <(grep -oE '`[^`]+`|\]\([^)]+\)' "$file" 2>/dev/null \ @@ -264,6 +287,12 @@ if [ "$checked" -eq 0 ]; then exit 2 fi +if [ "$notes" -gt 0 ]; then + say "$notes bare filename(s) above are mentioned but not present. Not a" + say "failure: a project adopts the scripts it needs one at a time, and the" + say "documents naming them are a menu rather than an inventory." +fi + if [ "$missing" -gt 0 ]; then say "$missing claimed path(s) do not exist, of $checked checked." say "A document naming a file that is not there is worse than one saying"