feat/worktree-data-location #46

Merged
xavier merged 8 commits from feat/worktree-data-location into dev 2026-11-12 11:02:29 +01:00
Owner
No description provided.
domain: the data-location vocabulary as a value object (zero value =
local-branch, absent = the default), one parse feeding load and write
alike; E_DATA_LOCATION + E_CONFIG_FLAG join the machine-code registry
(A DR-017/018 catalogue audit). app: ProjectConfig carries the additive
fact as a pointer (nil = key absent, non-nil = materialized, explicit
local-branch expressible), EffectiveDataLocation the one accessor, and
ConfigRepo.Update joins the port (presence-preconditioned, the
AgentRepo.Update shape). filestore: the canonical writer omits the key
when unset (unset bytes = never-carried bytes), the reader validates
through the shared parse with the corrective (exit 1) not corruptive
(exit 3) class, naming the file.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
boot: the implicit resolution branch gains its third link — the
deciding config's data-location key — with the redirect scoped to a
deciding root that IS the invocation's linked worktree root (loop-free
by construction, the bound config never consulted twice), the
corrective E_NO_MAIN_STORE naming the store-less main tree, and the
boundary-crossing notice predicate computed once at boot (implicit +
bound root outside the probe's toplevel). Explicit --repo/SKULD_REPO
pay nothing: no probe, no key, no notice. gitctx: Probe — one git exec
(worktree list --porcelain, main first, longest containing match for
the current toplevel), best-effort, outside the GitContext port.
render: the notice rides every success payload — additive bound_root
field appended last on machine records (per row on JSONL), a notice
line ahead of the human payload — absent otherwise, so no-crossing
output stays byte-identical. --repo's help states the four-link
precedence; the repo-env help pin moves with it consciously.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
app: SetConfigValue/UnsetConfigValue over the closed one-row registry
(flag, domain value object, clear, presence, effective — the unset
vocabulary mirroring the settable one); gate order membership →
GuardOwner inside the verb's own Tx, preceding the value parse, the
no-op comparison and all staging; effective-value no-ops stage nothing
(a no-op set never materializes an explicit local-branch), unset's
no-op presence-shaped; E_CONFIG_FLAG via UnknownConfigFlag/
FlaglessConfig (one wording for the CLI partition and the use cases).
cli: the config noun parses out of stock pflag — DisableFlagParsing +
the token partition (globals re-bound through the root's persistent
set, -h/--help to help, --data-location consuming its value on set and
bare on unset, any other dash-token and the flagless form the
corrective E_CONFIG_FLAG, stray positionals the usage class).
init twin: the value parses in the validate-first preamble (E_DATA_
LOCATION rejects whole), the fresh config carries the key from birth,
the re-run compares effective values (same a no-op, different
E_PROJECT_EXISTS naming config set, bare leaves the key untouched);
ADR-019's gate arm stands between the preamble and the state probes —
owner-holding roster gates the ensure (rostered + flag, nothing
written), zero-owner repair unchanged. Render pins move consciously
with the gate reorder (the gate now precedes the acronym probe) and
the --as re-run's gated arms.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
cmd/skuld/worktree_resolution_e2e_test.go: real `git worktree add` fixtures driving
the real boot path from inside a lane — the lane shape (committed branch-local
config: main-tree redirects to the main store, nothing lands in the lane, the
notice names the main root on both render arms; absent = lane-local, silent;
the deciding copy read from disk with uncommitted edits included), the escapes
(--repo . at binary level, SKULD_REPO outranking the key), the inside-repo
adoption (<repo>/.worktrees/wt-x with no checkout binds the main store and
names the main root, key or no key), the store-less main tree (E_NO_MAIN_STORE
naming the main root), the stored banana value rejecting every verb at load on
the deciding copy and on the bound copy, main-tree at the main root a no-op
(loop-free), the boundary-free corner (no repository under a walk-up-reachable
store: walk-up binds, the key never consulted, no notice — git absent from PATH
at binary level), rejections and explicit resolution carrying no bound_root,
and a claim landing in the main store through the crossing.

cmd/skuld/worktree_notice_golden_test.go: the crossing forms pinned per shape
family at golden bytes — JSONL lists per-row (agent list, release list, full
goldens), single-object shapes top-level appended last (item show with the
in-tree contrast run, config set as the mutation-response family writing the
bound root's config, release show, brief — full goldens), the human notice
line exactly once ahead of the payload, and the field's absence on error
envelopes and explicit resolution.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
cmd/skuld/config_surface_e2e_test.go: the write surface at the CLI — the key
after acronym (the additive seam, golden bytes), the effective-value no-ops
writing zero bytes pinned through a committed store's clean tree (a no-op set
never materializes an explicit local-branch; unset bytes equal a never-carried
key; the explicit local-branch line materializes only on a real change),
banana rejecting naming flag and value, the closed vocabulary's corrective
E_CONFIG_FLAG at exit 1 (unknown flags including --mode, single-dash tokens,
flagless — richer than stock pflag's exit 2, the mechanism guard), the usage
class (exit 2) for token-shape malformations, -h to help, the atomic multi-
flag fold, the no-read-surface boundary. The init twin: the key from birth,
banana rejecting whole with no partial state, the re-run's same-effective
no-op / different-value E_PROJECT_EXISTS naming config set / bare re-run
leaving the key untouched. The owner gates (ADR-019): membership before
ownership, the gate preceding the no-op paths (the already-stored value
included), no zero-owner relief on the verbs, the re-init gate on an
owner-holding roster rejecting before the state probes and before the
artifact heal (env-seed funnel included), the owner path healing.

cmd/skuld/merge_config_rows_e2e_test.go: the config key's merge rows at
command level over the twin-clones harness — identical sets clean (recorded
once), one-sided set clean, set-vs-unset conflict on exactly config.json,
double unset clean to the never-carried bytes, and the realizability
boundary: two-sided differing sets are unreachable at the command level (the
effective-value no-op filters the second side).

internal/infra/filestore/merge_config_reality_test.go: the store-level twin
on the reality harness, both sides staging through ConfigRepo.Update — the
two-sided differing-set CONFLICT row staged store-level (not command-
realizable, the store-twin home), identical sets clean, one-sided clean,
set-vs-unset conflict, double unset clean.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
review nits 1+3. SetConfigValue: the no-op verdict and the response
records now land AFTER the fold and describe the config as it stands
after the run — each DISTINCT named fact's effective value compared
against (and rendered from) the base, so a reverting tail folded by a
direct use-case caller (main-tree then local-branch over a keyless
store) stages nothing instead of materializing the tail's explicit
local-branch, and no record shows a value the fold superseded
(ADR-018 pt 4; ConfigResult's truthful-at-emission contract).
Byte-identical through the CLI, whose partition still folds last-wins
first. UnsetConfigValue needs no restructure: its fold is monotone
(clear has no inverse) and changed already keys off presence in the
immutable base — no reverting shape is expressible. Both use cases
gain the none-at-all leg of the closed vocabulary (FlaglessConfig) —
application.md's 'an unknown fact or none at all rejects
E_CONFIG_FLAG' now holds at the use case, not only at the CLI
partition. merge_config_reality_test.go: name the two merged values,
drop the throwaway (review nit 3).

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
worktree-data-location: tests — app-level table test for the config write use cases
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 1m7s
/ build windows/amd64 (pull_request) Successful in 39s
/ build darwin/arm64 (pull_request) Successful in 41s
/ build linux/amd64 (pull_request) Successful in 42s
/ build darwin/amd64 (pull_request) Successful in 43s
/ build linux/arm64 (pull_request) Successful in 36s
/ build windows/arm64 (pull_request) Successful in 35s
/ release (six binaries + checksums.txt, tag pushes only) (pull_request) Has been skipped
fa88984212
internal/app/config_usecase_test.go: the stagedConfigUpdate fakes' first
in-package consumer — SetConfigValue/UnsetConfigValue pinned at the
application layer against the fake (application.md's testing pattern),
directly off the CLI partition:

- the post-fold no-op verdict (9b42099): a direct caller's reverting tail
  (main-tree then local-branch over a keyless store) stages NOTHING — the
  config pointer never moves — and records ONE end-state entry (the
  post-fold verdict's value, ConfigResult truthful-at-emission);
- real changes stage: set over keyless, set over a carried different
  value (the explicit local-branch line materialized), unset over a
  carried key, unset over an explicit local-branch (its removal IS the
  real change);
- effective-value no-ops stage nothing but commit the empty write-set
  (set's carried value included — zero bytes, same response);
- the none-at-all leg rejects E_CONFIG_FLAG at the use case (both verbs),
  as does an unknown fact; banana rejects whole;
- ConfigRepo.Update's commit-time presence precondition asserted
  UNREACHABLE by construction: runConfigWrite's config read answers
  ErrNoConfig before any staging on a config-less store.

Staging observed by config pointer identity across the run (the fake
applies a staged update as a fresh pointer); transaction discipline rides
the fake's counters (one Tx per run; rejections roll back, commit nothing).
Fixtures seed state through the use cases (seedRoster + the set verb; an
explicit local-branch carried via the real-change route).

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
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!46
No description provided.