chore(datastore): sweep stale TODO(#92-followup-S03) metric markers

Why

All three citations in the 16 TODO(#92-followup-S03) markers in internal/datastore went stale. The helper they wait for landed as metrics.InstrumentQuery (S03-B). The "Named-Query Metrics" section they cite never existed. And the anchor issue closed: Land blob_storage_attachments foundation table ... (#92 - closed) • Hayley Swimelar.

Rejected resolutions: instrumenting now (the open tracker's scope, not a maintenance chore) and citing this MR's own issue (re-stales the moment it closes). The swept grammar names the landed helper, cites the Metrics section of docs/dev/observability.md, and retargets to the tracker the sibling markers already cite: Wire datastore query metrics per S03 catalog (#54) • Unassigned.

The markers cite docs/dev/observability.md § Metrics rather than docs/dev/storage.md § Observability, which review showed is wrong for 25 of the 26 sites: that section asserts a gitlab_artifact_registry_storage_* prefix, which does not hold for two families registering under the database subsystem, and its one relevant table row is scoped to blob_storage_blobs / upload_sessions. The observability catalog carries both families under their resolved names with S03-B provenance. The markers cite it for the metric families, not for a naming convention: the name-value rule lives in docs/specs/S03-b-metrics.md and in InstrumentQuery's doc comment, so pointing a "naming convention" clause at either dev doc would re-introduce the staleness this sweep removes.

The sweep covers 26 sites, up from 24 when it opened. ea734e56 (S17 Phase 3 Step 4) added two markers in container_tag.go carrying the old wording and no citation, so the rebase absorbs them and the package is left with one grammar instead of two. Store-level markers keep their method lists and drop "every", which over-claimed on the stores whose parenthetical was already short. CreateBatch is now named in the ContainerManifestRelationshipStore list, which otherwise left the batched insert uncovered while container_manifest_persister.go delegates to it.

The staleness turned up during review of chore(datastore): add container manifest reads ... (!1131 - merged) • Hayley Swimelar • 19.3. That MR adds another old-grammar marker, left verbatim so the sweep stays one greppable unit. If it merges first, this branch rebases and absorbs it.

Test plan

Mechanical assertions, all green locally. Scoped to internal/datastore:

  • zero TODO(#92-followup-S03), Named-Query, once S03 lands, Observability section, or docs/dev/storage.md hits remain
  • the five grammar atoms (TODO(#54), metrics.InstrumentQuery, landed with S03-B, Metrics section, docs/dev/observability.md) count 26 each
  • the quoted metric-name multiset is identical on both sides of the diff
  • zero non-comment changed lines
  • go build, go vet, and gofmt are clean, the datastore tests pass, and no golangci-lint finding lands on a changed line

Repo-wide, five TODO(#92-followup-S03) and one Named-Query hit survive, all in docs/plans/2026-05-21-blob-storage-attachments-foundation.md and docs/plans/2026-06-11-s03-metrics.md. Plan files are point-in-time records, so they stay.

No tests ship: the diff is comment-only, so there is no code to test. No e2e scenario catalog entry is affected: no behavior change.

Closes Sweep the stale TODO(#92-followup-S03) metric m... (#454 - closed) • Hayley Swimelar

Context for LLM agents

Rejected alternatives:

  • Instrument now: that is the tracking issue's scope, and landing it under a maintenance label would misfile feature work.
  • Cite this MR's own issue in the markers: it closes on merge, so the markers would re-stale immediately.
  • Widen docs/dev/storage.md § Observability instead of retargeting: corrects the prefix sentence and the row's scoping for every reader, but grows a comment-only MR into a docs change and leaves the citation one hop from the catalog.
  • Keep the citation sentence byte-identical and swap only the path: the replaced clause said "Naming convention per ...", and the observability catalog does not state the name-value convention, so the swap alone would trade one inaccurate citation for another.

Non-goals:

  • No instrumentation, no tracking-issue body edit, no docs change.
  • storage.md:697 still claims every metric name uses the gitlab_artifact_registry_storage_* prefix while its own table lists two database_* families. That predates this MR, and after the retarget no internal/datastore marker depends on it. It needs a docs MR its owner can review.
  • Selector line-wrapping is untouched. 12 of the 26 markers break after {name=, which predates the sweep and leaves the multiset identical on both sides of the diff. Rewrapping them would add churn to a comment-only diff without changing what any marker says.
  • internal/storage/pg_blob_info_integration_test.go:25 cites a "S06 Observability > Database Queries" subsection that does not exist, and calls the helper unwired when internal/storage/queries.go already wraps it. Different package, not a TODO(#54) marker, so it belongs in a follow-up.
Edited by Hayley Swimelar

Merge request reports

Loading
Loading