Skip to content

feat(health): expose liveness metadata - #2528

Merged
JSONbored merged 3 commits into
JSONbored:mainfrom
oktofeesh1:codex/health-liveness-metadata
Jul 2, 2026
Merged

feat(health): expose liveness metadata#2528
JSONbored merged 3 commits into
JSONbored:mainfrom
oktofeesh1:codex/health-liveness-metadata

Conversation

@oktofeesh1

@oktofeesh1 oktofeesh1 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Closes feat(health): enrich /health with version, uptime, and backend fingerprint #2077 by adding self-host liveness metadata for /health: image/package version, uptime seconds, and active DB backend.
  • Keeps /health binding-free for load balancers: it does not perform DB, Redis, or optional-backend reads.
  • Preserves the already-merged 0090_* migration filenames and grandfathers that duplicate in the migration guard so existing migration ledgers never replay a bare ALTER TABLE under a new filename.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked an issue, or this is small enough that the summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires >=99% coverage of the lines and branches changed.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • None. Also ran the full npm run test:ci gate and focused npx vitest run test/unit/selfhost-health.test.ts --coverage.enabled true --coverage.include src/selfhost/health.ts --coverage.reporter text, which reported 100% statements, branches, functions, and lines for src/selfhost/health.ts.

Safety

  • No sensitive credentials, private keys, raw private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

No visible UI, frontend, docs, or extension changes.

Notes

  • /ready remains the backend-touching readiness endpoint; /health remains liveness-only.
  • The OpenAPI /health schema describes the Worker/Hono app health route, which is unchanged.

@loopover-orb

loopover-orb Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-02 08:40:27 UTC

5 files · 1 AI reviewer · no blockers · readiness 60/100 · CI pending · blocked

⏸️ Suggested Action - Manual Review

  • Touches a guarded path — held for manual review

Review summary
The change cleanly adds binding-free `/health` metadata by computing version once at boot, deriving uptime from the existing process start time, and reporting the selected self-host DB backend without touching DB/Redis/optional backends. The readiness refactor preserves fail-closed behavior for an impossible missing COUNT row, and the focused tests cover the new version fallback and uptime clamping branches. The migration guard update is narrowly scoped to grandfather the already-shipped 0090 duplicate filenames and keeps the existing duplicate-detection behavior intact.

Nits — 6 non-blocking
  • nit: src/server.ts:/health still omits an explicit `Cache-Control: no-store`; health probes and operators should not receive cached uptime/version metadata from an intermediary.
  • nit: src/selfhost/health.ts:28 accepts any nonblank package fallback string, so a malformed build-time version will be surfaced as-is rather than normalized or rejected.
  • src/server.ts:/health: add `cache-control: no-store` alongside `content-type` so liveness metadata is always live.
  • src/selfhost/health.ts:24: keep `resolveHealthVersion` centralized as the only place that trims and defaults version strings; future callers should not duplicate the fallback logic.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2077
Related work ⚠️ 2 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High review scope from cached public metadata (size label size:M; 1 linked issue).
Validation posture ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 65 registered-repo PR(s), 58 merged, 4 issue(s).
Contributor context ✅ Confirmed Gittensor contributor oktofeesh1; Gittensor profile; 65 PR(s), 4 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Review context
Contributor next steps
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
  • Check active issues and PRs before submitting.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added gittensor gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. labels Jul 2, 2026
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.97%. Comparing base (8f2e0fb) to head (4d18a97).
⚠️ Report is 33 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2528      +/-   ##
==========================================
+ Coverage   95.95%   95.97%   +0.02%     
==========================================
  Files         226      228       +2     
  Lines       25387    25709     +322     
  Branches     9234     9350     +116     
==========================================
+ Hits        24359    24674     +315     
- Misses        417      425       +8     
+ Partials      611      610       -1     
Files with missing lines Coverage Δ
src/selfhost/health.ts 100.00% <100.00%> (+5.88%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dosubot dosubot Bot added the lgtm label Jul 2, 2026
@JSONbored
JSONbored merged commit 3f9e979 into JSONbored:main Jul 2, 2026
8 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

feat(health): enrich /health with version, uptime, and backend fingerprint

2 participants