Skip to content

repo set and unset replace add and remove, a clone takes git's name, and a group refuses a verb it does not have - #898

Merged
David-Noble-at-work merged 2 commits into
developfrom
feature/791-repo-set-and-unset
Sep 20, 2026
Merged

David-Noble-at-work merged 2 commits into
developfrom
feature/791-repo-set-and-unset

Conversation

@David-Noble-at-work

@David-Noble-at-work David-Noble-at-work commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Lanes 8 to 11 of #887.

  • repo set and unset (#791) — a layer has one
    registration; set re-points it, unset is idempotent, an unchanged set says so, every refusal precedes
    the clone, and the retired spellings are gone rather than aliased. The record carries source, root,
    owner, branch and previous.
  • A writ-owned clone goes with its registration (#792)
    — unset and a displacing set remove it and say so; a tree registered by path is never touched;
    --dry-run emits the record and does nothing. Removal passes a guard that decides from the path.
  • A clone takes the name git gives it (#793, pulled
    forward from #894 by ruling of 2026-09-19) — a URL
    without a destination clones to repos/<repository>, never repos/<layer>; two layers resolving to one name
    are refused naming both, before the clone; a URL that yields no name is refused.
  • A group refuses a verb it does not have (#897)
    — every program validates the command line before executing it, so writ repo add and every unknown verb
    under every group exit 64 with cobra's own message instead of printing help at exit 0. No group gains a
    RunE; §14 invariant 7 stands; §3 states the rule.

Test plan

  • make check green; make test-scenario green — the layer-journey scenario is writ names a cloned repository by its layer; it should name it the way git clone does #793's end-to-end test,
    and its absence from the first commit's pre-flight is why the first CI run was red
  • Coverage, complexity and size re-measured after writ names a cloned repository by its layer; it should name it the way git clone does #793; figures in the plan
  • darwin, installed: repo add refused with unknown command "add" for "writ repo"; list shows source
    and owner on the real registrations; set to the same root says unchanged
  • danoble-ud24-1.local (linux/arm64), snapshotted first: unset twice per layer — the first removes
    writ's clone, #792 live; set by URL re-clones
    base and team where "already exists" had blocked them the day before, and says unchanged the second
    time; set by path, unchanged; personal by path to ~/Workspace/Personal, owner user, source from
    its origin. Bare deploy exits 64 (#843); a
    real deploy stops at file.mkdir (#822), as on
    2026-09-18 — not this PR's; upgrade exits 0
  • danoble-wd11-3.local: carried to the next PR's sequence by ruling of 2026-09-19 — the host disk is
    full (22 GB free of 3.7 TB) and a snapshot of the running 32 GB machine does not fit.
    C:\Users\david-noble\writ-e2e.ps1 carries the sequence in the new verbs

Time

Marker UTC Elapsed
opened (first commit) 2026-09-19T23:10:45Z —
submitted (PR opened) 2026-09-19T23:11:04Z 0 h after opened
merged 2026-09-20T08:04:31Z 8.9 h after submitted; 8.9 h in all

Computed by the algorithm of noblefactor-ops#188 at merge.

… it does not have

A layer has exactly one registration, so registering one that is registered
re-points it rather than failing: the verb is set, the vocabulary config set and
config unset already use for a keyed value. unset is idempotent. set to the root a
layer already has narrates unchanged. Every refusal precedes the clone, where add
cloned first and refused after. add, remove, rm and ls are gone, not aliased.

The record says what changed. source is the URL writ would fetch from -- the
upstream's remote, else origin, else empty -- and root is where writ reads; owner
says whose tree it is, and previous carries what was displaced or removed, so a
script reads on stdout what narration says on stderr. repo list carries source and
owner on every row.

A clone writ made goes with its registration. unset removes it and says so; a set
that re-points elsewhere removes the one it displaces; a tree registered by path
is never touched. --dry-run emits the record and does nothing. Removal passes a
guard that decides from the path, not from the record.

A group refuses a verb it does not have. Cobra checks unknown commands at the root
alone and abandons a runless group before validating its arguments, so writ repo
add exited 0 and printed help with add retired -- as did every unknown verb under
every group in writ, lore and star. Each program now validates the command line
before executing it, using cobra's exported Find and its own NoArgs, so the
message is cobra's by construction and exits 64 through the mapping §9 already
had. No group gains a RunE; invariant 7 stands. §3 states the rule.

Closes #791
Closes #792
Closes #897
… one

repo set <layer> <url> cloned into repos/<layer>: three directories named base,
team and personal, whatever repositories they held. The clone now takes the name
git clone would give it -- the last path component with a trailing slash and a
.git suffix stripped -- so noblefactor-ops.git lands at repos/noblefactor-ops and
the directory says which repository it holds. Two layers whose repositories share
a name are refused, naming both, before anything is cloned. A URL that yields no
name is refused as git refuses it. owner is unaffected: the clone is still under
the writ home.

The layer-journey scenario, skipped on develop for want of repo set, ran on this
pull request's first CI and asserted #793 in the same step as #791. The
scenario is the ruled interface; the code now follows it, and make test-scenario
is in the pre-flight, where the first run left it out.

Closes #793
@David-Noble-at-work David-Noble-at-work changed the title repo set and unset replace add and remove, and a group refuses a verb it does not have repo set and unset replace add and remove, a clone takes git's name, and a group refuses a verb it does not have Sep 20, 2026
@David-Noble-at-work
David-Noble-at-work merged commit ad2219e into develop Sep 20, 2026
13 checks passed
@David-Noble-at-work
David-Noble-at-work deleted the feature/791-repo-set-and-unset branch September 20, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant