vectorsurv-integration #1

Merged
eliribble merged 3 commits from vectorsurv-integration into main 2026-10-15 19:25:16 +00:00
Owner
No description provided.
vectorsurv-go: a Config-only client with a complete, verified read surface
All checks were successful
/ gocheck (push) Successful in 11s
287967419b
Restructures the library so the curated surface is hand-written and the
generated resource surface stays regenerable, and makes it usable as a
client library rather than a CLI helper.

- The module root is hand-written; the generator emits into a `gateway`
  subpackage over an injected transport, and the import edge is one-way.
- `vectorsurv.New(Config)` is the only entry point. The library reads no
  environment variable and no file: a client program decides where its
  configuration comes from. `cmd/vectorsurv` owns the environment, builds
  the Config, and stands as the worked example.
- Authentication is by agency token (sent as the bearer, with no `/login`
  and nothing to refresh on a 401) or by username/password through
  `/login`.
- Reads page to exhaustion and report completeness to the caller instead
  of assuming it. The response cap is a Config field (default 64 MiB) and
  exceeding it is reported as itself, not as a JSON decode error.
- The generator resolves path-internal `$ref`s, so records that used to
  emit empty now populate. `gen/extensions.go` carries the curated
  corrections for what the specification gets wrong — fields it omits,
  fields it types wrongly, and collections whose shape it declares
  incorrectly — and `checkCurated` fails generation when an entry stops
  matching what was emitted.
- `conformance_test.go` walks every resource and lookup from both sides
  (the curated tables and the emitted methods) against a fake VectorSurv;
  `cmd/vectorsurv conform` runs the same surface against the real API and
  classifies failures by observable cause, so only a genuine defect fails
  the run. Live against the sandbox: 95 reads, 85 conformed, 0 defects.
vectorsurv-go: the write path — composition, push, sandbox-proven
All checks were successful
/ gocheck (push) Successful in 12s
9d84b8053a
Move the outbound write path out of nidus-sync's private platform/vectorsurv
client and into this library, as a strict gateway: plain structs in, plain
structs out, and no Nidus concept anywhere in the code.

- units.go — the /v1/unit index and the unit-id resolution, over a
  caller-supplied UnitSystem (render an area, render an amount and name its
  dimension, convert within a dimension) rather than an import of the caller's
  units package.
- compose.go — the PUR composition: buckets, mix decomposition, payload, unit
  resolution. Physical control and "this applies a district custom mix" are the
  caller's flags now, not a control-class or product-kind string.
- application.go — one plan per treatment from plain treatment facts. The
  idempotency key, the mix code, the description and the category-to-purpose
  policy belong to the caller (LocalKey, MixCode, Description, PurposeFor), and
  one that is missing is a reported skip, never an invented value.
- application_push.go — PushApplications, the roster and supervisor technician
  resolvers, the mix find-or-create and the `local`-key read-before-create,
  preserving every skip reason and the progress callback.
- types.go, resources.go — the curated wire types and the creates, with the
  vocabulary and index reads bought whole: a walk the server leaves short is an
  error, never an index that looks complete. The public read surface stays the
  generated one.
- Config.AllowProductionWrites — a write allowance separate from the read one,
  refused before the request is built (ErrNotSandboxWrite). A non-sandbox host
  still needs the read allowance, and the sandbox needs neither.

The tests moved with the code — the fake-server harness, the composition and
resolver tests, the transport and auth tests — and the write path gained a live
proof: TestSandboxApplicationsRoundTrip files a real mix and application against
the sandbox, reads both back, and proves a re-run creates nothing. It skips
without credentials, so CI files nothing.

The five PUR endpoints answer HTTP 500 on the sandbox and production alike, so
the PUR filing half is composed and tested offline only.
vectorsurv-go: the library names no consumer
All checks were successful
/ gocheck (push) Successful in 12s
bb608369d7
The seam table illustrated each seam with the concrete caller, which puts
one consumer's identity in a library that must have none. The seams are
documented by their contract instead.
eliribble deleted branch vectorsurv-integration 2026-10-15 19:25:16 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Gleipnir/vectorsurv-go!1
No description provided.