Skip to content

Commit e13aaa2

Browse files
cemililikclaude
andcommitted
fix: PR #3 review-3 — seed health-check + pre-commit output + roadmap clarity
One inline + three nitpicks from the review. The fourth nitpick (frontend tsconfig _comment field) was already closed in 1a5f245. Inline (scripts/seed.sh): - The health-check loop captured only `.Health`; a service with no healthcheck (empty Health column) was treated as already-healthy. All current dev.yml services carry a healthcheck per Standards 12, but the policy should be enforced not assumed. Rewrote the awk to consume `{{.Name}}\t{{.State}}\t{{.Health}}` and flag three distinct failure shapes — service not running, service running but with no healthcheck defined, service running but healthcheck not yet `healthy`. Each shape prints its own diagnostic so the developer can see whether to wait or to fix a missing healthcheck. Nitpick (.githooks/pre-commit): - Leakwatch failure path piped scanner output to `/dev/null`, leaving the developer guessing which detector fired. Now captures stdout + stderr, replays it before exiting 1 — exit code drives the gate, scanner output drives the diagnosis. Nitpicks (docs/roadmap/phase-01-repository-tooling.md): - The CI Baseline section listed Integration / OpenAPI-diff / Lighthouse as plain bullets, contradicting the in-progress status block above that calls them deferred. Each now carries an inline *(scaffolded as `if: false` placeholder; activates in Phase 0Xx when …)* note so Scope and Status read coherently. - "Optional `learnstack-hub` compose overlay for local Hub development" was ambiguous about ownership — could be read as "lives in this repo." Rewritten to "Optional **external** `learnstack-hub` compose overlay (maintained in the separate `learnstack-hub` repository per ADR-0019)" so location + ownership are unambiguous. Skipped: - Action SHA pinning (.github/workflows/ci.yml): genuine supply- chain hardening recommendation, but maintaining SHA pins without Renovate / Dependabot is operationally heavy for a Phase 01 PR. Track for Phase 11 production-hardening — the addition there bundles SHA pinning + a Renovate config in one change. The current `@v4` / `@v5` major-tag pins are the GitHub-recommended Phase-01-grade posture. Verification: `bash -n` clean on both shell scripts; `python3 yaml.safe_load` clean on ci.yml; roadmap links resolve under the new sibling-relative + repo-relative auditor. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c503fd9 commit e13aaa2

3 files changed

Lines changed: 36 additions & 10 deletions

File tree

‎.githooks/pre-commit‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,13 @@ if command -v leakwatch >/dev/null 2>&1; then
102102
for f in "${all_staged[@]}"; do
103103
# Skip files that don't exist (D for delete in --diff-filter).
104104
[[ -f "$f" ]] || continue
105-
if ! leakwatch scan fs "$f" --config .leakwatch.yaml --min-severity medium --no-verify >/dev/null; then
106-
printf "\npre-commit: leakwatch found a likely secret in %s\n" "$f" >&2
105+
# Capture stdout+stderr; on failure replay the scanner output to
106+
# the developer (suppressing it would leave them guessing which
107+
# detector fired). Exit code drives the gate; output drives the
108+
# diagnosis.
109+
if ! scan_output=$(leakwatch scan fs "$f" --config .leakwatch.yaml --min-severity medium --no-verify 2>&1); then
110+
printf "\npre-commit: leakwatch found a likely secret in %s\n\n" "$f" >&2
111+
printf "%s\n\n" "$scan_output" >&2
107112
printf "If it is a legitimate dev credential, add an inline\n" >&2
108113
printf "\`# leakwatch:ignore\` comment or extend .leakwatchignore.\n" >&2
109114
exit 1

‎docs/roadmap/phase-01-repository-tooling.md‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,11 @@ Docker Compose under `infra/compose/`:
201201
- **Dapr sidecar** + placement service.
202202
- **APISIX** (file-driven standalone `data_plane` mode per ADR-0015 — no etcd, no Admin API, no dashboard companion).
203203
- Optional Jaeger or Tempo (for trace inspection).
204-
- Optional `learnstack-hub` compose overlay for local Hub development (depends on
205-
the same Keycloak / Postgres / Kafka / Vault / APISIX stack).
204+
- Optional **external** `learnstack-hub` compose overlay (maintained in the
205+
separate `learnstack-hub` repository per
206+
[ADR-0019](../decisions/0019-learnstack-hub.md)) for local Hub development —
207+
depends on the same Keycloak / Postgres / Kafka / Vault / APISIX stack but
208+
never ships in this repo.
206209

207210
Two compose files:
208211

@@ -221,10 +224,16 @@ Two compose files:
221224

222225
- GitHub Actions workflow.
223226
- Backend build and unit + architecture + contract tests.
224-
- Integration tests with Testcontainers PostgreSQL.
227+
- Integration tests with Testcontainers PostgreSQL — *scaffolded as
228+
`if: false` placeholder; activates in Phase 02a when the first
229+
integration test lands (see Status note above).*
225230
- Frontend install, typecheck, build, lint, component tests.
226-
- OpenAPI breaking-change check.
227-
- Lighthouse budget check on representative public pages.
231+
- OpenAPI breaking-change check — *scaffolded as `if: false` placeholder;
232+
activates in Phase 03 when the first real `/api/v1/*` endpoint replaces
233+
the `/healthz` placeholder.*
234+
- Lighthouse budget check on representative public pages — *scaffolded as
235+
`if: false` placeholder; activates in Phase 04 when the first content-
236+
bearing public page ships.*
228237
- Required status checks on `main`.
229238

230239
## Deliverables

‎scripts/seed.sh‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,20 @@ fi
4747

4848
elapsed=0
4949
while true; do
50-
not_healthy=$(docker compose -f "$COMPOSE_FILE" ps --format '{{.Name}}\t{{.Health}}' \
51-
| awk -F'\t' '$2 != "healthy" && $2 != "" {print $1 " (" $2 ")"}')
50+
# Capture BOTH .State and .Health so we can distinguish:
51+
# - service running + healthcheck reports `healthy` → ok
52+
# - service running + healthcheck still `starting` → wait
53+
# - service running + NO healthcheck defined → flag (every
54+
# service in dev.yml carries one per Standards 12 § Local Infra;
55+
# an empty Health column means a future regression)
56+
# - service not running (exited, dead, restarting) → flag
57+
not_healthy=$(docker compose -f "$COMPOSE_FILE" \
58+
ps --format '{{.Name}}\t{{.State}}\t{{.Health}}' \
59+
| awk -F'\t' '
60+
$2 != "running" { print $1 " (state=" $2 ")"; next }
61+
$3 == "" { print $1 " (no healthcheck)"; next }
62+
$3 != "healthy" { print $1 " (health=" $3 ")"; next }
63+
')
5264
[[ -z "$not_healthy" ]] && break
5365
if (( elapsed >= HEALTH_TIMEOUT_SECONDS )); then
5466
red "Services still not healthy after ${HEALTH_TIMEOUT_SECONDS}s — inspect with:"
@@ -61,7 +73,7 @@ while true; do
6173
sleep 3
6274
elapsed=$(( elapsed + 3 ))
6375
done
64-
green " ✓ All compose services healthy."
76+
green " ✓ All compose services running + healthcheck-green."
6577

6678
# ─── Step 2: Keycloak realm verification ─────────────────────────────────
6779
# Realm import happens during Keycloak's first boot — even after the

0 commit comments

Comments
 (0)