feat: add estate-standard /health endpoint - #116
Merged
Conversation
|
🎉 PR Validation ✅ PASSED Commit: Checks:
Visual Changes: 5 of 20 screenshots changed 📸 downloads dark desktop — 100% changed📸 downloads dark mobile — 100% changed📸 downloads light desktop — 100% changed📸 downloads light mobile — 100% changedReady to merge! ✨ 🔗 View workflow run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
@agentage/observability/healthand mountGET /healthatsrc/app/health/route.tsper the Next.js profile inspecs/health-endpoints.md(export const dynamic = 'force-dynamic', no downstream dependency checks).service: 'diffractwd-web'passed explicitly -OTEL_SERVICE_NAMEis not set anywhere in this repo's compose/env, so the kit default would have resolved to'unknown'.@agentage/observabilityfrom^0.6.1(already a dependency, used for@agentage/observability/nexttracing register) to^0.8.0for the/healthsubpath.Build provenance (Dockerfile)
Found:
COMMIT_SHA/BRANCH/BUILD_TIMEwere declared as build-onlyARGs in thebuilderstage, used solely to bakepublic/version.json(consumed by the pre-existing/api/versionroute). They never crossed into therunnerstage, so any runtime reader (this new/healthroute) would have seenversion: '0.0.0-dev'/commit: 'dev'/buildTime: nullregardless of what was actually deployed.Fix: redeclared
ARG COMMIT_SHA="" BUILD_TIME=""in therunnerstage and promoted both toENV. Verified end to end - see below.Compose healthcheck (judgement call)
Repointed the Swarm
healthcheckfromwget --spider http://127.0.0.1:3001/to.../health. Justification:/renders the full marketing page (heavier, and a false-positive risk if a page-level error still 200s past the App Router shell), while/healthis the purpose-built, cache-disabled probe the rest of the estate standardises on. Per the Next.js profile this route does no downstream dependency checks, so it can only ever fail if the process itself is unhealthy - which is exactly what a container healthcheck should assert. Verifiedwget --spideragainst the new path inside the built container (exit 0).Test coverage
Repo has Vitest configured (
src/**/*.test.{ts,tsx}), so addedsrc/app/health/route.test.tsasserting200+data.service === 'diffractwd-web'+data.status === 'ok'.Verification
npm run verify(tsc --noEmit && next lint && next build && vitest run) - green, all 32 tests pass including the new one.npm run format:check- green (separate PR-validation CI step, not part ofverify).docker build --build-arg COMMIT_SHA=testsha1234567890 --build-arg BUILD_TIME=2026-08-09T12:00:00Z .then ran the container and curled/health:{ "success": true, "data": { "status": "ok", "service": "diffractwd-web", "version": "testsha1234567890", "commit": "testsha", "buildTime": "2026-08-09T12:00:00Z", "startedAt": "2026-08-09T14:35:06.727Z", "uptimeSeconds": 6 } }commitis the short SHA,servicematches the registry/telemetry name, provenance is read at runtime as required.Test plan
https://diffractwd.com/healthreturns the same envelope in prod