Skip to content

chore: delete pkg/api, twelve routes nothing served (#367) - #396

Merged
scttfrdmn merged 1 commit into
mainfrom
chore/367-delete-pkg-api
Aug 9, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
chore/367-delete-pkg-api

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

Closes #367.

What is deleted

pkg/api — 559 lines of handlers, 999 lines of tests, zero importers outside the package:

$ grep -rn 'objectfs/pkg/api' --include='*.go' . | grep -v '^./pkg/api/'
$

Twelve declared routes: /health, /health/components, /health/live, /health/ready, /status, /status/operations, /status/operations/, /status/history, /metrics, /api/v1/mounts, /api/v1/mounts/, /info.

A running mount's actual HTTP surface is two endpoints — /metrics (internal/metrics/collector.go) and /health (internal/health/checker.go). Nothing users could reach is gone, because nothing users could reach was ever there.

Why deleted rather than kept waiting for a caller

A declared-but-unserved HTTP surface is worse than an absent one: it produces documentation that cannot be checked against behavior. It already had. The six fabricated endpoints #336 had to correct in the docs playground looked plausible precisely because a package in this tree declared their shapes — a reviewer comparing docs against code would have found the routes and stopped there. That is the failure mode being removed, not just the line count.

Docs follow the deletion

Rather than deleting a row and leaving the reasoning to be rediscovered:

  • docs/index.md — the "not yet wired up" row for pkg/api is replaced with a paragraph saying it was deleted and why. The table is a list of things that may be wired up; this one will not be.
  • docs-platform/.vitepress/config.js — a sidebar entry 'REST API' → /api/rest pointed at a page that has never existed anywhere in the tree (a dead link independent of this deletion). Removed, with a comment naming what a mount does serve.
  • docs/ARCHITECTURE_EVOLUTION.md — the Phase 2 diagram has a "REST API" box. That file's header already states it is a design sketch and lists where it diverges from the code, so this divergence joins that list. The diagram is not redrawn: proposing a WebDAV/REST surface is a reasonable thing for a proposal to do, and silently editing a drawing to match today would make the file less honest, not more.

The CHANGELOG's other pkg/api mentions are historical release records and are left alone — they describe what shipped at the time, which is the one thing a changelog must not revise.

The coverage floor was required, not tidying

.coverage-floors had pkg/api 73. Removing it is not housekeeping — scripts/coverage-gate.sh fails on a floor whose package produces no profile lines:

a floor nothing measures is a gate that has quietly stopped gating

Verified by running the gate over a real profile rather than reasoning about it: 36 packages at or above their floor, exit 0, no FAIL lines, and the no floor set list unchanged.

Worth recording: those 999 lines of tests are the reason the floor was as high as it was. A package can be well tested and still not be part of the product, and coverage cannot tell the difference.

Verification

  • go build ./... — clean (nothing imported it)
  • gofmt -l ., go vet ./..., golangci-lint run — clean
  • go test -race ./... — full suite, exit 0
  • ./scripts/coverage-gate.sh coverage.out .coverage-floors — exit 0
  • npx [email protected] docs/index.md docs/ARCHITECTURE_EVOLUTION.md — 0 issues

559 lines of handlers and 999 lines of tests declaring /health,
/health/components, /health/live, /health/ready, /status, /status/operations,
/status/operations/, /status/history, /metrics, /api/v1/mounts,
/api/v1/mounts/ and /info — with zero importers outside the package. A running
mount's real HTTP surface is /metrics from internal/metrics and /health from
internal/health. Nothing users could reach is gone, because nothing users could
reach was ever there.

Deleted rather than left waiting for a caller, because a declared-but-unserved
surface is worse than an absent one: it produces documentation that cannot be
checked against behavior. It already had. The six fabricated endpoints #336 had
to correct in the docs playground looked plausible precisely because a package
in this tree declared their shapes, and a reviewer comparing the docs to the
code would have found the routes and stopped there.

Docs follow the deletion rather than being left to drift:

- docs/index.md's "not yet wired up" row is replaced with a note saying it was
  deleted and why, so the reasoning survives the row.
- docs-platform's sidebar had a 'REST API' -> /api/rest entry pointing at a page
  that has never existed. Removed, with a comment saying what a mount does serve.
- docs/ARCHITECTURE_EVOLUTION.md's Phase 2 diagram shows a "REST API" box. That
  file is explicitly a proposal and its header already lists where it diverges
  from the code, so the divergence is added to that list rather than the diagram
  being quietly redrawn.

The pkg/api 73 floor is out of .coverage-floors — required, not tidying: the gate
fails on a floor whose package produces no profile lines ("a floor nothing
measures is a gate that has quietly stopped gating"). Verified by running
scripts/coverage-gate.sh over a real profile: 36 packages at or above their
floor, exit 0.

Worth stating plainly: those 999 lines of tests are why the floor was as high as
it was. A package can be well tested and still not be part of the product, and
coverage cannot tell the difference.

Closes #367
@scttfrdmn
scttfrdmn force-pushed the chore/367-delete-pkg-api branch from ddb5a34 to aae5c40 Compare August 9, 2026 01:14
@scttfrdmn
scttfrdmn merged commit e9b897b into main Aug 9, 2026
35 checks passed
@scttfrdmn
scttfrdmn deleted the chore/367-delete-pkg-api branch August 9, 2026 01:18
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.

pkg/api declares 12 HTTP routes and has no importer

1 participant