feat/server-rest-protocol #50

Merged
xavier merged 11 commits from feat/server-rest-protocol into dev 2026-11-15 22:46:29 +01:00
Owner
No description provided.
E_ACRONYM_TAKEN and E_UNKNOWN_PROJECT move into domain/errors.go (consumed
by the registry as the domain constants); E_MALFORMED_REQUEST joins them
as the protocol's third shape. One vocabulary the moment the wire renders
codes (ADR-021 point 6; the fold-in obligation from the registry review).
Contract pin extended; registry's local constants gone.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
internal/server/protocol — the thin store protocol: /p/<acronym>/… resource
reads, the whole-project snapshot (the client Tx's open-time read, ADR-021
L3), POST commit carrying the ordered staged op set replayed through one
engine transaction, POST /register control plane. One rejection envelope:
{error:{kind,code,message,detail}} — precondition 409 / domain 422 /
protocol 400+404 / internal 500, codes verbatim from the audited E_*
catalogue; absent reads carry the port sentinel by name. Wire values are
the canonical shapes; wire->domain goes through the domain constructors
(a grammar failure is E_MALFORMED_REQUEST).

internal/server — the host: registry + lazy keep-open boltstore engines +
protocol handler; loopback-default bind constant; graceful shutdown
draining in-flight requests, closing engines and registry.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
internal/infra/httpstore: the client adapter (ADR-021 L3 verbatim — snapshot
+ buffer over the wire, one commit request into one server transaction).
Reads are resource GETs; a Tx opens with one snapshot GET, stages into a
local overlay (read-your-writes, the engine's stagedSource one hop out),
and commits with one POST of the ordered op set. Rejections reconstruct
typed: the precondition family via NewPrecondition (PreconditionOf and
Code() hold caller-side), domain/protocol codes via domain.NewError,
absent reads return the exact port sentinels (errors.Is holds). The
conformance harness's seed; the client epic polishes it.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
The store conformance suite runs UNCHANGED against the served protocol:
Fresh registers a fresh project through the control plane (over the
wire), Alike is a second client connection, Interfere is a second
client's commit where the port can express the divergence and the raw
engine dialect for the four divergences no port op can express (config/
agent/claim/version removals — claim's End would land an episode the
clause forbids). All 75 clauses round-trip HTTP; engines' suites stay
green (probe reshape + Recode delta absorbed).

Fold-ins taken with this landing: the staged-invisibility probe reshape
(channel-routed verdicts, main-goroutine reporting — live now that the
wire harness can genuinely stall a read), and the engine delta it
surfaced: boltstore's Recode stage-time view checks now carry the same
typed identity as their commit-time guards (E_UNKNOWN_ITEM/
E_DUPLICATE_ITEM) — a plain replay-time refusal would have shadowed the
typed family the contract pins. Also fixed: WireConfig carries the
port's config value whole (the suite is the arbiter; L2's 'never
crossing' names the client's boot-selector file, not the port value).

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
Concurrent writes from two clients against the production composition
(internal/server, real loopback listener): 12 rounds of concurrent
claims — exactly one lands per round, the loser typed E_CLAIMED naming
the winner, the landed claim the winner's own metadata; 12 rounds of
deterministic same-suffix child-creates (different birth certificates —
two real mints never share a CreatedAt; the same-certificate write is
the update path by contract, ADR-021 L1) — one lands, the loser typed
E_DUPLICATE_ITEM naming the code; 8 rounds of concurrent registrations
of one fresh acronym — exactly one registration, the loser typed
E_ACRONYM_TAKEN; grammar rejections E_ACRONYM; unknown project typed
E_UNKNOWN_PROJECT; and the isolation corner — same identifiers in two
projects, writes to one never move the other's reads. Green under -race.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
internal/cli/serve.go — the command surface: --bind (loopback default
127.0.0.1:8420 — the boundary, a wider bind is an explicit operator act)
and --data (the serving data root); the help text states the posture
(internal surface, not a contract; no auth this cut). Serve is
project-less: boot lists it with help/version, its composition runs
behind cli.Deps.Serve (the BootFunc sibling, wired by main).
cmd/skuld/main.go — serveComposition: data-root default (XDG_DATA_HOME/
skuld, else ~/.local/share/skuld), the host, the bind, the announce
line naming the real address and the posture, signal-context lifecycle.
Pins: the flag surface (verbatim flags, loopback default, usage-class
args), the host lifecycle (registration + reads over the wire, clean
shutdown releasing the data root, second-serve-on-one-root fails fast
naming the lock, unknown project typed 404 and never materializing a
store, broken-listener loud failure).

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
Teeth-probe dedup: classifyAddAddRow is THE shared classification
predicate — the merge probe and the teeth probe both run it (one
classification, no drift). Sweep 1: boltstore's config Update guard now
reads the existing config loudly (a config that exists but does not
parse refuses the mutation instead of being silently overwritten — the
filestore alignment). Sweep 2: encodeVersionID's dead 255-byte width
check gone (a uint64's minimal big-endian form never exceeds 8 bytes;
the misleading message with it). Doc note: versionComponents' Sscanf
laxness vs ParseVersionID's canonical grammar — defensive-only,
unreachable through the store.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
Wire-level edge cases the conformance suite and two-client harness do
not reach: undecodable body / trailing data / unknown field / unknown
op kind (nothing stages past a valid op) / op field-mask violation /
wrong method / unknown path / wrong depth all answer one typed
E_MALFORMED_REQUEST envelope with the store untouched; a valid-JSON
body over the size gate is malformed, under it lands; the raw status
families pinned verbatim (409 E_CLAIMED naming the holder, 404
E_UNKNOWN_PROJECT, 404 absent sentinel by name, 422 E_ACRONYM).

Pins observed behavior with the 400/422 divergence flagged: the
malformed family answers 422 (kind domain) — protocol.KindProtocol's
400 branch never fires; whichever way the contract settles, the pin
updates consciously.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
The tester's finding (2c4d3e9): codeOfError classified every
malformed-request rejection as kind domain/422, leaving KindProtocol's
400 branch dead code while the envelope's own comments and protocol.md
promised 400/protocol. Settled on the classification change: the
protocol family is defined BY its codes — the closed two-code set
protocol.md names protocol-level (E_MALFORMED_REQUEST,
E_UNKNOWN_PROJECT) — so the classification is total regardless of
which side raised the error (the registry's Resolve, the handlers'
shape checks). A malformed request is protocol-level: the domain never
saw it, nothing ran, nothing staged; 422 then means exactly
"well-formed, domain-rejected". The codes STAY in the audited domain
catalogue (one vocabulary, ADR-021 point 6) — the kind is the wire
envelope's family label, not a catalogue statement.

The tester's probe file carries only the pinned-expectation updates
(422/domain -> 400/protocol, the divergence comment replaced by the
settlement) — expectations only, per the settle motion; the probes'
coverage is untouched. The E_ACRONYM/E_ACRONYM_TAKEN pins stay 422
(domain family, unchanged). Unknown project answers 404 as before; its
kind now reads protocol.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
server-rest-protocol: review sweep — comment truths, the protocolCodes pin, dead code, one sentence
All checks were successful
/ secrets-scan (gitleaks 8.28.0, all refs, redacted) (pull_request) Successful in 5s
/ test (linux/amd64, full suite) (pull_request) Successful in 1m17s
/ build darwin/amd64 (pull_request) Successful in 48s
/ build linux/amd64 (pull_request) Successful in 49s
/ build windows/amd64 (pull_request) Successful in 53s
/ build darwin/arm64 (pull_request) Successful in 54s
/ build linux/arm64 (pull_request) Successful in 45s
/ build windows/arm64 (pull_request) Successful in 45s
/ release (six binaries + checksums.txt, tag pushes only) (pull_request) Has been skipped
ffe66ce8ec
The review's four bounded items, nothing else:

1. replayOps' stage-loop comment now says what the branch made true:
stage failures may also be the typed rename-endpoint refusals (Recode's
stage-time view checks carry E_UNKNOWN_ITEM/E_DUPLICATE_ITEM), carried
verbatim through the wrap and classified precondition/409.
2. TestProtocolCodesPinned pins protocolCodes == {E_MALFORMED_REQUEST,
E_UNKNOWN_PROJECT} exactly — the silent-drift door closed (a forgotten
map entry would quietly render as kind domain); the map's comment spells
the three-place procedure for a future protocol-level code (protocol.md,
the audited catalogue, this map).
3. Dead code gone: the repeated second eErr guard in httpstore's
storeNeeds.All (its NeedsOf twin was already clean) and the dead
assign-then-delete in stagedView.commentDelete.
4. ConfigFromWire's comment claims only what holds: the engines' read
paths gate data-location (E_DATA_LOCATION at load); mode has no
read-path gate — its gate is client boot.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
xavier deleted branch feat/server-rest-protocol 2026-11-15 22:46:29 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
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
assistant/skuld!50
No description provided.