@hxp-tools/godplans 0.0.0-stage → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1202 -0
- package/LICENSE +21 -0
- package/PROMPT.md +4006 -0
- package/README.md +245 -2
- package/bin/godplans.js +93 -0
- package/docs/ARCHITECTURE.md +136 -0
- package/docs/RELEASING.md +107 -0
- package/docs/assets/badge-approved.svg +12 -0
- package/docs/assets/badge-done.svg +11 -0
- package/docs/assets/badge-graded.svg +12 -0
- package/docs/assets/badge-validated.svg +10 -0
- package/docs/assets/hero.svg +37 -0
- package/docs/assets/quest-map.svg +53 -0
- package/evals/README.md +295 -0
- package/evals/cases/brownfield-cli/EXPECTATIONS +15 -0
- package/evals/cases/brownfield-cli/INPUT/package.json +9 -0
- package/evals/cases/brownfield-cli/INPUT/src/cli.js +4 -0
- package/evals/cases/brownfield-cli/INPUT/src/format.js +3 -0
- package/evals/cases/brownfield-cli/INPUT/test/cli.test.js +7 -0
- package/evals/cases/brownfield-cli/REQUEST.baseline.md +10 -0
- package/evals/cases/brownfield-cli/REQUEST.md +10 -0
- package/evals/cases/compliance-refusal/EXPECTATIONS +4 -0
- package/evals/cases/compliance-refusal/REQUEST.baseline.md +9 -0
- package/evals/cases/compliance-refusal/REQUEST.md +8 -0
- package/evals/cases/greenfield-saas/EXPECTATIONS +21 -0
- package/evals/cases/greenfield-saas/REQUEST.baseline.md +11 -0
- package/evals/cases/greenfield-saas/REQUEST.md +11 -0
- package/evals/cases/nested-pillars/EXPECTATIONS +12 -0
- package/evals/cases/nested-pillars/REQUEST.baseline.md +10 -0
- package/evals/cases/nested-pillars/REQUEST.md +11 -0
- package/evals/cases/observability-evidence/EXPECTATIONS +10 -0
- package/evals/cases/observability-evidence/REQUEST.baseline.md +10 -0
- package/evals/cases/observability-evidence/REQUEST.md +11 -0
- package/evals/cases/product-business/EXPECTATIONS +18 -0
- package/evals/cases/product-business/REQUEST.baseline.md +13 -0
- package/evals/cases/product-business/REQUEST.md +14 -0
- package/evals/cases/product-form-routing/EXPECTATIONS +13 -0
- package/evals/cases/product-form-routing/REQUEST.baseline.md +11 -0
- package/evals/cases/product-form-routing/REQUEST.md +11 -0
- package/evals/cases/prose-integrity/EXPECTATIONS +19 -0
- package/evals/cases/prose-integrity/REQUEST.baseline.md +19 -0
- package/evals/cases/prose-integrity/REQUEST.md +20 -0
- package/evals/cases/replan-preserves-history/EXPECTATIONS +9 -0
- package/evals/cases/replan-preserves-history/INPUT/.godplans/PLAN.mdx +115 -0
- package/evals/cases/replan-preserves-history/INPUT/package.json +5 -0
- package/evals/cases/replan-preserves-history/REQUEST.baseline.md +10 -0
- package/evals/cases/replan-preserves-history/REQUEST.md +10 -0
- package/evals/cases/stale-prepublication/EXPECTATIONS +10 -0
- package/evals/cases/stale-prepublication/REQUEST.baseline.md +12 -0
- package/evals/cases/stale-prepublication/REQUEST.md +13 -0
- package/evals/cases/stale-source-evidence/EXPECTATIONS +10 -0
- package/evals/cases/stale-source-evidence/INPUT/package.json +8 -0
- package/evals/cases/stale-source-evidence/REQUEST.baseline.md +11 -0
- package/evals/cases/stale-source-evidence/REQUEST.md +12 -0
- package/evals/cases/weekend-library/EXPECTATIONS +19 -0
- package/evals/cases/weekend-library/REQUEST.baseline.md +10 -0
- package/evals/cases/weekend-library/REQUEST.md +11 -0
- package/evals/cases-roster.txt +19 -0
- package/evals/external/GRADE.schema.json +39 -0
- package/evals/external/README.md +42 -0
- package/evals/external/RUBRIC.md +32 -0
- package/evals/metrics/context-cost.json +154 -0
- package/evals/outcomes/README.md +65 -0
- package/evals/outcomes/cases/tenant-notes-api/REQUEST.baseline.md +14 -0
- package/evals/outcomes/cases/tenant-notes-api/REQUEST.md +13 -0
- package/evals/outcomes/cases/tenant-notes-api/VERIFY.sh +13 -0
- package/evals/outcomes/results/2026-07-23-tenant-notes-api-codex/README.md +93 -0
- package/evals/outcomes/results/2026-07-23-tenant-notes-api-codex/treatment/plan/PLAN.json +547 -0
- package/evals/runners/claude-baseline.sh +4 -0
- package/evals/runners/claude-grade.sh +3 -0
- package/evals/runners/claude.sh +4 -0
- package/evals/runners/codex-baseline.sh +181 -0
- package/evals/runners/codex-builder.sh +96 -0
- package/evals/runners/codex-godaudits.sh +84 -0
- package/evals/runners/codex.sh +147 -0
- package/evals/runners/gemini-baseline.sh +4 -0
- package/evals/runners/gemini-grade.sh +3 -0
- package/evals/runners/gemini.sh +4 -0
- package/evals/runners/vendor-cli.sh +257 -0
- package/evals/runners/vendor-grade.sh +82 -0
- package/install.sh +323 -0
- package/package.json +91 -4
- package/requirements/skills-ref.txt +2 -0
- package/scripts/build-catalog.js +114 -0
- package/scripts/build-prompt.sh +257 -0
- package/scripts/context-metrics.js +118 -0
- package/scripts/eval-external.js +226 -0
- package/scripts/eval-matrix.sh +172 -0
- package/scripts/eval-outcome.js +143 -0
- package/scripts/eval.sh +321 -0
- package/scripts/lint-parity.js +331 -0
- package/scripts/lint.sh +743 -0
- package/scripts/outcome-summary.js +126 -0
- package/scripts/release-check.sh +108 -0
- package/scripts/release-prepare.js +41 -0
- package/scripts/summarize-eval.js +91 -0
- package/scripts/summarize-matrix.js +101 -0
- package/scripts/version-sync.js +65 -0
- package/skills/godplans/SKILL.md +192 -0
- package/skills/godplans/references/agent-memory.md +168 -0
- package/skills/godplans/references/architecture.md +189 -0
- package/skills/godplans/references/build.md +130 -0
- package/skills/godplans/references/business.md +252 -0
- package/skills/godplans/references/code-quality.md +165 -0
- package/skills/godplans/references/compliance.md +59 -0
- package/skills/godplans/references/database.md +157 -0
- package/skills/godplans/references/deploy.md +146 -0
- package/skills/godplans/references/discovery.md +297 -0
- package/skills/godplans/references/doc-set.md +243 -0
- package/skills/godplans/references/exemplar.md +228 -0
- package/skills/godplans/references/launch.md +162 -0
- package/skills/godplans/references/llm.md +132 -0
- package/skills/godplans/references/observe.md +178 -0
- package/skills/godplans/references/plan-format.md +340 -0
- package/skills/godplans/references/product.md +130 -0
- package/skills/godplans/references/repo.md +184 -0
- package/skills/godplans/references/roadmap.md +158 -0
- package/skills/godplans/references/security.md +156 -0
- package/skills/godplans/references/seo.md +133 -0
- package/skills/godplans/references/stack.md +133 -0
- package/skills/godplans/references/style-genome.md +198 -0
- package/skills/godplans/references/ui.md +153 -0
- package/skills/godplans/references/ux.md +150 -0
- package/skills/godplans/schemas/PLAN.schema.json +275 -0
- package/skills/godplans/schemas/PLAN.v1.schema.json +258 -0
- package/skills/godplans/scripts/plan-halflife.sh +76 -0
- package/skills/godplans/scripts/style-stats.py +630 -0
- package/skills/godplans/scripts/validate-plan.sh +1709 -0
- package/skills/godplans/templates/PLAN.template.mdx +269 -0
- package/tests/agent-memory-guidance.sh +32 -0
- package/tests/build-catalog.sh +81 -0
- package/tests/codex-runner.sh +139 -0
- package/tests/eval-harness.sh +377 -0
- package/tests/evidence-harnesses.sh +243 -0
- package/tests/fixtures/plan-json-v1-1.13.0.json +472 -0
- package/tests/install-regression.sh +246 -0
- package/tests/lib/plan-schema-check.js +163 -0
- package/tests/lint-selftest.sh +582 -0
- package/tests/package-contents.sh +143 -0
- package/tests/portable-prompt.test.sh +261 -0
- package/tests/release-tooling.sh +204 -0
- package/tests/run.sh +14 -0
- package/tests/script-usage.sh +37 -0
- package/tests/style-stats.sh +170 -0
- package/tests/validate-plan.sh +1970 -0
- package/tests/vendor-runner.sh +291 -0
|
@@ -0,0 +1,582 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# tests/lint-selftest.sh: prove that every scripts/lint.sh check fails when it
|
|
3
|
+
# should.
|
|
4
|
+
#
|
|
5
|
+
# Copies the repository (every tracked file and every untracked file git does
|
|
6
|
+
# not ignore) into a temporary directory once, and gives the copy its own git
|
|
7
|
+
# repository so ignore rules apply and nothing here touches the real index. A
|
|
8
|
+
# baseline run proves every --all check passes on that copy. Then each case
|
|
9
|
+
# starts from a fresh copy, injects one violation, runs only the relevant
|
|
10
|
+
# checks by name, and asserts that scripts/lint.sh exits 1 and prints the
|
|
11
|
+
# message naming the problem. The temporary path contains a space on purpose.
|
|
12
|
+
#
|
|
13
|
+
# The official validator and gh are stand-ins written here, so the result
|
|
14
|
+
# never depends on what is installed. Every nested lint runs under the bash
|
|
15
|
+
# running this script ($BASH), so /bin/bash tests/lint-selftest.sh tests 3.2.
|
|
16
|
+
#
|
|
17
|
+
# Usage: bash tests/lint-selftest.sh (exit 0 when every case passes)
|
|
18
|
+
# Bash 3.2 compatible. Writes only inside a temporary directory.
|
|
19
|
+
|
|
20
|
+
set -u
|
|
21
|
+
|
|
22
|
+
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
23
|
+
TMP="$(mktemp -d "${TMPDIR:-/tmp}/godplans lint selftest.XXXXXX")"
|
|
24
|
+
trap 'rm -rf "$TMP"' EXIT
|
|
25
|
+
TMP="$(cd "$TMP" && pwd)"
|
|
26
|
+
BASE="$TMP/base"
|
|
27
|
+
CASE="$TMP/case"
|
|
28
|
+
BIN="$TMP/bin"
|
|
29
|
+
PASS=0
|
|
30
|
+
FAIL=0
|
|
31
|
+
OUT=""
|
|
32
|
+
RC=0
|
|
33
|
+
VALIDATOR_BIN="$BIN/skills-ref-ok"
|
|
34
|
+
|
|
35
|
+
ok() { PASS=$((PASS + 1)); }
|
|
36
|
+
bad() { FAIL=$((FAIL + 1)); printf 'FAIL [lint-selftest] %s\n' "$*"; }
|
|
37
|
+
show() { printf '%s\n' "$OUT" | sed -n '1,30p' | sed 's/^/ | /'; }
|
|
38
|
+
|
|
39
|
+
# fresh: a new working copy of the pristine base in $CASE.
|
|
40
|
+
fresh() { rm -rf "$CASE"; cp -Rp "$BASE" "$CASE"; }
|
|
41
|
+
|
|
42
|
+
# run [ARG...]: run the lint in $CASE. Sets OUT and RC. SKILLS_REF_BIN is
|
|
43
|
+
# VALIDATOR_BIN; an empty VALIDATOR_BIN leaves the lint to find one itself.
|
|
44
|
+
run() {
|
|
45
|
+
RC=0
|
|
46
|
+
OUT="$(cd "$CASE" && SKILLS_REF_BIN="$VALIDATOR_BIN" "${BASH:-bash}" scripts/lint.sh "$@" 2>&1)" || RC=$?
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
# expect NAME RC TEXT...: the last run exited RC and printed every TEXT.
|
|
50
|
+
expect() {
|
|
51
|
+
name=$1
|
|
52
|
+
want=$2
|
|
53
|
+
shift 2
|
|
54
|
+
if [ "$RC" != "$want" ]; then
|
|
55
|
+
bad "$name: lint exited $RC, want $want"
|
|
56
|
+
show
|
|
57
|
+
return 0
|
|
58
|
+
fi
|
|
59
|
+
miss=""
|
|
60
|
+
for t in "$@"; do
|
|
61
|
+
printf '%s\n' "$OUT" | grep -qF -- "$t" || miss="$miss [$t]"
|
|
62
|
+
done
|
|
63
|
+
if [ -n "$miss" ]; then
|
|
64
|
+
bad "$name: output lacks$miss"
|
|
65
|
+
show
|
|
66
|
+
else
|
|
67
|
+
ok
|
|
68
|
+
fi
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
# lacks NAME TEXT: the last run did not print TEXT.
|
|
72
|
+
lacks() {
|
|
73
|
+
if printf '%s\n' "$OUT" | grep -qF -- "$2"; then
|
|
74
|
+
bad "$1: output should not contain [$2]"
|
|
75
|
+
show
|
|
76
|
+
else
|
|
77
|
+
ok
|
|
78
|
+
fi
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
# count_is NAME N TEXT: the last run printed exactly N lines containing TEXT.
|
|
82
|
+
count_is() {
|
|
83
|
+
n=$(printf '%s\n' "$OUT" | grep -cF -- "$3" || true)
|
|
84
|
+
if [ "$n" = "$2" ]; then ok; else bad "$1: $n lines contain [$3], want $2"; show; fi
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
# replace_once FILE OLD NEW: replace the first occurrence of fixed text OLD.
|
|
88
|
+
replace_once() {
|
|
89
|
+
awk -v o="$2" -v n="$3" '!done && (i = index($0, o)) { $0 = substr($0, 1, i - 1) n substr($0, i + length(o)); done = 1 } { print }' "$1" > "$1.tmp" && mv "$1.tmp" "$1"
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
# ---- stand-in tools -----------------------------------------------------------
|
|
93
|
+
mkdir -p "$BIN" "$TMP/gh-bin" "$TMP/gh-noauth" "$TMP/crash-bin"
|
|
94
|
+
printf '#!/bin/sh\nexit 0\n' > "$BIN/skills-ref-ok"
|
|
95
|
+
printf '#!/bin/sh\n[ "$1" = "--version" ] && exit 0\necho "Invalid skill: selftest rejection"\nexit 1\n' > "$BIN/skills-ref-reject"
|
|
96
|
+
printf '#!%s/no-such-interpreter\n' "$TMP" > "$BIN/skills-ref-broken"
|
|
97
|
+
printf '#!/bin/sh\nexit 0\n' > "$TMP/gh-bin/gh"
|
|
98
|
+
printf '#!/bin/sh\nexit 1\n' > "$TMP/gh-noauth/gh"
|
|
99
|
+
printf '#!/bin/sh\necho "perl: simulated crash" >&2\nexit 2\n' > "$TMP/crash-bin/perl"
|
|
100
|
+
chmod +x "$BIN"/* "$TMP/gh-bin/gh" "$TMP/gh-noauth/gh" "$TMP/crash-bin/perl"
|
|
101
|
+
|
|
102
|
+
# ---- one pristine copy -----------------------------------------------------
|
|
103
|
+
mkdir -p "$BASE"
|
|
104
|
+
if ! git -C "$ROOT" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
|
105
|
+
printf 'FAIL [lint-selftest] %s is not a git work tree; the self-test needs git to copy it\n' "$ROOT" >&2
|
|
106
|
+
exit 1
|
|
107
|
+
fi
|
|
108
|
+
(cd "$ROOT" && git ls-files -z --cached --others --exclude-standard |
|
|
109
|
+
while IFS= read -r -d '' f; do
|
|
110
|
+
if [ -e "$f" ] || [ -L "$f" ]; then printf '%s\0' "$f"; fi
|
|
111
|
+
done |
|
|
112
|
+
tar -cf - --null -T -) | (cd "$BASE" && tar -xf -)
|
|
113
|
+
(cd "$BASE" && git init -q && git add -A) >/dev/null 2>&1
|
|
114
|
+
if [ ! -f "$BASE/scripts/lint.sh" ] || [ ! -d "$BASE/.git" ]; then
|
|
115
|
+
printf 'FAIL [lint-selftest] could not copy the repository into %s\n' "$BASE" >&2
|
|
116
|
+
exit 1
|
|
117
|
+
fi
|
|
118
|
+
PACKAGE_VERSION=$(awk -F'"' '/"version":/ { print $4; exit }' "$BASE/package.json")
|
|
119
|
+
HAVE_PYTHON=0
|
|
120
|
+
if command -v python3 >/dev/null 2>&1 && python3 -c 'import ast' >/dev/null 2>&1; then
|
|
121
|
+
HAVE_PYTHON=1
|
|
122
|
+
fi
|
|
123
|
+
|
|
124
|
+
# ---- baseline: the unmodified copy passes every --all check ----------------
|
|
125
|
+
fresh
|
|
126
|
+
run --all
|
|
127
|
+
expect "baseline" 0 "ok [unicode-clean]" "ok [domain-parity]" "ok [official-validator]" "ok [context-metrics]"
|
|
128
|
+
lacks "baseline has no failure" "FAIL ["
|
|
129
|
+
lacks "--all leaves out the release-only check" "[tag-release-parity]"
|
|
130
|
+
if [ "$FAIL" -gt 0 ]; then
|
|
131
|
+
printf 'lint-selftest: the unmodified copy already fails; fix that before trusting the cases below\n'
|
|
132
|
+
fi
|
|
133
|
+
|
|
134
|
+
# ---- arguments ---------------------------------------------------------------
|
|
135
|
+
run dir-name-match no-such-check
|
|
136
|
+
expect "an unknown check name fails" 1 "Unknown check: no-such-check"
|
|
137
|
+
lacks "no check runs when a name is unknown" "ok [dir-name-match]"
|
|
138
|
+
run ""
|
|
139
|
+
expect "an empty check name fails instead of running nothing" 1 "Empty or blank check name: ''"
|
|
140
|
+
run dir-name-match " "
|
|
141
|
+
expect "a blank check name fails" 1 "Empty or blank check name: ' '"
|
|
142
|
+
lacks "no check runs when a name is blank" "ok [dir-name-match]"
|
|
143
|
+
run dir-name-match references-exist
|
|
144
|
+
expect "several names run every named check" 0 "ok [dir-name-match]" "ok [references-exist]"
|
|
145
|
+
run --verbose dir-name-match
|
|
146
|
+
expect "--verbose before a name runs only that check" 0 "ok [dir-name-match]"
|
|
147
|
+
lacks "--verbose is only a flag" "[unicode-clean]"
|
|
148
|
+
run dir-name-match --verbose
|
|
149
|
+
expect "--verbose after a name is still only a flag" 0 "ok [dir-name-match]"
|
|
150
|
+
lacks "--verbose after a name runs nothing else" "[unicode-clean]"
|
|
151
|
+
|
|
152
|
+
# ---- one failure never stops the run ---------------------------------------
|
|
153
|
+
fresh
|
|
154
|
+
printf 'a \342\200\224 b\n' >> "$CASE/docs/ARCHITECTURE.md"
|
|
155
|
+
printf '%s\n' '{ invalid json' > "$CASE/evals/cases/brownfield-cli/INPUT/package.json"
|
|
156
|
+
run --all
|
|
157
|
+
expect "--all reports every failing check and runs the rest" 1 \
|
|
158
|
+
"FAIL [unicode-clean] non-ASCII character in docs/ARCHITECTURE.md:" \
|
|
159
|
+
"FAIL [json-valid] invalid JSON: evals/cases/brownfield-cli/INPUT/package.json" \
|
|
160
|
+
"ok [context-metrics]" \
|
|
161
|
+
"FAIL [lint] failing checks: unicode-clean json-valid"
|
|
162
|
+
|
|
163
|
+
# A check that crashes (perl exits 2) fails the run, and the next check runs.
|
|
164
|
+
fresh
|
|
165
|
+
RC=0
|
|
166
|
+
OUT="$(cd "$CASE" && PATH="$TMP/crash-bin:$PATH" SKILLS_REF_BIN="$VALIDATOR_BIN" "${BASH:-bash}" scripts/lint.sh unicode-clean dir-name-match 2>&1)" || RC=$?
|
|
167
|
+
expect "a check that crashes fails the run" 1 "FAIL [unicode-clean] the check stopped early (exit 2)" "ok [dir-name-match]"
|
|
168
|
+
lacks "a crash is never reported as a pass" "ok [unicode-clean]"
|
|
169
|
+
|
|
170
|
+
# ---- unicode-clean -----------------------------------------------------------
|
|
171
|
+
fresh
|
|
172
|
+
printf 'Launch \360\237\232\200 now\n' >> "$CASE/README.md" # emoji, tracked .md
|
|
173
|
+
printf '# \342\200\234quoted\342\200\235\n' >> "$CASE/skills/godplans/scripts/style-stats.py" # smart quotes, tracked .py
|
|
174
|
+
printf '# a \342\206\222 b\n' >> "$CASE/requirements/skills-ref.txt" # arrow, tracked .txt
|
|
175
|
+
printf 'tree\n\342\224\234\342\224\200 x\n' > "$CASE/docs/new notes.md" # box drawing, untracked
|
|
176
|
+
mkdir -p "$CASE/.godplans" "$CASE/.venv-skills-ref/lib"
|
|
177
|
+
printf 'plan \342\200\224 local\n' > "$CASE/.godplans/PLAN.mdx" # git-ignored
|
|
178
|
+
printf '{"name": "caf\303\251"}\n' > "$CASE/.venv-skills-ref/lib/METADATA.json" # git-ignored
|
|
179
|
+
run unicode-clean
|
|
180
|
+
expect "unicode-clean flags tracked .md, .py, and .txt files and untracked files" 1 \
|
|
181
|
+
"FAIL [unicode-clean] non-ASCII character in README.md:" \
|
|
182
|
+
"FAIL [unicode-clean] non-ASCII character in skills/godplans/scripts/style-stats.py:" \
|
|
183
|
+
"FAIL [unicode-clean] non-ASCII character in requirements/skills-ref.txt:" \
|
|
184
|
+
"FAIL [unicode-clean] non-ASCII character in docs/new notes.md:"
|
|
185
|
+
lacks "unicode-clean skips git-ignored plan output" ".godplans/PLAN.mdx"
|
|
186
|
+
lacks "unicode-clean skips the git-ignored validator venv" ".venv-skills-ref"
|
|
187
|
+
|
|
188
|
+
# Without git (an unpacked npm tarball or an export), a name allowlist and a
|
|
189
|
+
# prune list stand in for the ignore rules.
|
|
190
|
+
fresh
|
|
191
|
+
rm -rf "$CASE/.git"
|
|
192
|
+
run unicode-clean json-valid
|
|
193
|
+
expect "without git a clean copy passes" 0 "ok [unicode-clean]" "ok [json-valid]"
|
|
194
|
+
mkdir -p "$CASE/.godplans" "$CASE/.venv-skills-ref/lib" "$CASE/node_modules/dep" "$CASE/.claude/worktrees/other"
|
|
195
|
+
printf 'plan \342\200\224 local\n' > "$CASE/.godplans/PLAN.mdx"
|
|
196
|
+
printf '{"truncated": ' > "$CASE/.godplans/PLAN.json"
|
|
197
|
+
printf '{"name": "caf\303\251"\n' > "$CASE/.venv-skills-ref/lib/METADATA.json"
|
|
198
|
+
printf '{"name": "caf\303\251"\n' > "$CASE/node_modules/dep/package.json"
|
|
199
|
+
printf 'a \342\200\224 b\n' > "$CASE/.claude/worktrees/other/README.md"
|
|
200
|
+
printf '# \342\200\234quoted\342\200\235\n' >> "$CASE/skills/godplans/scripts/style-stats.py"
|
|
201
|
+
run unicode-clean json-valid
|
|
202
|
+
expect "without git authored files are still scanned" 1 \
|
|
203
|
+
"FAIL [unicode-clean] non-ASCII character in skills/godplans/scripts/style-stats.py:" \
|
|
204
|
+
"ok [json-valid]"
|
|
205
|
+
lacks "without git plan output is skipped" ".godplans/PLAN"
|
|
206
|
+
lacks "without git the validator venv is skipped" ".venv-skills-ref"
|
|
207
|
+
lacks "without git node_modules is skipped" "node_modules"
|
|
208
|
+
lacks "without git other worktrees are skipped" ".claude/worktrees"
|
|
209
|
+
|
|
210
|
+
# ---- version-parity ----------------------------------------------------------
|
|
211
|
+
fresh
|
|
212
|
+
perl -0pi -e 's/"version": "[^"]+"/"version": "9.9.9"/' "$CASE/package.json"
|
|
213
|
+
run version-parity
|
|
214
|
+
expect "version-parity flags package drift" 1 "FAIL [version-parity] package version (9.9.9) != SKILL.md version"
|
|
215
|
+
|
|
216
|
+
fresh
|
|
217
|
+
rm "$CASE/.claude-plugin/marketplace.json"
|
|
218
|
+
run version-parity
|
|
219
|
+
expect "version-parity names a missing surface" 1 "FAIL [version-parity] missing version surface: .claude-plugin/marketplace.json"
|
|
220
|
+
lacks "a missing surface is a failure, not a crash" "stopped early"
|
|
221
|
+
|
|
222
|
+
# ---- description-length and description-parity -----------------------------
|
|
223
|
+
fresh
|
|
224
|
+
perl -0pi -e 's/^description: .*$/"description: \"" . join(" ", ("plan") x 220) . "\""/me' "$CASE/skills/godplans/SKILL.md"
|
|
225
|
+
run description-length
|
|
226
|
+
expect "description-length flags a long description" 1 "FAIL [description-length] description is 1099 characters; Agent Skills spec bound is 1-1024"
|
|
227
|
+
|
|
228
|
+
# Only one double-quoted line is read; a folded or continued description is
|
|
229
|
+
# refused by name rather than measured.
|
|
230
|
+
fresh
|
|
231
|
+
perl -0pi -e 's/^description: "(.*)"$/my $d = $1; $d =~ s{(.{60,}?) }{$1\n }g; "description: >-\n $d"/me' "$CASE/skills/godplans/SKILL.md"
|
|
232
|
+
run description-length description-parity
|
|
233
|
+
expect "a folded description is refused" 1 \
|
|
234
|
+
"FAIL [description-length] cannot read the SKILL.md description: skills/godplans/SKILL.md description must be one double-quoted line" \
|
|
235
|
+
"FAIL [description-parity] cannot compare descriptions: skills/godplans/SKILL.md description must be one double-quoted line"
|
|
236
|
+
fresh
|
|
237
|
+
perl -0pi -e 's/^description: "(.{40,}?) (.*)"$/description: "$1\n $2"/m' "$CASE/skills/godplans/SKILL.md"
|
|
238
|
+
run description-length
|
|
239
|
+
expect "a double-quoted description continued on a second line is refused" 1 "FAIL [description-length] cannot read the SKILL.md description: skills/godplans/SKILL.md description must be one double-quoted line"
|
|
240
|
+
|
|
241
|
+
# Escapes are decoded before measuring and comparing: 24 characters, not 26.
|
|
242
|
+
fresh
|
|
243
|
+
perl -0pi -e 's/^description: ".*"$/description: "Plan \\"everything\\" first."/m' "$CASE/skills/godplans/SKILL.md"
|
|
244
|
+
perl -0pi -e 's/("description": )"[^"]*"/$1"Plan \\"everything\\" first."/' "$CASE/plugins/godplans/.claude-plugin/plugin.json"
|
|
245
|
+
perl -0pi -e 's/("source": "\.\/plugins\/godplans",\s*"description": )"[^"]*"/$1"Plan \\"everything\\" first."/' "$CASE/.claude-plugin/marketplace.json"
|
|
246
|
+
run --verbose description-length description-parity
|
|
247
|
+
expect "an escaped quote is one character and compares decoded" 0 "description length: 24" "ok [description-length]" "ok [description-parity]"
|
|
248
|
+
|
|
249
|
+
fresh
|
|
250
|
+
perl -0pi -e 's/("description": )"[^"]*"/$1"A stale description"/' "$CASE/plugins/godplans/.claude-plugin/plugin.json"
|
|
251
|
+
perl -0pi -e 's/("source": "\.\/plugins\/godplans",\s*"description": )"[^"]*"/$1"A stale description"/' "$CASE/.claude-plugin/marketplace.json"
|
|
252
|
+
run description-parity
|
|
253
|
+
expect "description-parity flags both manifests and names the fix" 1 \
|
|
254
|
+
"FAIL [description-parity] plugins/godplans/.claude-plugin/plugin.json description differs from the SKILL.md frontmatter description" \
|
|
255
|
+
"FAIL [description-parity] .claude-plugin/marketplace.json godplans plugin entry description differs from the SKILL.md frontmatter description" \
|
|
256
|
+
"copy the SKILL.md description into it verbatim"
|
|
257
|
+
|
|
258
|
+
# The marketplace tagline is a hand copy of package.json, not of SKILL.md.
|
|
259
|
+
fresh
|
|
260
|
+
perl -0pi -e 's/("metadata": \{\s*"description": )"[^"]*"/$1"A stale tagline"/' "$CASE/.claude-plugin/marketplace.json"
|
|
261
|
+
run description-parity
|
|
262
|
+
expect "description-parity flags a stale marketplace tagline" 1 \
|
|
263
|
+
"FAIL [description-parity] .claude-plugin/marketplace.json metadata description differs from the package.json description" \
|
|
264
|
+
"copy the package.json description into it verbatim"
|
|
265
|
+
lacks "a stale tagline is not blamed on the plugin entry" "godplans plugin entry description differs"
|
|
266
|
+
|
|
267
|
+
fresh
|
|
268
|
+
perl -0pi -e 's/("plugins": \[\s*\{\s*"name": )"godplans"/$1"godplan"/' "$CASE/.claude-plugin/marketplace.json"
|
|
269
|
+
run description-parity
|
|
270
|
+
expect "description-parity needs the godplans marketplace entry" 1 "FAIL [description-parity] .claude-plugin/marketplace.json has 0 plugin entries named godplans; want exactly 1"
|
|
271
|
+
|
|
272
|
+
# ---- dir-name-match, references-exist, modules-complete -------------------
|
|
273
|
+
fresh
|
|
274
|
+
replace_once "$CASE/skills/godplans/SKILL.md" 'name: godplans' 'name: godplan'
|
|
275
|
+
run dir-name-match
|
|
276
|
+
expect "dir-name-match flags a renamed skill" 1 "FAIL [dir-name-match] frontmatter name (godplan) != directory name (godplans)"
|
|
277
|
+
|
|
278
|
+
fresh
|
|
279
|
+
printf '\nSee `references/missing-module.md`.\n' >> "$CASE/skills/godplans/SKILL.md"
|
|
280
|
+
run references-exist
|
|
281
|
+
expect "references-exist flags a missing module" 1 "FAIL [references-exist] SKILL.md names references/missing-module.md but it does not exist"
|
|
282
|
+
|
|
283
|
+
fresh
|
|
284
|
+
grep -v '^## Task seeds' "$CASE/skills/godplans/references/ux.md" > "$CASE/ux.tmp" && mv "$CASE/ux.tmp" "$CASE/skills/godplans/references/ux.md"
|
|
285
|
+
run modules-complete
|
|
286
|
+
expect "modules-complete flags a missing section" 1 "FAIL [modules-complete] ux.md missing section: ## Task seeds"
|
|
287
|
+
|
|
288
|
+
# ---- domain-parity -----------------------------------------------------------
|
|
289
|
+
# A complete new module that no list names passes modules-complete and fails
|
|
290
|
+
# domain-parity once per list.
|
|
291
|
+
fresh
|
|
292
|
+
printf '# Product ops\n\n## Lineage\n\n## Decisions to force\n\n## Plan requirements\n\n## Task seeds\n\n## Self-audit rubric\n\n## Anti-patterns refused\n' > "$CASE/skills/godplans/references/product-ops.md"
|
|
293
|
+
run modules-complete domain-parity
|
|
294
|
+
expect "a new module unknown to every list fails domain-parity" 1 \
|
|
295
|
+
"ok [modules-complete]" \
|
|
296
|
+
"FAIL [domain-parity] skills/godplans/SKILL.md Phase 4 table lacks domain module product-ops" \
|
|
297
|
+
"FAIL [domain-parity] skills/godplans/scripts/validate-plan.sh %known_domain lacks domain module product-ops" \
|
|
298
|
+
"FAIL [domain-parity] skills/godplans/scripts/validate-plan.sh %module_prefix keys lacks domain module product-ops" \
|
|
299
|
+
"FAIL [domain-parity] scripts/build-prompt.sh full REFERENCE_ORDER lacks domain module product-ops" \
|
|
300
|
+
"FAIL [domain-parity] scripts/context-metrics.js coreModules + lazyModules lacks domain module product-ops" \
|
|
301
|
+
"FAIL [domain-parity] tests/portable-prompt.test.sh expected_refs + lazy_refs lacks domain module product-ops"
|
|
302
|
+
|
|
303
|
+
# The template matrix every plan copies, discovery's worked matrix, and the
|
|
304
|
+
# schema's row count are compared too.
|
|
305
|
+
fresh
|
|
306
|
+
perl -0pi -e 's/^\| business \| applicable-or-excluded \|[^\n]*\n//m' "$CASE/skills/godplans/templates/PLAN.template.mdx"
|
|
307
|
+
perl -0pi -e 's/"minItems": 19,/"minItems": 18,/' "$CASE/skills/godplans/schemas/PLAN.schema.json"
|
|
308
|
+
run domain-parity
|
|
309
|
+
expect "template matrix and schema count are compared" 1 \
|
|
310
|
+
"FAIL [domain-parity] skills/godplans/templates/PLAN.template.mdx applicability matrix lacks domain module business" \
|
|
311
|
+
"FAIL [domain-parity] skills/godplans/schemas/PLAN.schema.json applicability minItems 18 and maxItems 19 must both equal the 19 domain modules"
|
|
312
|
+
|
|
313
|
+
# One list drifting fails only on that file: once as a missing module and
|
|
314
|
+
# once as a gap in its lazy list.
|
|
315
|
+
fresh
|
|
316
|
+
grep -vx 'ux' "$CASE/tests/portable-prompt.test.sh" > "$CASE/pp.tmp" && mv "$CASE/pp.tmp" "$CASE/tests/portable-prompt.test.sh"
|
|
317
|
+
run domain-parity
|
|
318
|
+
expect "one drifting list fails domain-parity" 1 \
|
|
319
|
+
"FAIL [domain-parity] tests/portable-prompt.test.sh expected_refs + lazy_refs lacks domain module ux" \
|
|
320
|
+
"FAIL [domain-parity] tests/portable-prompt.test.sh lazy_refs lacks ux, which scripts/context-metrics.js lazyModules names"
|
|
321
|
+
count_is "only the drifting file is named" 2 "FAIL [domain-parity]"
|
|
322
|
+
count_is "every message names the drifting file" 2 "FAIL [domain-parity] tests/portable-prompt.test.sh"
|
|
323
|
+
|
|
324
|
+
# The core and lazy split, the lazy module sentence, and the module count in
|
|
325
|
+
# build-prompt.sh are compared too, even when every union list is complete.
|
|
326
|
+
fresh
|
|
327
|
+
replace_once "$CASE/scripts/build-prompt.sh" 'all 19 domain modules' 'all 18 domain modules'
|
|
328
|
+
replace_once "$CASE/scripts/build-prompt.sh" 'The lazy modules are business, llm, ux, ui,' 'The lazy modules are business, llm, ui,'
|
|
329
|
+
perl -0pi -e 's/^product architecture stack database security\nexemplar plan-format$/product architecture stack database\nexemplar plan-format/m' "$CASE/scripts/build-prompt.sh"
|
|
330
|
+
perl -0pi -e 's/^ux\n//m; s/^security\n/security\nux\n/m' "$CASE/tests/portable-prompt.test.sh"
|
|
331
|
+
run domain-parity
|
|
332
|
+
expect "build-prompt prose and the core and lazy split are compared" 1 \
|
|
333
|
+
"FAIL [domain-parity] scripts/build-prompt.sh full-mode header says all 18 domain modules, but skills/godplans/references has 19" \
|
|
334
|
+
"FAIL [domain-parity] scripts/build-prompt.sh core-mode lazy module sentence lacks ux, which scripts/context-metrics.js lazyModules names" \
|
|
335
|
+
"FAIL [domain-parity] scripts/build-prompt.sh core REFERENCE_ORDER lacks security, which scripts/context-metrics.js coreModules names" \
|
|
336
|
+
"FAIL [domain-parity] tests/portable-prompt.test.sh expected_refs names ux, which scripts/context-metrics.js coreModules does not" \
|
|
337
|
+
"FAIL [domain-parity] tests/portable-prompt.test.sh lazy_refs lacks ux, which scripts/context-metrics.js lazyModules names"
|
|
338
|
+
lacks "a complete union list is not reported" "expected_refs + lazy_refs lacks"
|
|
339
|
+
|
|
340
|
+
# Requirement prefixes: one per module, and each module defines its
|
|
341
|
+
# requirements under its own prefix.
|
|
342
|
+
fresh
|
|
343
|
+
perl -pi -e "s/'seo' => 'SEO'/'seo' => 'SEOX'/; s/'ux' => 'UX'/'ux' => 'UI'/" "$CASE/skills/godplans/scripts/validate-plan.sh"
|
|
344
|
+
run domain-parity
|
|
345
|
+
expect "requirement prefixes are compared with the modules" 1 \
|
|
346
|
+
"FAIL [domain-parity] skills/godplans/scripts/validate-plan.sh %module_prefix gives the prefix UI to ux and ui" \
|
|
347
|
+
"FAIL [domain-parity] skills/godplans/references/seo.md defines no R-SEOX-N requirement" \
|
|
348
|
+
"FAIL [domain-parity] skills/godplans/references/seo.md defines R-SEO-N requirements, but %module_prefix gives seo the prefix SEOX"
|
|
349
|
+
|
|
350
|
+
# The validator derives the prefix-to-module map with reverse; a validator
|
|
351
|
+
# without that line fails.
|
|
352
|
+
fresh
|
|
353
|
+
perl -0pi -e 's/^my %prefix_module = reverse %module_prefix;\n//m' "$CASE/skills/godplans/scripts/validate-plan.sh"
|
|
354
|
+
run domain-parity
|
|
355
|
+
expect "a validator with no prefix-to-module map fails" 1 "FAIL [domain-parity] skills/godplans/scripts/validate-plan.sh prefix-to-module map: cannot find %prefix_module = reverse %module_prefix"
|
|
356
|
+
perl -0pi -e 's/^(my %module_prefix = \(.*?\);\n)/$1my %prefix_module = reverse %module_prefix;\n/ms' "$CASE/skills/godplans/scripts/validate-plan.sh"
|
|
357
|
+
run domain-parity
|
|
358
|
+
expect "a prefix map derived with reverse passes" 0 "ok [domain-parity]"
|
|
359
|
+
|
|
360
|
+
fresh
|
|
361
|
+
perl -0pi -e 's/(%known_domain = map \{ \$_ => 1 \} qw\()/$1\n analytics/' "$CASE/skills/godplans/scripts/validate-plan.sh"
|
|
362
|
+
perl -0pi -e "s/'seo' => 'SEO',\\s*//" "$CASE/skills/godplans/scripts/validate-plan.sh"
|
|
363
|
+
run domain-parity
|
|
364
|
+
expect "validator domain tables are compared" 1 \
|
|
365
|
+
"FAIL [domain-parity] skills/godplans/scripts/validate-plan.sh %known_domain names analytics, but skills/godplans/references/analytics.md does not exist" \
|
|
366
|
+
"FAIL [domain-parity] skills/godplans/scripts/validate-plan.sh %module_prefix keys lacks domain module seo"
|
|
367
|
+
|
|
368
|
+
# ---- symlinks-valid ----------------------------------------------------------
|
|
369
|
+
fresh
|
|
370
|
+
rm "$CASE/.claude/skills/godplans"
|
|
371
|
+
printf '../../skills/godplans' > "$CASE/.claude/skills/godplans"
|
|
372
|
+
rm "$CASE/.agents/skills/godplans"
|
|
373
|
+
mkdir "$CASE/.agents/skills/godplans"
|
|
374
|
+
rm "$CASE/plugins/godplans/skills"
|
|
375
|
+
ln -s ../../skills/godplans "$CASE/plugins/godplans/skills"
|
|
376
|
+
run symlinks-valid
|
|
377
|
+
expect "symlinks-valid flags a link file, a copied directory, and a wrong target" 1 \
|
|
378
|
+
"FAIL [symlinks-valid] .claude/skills/godplans is not a symlink to skills/godplans" \
|
|
379
|
+
"FAIL [symlinks-valid] .agents/skills/godplans is not a symlink to skills/godplans" \
|
|
380
|
+
"FAIL [symlinks-valid] plugins/godplans/skills resolves to" ", not skills"
|
|
381
|
+
|
|
382
|
+
fresh
|
|
383
|
+
rm "$CASE/plugins/godplans/skills"
|
|
384
|
+
run symlinks-valid
|
|
385
|
+
expect "symlinks-valid flags a missing plugin projection" 1 "FAIL [symlinks-valid] plugins/godplans/skills does not exist; it must be a symlink to skills"
|
|
386
|
+
|
|
387
|
+
# ---- json-valid --------------------------------------------------------------
|
|
388
|
+
fresh
|
|
389
|
+
printf '%s\n' '{ invalid json' > "$CASE/evals/cases/brownfield-cli/INPUT/package.json"
|
|
390
|
+
mkdir -p "$CASE/.godplans" "$CASE/.venv-skills-ref/lib"
|
|
391
|
+
printf '{"truncated": ' > "$CASE/.godplans/PLAN.json"
|
|
392
|
+
printf '{"name": ' > "$CASE/.venv-skills-ref/lib/METADATA.json"
|
|
393
|
+
run json-valid
|
|
394
|
+
expect "json-valid flags a tracked file" 1 "FAIL [json-valid] invalid JSON: evals/cases/brownfield-cli/INPUT/package.json"
|
|
395
|
+
lacks "json-valid skips git-ignored plan output" ".godplans/PLAN.json"
|
|
396
|
+
lacks "json-valid skips the git-ignored validator venv" ".venv-skills-ref"
|
|
397
|
+
|
|
398
|
+
# ---- shell-syntax ------------------------------------------------------------
|
|
399
|
+
# The printf arguments keep this file's own lines from matching the bash 4
|
|
400
|
+
# pattern, since shell-syntax scans this file too.
|
|
401
|
+
fresh
|
|
402
|
+
printf 'if then\n' >> "$CASE/evals/outcomes/cases/tenant-notes-api/VERIFY.sh"
|
|
403
|
+
printf 'fi\n' >> "$CASE/install.sh"
|
|
404
|
+
printf '#!/usr/bin/env bash\nma%sfile -t lines < /dev/null\n' p > "$CASE/scripts/b4.sh"
|
|
405
|
+
printf '#!/usr/bin/env bash\necho "$%s{1,,}"\n' '' > "$CASE/scripts/b4c.sh"
|
|
406
|
+
printf '#!/usr/bin/env bash\n# a comment may say ma%sfile\nx=1\n' p > "$CASE/scripts/b3.sh"
|
|
407
|
+
run shell-syntax
|
|
408
|
+
expect "shell-syntax parses every script and flags bash 4 constructs" 1 \
|
|
409
|
+
"FAIL [shell-syntax] evals/outcomes/cases/tenant-notes-api/VERIFY.sh does not parse as bash" \
|
|
410
|
+
"FAIL [shell-syntax] install.sh does not parse as sh" \
|
|
411
|
+
"FAIL [shell-syntax] scripts/b4.sh uses a bash 4 construct" \
|
|
412
|
+
"FAIL [shell-syntax] scripts/b4c.sh uses a bash 4 construct"
|
|
413
|
+
lacks "shell-syntax skips comment lines" "scripts/b3.sh"
|
|
414
|
+
|
|
415
|
+
# One script per further bash 4 or later construct. Each line below carries a
|
|
416
|
+
# ~~ that is stripped when the script is written, so this file's own lines
|
|
417
|
+
# never match the pattern.
|
|
418
|
+
fresh
|
|
419
|
+
n=0
|
|
420
|
+
while IFS= read -r construct; do
|
|
421
|
+
n=$((n + 1))
|
|
422
|
+
printf '#!/usr/bin/env bash\n%s\n' "$construct" | sed 's/~~//g' > "$CASE/scripts/b4-$n.sh"
|
|
423
|
+
done <<'EOF'
|
|
424
|
+
declare -~~g x=1
|
|
425
|
+
echo "${x@~~Q}"
|
|
426
|
+
a=(1 2); echo "${a[-~~1]}"
|
|
427
|
+
sh~~opt -s globstar
|
|
428
|
+
wa~~it -n
|
|
429
|
+
ls |~~& cat
|
|
430
|
+
[[ -~~v x ]] && echo set
|
|
431
|
+
case x in a) echo a ;~~& b) echo b ;; esac
|
|
432
|
+
local -~~u y
|
|
433
|
+
EOF
|
|
434
|
+
run shell-syntax
|
|
435
|
+
i=0
|
|
436
|
+
while [ "$i" -lt "$n" ]; do
|
|
437
|
+
i=$((i + 1))
|
|
438
|
+
expect "shell-syntax flags bash 4 construct $i: $(sed -n 2p "$CASE/scripts/b4-$i.sh")" 1 "FAIL [shell-syntax] scripts/b4-$i.sh uses a bash 4 construct"
|
|
439
|
+
done
|
|
440
|
+
|
|
441
|
+
# ---- js-syntax and python-syntax --------------------------------------------
|
|
442
|
+
fresh
|
|
443
|
+
printf 'function (\n' >> "$CASE/scripts/summarize-matrix.js"
|
|
444
|
+
run js-syntax
|
|
445
|
+
expect "js-syntax flags a broken script" 1 "FAIL [js-syntax] scripts/summarize-matrix.js does not parse:"
|
|
446
|
+
|
|
447
|
+
fresh
|
|
448
|
+
printf 'def broken(:\n' >> "$CASE/skills/godplans/scripts/style-stats.py"
|
|
449
|
+
run python-syntax
|
|
450
|
+
if [ "$HAVE_PYTHON" = "1" ]; then
|
|
451
|
+
expect "python-syntax flags a broken script" 1 "FAIL [python-syntax] skills/godplans/scripts/style-stats.py does not parse:"
|
|
452
|
+
if [ -e "$CASE/skills/godplans/scripts/__pycache__" ]; then
|
|
453
|
+
bad "python-syntax wrote __pycache__ into the skill directory"
|
|
454
|
+
else
|
|
455
|
+
ok
|
|
456
|
+
fi
|
|
457
|
+
else
|
|
458
|
+
expect "python-syntax skips visibly without python3" 0 "skip [python-syntax] python3 cannot run"
|
|
459
|
+
fi
|
|
460
|
+
|
|
461
|
+
# ---- eval-cases, product-surfaces, context-metrics ------------------------
|
|
462
|
+
fresh
|
|
463
|
+
printf 'bogus|x|y\n' >> "$CASE/evals/cases/greenfield-saas/EXPECTATIONS"
|
|
464
|
+
run eval-cases
|
|
465
|
+
expect "eval-cases flags an invalid manifest" 1 "FAIL [eval-cases] behavioral case contract failed"
|
|
466
|
+
|
|
467
|
+
fresh
|
|
468
|
+
chmod -x "$CASE/scripts/eval-matrix.sh"
|
|
469
|
+
run product-surfaces
|
|
470
|
+
expect "product-surfaces flags a non-executable entry point" 1 "FAIL [product-surfaces] missing executable: scripts/eval-matrix.sh"
|
|
471
|
+
|
|
472
|
+
fresh
|
|
473
|
+
printf '\nA sentence that changes the module size.\n' >> "$CASE/skills/godplans/references/compliance.md"
|
|
474
|
+
run context-metrics
|
|
475
|
+
expect "context-metrics flags stale metrics" 1 "FAIL [context-metrics] evals/metrics/context-cost.json is stale"
|
|
476
|
+
|
|
477
|
+
# ---- action-pins -------------------------------------------------------------
|
|
478
|
+
fresh
|
|
479
|
+
printf ' - uses: actions/checkout@v4\n' >> "$CASE/.github/workflows/lint.yml"
|
|
480
|
+
run action-pins
|
|
481
|
+
expect "action-pins flags the - uses: list-item form" 1 "FAIL [action-pins] floating GitHub Action reference in .github/workflows/lint.yml: actions/checkout@v4"
|
|
482
|
+
|
|
483
|
+
fresh
|
|
484
|
+
perl -0pi -e 's|actions/checkout\@[0-9a-f]{40}|actions/checkout\@v7|' "$CASE/.github/workflows/lint.yml"
|
|
485
|
+
run action-pins
|
|
486
|
+
expect "action-pins flags a floating plain uses: reference" 1 "FAIL [action-pins] floating GitHub Action reference in .github/workflows/lint.yml: actions/checkout@v7"
|
|
487
|
+
|
|
488
|
+
fresh
|
|
489
|
+
printf ' - uses: "actions/checkout@%s"\n' 0123456789abcdef0123456789abcdef01234567 >> "$CASE/.github/workflows/lint.yml"
|
|
490
|
+
printf " - uses: './.github/actions/local'\n" >> "$CASE/.github/workflows/lint.yml"
|
|
491
|
+
run action-pins
|
|
492
|
+
expect "action-pins accepts a quoted SHA pin and a local action" 0 "ok [action-pins]"
|
|
493
|
+
|
|
494
|
+
# ---- official-validator ------------------------------------------------------
|
|
495
|
+
fresh
|
|
496
|
+
VALIDATOR_BIN="$BIN/skills-ref-reject"
|
|
497
|
+
run official-validator
|
|
498
|
+
expect "a validator that rejects the skill fails" 1 "FAIL [official-validator] official skills-ref validator rejected skills/godplans (exit 1):" "Invalid skill: selftest rejection"
|
|
499
|
+
VALIDATOR_BIN="$TMP/no-such-dir/skills-ref"
|
|
500
|
+
run official-validator
|
|
501
|
+
expect "an explicit SKILLS_REF_BIN that does not exist fails" 1 "FAIL [official-validator] SKILLS_REF_BIN=$TMP/no-such-dir/skills-ref is not an executable file"
|
|
502
|
+
VALIDATOR_BIN="$BIN/skills-ref-broken"
|
|
503
|
+
run official-validator
|
|
504
|
+
expect "an explicit SKILLS_REF_BIN that cannot run fails" 1 "FAIL [official-validator] could not execute $BIN/skills-ref-broken"
|
|
505
|
+
lacks "a validator that cannot run is not reported as a rejection" "rejected"
|
|
506
|
+
# Found automatically, the repo venv comes before PATH, and a copy that cannot
|
|
507
|
+
# run is a visible skip rather than a rejection.
|
|
508
|
+
mkdir -p "$CASE/.venv-skills-ref/bin"
|
|
509
|
+
cp "$BIN/skills-ref-broken" "$CASE/.venv-skills-ref/bin/skills-ref"
|
|
510
|
+
VALIDATOR_BIN=""
|
|
511
|
+
run official-validator
|
|
512
|
+
expect "a broken venv validator is skipped visibly" 0 "skip [official-validator] $CASE/.venv-skills-ref/bin/skills-ref is installed but cannot run"
|
|
513
|
+
cp "$BIN/skills-ref-ok" "$CASE/.venv-skills-ref/bin/skills-ref"
|
|
514
|
+
run --verbose official-validator
|
|
515
|
+
expect "the repo venv validator is found without SKILLS_REF_BIN" 0 "skills-ref accepted skills/godplans ($CASE/.venv-skills-ref/bin/skills-ref)" "ok [official-validator]"
|
|
516
|
+
VALIDATOR_BIN="$BIN/skills-ref-ok"
|
|
517
|
+
|
|
518
|
+
# No validator anywhere is a visible skip, never an ok. PATH keeps every
|
|
519
|
+
# directory except those holding a skills-ref.
|
|
520
|
+
fresh
|
|
521
|
+
NOREF_PATH=""
|
|
522
|
+
old_ifs=$IFS
|
|
523
|
+
IFS=:
|
|
524
|
+
for dir in $PATH; do
|
|
525
|
+
if [ -n "$dir" ] && [ ! -x "$dir/skills-ref" ]; then
|
|
526
|
+
NOREF_PATH="${NOREF_PATH:+$NOREF_PATH:}$dir"
|
|
527
|
+
fi
|
|
528
|
+
done
|
|
529
|
+
IFS=$old_ifs
|
|
530
|
+
if PATH="$NOREF_PATH" command -v mktemp >/dev/null 2>&1; then
|
|
531
|
+
RC=0
|
|
532
|
+
OUT="$(cd "$CASE" && PATH="$NOREF_PATH" SKILLS_REF_BIN="" "${BASH:-bash}" scripts/lint.sh official-validator 2>&1)" || RC=$?
|
|
533
|
+
expect "no installed validator is skipped visibly" 0 "skip [official-validator] skills-ref not installed"
|
|
534
|
+
lacks "no installed validator is never reported ok" "ok [official-validator]"
|
|
535
|
+
else
|
|
536
|
+
printf 'lint-selftest: note: skills-ref shares a directory with mktemp; the no-validator case was not run\n'
|
|
537
|
+
fi
|
|
538
|
+
|
|
539
|
+
# ---- prompt-fresh ------------------------------------------------------------
|
|
540
|
+
fresh
|
|
541
|
+
printf '\nstale marker\n' >> "$CASE/PROMPT.md"
|
|
542
|
+
before=$(cksum < "$CASE/PROMPT.md")
|
|
543
|
+
run prompt-fresh
|
|
544
|
+
expect "prompt-fresh flags a stale prompt" 1 "FAIL [prompt-fresh] PROMPT.md is stale"
|
|
545
|
+
after=$(cksum < "$CASE/PROMPT.md")
|
|
546
|
+
if [ "$before" = "$after" ]; then ok; else bad "prompt-fresh mutated PROMPT.md"; fi
|
|
547
|
+
|
|
548
|
+
fresh
|
|
549
|
+
rm "$CASE/skills/godplans/references/security.md"
|
|
550
|
+
run prompt-fresh dir-name-match
|
|
551
|
+
expect "a failing prompt build is a failure and the next check runs" 1 "FAIL [prompt-fresh] scripts/build-prompt.sh failed" "ok [dir-name-match]"
|
|
552
|
+
lacks "a failing prompt build is not a crash" "stopped early"
|
|
553
|
+
|
|
554
|
+
# ---- tag-release-parity (release-only; gh is a stand-in) -------------------
|
|
555
|
+
# tag.gpgSign=true in the user's config would turn the tag into a signed
|
|
556
|
+
# annotated tag that needs a message, so signing is off and the editor is a
|
|
557
|
+
# no-op.
|
|
558
|
+
fresh
|
|
559
|
+
(cd "$CASE" &&
|
|
560
|
+
git -c user.name=selftest -c user.email=selftest@example.invalid -c commit.gpgsign=false -c core.hooksPath=/dev/null commit -q -m selftest &&
|
|
561
|
+
GIT_EDITOR=true git -c tag.gpgSign=false tag v0.0.1) >/dev/null 2>&1
|
|
562
|
+
if git -C "$CASE" rev-parse -q --verify refs/tags/v0.0.1 >/dev/null 2>&1; then
|
|
563
|
+
RC=0
|
|
564
|
+
OUT="$(cd "$CASE" && PATH="$TMP/gh-bin:$PATH" "${BASH:-bash}" scripts/lint.sh tag-release-parity 2>&1)" || RC=$?
|
|
565
|
+
expect "tag-release-parity flags a tag without a matching version or release" 1 \
|
|
566
|
+
"FAIL [tag-release-parity] v0.0.1 package version ($PACKAGE_VERSION) does not match 0.0.1" \
|
|
567
|
+
"FAIL [tag-release-parity] v0.0.1 has no matching published GitHub release"
|
|
568
|
+
else
|
|
569
|
+
bad "tag-release-parity setup: could not create the tag v0.0.1 in the copy"
|
|
570
|
+
fi
|
|
571
|
+
|
|
572
|
+
# Without an authenticated gh the check is a visible skip, never an ok.
|
|
573
|
+
RC=0
|
|
574
|
+
OUT="$(cd "$CASE" && PATH="$TMP/gh-noauth:$PATH" "${BASH:-bash}" scripts/lint.sh tag-release-parity 2>&1)" || RC=$?
|
|
575
|
+
expect "tag-release-parity without an authenticated gh is skipped visibly" 0 "skip [tag-release-parity] authenticated gh CLI unavailable"
|
|
576
|
+
lacks "tag-release-parity without gh is never reported ok" "ok [tag-release-parity]"
|
|
577
|
+
|
|
578
|
+
printf 'lint-selftest: %d passed, %d failed\n' "$PASS" "$FAIL"
|
|
579
|
+
if [ "$FAIL" -ne 0 ]; then
|
|
580
|
+
exit 1
|
|
581
|
+
fi
|
|
582
|
+
echo "ok [lint-selftest]"
|