Skip to content

refactor(op): WithRoot takes only the anchor; fsroot.Mode and Open are gone - #576

Merged
David-Noble-at-work merged 1 commit into
developfrom
withroot-drops-the-mode
Aug 20, 2026
Merged

David-Noble-at-work merged 1 commit into
developfrom
withroot-drops-the-mode

Conversation

@David-Noble-at-work

Copy link
Copy Markdown
Contributor

#568 step 5 — the last one. With one confinement there is nothing to select, so the mode parameter selected
nothing.

The signature

WithRoot(path, mode) → WithRoot(path). The spec's RootMode field and the environment's rootMode go;
probeRootAnchor and the lazy mint call fsroot.OpenConfined directly. RootMode was never serialized —
no document or schema carries it — so this is pure Go surface.

The vestige

fsroot.Mode, ModeConfined, and the one-branch Open that step 3 kept alive for this exact signature are
deleted. Zero references remain (repo-wide grep).

42 call sites, 34 orphaned imports

writ (9), lore, star, devlore-test (2), the plan provider, and the test files all drop the constant; 34 files
lose an fsroot import that existed only to spell it. Three of those imports were shadowed by comments
mentioning fsroot. and surfaced only under vet — the sweep now checks compilable references, not text.

A step-3 leftover collapsed

newTriadRW and newTriadConfined had become identical, and eight triad tables still ran every test twice —
once under "RootReaderWriter", a type deleted two steps ago. Duplicate helper and rows gone; newTriad
takes only the directory.

Tests

TestOpen_ModeConfined survives as TestOpenConfined_CloseReleasesTheHandle — the behavior it actually
pinned. The missing-directory and zero-value-Mode tests died with the dispatch they tested.

Status document

The last open item resolves by inspection: TestIsPrivateMode/TestNewPath are ordinary _test.go
functions; nothing test-shaped is exported from a non-test file (NewPath is public for document
deserialization; the Perm* masks are chartered with #559). Open section now reads: nothing — the design
is implemented in full.

Verified

  • make check — 103 packages ok, 0 failures
  • make vet GOOS=windows, GOOS=linux
  • gofmt -l over pkg/ and cmd/ — clean

Closes #568.

…e gone

#568 step 5, the last one. With one confinement there is nothing to select, so the mode parameter selected
nothing: WithRoot(path, mode) becomes WithRoot(path), the spec's RootMode field and the environment's rootMode
go, probeRootAnchor and the mint call fsroot.OpenConfined directly, and fsroot deletes the Mode type, its one
remaining constant, and the one-branch Open that survived step 3 as a documented vestige.

Forty-two call sites drop the constant -- writ (9), lore, star, devlore-test (2), the plan provider, and the
test files -- and thirty-four of them lose an fsroot import that existed only to spell it. Three of those
imports were shadowed by comments mentioning fsroot and surfaced only under vet.

triad_test carried a leftover from step 3: newTriadRW and newTriadConfined had become identical, and eight
tables still ran every test twice, once under "RootReaderWriter" -- a type deleted two steps ago. The
duplicate helper and rows are gone, and newTriad takes only the directory.

TestOpen_ModeConfined survives as TestOpenConfined_CloseReleasesTheHandle, which is the behavior it actually
pinned; the missing-directory and zero-value-Mode tests died with the dispatch they tested.

The status document's last open item resolves by inspection: TestIsPrivateMode and TestNewPath are ordinary
_test.go functions, and nothing test-shaped is exported from a non-test file. The design is implemented in
full -- one confinement behavior, two types, two constructors.

Verified with make check (103 packages ok, 0 failures) and make vet under GOOS windows and linux.

Closes #568.
@David-Noble-at-work David-Noble-at-work self-assigned this Aug 20, 2026
@David-Noble-at-work
David-Noble-at-work merged commit 925e888 into develop Aug 20, 2026
7 of 8 checks passed
@David-Noble-at-work
David-Noble-at-work deleted the withroot-drops-the-mode branch August 20, 2026 06:31
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.

Collapse fsroot to one confinement behaviour and two types

1 participant