[E00-S02-T02] PostgreSQL health gates app start #169

Closed
opened 2026-08-27 00:07:10 +00:00 by kpcto · 5 comments
Owner

Parent story: [E00-S02] Docker Compose baseline (#59)

Intent

Ensure the application does not start until PostgreSQL is healthy.

Acceptance criteria

  • PostgreSQL health check gates application start
  • app waits for the database before starting

Explicitly out of scope

  • compose starts DB + app (E00-S02-T01)
  • app health endpoint (E00-S02-T03)
  • DB volume persistence (E00-S02-T04)

Test plan

  • start the stack and confirm the app waits on database health

Rollback note

  • revert the healthcheck/depends_on changes

Owning stream

platform

Risk quadrant

agent-full

> Parent story: [E00-S02] Docker Compose baseline (#59) ## Intent Ensure the application does not start until PostgreSQL is healthy. ## Acceptance criteria - PostgreSQL health check gates application start - app waits for the database before starting ## Explicitly out of scope - compose starts DB + app (E00-S02-T01) - app health endpoint (E00-S02-T03) - DB volume persistence (E00-S02-T04) ## Test plan - start the stack and confirm the app waits on database health ## Rollback note - revert the healthcheck/depends_on changes ### Owning stream platform ### Risk quadrant agent-full
kpcto added this to the Sprint 0 milestone 2026-08-27 00:07:10 +00:00
kpcto added the
status
ready
kind
task
labels 2026-08-27 00:07:10 +00:00
bot-dispatcher added
status
proposed
and removed
status
ready
kind
task
labels 2026-08-27 00:07:11 +00:00
Member

Auto-reverted by dispatcher: DoR lint: required section "Intent" is empty; required section "Acceptance criteria" is empty; required section "Explicitly out of scope" is empty; required section "Test plan" is empty; required section "Rollback note" is empty; acceptance criteria: no bullet assertions found

status/ready may only be applied by a human maintainer.

> Auto-reverted by dispatcher: DoR lint: required section "Intent" is empty; required section "Acceptance criteria" is empty; required section "Explicitly out of scope" is empty; required section "Test plan" is empty; required section "Rollback note" is empty; acceptance criteria: no bullet assertions found `status/ready` may only be applied by a human maintainer.
kpcto added the
kind
task
label 2026-08-27 21:24:12 +00:00
kpcto added
status
ready
and removed
status
proposed
labels 2026-08-28 23:55:28 +00:00
bot-dispatcher added
loop
1
status
in-progress
and removed
status
ready
labels 2026-08-28 23:55:38 +00:00
Member
agent: dispatcher
phase: complete
plan_summary: Dispatch #169: [E00-S02-T02] PostgreSQL health gates app start (platform)
```yaml agent: dispatcher phase: complete plan_summary: Dispatch #169: [E00-S02-T02] PostgreSQL health gates app start (platform) ```
Member
agent: implementer
phase: start
objective: "[E00-S02-T02] PostgreSQL health gates app start"
plan:
  - add a healthcheck to the compose.yaml db service (pg_isready against POSTGRES_USER/POSTGRES_DB, $$-escaped so container env applies)
  - change the app service depends_on to a mapping with condition: service_healthy so the app waits for the database
  - update tests/compose-config.test.mjs to lock in both acceptance criteria (healthcheck present + healthy-gated depends_on)
  - add non-vacuous mutation probes for both criteria
  - run the committed suite, push feature/169, open PR feature/169 -> main with criterion-to-test table
out_of_scope:
  - compose starts DB + app (E00-S02-T01)
  - app health endpoint (E00-S02-T03)
  - DB volume persistence (E00-S02-T04)
```yaml agent: implementer phase: start objective: "[E00-S02-T02] PostgreSQL health gates app start" plan: - add a healthcheck to the compose.yaml db service (pg_isready against POSTGRES_USER/POSTGRES_DB, $$-escaped so container env applies) - change the app service depends_on to a mapping with condition: service_healthy so the app waits for the database - update tests/compose-config.test.mjs to lock in both acceptance criteria (healthcheck present + healthy-gated depends_on) - add non-vacuous mutation probes for both criteria - run the committed suite, push feature/169, open PR feature/169 -> main with criterion-to-test table out_of_scope: - compose starts DB + app (E00-S02-T01) - app health endpoint (E00-S02-T03) - DB volume persistence (E00-S02-T04) ```
Member
agent: implementer
phase: complete
objective: "[E00-S02-T02] PostgreSQL health gates app start"
pr: Fabrika/PersonalBlog#383 (feature/169 -> main, head 59a102b)
ci: "green — CI / Frozen lockfile install (pull_request) success in 47s (run 64, job 76)"
files:
  - compose.yaml (db healthcheck: pg_isready vs $${POSTGRES_USER}/$${POSTGRES_DB}, interval/timeout/retries/start_period; app depends_on db condition: service_healthy)
  - tests/compose-config.test.mjs (assertDbHealthcheck + 2 new criterion tests, updated app assertions, 2 new mutation probes, extended parser probe, real-stack probe asserts db healthy)
criterion_to_test:
  - "PostgreSQL health check gates application start" -> compose-config.test.mjs 'PostgreSQL health check gates application start (db declares a pg_isready healthcheck)': db.healthcheck.test runs pg_isready against $${POSTGRES_USER}/$${POSTGRES_DB} (credential-consistent, $$-escaped) with interval + retries; non-vacuous mutation probe removes the healthcheck; docker-gated real-stack probe asserts the db container is healthy when Docker reports it
  - "app waits for the database before starting" -> compose-config.test.mjs 'the app waits for the database before starting (depends_on db with condition service_healthy)' + assertAppService: app.depends_on.db.condition === 'service_healthy'; non-vacuous mutation probe reverts depends_on to a plain list
verification:
  - "node --test tests/compose-config.test.mjs: 13/13 pass, 2 docker probes skipped (no daemon in sandbox)"
  - "full suite node --test tests/*.test.mjs: 52 pass / 12 fail / 2 skip — the 12 failures are the pre-existing Node-22-environment baseline (frozen-install/engine/root-commands/tsc/TS-version), none caused by this change (compose-config +4 pass, 0 fail)"
  - "compose.yaml re-parsed by the committed minimal block-YAML parser: db.healthcheck.test contains pg_isready + $${POSTGRES_USER}/$${POSTGRES_DB}; app.depends_on.db.condition = service_healthy"
  - "PR diff verified identical to local commit 59a102b; lockfile + CI workflow untouched"
out_of_scope:
  - compose starts DB + app (E00-S02-T01)
  - app health endpoint (E00-S02-T03)
  - DB volume persistence (E00-S02-T04)
```yaml agent: implementer phase: complete objective: "[E00-S02-T02] PostgreSQL health gates app start" pr: Fabrika/PersonalBlog#383 (feature/169 -> main, head 59a102b) ci: "green — CI / Frozen lockfile install (pull_request) success in 47s (run 64, job 76)" files: - compose.yaml (db healthcheck: pg_isready vs $${POSTGRES_USER}/$${POSTGRES_DB}, interval/timeout/retries/start_period; app depends_on db condition: service_healthy) - tests/compose-config.test.mjs (assertDbHealthcheck + 2 new criterion tests, updated app assertions, 2 new mutation probes, extended parser probe, real-stack probe asserts db healthy) criterion_to_test: - "PostgreSQL health check gates application start" -> compose-config.test.mjs 'PostgreSQL health check gates application start (db declares a pg_isready healthcheck)': db.healthcheck.test runs pg_isready against $${POSTGRES_USER}/$${POSTGRES_DB} (credential-consistent, $$-escaped) with interval + retries; non-vacuous mutation probe removes the healthcheck; docker-gated real-stack probe asserts the db container is healthy when Docker reports it - "app waits for the database before starting" -> compose-config.test.mjs 'the app waits for the database before starting (depends_on db with condition service_healthy)' + assertAppService: app.depends_on.db.condition === 'service_healthy'; non-vacuous mutation probe reverts depends_on to a plain list verification: - "node --test tests/compose-config.test.mjs: 13/13 pass, 2 docker probes skipped (no daemon in sandbox)" - "full suite node --test tests/*.test.mjs: 52 pass / 12 fail / 2 skip — the 12 failures are the pre-existing Node-22-environment baseline (frozen-install/engine/root-commands/tsc/TS-version), none caused by this change (compose-config +4 pass, 0 fail)" - "compose.yaml re-parsed by the committed minimal block-YAML parser: db.healthcheck.test contains pg_isready + $${POSTGRES_USER}/$${POSTGRES_DB}; app.depends_on.db.condition = service_healthy" - "PR diff verified identical to local commit 59a102b; lockfile + CI workflow untouched" out_of_scope: - compose starts DB + app (E00-S02-T01) - app health endpoint (E00-S02-T03) - DB volume persistence (E00-S02-T04) ```
Member
agent: reviewer
verdict: approve
```yaml agent: reviewer verdict: approve ```
bot-dispatcher added
status
review
and removed
status
in-progress
loop
1
kind
task
labels 2026-08-29 00:04:50 +00:00
kpcto closed this issue 2026-08-29 00:09:42 +00:00
kpcto added
kind
task
status
done
and removed
status
review
labels 2026-08-29 00:09:42 +00:00
Sign in to join this conversation.