feat/export-payload #61

Merged
xavier merged 5 commits from feat/export-payload into dev 2026-11-19 08:48:53 +01:00
Owner
No description provided.
ADR-029's payload carries claim episodes with their ids («each with its
id»), and the id died at the port boundary: filestore/boltstore named
their records by it, but Episodes returned bare ClaimEpisode records and
the server's snapshot composed episodes with ulidZero. The port grows
for its use case (the standing precedent): []ClaimEpisodeRecord{ID,
Episode} — engines, the wire (real ids from here on, ulidZero gone),
the conformance clauses (the archive clause now pins the id) and the
test fakes all carry the identity through.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
The payload's one rejection joins the domain catalogue (ADR-029 point
3): broken serialization, unknown schema, or a poisoning invariant —
one code, exit 1, the file and the fault named, nothing proposed, the
remedy re-export. The audited catalogue extends consciously (the pin
passes both legs). Beside it, FindCycle: the whole-graph acyclicity
check the strict reader runs — the deterministic sorted-walk sibling of
Cycles, over a graph that already holds its edges.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
internal/migration: the payload document (ADR-029's ten sections in
fixed order — schema 1, acronym, roster, items, claims, episodes,
comments, receipts, edges, versions; no config section, no wall-clock),
the composer (one snapshot read through the port: locally the
filestore's locked Tx read, over the wire the open-time snapshot GET —
the server's own projectSnapshot shape, client-side), the strict reader
(UnmarshalStrict decode, schema check, then the poisoning invariants:
every grammar-bearing value through its domain constructor, hierarchy
inside the live set, edges resolving inside the live set, one edge per
relation, no cycle via domain.FindCycle — all E_PAYLOAD_MALFORMED
naming the file and the fault, nothing proposed), and the export use
case. Determinism by construction: explicit sorts (code, code-then-ULID,
identifier-numeric), canonical codec marshal, byte-verified on a seeded
scratch project — two runs byte-identical across a wall-clock gap, and
the file form identical to the stdout form.

skuld export: stdout default, --out the file form, ungated (a read);
no renderer — the payload bytes are the output, --json has no effect.

Probed the reader's corners end to end (throwaway probes, removed —
the tester owns the tests): own export roundtrips verbatim; trailing
data, unknown schema, unknown field, bad acronym, unresolvable edge,
cycle, self-parent, duplicate roster name, ghost-item claim, duplicate
edge all reject E_PAYLOAD_MALFORMED.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
The AC's test half, landed as real tests on the branch:

- internal/migration/export_payload_test.go — the determinism
  battery: repeat-stability across a real wall-clock gap crossing a
  second boundary; mutation-changes-bytes over 21 single-fact
  mutations (title, status, priority, labels, assignee, roster flag,
  roster growth, comment edit/add, claim move, claim end, episode
  add, receipt pointer/add, edge add/remove, version state/create,
  item deletion, the acronym); the canonical-ordering pin (roster
  name-ordered, items code-ordered with dotted codes verbatim,
  episodes/comments/receipts code-then-ULID, edges
  dependent-then-needed, versions ASCENDING — pinned against the
  store list's DESCENDING presentation, the deliberate divergence);
  the document's shape at the token-stream level (ten sections in
  fixed order, no config section, no wall-clock — the stamp count
  and set equal the facts' own stamps exactly, every fixture stamp
  distinct); empty sections composing as [] never null.
- internal/migration/reader_adversarial_test.go — the ten corners
  re-probed as committed tests: serialization faults (truncation,
  trailing data, unknown field top-level and nested, garbage),
  the schema gate (higher and lower), 23 grammar corners, nine
  timestamp corners, hierarchy (ghost parent, self-adoption, two
  ladder violations, the sub-task cap), edges (ghosts both ends,
  duplicates, self-edge, two-node cycle with the chain named),
  duplicates on every landing key with the per-item positive
  control, ghost sub-facts, the exclusive claim, released-only
  fields with the positive control — every one E_PAYLOAD_MALFORMED,
  nothing parsed, the artifact and fault named, the remedy
  re-export.
- cmd/skuld/export_e2e_test.go — the real run path, both modes: a
  rich local board exporting bytes identical to the port's, the
  reader accepting them whole; --out (stdout stays empty, the file
  identical), --json inert, ungated (a stranger's SKULD_AS exports
  where the same name on a mutation rejects E_UNKNOWN_AGENT), the
  usage corners (extra args, a store-less repo, a doomed --out);
  cross-mode equal — the same state through the filestore and a
  real served root exporting BYTE-IDENTICAL payloads over exactly
  ONE request (a request-counting transport — connections pool, so
  the one-read pin counts requests); the boundary-crossing notice
  pinned absent from the payload at a lane whose rendered records
  all carry bound_root.
- internal/app/layering_test.go — the placement design call pinned:
  the use-case layer imports no internal/infra/* package.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
export-payload: the verbatim roundtrip pinned section by section
All checks were successful
/ secrets-scan (gitleaks 8.28.0, all refs, redacted) (pull_request) Successful in 6s
/ test (linux/amd64, full suite) (pull_request) Successful in 1m42s
/ build windows/amd64 (pull_request) Successful in 55s
/ build darwin/arm64 (pull_request) Successful in 58s
/ build linux/amd64 (pull_request) Successful in 1m2s
/ build darwin/amd64 (pull_request) Successful in 1m5s
/ build linux/arm64 (pull_request) Successful in 52s
/ build windows/arm64 (pull_request) Successful in 52s
/ release (six binaries + checksums.txt, tag pushes only) (pull_request) Has been skipped
a185869ed9
The strict reader's acceptance side at the migration level: the
project's own export parses whole and every seeded fact comes back
verbatim — roster stamps and the owner flag, the dotted code with its
whole field set, the claim's execution metadata, the archive identity
ids, the comment's edit time, the receipt pointer, every edge, the
versions' release facts. What the composer projects, the reader hands
back unchanged — the fidelity half of the read.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
xavier deleted branch feat/export-payload 2026-11-19 08:48:53 +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!61
No description provided.