Repository navigation
refactor(op): WithRoot takes only the anchor; fsroot.Mode and Open are gone - #576
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#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'sRootModefield and the environment'srootModego;probeRootAnchorand the lazy mint callfsroot.OpenConfineddirectly.RootModewas never serialized —no document or schema carries it — so this is pure Go surface.
The vestige
fsroot.Mode,ModeConfined, and the one-branchOpenthat step 3 kept alive for this exact signature aredeleted. 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
fsrootimport that existed only to spell it. Three of those imports were shadowed by commentsmentioning
fsroot.and surfaced only under vet — the sweep now checks compilable references, not text.A step-3 leftover collapsed
newTriadRWandnewTriadConfinedhad 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;newTriadtakes only the directory.
Tests
TestOpen_ModeConfinedsurvives asTestOpenConfined_CloseReleasesTheHandle— the behavior it actuallypinned. The missing-directory and zero-value-
Modetests died with the dispatch they tested.Status document
The last open item resolves by inspection:
TestIsPrivateMode/TestNewPathare ordinary_test.gofunctions; nothing test-shaped is exported from a non-test file (
NewPathis public for documentdeserialization; the
Perm*masks are chartered with #559). Open section now reads: nothing — the designis implemented in full.
Verified
make check— 103 packages ok, 0 failuresmake vetGOOS=windows, GOOS=linuxgofmt -lover pkg/ and cmd/ — cleanCloses #568.