Skip to content

A liveness response joins the /v1 contract - #64

Merged
enesismail merged 1 commit into
mainfrom
health-response-joins-the-contract
Sep 19, 2026
Merged

enesismail merged 1 commit into
mainfrom
health-response-joins-the-contract

Conversation

@enesismail

Copy link
Copy Markdown
Contributor

The contract gains HealthResponse, the body of an unauthenticated liveness
endpoint the control plane will mount. Nothing in this client calls that
route, and the type belongs here anyway: this package defines the protocol
once, before anything serves it, and the callers that need a liveness answer
— a process supervisor, or a person establishing that a listening port is
attached to a server that answers — are as much consumers as the CLI is.

Three fields, every one emitted at its zero value because this package bans
omitempty outright:

  • uptime_seconds — a count, not an instant. At zero a count reads as zero,
    where an unset timestamp renders as a date in year one that every reader
    has to decode before dismissing, and a committed fixture is read far more
    often than it is written.
  • artefact_sha256 — what the running binary computes of ITSELF at startup.
    Its own identity rather than an assertion about it, which is the one form
    of that fact which cannot disagree with reality. Empty when the process
    could not read its own file, and that is not an error: a liveness endpoint
    which failed on self-inspection would not be one.
  • deployed_commit — configuration, and the field name says so rather than
    implying the binary knows. Whatever installed the binary is the only thing
    that knows which revision produced it, so the value is exactly as
    trustworthy as that installation. Deliberately not compiled in: stamping a
    revision would make the binary's bytes depend on where it came from, and
    the build that produces it is pinned precisely so its output follows from
    its inputs alone.

TWO FIXTURES, because the all-zero state is reachable rather than
degenerate. A supervisor's first poll arrives before a second of uptime has
accrued; a binary that cannot read its own file reports no digest; nothing
obliges an installation to declare a revision. All three answer success, so
all three need pinning — the same argument the closed-capacity fixture
already makes, and that fixture's comment claiming to be the only one of its
kind moves in this change rather than being left beside its own
counterexample.

Fixture values are synthetic on purpose. A fixture pins field names; it does
not record a measurement. This repository is world-readable, and a real
digest beside a real revision id would publish two facts about a private
deployment in a file that needed three keys.

Both new golden rows were proved by mutation before being trusted: dropping
a key from the zero fixture reds with "emitted but absent from the fixture",
and tagging a field omitempty reds both new rows with "vanishes when the
zero value is marshalled". Restored byte-identical, with the baseline green
again afterwards, so the restore is measured rather than assumed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XfBYBGuUkF7zUnZfAFD3dW

… state pinned

The contract gains a response type for a liveness endpoint. Nothing in this
client calls that route, and the type is here anyway, because this package is
where the protocol is defined once — before anything serves it — and a
supervisor or a person establishing that a listening port is attached to a
server that answers is as much a consumer as the CLI is.

Liveness is the whole claim and the type says so. The handler reads no
datastore and reaches nothing else, so a success means this process is up and
serving; it does not mean the dependencies are well. One endpoint answering
both questions can only ever answer the weaker one while reporting the
stronger, which is worse than not answering at all.

TWO FIXTURES, because the all-zero state is reachable rather than degenerate.
A supervisor's first poll arrives before a second of uptime has accrued; a
binary that cannot read its own file reports no digest; nothing obliges an
installation to declare a revision. All three answer success, so all three
need pinning — the same argument the closed-capacity fixture already makes,
and that fixture's comment claiming to be the only one of its kind moves in
this commit rather than being left beside its own counterexample.

Both string fields may be empty and empty is not an error. The digest is what
the binary computes of ITSELF at startup — its own identity rather than an
assertion about it, the one form of that fact which cannot disagree with
reality — and a process that cannot read its own file still serves. The
revision is configuration, and the field name says so rather than implying
the binary knows: whatever installed it is the only thing that does, so the
value is exactly as trustworthy as that installation. It is deliberately not
compiled in, because stamping it would make the binary's bytes depend on
where it came from, and the build that produces it is pinned precisely so its
output follows from its inputs alone.

Uptime is a count rather than an instant. At zero a count reads as zero,
where an unset timestamp renders as a date in year one that every reader must
decode before dismissing — and a committed fixture is read far more often
than it is written.

FIXTURE VALUES ARE SYNTHETIC ON PURPOSE. A fixture pins field names; it does
not record a measurement. This repository is world-readable, and a real
digest with a real revision id would have published two facts about a private
deployment in a file that needed three keys.

Both new rows were proved by mutation before being trusted: dropping a key
from the zero fixture reds with "emitted but absent from the fixture", and
tagging the field omitempty reds both health rows with "vanishes when the
zero value is marshalled". Restored byte-identical, with the baseline green
again afterwards, so the restore is measured rather than assumed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XfBYBGuUkF7zUnZfAFD3dW
@enesismail
enesismail added this pull request to the merge queue Sep 19, 2026
Merged via the queue into main with commit 57c19a2 Sep 19, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant