Artifact 39d53eea5d406b5804731b76b032315b9f730097501a388ab75d84a1406a3898:
- File
internal/api/register.go
— part of check-in
[cfd3f85ff3]
at
2026-08-14 22:29:35
on branch trunk
— OpenAPI reflector over the registry (dagnats 0.0.13)
quarry spec subcommand, RegisterAll with meta.version, required Op.Doc, validate rules feed schemas; make spec-lint via vacuum. (user: dmestas, size: 909) [annotate] [blame] [check-ins using]
// Package api owns RegisterAll — the one explicit wiring point where every // op joins the registry (0003 §2: no init() magic; the wiring stays // greppable). Consumers build a registry by calling RegisterAll exactly // once at startup. package api import ( "context" "craftdesign.group/quarry/internal/ops" ) type versionIn struct{} type versionOut struct { Version string `json:"version"` } // RegisterAll wires every op. version is the build-stamped quarry version // (0001 Principle 1: every surface reports it). func RegisterAll(r *ops.Registry, version string) error { return ops.Register(r, ops.Op[versionIn, versionOut]{ Name: "meta.version", Doc: "Report the quarry build version.", Kind: ops.Query, Auth: ops.Anonymous, Route: "GET /api/v1/version", Run: func(_ context.Context, _ versionIn) (versionOut, error) { return versionOut{Version: version}, nil }, }) }