feat/import-payload #62

Merged
xavier merged 6 commits from feat/import-payload into dev 2026-11-19 22:50:21 +01:00
Owner
No description provided.
The write-set's one structural gap: episodes could not land through the
existing surface — End carries the claim-presence precondition
(FR-034's load-bearing guard), so a virgin landing's episode archive
had no path. ADR-030's consequences say the write-set 'rides the port
untouched', but its own decision (one staged write-set carrying
episodes) needs the write: ClaimRepo grows Archive — the episode lands
under its id, the active claim untouched, commit carrying the
id-uniqueness precondition (the CommentRepo.Append shape, port-level
unreachable by construction). The port-growth precedent applies
(CodeGen/ULIDGen/Recode/ClaimEpisodeRecord); flagged for the architect's
ADR record. Wire op episodes.archive beside claims.end; filestore,
boltstore, httpstore client + staged view all carry it.

Beside it: E_TARGET_NOT_EMPTY (ADR-030 point 4 — the landing's loud
rejection) and E_DUPLICATE_EPISODE (the archive guard's code, the
E_DUPLICATE_COMMENT family's mirror) join the audited catalogue, both
pin legs green. Fold-in from export-payload's review: the reader's
released-only guard now rejects a null-like released_at value (one
IsZero check). filestore.StoreDataPaths exports the up-flip's
retirement set — agents/, items/, versions/, the store's .gitignore —
one source of truth in the layout.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
internal/migration/import.go: the walk per ADR-030 — payload read and
validated before anything (E_PAYLOAD_MALFORMED, nothing proposed); the
owner gate client-side on the bound roster (membership E_UNKNOWN_AGENT,
then ownership E_NOT_OWNER, an empty roster ungated by definition); the
target's state from one snapshot read. The three arms reuse ADR-028's
machinery: ABSENT births through the standing initialization proposal
(the resolved actor the founding seed); VIRGIN re-proposes (the
completion window un-rejects this machine's own interrupted birth; a
foreign birth answers the registry's E_ACRONYM_TAKEN); EQUAL completes
with the rebind alone. The oracle is export: section-wise canonical
bytes with the landing's own named expectations — the acronym member
the target's own (--acronym normalized), the roster supersession-shaped
(every payload member verbatim, at most the one birth seed remaining —
the crash window heals exactly there). LIVED answers E_TARGET_NOT_EMPTY
naming the target and what it holds. The landing is one staged
write-set through the port, one transaction: config update (the
identity — format, the target's mode, the acronym), roster
update-not-delete, items with client-supplied codes (the sanctioned
path, create-uniqueness arbitrating at commit), claims, episodes under
their ids (Archive), comments, receipts, edges, versions. The flips are
remote-first, every local step idempotent: up — thin config born
(Update over the old config), store data retired via
filestore.StoreDataPaths, artifacts ensured; down — the config rides
the landing (mode local, no data-location), artifacts ensured. The
crash window heals by re-running.

skuld import <payload> [--server <base>] [--acronym <ACRO>]: '-' reads
stdin; the composition (cmd/skuld) resolves the --server token lazily —
before any request, after the walk's local gates; the target store is
constructed per acronym (the use case knows it after the parse). The
absent arm's roster presence carries the birth seed (the resolved
actor) so the seed yields instead of colliding.

Smoke-verified end to end against a live server and local targets:
landed/completed/lived-rejection/foreign-birth/interrupted-birth-heal,
both flips' end states (.skuld/ = thin config alone; mode local, no
data-location), the gate's typed order, the stdin and override paths,
malformed rejections, the oracle byte-equal but for the named residue.

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

- internal/migration/import_test.go — the landing use case: the three
  arms (absent births through the recorded proposal with the resolved
  actor the seed — the materialization modeled; virgin lands whole;
  equal completes with ZERO commits on the target, the
  commit-counting store the nothing-written observable); the
  crash-window heal THROUGH the birth-seed residue (the ruled row) and
  the second-extra divergence; the oracle's named expectations (the
  --acronym fold; the roster supersession-shaped with the seed's own
  record untouched — update-NOT-delete); the virgin legs exact
  (roster past the seed, facts present); E_TARGET_NOT_EMPTY naming the
  inventory; the write-set verbatim (dotted codes, claims, episodes
  under their ids, versions in every state with release facts);
  E_DUPLICATE_EPISODE on the filestore AND boltstore engines with the
  incumbent intact; the gate's typed order before the target and the
  proposal; the up-flip's retirement set; StoreDataPaths.
- cmd/skuld/import_e2e_test.go — the real run path against a real
  served root: the up-flip round trip local→server→local with
  BYTE-EQUAL exports at each end and golden flip end-states (the thin
  config's three members; the down config with NO data-location); the
  interrupted birth healing through the residue live (the local half
  frozen mid-flight, the re-run completing the rebind); the foreign
  machine's birth answering E_ACRONYM_TAKEN and the completion window
  un-rejecting this machine's own, with the window's negative legs;
  the gate's zero-proposal request discipline (a recording transport)
  and the lazy order (the gate precedes the token resolution); the
  malformed trio proposing nothing, the acronym staying free; stdin
  and the folded --acronym override; racing imports resolving one
  whole landing and one loud rejection; the mid-flight broken COMMIT
  answering E_NETWORK outcome-unknown with the local half waiting; the
  actor chain seeding the birth (the sole-roster fallback and
  SKULD_AS); the onboarding-ensure scrutiny probe (the tampered
  artifact surviving the flip — the pass-through FLAGGED); the wire
  engine's E_DUPLICATE_EPISODE probe completing the three-engine
  cover.
- internal/migration/reader_adversarial_test.go — the fold-in's
  corner: a null-like released_at VALUE on a released scope rejects
  (presence-vs-state was the old guard; the value is the new one).

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
The reviewer's major: the new op fell to FactOf's default arm and
recorded nothing — every episode a wire-side import landed broke
«minimal audit rows» at introduction. The standing precedent's shape:
one case beside opClaimEnd (the same address items/<code>/claims/<id>,
the same nil/empty guards — the archive identity is the address
whichever op wrote it), one guard-leg probe in the gap-shapes table and
one positive pin in the canonical-addresses table.

Riding nits: the import file header now states the artifacts ruling
(the seam declared, unwired at the verb; the repo-level artifacts ride
git untouched — the flip is not the repo's birth), and the Archive
port's doc names where the guard's coverage lives (the landing battery;
no storeconformance clause yet — the catalogue's honest reach).

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
import-payload: the audit row-count proof — every landed episode writes its row
Some checks failed
/ secrets-scan (gitleaks 8.28.0, all refs, redacted) (pull_request) Successful in 6s
/ build linux/amd64 (pull_request) Has been skipped
/ build windows/amd64 (pull_request) Has been skipped
/ build darwin/arm64 (pull_request) Has been skipped
/ build linux/arm64 (pull_request) Has been skipped
/ build windows/arm64 (pull_request) Has been skipped
/ test (linux/amd64, full suite) (pull_request) Failing after 1m13s
/ build darwin/amd64 (pull_request) Has been skipped
/ release (six binaries + checksums.txt, tag pushes only) (pull_request) Has been skipped
b46d0830ed
The reviewer's point, proven live: a wire-side import whose payload
carries TWO episodes lands against the real host, the host stops, and
audit.db raw-reads. The row set is counted per op kind against the
landing's write-set: one row per episode id at items/<code>/claims/<id>
(the shared address, whichever op wrote it), the initialization row
exactly once, and no op kind silent — config, roster both legs, items,
claim, episodes, comment, receipt, edge, versions, registry — the
ledger holding exactly the expected set, nothing beyond the write-set's
ops. Before the FactOf fix this battery exercised the gap silently;
now the count is the proof.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
import-payload: the crash-window interrupt goes root-proof — the lock path flips type
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 1m30s
/ build linux/amd64 (pull_request) Successful in 48s
/ build darwin/amd64 (pull_request) Successful in 50s
/ build darwin/arm64 (pull_request) Successful in 1m3s
/ build windows/amd64 (pull_request) Successful in 1m5s
/ build linux/arm64 (pull_request) Successful in 46s
/ build windows/arm64 (pull_request) Successful in 46s
/ release (six binaries + checksums.txt, tag pushes only) (pull_request) Has been skipped
2dd403f2fd
The CI failure diagnosed: the interruption was a permission freeze
(chmod 0500 on .skuld/), and a root CI runner bypasses it — root's
CAP_DAC_OVERRIDE beats mode bits, the lock file created fine, the flip
completed, the import exited 0, and the test caught its own
intervention failing. Proven empirically: root writes into a 0500
directory (the old freeze a no-op), and the new mechanism's failure is
EISDIR in a root container — a path-type mismatch privilege cannot
override.

The interrupt now makes .skuld/.lock a DIRECTORY before the import:
OpenFile(O_CREATE|O_RDWR) on a directory path is EISDIR for any
runner, root included, and nothing before the flip touches the lock —
boot reads the config lock-free, the gate reads lock-free, the landing
rides the wire — so the first local lock acquisition IS the flip's and
the interrupt fires exactly at the rebind, after the landing has
committed. The thaw removes the empty directory, a no-op for any
runner. The test's promise is unchanged and CI keeps the heal
coverage: the landing commits, the rebind is interrupted, the re-run
classifies equal through the residue and completes.

Verified: green locally, green under uid 0 in a container (the
CI-like condition), full cmd/skuld suite green, fresh full suite green.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
xavier deleted branch feat/import-payload 2026-11-19 22:50:21 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
2 participants
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!62
No description provided.