Skip to content

Commit 34423ea

Browse files
author
mforce
committed
chore(#417): quality-review pass — empty-generation belt, CI-matched readiness budget, index row grouping
- --check refuses to compare when the fresh generation produced no output (README.md missing): two-empty-dirs would otherwise diff clean, and a silent generation failure must never read as up to date. - Postgres readiness wait aligned to ci.yml's smoke-test budget for the same image (30 x 2s, was 30 x 1s with no stated reason). - Decision-index row for #417 grouped with the other Conventions rows.
1 parent 02d7a70 commit 34423ea

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

docs/decisions/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ follow the `→` link from the `AGENTS.md` bullet to get here.
3131
| [SPA E2E lives in `tools/simulation/ui/` (#277/#385)](277-spa-e2e.md) | AGENTS · Conventions |
3232
| [A write-contract change must update its non-CI callers (#394)](394-write-contract-callers.md) | AGENTS · Conventions |
3333
| [Production logs: compact JSON on stdout (#404)](404-production-logs.md) | AGENTS · Conventions |
34+
| [Generated PostgreSQL schema documentation (#417)](417-schema-docs.md) | AGENTS · Conventions |
3435
| [Writing a guard (a test that asserts an invariant)](407-writing-a-guard.md) | AGENTS · Writing a guard |
3536
| [CI security gates, lock-file healing, Dependabot, action pinning (#146)](146-ci-security-gates.md) | AGENTS · CI security gates |
3637
| [Releases and image publishing — internals (#351)](351-releases.md) | AGENTS · Releases · and `README.md` |
37-
| [Generated PostgreSQL schema documentation (#417)](417-schema-docs.md) | AGENTS · Conventions |
3838

3939
The five short-enough Conventions bullets that kept their full rationale inline in
4040
`AGENTS.md` — break-glass recovery (#265), farm timezone (#264), the proxy-trust

tools/schema-docs/generate.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@ docker run -d --name "$PG" --network "$NET" \
4848
-p 127.0.0.1:0:5432 \
4949
"$POSTGRES_IMAGE" >/dev/null
5050

51+
# Same 60s readiness budget as ci.yml's smoke test uses for this image.
5152
for i in $(seq 1 30); do
5253
if docker exec "$PG" pg_isready -h 127.0.0.1 -U cluckwork -d cluckwork >/dev/null 2>&1; then break; fi
5354
if [ "$i" = 30 ]; then echo "Postgres never became ready" >&2; exit 1; fi
54-
sleep 1
55+
sleep 2
5556
done
5657

5758
PORT="$(docker inspect -f '{{ (index (index .NetworkSettings.Ports "5432/tcp") 0).HostPort }}' "$PG")"
@@ -97,6 +98,12 @@ if [ "$MODE" = "generate" ]; then
9798
else
9899
TMP_OUT="$(mktemp -d)"
99100
run_tbls "-v ${TMP_OUT}:/schema-check" "/schema-check"
101+
# A generation that silently produced nothing must never read as "up to
102+
# date" — README.md is the one file every tbls run emits.
103+
if [ ! -f "$TMP_OUT/README.md" ]; then
104+
echo "Schema-docs generation produced no output — refusing to compare." >&2
105+
exit 1
106+
fi
100107
if ! diff -r docs/schema "$TMP_OUT" >/dev/null 2>&1; then
101108
echo "docs/schema/ is STALE — it does not match what the migrations produce." >&2
102109
echo "Regenerate with: tools/schema-docs/generate.sh" >&2

0 commit comments

Comments
 (0)