Repository navigation
fix(fs): replay mount --pack-path values to umount so auto-pack includes them - #101
Conversation
The companion's `mount` has no pack-path flag: it builds the effective pack paths from the mount profile only. The only place that accepts extra paths is `umount --pack-path`, which merges them with the pack state before running the automatic pack. ti therefore has to keep the values from mount time until unmount. - Locator gains PackPaths (`pack_paths,omitempty`); an omitted field means "none", so locators written by earlier versions keep working. - WithPackPaths/NormalizePackPaths trim, drop blank entries and remove duplicates while preserving order, because the companion appends one --pack-path flag per entry. - Tests pin the round trip and the normalization.
`ti fs mount-file-system --pack-path /src` mounted fine while the automatic pack silently omitted /src: the flag only reached MountResult/mountstate, and the companion mount ignores it (it derives pack paths from the profile). The previous change dropped the mount-time forward without providing another channel, which left the flag inert. Record the values on the locator at mount time and replay them as repeated `drive9 umount --pack-path` on unmount, which is what feeds the automatic pack. --no-auto-pack keeps suppressing both the pack and the replay; a mount without extra paths sends no flag, so existing behaviour is unchanged. Tests drive the fake companion end to end: the umount argv carries the paths in order, --no-auto-pack sends none, and a mount without extra paths sends none.
mornyx
left a comment
There was a problem hiding this comment.
Review summary
The diagnosis is right and well argued against the companion source: drive9 mount has no pack-path flag, so umount --pack-path is the only channel into the automatic pack, and recording the values on the locator is the additive, backward-compatible way to carry them there. The --no-auto-pack boundary is correct, and every fix line is pinned by a test.
What blocks the merge is that the replay makes unvalidated mount-time input load-bearing at unmount, where the companion treats --pack-path strictly and only after the mount has been detached. Several reachable states — including the example in the PR description, and any WebDAV mount started with --pack-path — unmounted cleanly before this change and now fail. The structural points further down (a second pack-path normalizer, docs that no longer match the code) are not blockers.
I checked the companion behaviour by reading drive9 81bb0d92 (the revision the PR description cites) and by running its own runUmount and defaultPackAfterUnmount in an isolated test with fake unmount and terminate dependencies. I did not run a real mount.
What looks good
- The root cause is identified correctly:
effectivePackPathscomes from the profile alone (drive9cmd/drive9/cli/mount.go:576), so a mount-time forward could never have worked. Locator.PackPathsis additive (omitempty, "omitted means none", no schema bump).ReadandListuse plainjson.Unmarshal(internal/fs/mountlocator/locator.go:153,:229), so older builds ignore the field and this build reads older locators as none. The locator has a single production writer, so nothing rewrites the field away.- A mount without extra paths keeps the exact same
umountargv. Reverting the fix lines one at a time fails at least one new test every time: the replay loop failsTestUnmountForwardsPackPathsToCompanion, dropping theelsefailsTestUnmountSkipsPackPathsWhenAutoPackDisabled, removing the locator write failsTestMountRecordsPackPathsInLocator, and removing trimming or de-duplication fails the two locator tests. - Both commit messages explain the why, and the record/replay split reads cleanly.
Blocking (please address before merge)
1. Replayed --pack-path values can fail an unmount that used to succeed, after the mount is already gone
drive9UnmountFileSystem now replays every recorded value unless --no-auto-pack is set (internal/fs/drive9_companion.go:1357-1358). At mount time the only check is the none-profile rejection (internal/fs/mount.go:689-692), and NormalizePackPaths only trims and de-duplicates. On the companion side umount --pack-path is the strict form of a pack path, not the lenient profile form:
- Each value must exist under
<local-root>/overlay/, otherwise the pack fails withstat pack path …(resolveExplicitPackSourcesis called withskipMissing=false, drive9cmd/drive9/cli/pack.go:591and:600-620;defaultPackAfterUnmountsets noSkipMissing,cmd/drive9/cli/mount.go:2601-2607). ./x,x/,x//yand backslashes are refused (joinArchivePath,cmd/drive9/cli/pack.go:1077-1101).- The builtin profiles route only
node_modules,.venv,targetand Git workspaces into the overlay (cmd/drive9/cli/profile.go:268-290), so a path such as/srcis not there.
Four reachable states, each of which unmounted cleanly before this PR:
- Path absent from the overlay (FUSE). For a
portablemount and the default archive,defaultPackAfterUnmountsucceeds without an explicit path and fails with/srcreplayed:drive9 umount: pack :/.drive9/packs/workspace-….tar.gz: stat pack path /workspace/src (<local-root>/overlay/src): lstat …: no such file or directory. That is the PR description's own example (--mount-profile portable --pack-path /src): nothing routessrcinto the overlay, so there is nothing to pack. The pack is the last step ofrunUmount, after the stop and the kernel unmount (cmd/drive9/cli/mount.go:2397-2401,:2452-2466). ti then reports a failed unmount for a mount that is already detached and keeps the locator (internal/fs/drive9_companion.go:1377). For as long as that locator exists, the token guards refuse refresh, disable and delete withfs.token_mount_active(internal/fs/tokenmgmt/service.go:840-876) and point back at the same failing unmount. With--ignore-absent, ti removes the locator and returnsstatus: absent(internal/fs/drive9_companion.go:1363-1375): exit 0 and no archive. - Path in a form the pack refuses (FUSE).
./src,src/andsrc//suball fail withinvalid relative pack path. Same outcome as 1. - WebDAV. ti accepts
--pack-pathwith the WebDAV driver when--mount-profileis omitted: the empty profile is treated ascoding-agentfor eligibility (internal/fs/pack.go:31,:1658-1669), ti forwards no--profile, and the locator is written withdriver=webdavand the paths on it. Unmount skips the drain for WebDAV (internal/fs/drive9_mount_drain.go:108-109,:210-214) and replays. A WebDAV mount state has nolocal_root(cmd/drive9/cli/mount_webdav.go:194-199), sovalidateUmountPackStaterejects it (cmd/drive9/cli/mount.go:2249-2252,:2559-2562). Run against such a state,umount --pack-path /srcreturnsdrive9 umount: --pack requires mount metadata with local_root, with no kernel unmount and no bridge termination; the same state unmounts cleanly without the flag. On macOS and Windows the default--driver autois a WebDAV mount (cmd/drive9/cli/mount_webdav.go:46-56), so this needs no unusual flag combination. On non-Windows the companion also terminates the live bridge by PID identity before that check runs (cmd/drive9/cli/mount.go:2208-2213,:2239-2244); I read that from the source and did not execute it. --forcewith an unreadable mount state.--forceskips the drain (internal/fs/drive9_mount_drain.go:120-121), soumountis reached with the replayed path and fails withread mount state for packbefore the stop (cmd/drive9/cli/mount.go:2148-2151). Without the flag the same state unmounts cleanly.
The note in the PR description does not hold for --force and WebDAV: ti does not fail earlier at the drain step when the drain gate is skipped. The message it quotes is produced only when --pack-path is sent together with --no-auto-pack (cmd/drive9/cli/mount.go:2265-2267), which ti never does.
Suggested direction:
- Validate at mount, in a place shared with
--dry-run(mountOverlayPolicyornormalizeMountOptions): reject--pack-pathwhen the effective driver is WebDAV, and reject the forms the pack refuses (./../empty segments, backslash). At minimum, recordPackPathsonly when the companion reported a FUSE mount (mountedDriver,internal/fs/drive9_mount_audit.go:131-132). - Record the overlay root next to the paths (the mount already resolves it as
auditRoot) and check each recorded path indrive9UnmountFileSystembeforeumount: either fail before anything is detached, or skip the missing ones with a visible check inUnmountResult. Mirror the decision inDryRunUnmountFileSystem. - When
umountfails after a successful drain, say that the mount may already be detached and name--no-auto-packand--ignore-absent, instead of only asking for a retry. - Add the cases listed under item 4.
Should fix (non-blocking, strong)
2. A second pack-path normalizer, in the wrong package
mountlocator.NormalizePackPaths (internal/fs/mountlocator/locator.go:65-88) is mergeMountPackPaths (internal/fs/mount.go:740-757) again: trim, drop blanks, exact de-duplication, order preserved. AGENTS.md:1283-1284 names mountOverlayPolicy the single owner of the effective pack paths, and internal/fs/mountlocator is the non-secret routing record (AGENTS.md:1161). The split already shows: MountResult.PackPaths reports the raw flag values (internal/fs/drive9_mount_audit.go:179) while the locator stores normalized ones.
Normalize once, where flag values are already trimmed for the companion argv: opts.PackPaths = mergeMountPackPaths(opts.PackPaths) in normalizeMountOptions (internal/fs/mount.go:173), then assign locator.PackPaths = opts.PackPaths in writeDrive9MountLocator. WithPackPaths, NormalizePackPaths and their two tests can go; keep one JSON write-then-read assertion for the pack_paths key and move the table to a mergeMountPackPaths test, which has none. Separately, the zero-or-one mountOpts ...MountFileSystemOptions parameter now has a second dependency behind len(mountOpts) > 0 (internal/fs/drive9_companion.go:1412-1419); explicit arguments would be clearer.
3. Docs and help text no longer match the code
ti fs unmount-file-system --no-auto-packstill says "Skip the portable mount profile's default auto-pack action" (internal/cli/commands.go:2687). After this PR it also drops the recorded paths (internal/fs/drive9_companion.go:1350-1360), which forcoding-agentis the only thing that triggers an auto-pack.- The README paragraph this PR extends still says auto-unpack applies when "
portablesupplies/by default and--pack-pathadds more". In the companion path the profile alone decides:effectivePackPathscomes from the profile (cmd/drive9/cli/mount.go:576,:741),coding-agenthas none (cmd/drive9/cli/profile.go:224), and ti forwards--unpackonly for an explicit--unpack-archive-path(internal/fs/drive9_mount_audit.go:103-110). Acoding-agent --pack-path Xmount therefore never restores the archive this PR writes, while ti'sunpackPossiblepredicate (internal/fs/mount.go:726) audits an unpack that does not happen. Forportable,/already packs the whole overlay (cmd/drive9/cli/profile.go:236,cmd/drive9/cli/pack.go:628-634), so the replay adds no content there.
With either builtin profile, the stated outcome (the next sandbox unpacks the requested paths) is not reached by this change alone. It is worth deciding what --pack-path is for and saying it once: either close the loop (have the mount unpack the default archive when extra pack paths are recorded, after confirming that ti's defaultPackArchivePath names the same file as the companion's), or state that the extras are packed at unmount and must already be overlay paths, and add the --pack-archive-path interaction to the README sentence.
4. Tests stop at argv shape
The fake companion's umount accepts anything (internal/fs/drive9_fake_companion_test.go:133-137), so no test can see any state in item 1. The pieces are already there: TI_FAKE_UMOUNT_FAIL (for example internal/fs/drive9_mount_drain_test.go:362) and legacyTestLocator (:578). Missing: a failing umount with recorded paths and the locator state that follows; a WebDAV locator with pack paths; --force with a gone mount; a legacy locator without pack_paths. Under e2e/ there is no flag → locator → umount test (only the help assertion at e2e/cli_test.go:65), and the live suite never mounts with --pack-path. One live FUSE mount and unmount with an existing overlay directory, asserting that the archive contains it, is the only way the PR's claim gets checked against the real companion.
Two small ones in the new test file: the variadic opts parameter of mountWithPackPaths (internal/fs/drive9_unmount_pack_paths_test.go:14) is unused by all four callers, and TestUnmountWithoutPackPathsSendsNoFlag (:111) cannot fail while the loop iterates locator.PackPaths. It would sit better as a table case next to TestUnmountSkipsPackPathsWhenAutoPackDisabled (:95).
Nits
AGENTS.md:1161still describes the mount locator as routing state only.
Recommendation
Request changes. The replay turns unmounts that worked before into reported failures (the PR's own example, and any WebDAV mount started with --pack-path) and leaves a locator that blocks token operations; it needs mount-time validation and a check before the mount is detached.
Review of #101 found that replaying mount-time --pack-path values turned unmounts that used to succeed into reported failures. The companion treats `umount --pack-path` as the strict form: each value must exist under <local-root>/overlay, the forms `./x`, `x/`, `x//y` and backslashes are refused, and a WebDAV mount has no local_root at all, so validateUmountPackState rejects it. Because the pack runs after the stop and the kernel unmount, a rejected value left the mount detached with the locator still present, which also blocks token refresh, disable and delete. - Validate at mount, where --dry-run sees it too: --pack-path is refused for a WebDAV mount (fs.pack_path_requires_fuse) and for the shapes the companion's joinArchivePath rejects (fs.invalid_pack_path). Normalization now happens once in normalizeMountPackPaths via mergeMountPackPaths; the second normalizer in mountlocator is gone. - Record the mount's local root next to the paths, and only for a FUSE mount. Unmount replays a value only when it is still in `<local-root>/overlay`; the rest are reported as skipped checks so the pack cannot fail after the detach. A locator without a recorded local root replays nothing and says so. - A failed unmount after a successful drain now says the kernel mount may already be detached and names --no-auto-pack and --ignore-absent instead of only asking for a retry. - Dry-run unmount reports the same decision (auto_pack_paths). - Docs: --pack-path and --no-auto-pack help text, the README paragraph that claimed a mount-time forward, and the locator description in AGENTS.md. Tests cover the four reachable states from the review: an absent overlay path (FUSE), --force with a gone mount, a WebDAV locator with recorded paths, and a legacy locator without pack paths, plus locator retention after a failed pack.
|
Thanks — the review was right on the blocking point, and I've reworked the change in Blocking: the replay could break an unmount that used to workConfirmed your reading of the companion: The fix moves every unsafe case before the detach and keeps the replay only where it is known to be packable:
Should fix 2 — one normalizer
Should fix 3 — docs
Should fix 4 — testsAll four states now have a case through the fake companion, including the locator state that follows a failure:
The two small ones are addressed: the unused variadic in the test helper is now a single optional tweak used by no caller, and the "no flag" case is a table sibling rather than a loop that cannot fail.
One thing I did not change: |
The dry run is the only way to see the replay decision before the mount is detached, so cover it: a path present in the overlay is reported as replayed, and one that is not is named as skipped.
|
Pushed one test-only commit ( |
--no-auto-pack suppresses the automatic archive, but an explicit --pack-archive-path still runs the pack, so dropping the recorded --pack-path values there produces an explicit archive that omits them. Replay whenever a pack will run: the automatic one, or an explicit archive that outlives --no-auto-pack. --no-auto-pack alone still suppresses both, and the dry run reports the same rule. Help text and README say which flag wins.
|
One more fix in
New test: |
The locator is no longer routing state only: it also carries the local overlay root and the --pack-path values unmount replays, and the replay is filtered by what the overlay still holds.
|
Also closed the AGENTS.md nit in |
User-visible Filesystem behaviour changed: the flag now reaches the automatic pack, WebDAV refuses it, and an absent overlay path is reported instead of failing the pack after the detach.
The review noted that e2e/ asserted only the help text: nothing drove the real binary from the flag through the locator to the companion argv. Mount through the installed layout with --mount-profile portable --pack-path /src and an existing overlay directory, unmount, and assert the recorded umount argv replays --pack-path /src; also assert a WebDAV mount refuses the flag before the companion runs.
|
Covered the last gap from item 4 in
Verified locally with The one thing still uncovered is the live assertion you named — a real FUSE mount whose archive is then inspected. This environment has no Drive9 deployment, so I can only add it if the live suite ( |
mornyx
left a comment
There was a problem hiding this comment.
Review summary
The rework does what the previous review asked for where the problem was reachable most. --pack-path is validated at mount inside normalizeMountOptions, so --dry-run sees the same refusal; the locator records the overlay root; unmount checks every recorded value before the detach and reports the ones it skips; the dry run predicts the same decision; and the explicit-archive rule added later is the companion's own rule.
Two things still block, and both are small and local. The new WebDAV refusal makes --pack-path driver-sensitive, and that breaks three existing tests in internal/fs on macOS. The new fs.unmount_failed_after_drain error is returned whenever no drain error is set, which includes the case where no drain ran; it then says the drain succeeded, exits with the authentication code, and recommends --ignore-absent even for a mount that is still attached.
I reviewed e067aa06. Its code is identical to 961bf499; the three later commits are documentation and one e2e test. Besides reading, I ran the tests on darwin/arm64, reverted the fix lines one at a time, compared ti's path mapping with the companion's own functions at drive9 81bb0d92, and applied each fix suggested below in a scratch copy to see that it holds. I did not run a real mount.
Resolved since the previous review
- A recorded value missing from the overlay is skipped before the detach, instead of failing the pack after it (
internal/fs/drive9_companion.go:1438-1447). ./src,src/andsrc//subare refused at mount (internal/fs/mount.go:205-219).- WebDAV refuses
--pack-pathat mount (internal/fs/mount.go:201-204), and a non-FUSE locator never replays. - There is one pack-path normalizer again,
writeDrive9MountLocatorhas an explicit signature, and the locator is a plain additive record. - The help texts, the README paragraph and the AGENTS.md locator description are updated, and the release-notes entry is accurate.
- Tests now cover a failing
umountwith the locator state that follows, a WebDAV locator, a legacy locator, the dry-run report, and (ine067aa06) the e2e path from the flag through the locator to the recordedumountargv.TestFSMountPackPathReachesUmountpasses against amake buildbinary on this machine and fails when I remove the replay or the WebDAV refusal.
What looks good
- Record and replay is the right shape for this, and the filter before the detach removes the failure the previous review blocked on for every value the overlay does not hold.
- With
--no-auto-packplus--pack-archive-path, the recorded paths ride along with the explicit archive, which is what the companion accepts (cmd/drive9/cli/mount.go:2247-2267). - Reverting the fix lines one at a time fails at least one test for 9 of the 12 lines I tried.
Blocking (please address before merge)
1. make test fails on macOS
normalizeMountPackPaths refuses --pack-path when companionMountMode(opts.Driver) == "webdav" (internal/fs/mount.go:201), and companionMountMode maps an empty or auto driver to WebDAV on darwin and Windows (internal/fs/mount_durability.go:138-150). Three tests this PR does not change call MountFileSystem with PackPaths: []string{"/"} and no Driver, so they fail on darwin/arm64 at e067aa06:
TestDrive9MountDerivesOverlayRootForAudit(internal/fs/drive9_mount_audit_test.go:175)TestDrive9MountRejectsPackFlagsWithoutProfile(:318)TestDrive9MountNoAutoUnpackKeepsOldFlagShape(:582)
Each gets --pack-path needs a FUSE mount …. go test ./internal/fs/... ./internal/cli/... fails with exactly these three, and the same three pass at the merge base f13d62df. CI stays green because it runs on ubuntu only (.github/workflows/ci.yml:18, :47-48). The new tests are host-independent only because they set Driver explicitly.
Fix: pass Driver: "fuse" at the three call sites, which is the convention e2e/cli_test.go:1224-1227 already states. With only that applied, the three and the rest of internal/fs and internal/cli pass on darwin/arm64. Please run make test on a macOS host before merging.
2. fs.unmount_failed_after_drain is wrong when the drain gate was skipped, and it changes the exit code of every failed unmount
The block at internal/fs/drive9_companion.go:1385 is returned whenever drainErr == nil. That also holds when drainBeforeUnmount skipped the gate and returned MountDrain{Status: "skipped"} (internal/fs/drive9_mount_drain.go:211-213): under --force, for a WebDAV locator, and for a locator that records no driver. The message then says "the pre-unmount drain succeeded, so writes are safe". Under --force with a failing umount I get that sentence while the drain status is skipped, and AGENTS.md:1181-1182 defines --force as the path that accepts the loss.
This is also how the fourth state of the previous review reports itself now, for a recorded value that is still in the overlay: --force on a mount whose companion state is gone while ti's locator and the overlay persist. The value is replayed, the companion fails with read mount state for pack before the stop (cmd/drive9/cli/mount.go:2148-2151), and ti reports a drain that never ran. Only a value missing from the overlay is filtered out under --force; the reply's "the strict flag never reaches a state that cannot satisfy it" holds for those alone.
Three more problems in the same block:
- Exit code.
apperr.New("fs.unmount_failed_after_drain", "runtime", 3, …). Every other error ininternal/fsthat exits3is an"authentication"error, andAGENTS.md:1367-1368reserves3for authentication. The block also replacesfs.companion_failed, which carries the companion's own exit status (internal/fswrap/runner.go:113), for every failed unmount that follows a nil drain error, pack paths or not. A busy FUSE mount now exits3. - The
--ignore-absentadvice. It is offered for any failure after the drain. When the mount is still attached, following it removes the locator and returnsabsent(internal/fs/drive9_companion.go:1370-1383), which leaves a live mount that the drain gate and the token guards can no longer see. - No test covers a failing
umountunder a skipped gate.TestUnmountFailureAfterDrainNamesTheRecoverydrains for real.
Fix: key the block on the drain outcome (drain.Status == "drained"), use exit code 1, and offer --ignore-absent only when the mount is no longer listed. Add a --force variant of the test. With the first two applied in a scratch copy, --force returns the plain fs.companion_failed, a drained failure exits 1, and the PR's tests still pass.
Should fix (non-blocking, strong)
3. A --pack-path mount with --no-auto-unpack and no --local-root records no root and never replays
The locator's root is auditRoot (internal/fs/drive9_mount_audit.go:135), and mountOverlayAudit returns an empty root when nothing unpacks and no --local-root was given (internal/fs/mount.go:819-822). I ran --driver fuse --mount-profile portable --pack-path /src --no-auto-unpack: the locator holds pack_paths and an empty local_root. With src present in the companion's overlay, the unmount sends no --pack-path and reports "the mount did not record its local overlay root … pass --pack-archive-path to pack explicitly" (internal/fs/drive9_companion.go:1429-1435). That advice goes nowhere: unmount has no flag for paths, and an explicit archive runs the same filter. In --output text nothing is printed at all, because UnmountResult.Human() (internal/fs/mount.go:903-922) does not render checks. So in the one configuration that says "pack, but do not unpack", --pack-path is inert again.
The root is knowable there. companionMountLocalRoot (internal/fs/mountroot.go:27) is a pure computation, and the companion uses that default root for any FUSE overlay-profile mount regardless of auto-unpack (cmd/drive9/cli/mount.go:713-718). Fix: resolve the locator's root independently of the audit decision, drop the advice from the check, and add a test that mounts with --no-auto-unpack and no --local-root. With only that applied, the same mount records the default root and the unmount replays /src.
4. The copy of the companion's path mapping is loose for absolute values, and nothing pins it
mountPackArchivePath and mountPackOverlayPath (internal/fs/mount.go:228-254) mirror resolvePackPath and overlayPathForArchivePath (cmd/drive9/cli/pack.go:993-1049). Mount-time validation skips absolute values (internal/fs/mount.go:210-212). I ran both sides over 140 (remote root, value) pairs. The pairs where ti replays a value and the companion then refuses it are the absolute ones with a . or .. segment: ti checks the cleaned path, <root>/overlay/b for /a/../b, and if that exists it replays /a/../b, which the companion rejects inside the pack that runs after the detach. That is the failure class the previous review blocked on, now with an actionable error. One rarer difference points the same way: the companion normalizes to NFC and ti checks the raw bytes, so a non-ASCII name in another normalization form is skipped, or not found by the companion.
Nothing would catch a drift: seedOverlay (internal/fs/drive9_unmount_pack_paths_test.go:46-52) builds the overlay path with the same two functions the check uses. The repository already pins a companion replica with vectors observed from the real one (TestCompanionMountLocalRootMatchesDrive9, internal/fs/drive9_mount_audit_test.go:193; AGENTS.md:1302-1305).
Fix: run the segment check on absolute values too and reject only . and .. there. / and /a//b are valid pack paths, and the existing tests pack with --pack-path /, so do not reject empty segments. With only that applied, the . and .. pairs disappear from the comparison and the PR's tests still pass. Give the two functions a table test with literal expected strings.
5. The live test is addable
The reply declined the live FUSE test because this environment has no drive9 deployment. The repository has a job that mounts: .github/workflows/live-e2e.yml:61-71 installs fuse3 and runs make live-e2e, which includes TestLiveFSMountRuntime (e2e/live_test.go:1482; it mounts at :1524). "The archive contains the directory" is still checked only against the fake companion, whose umount accepts any argv. A case next to that test (mount with --pack-path <existing overlay directory>, unmount, unpack the archive, assert the path) is the only way the PR's central claim gets checked against the real companion. Writing it for the maintainer to dispatch is enough.
Nits
TestUnmountSkipsReplayWithoutRecordedLocalRootpasses with the blank-root branch removed: with an empty root the overlay path is relative, so each value is skipped by the per-value check instead. Assert the message.- The dry-run rule for
--no-auto-packwith--pack-archive-path(internal/fs/mount.go:460-462) is not pinned. Reverting the condition leaves every test green. - README: "Pass
--pack-archive-pathto choose the archive name". It adds one. Without--no-auto-packthe companion writes both the default archive and the named one (cmd/drive9/cli/mount.go:2254-2263). - The reply credits the README with a sentence about the archive restore being decided by the mount profile. It is not there.
- The PR description is stale in its Notes, Change and Tests sections. Merge commits here carry the title only, so it costs the PR page.
AGENTS.md:1288still namesmountOverlayPolicythe single owner of the effective pack paths. Trimming, de-duplication and the two refusals now live innormalizeMountPackPaths.- The
tweakparameter ofmountWithPackPathshas no caller, and the pack-path helpers could sit in their own file next to their tests (internal/fs/mount.gois at 938 lines).
Recommendation
Request changes. Two small local fixes: make test must pass on macOS again, and the new failure path must not report a drain that never ran or exit with the authentication code.
Two review blocking points, both local. The locator's overlay root came from the unpack audit decision, so `--pack-path` with `--no-auto-unpack` and no `--local-root` recorded an empty root and the replay was skipped: the one configuration that says "pack, but do not unpack" made the flag inert. Resolve the root from `companionMountLocalRoot` whenever the mount records pack paths, which is the root the companion itself uses for any FUSE overlay-profile mount, and drop the check's advice that pointed at an explicit archive that runs the same filter. `fs.unmount_failed_after_drain` keyed on a nil drain error, which is also true when the gate was skipped (--force, a WebDAV locator, a locator with no driver): it then claimed a drain that never ran. Key it on the drain result instead, exit with `1` rather than the authentication code `3`, and offer `--ignore-absent` only when the kernel no longer lists the mount, because dropping the record for a live mount hides it from the drain gate and the token guards. Render the unmount checks in the text output so a skipped `--pack-path` is not silent.
The mount-time check skipped absolute values, so `/a/../b` was validated as its cleaned overlay path and then replayed verbatim; the companion refuses it inside the pack that runs after the detach. Refuse `.` and `..` segments in absolute values too, and keep the shapes the pack accepts (`/`, repeated slashes below the root). Move the pack-path normalizer, the refusals, and the replica of the companion's archive/overlay path mapping into their own file next to their tests, and pin that replica with literal path vectors: `seedOverlay` builds its fixture with the same helpers the check uses, so a drift would satisfy both sides.
`companionMountMode` maps an empty or `auto` driver to WebDAV on darwin and Windows, so three tests that mount with `PackPaths` and no `Driver` fail on macOS with the new WebDAV refusal. Pass `Driver: "fuse"`, the convention the e2e suite already states, so the suite is host-independent again and CI's ubuntu-only runner stops hiding it.
The fake companion's `umount` accepts any argv, so "the archive contains the directory named by --pack-path" was only ever checked against the fake. Mount with `--pack-path` on an existing overlay directory, unmount with `--no-auto-pack` and an explicit archive, unpack it, and assert the path is there. Dispatch-only: it needs FUSE and a provisioned File System, so it runs under `make live-e2e` (TI_LIVE=1).
README: `--pack-archive-path` adds an archive rather than choosing the only one; `--pack-path` is refused for WebDAV and for values the pack cannot accept; restoring the archive is still the mount profile's decision. AGENTS: `normalizeMountPackPaths` owns trimming, de-duplication and the refusals, and the companion path replicas are pinned by vectors. Release notes: the replay no longer depends on the unpack decision, the skip is visible in text output, and a failed unmount after a completed drain exits 1 with evidence-gated `--ignore-absent` advice.
|
Reworked at 1. 2. 3. Root without 4. Absolute values with 5. Live test. Added Nits: the blank-root test asserts the message; the dry-run
|
mornyx
left a comment
There was a problem hiding this comment.
Review summary
The five commits answer every item of the second review, and I could confirm the one claim the author could not: on this darwin/arm64 host make test passes at f38ed170 (47 packages), and the full e2e suite passes against a make build binary (47 tests; the live ones skip as designed).
Nothing blocking remains. One thing should be fixed before the new live test's first green run is read as confirmation: it mounts with the portable profile, whose own pack path / puts the whole overlay into every archive, so it passes with or without the replay.
Besides reading, I ran the tests on darwin/arm64, reverted the fix lines one at a time, re-ran the mapping comparison against the companion's functions at drive9 81bb0d92, and built archives with the companion's own pack function. I did not run a real mount.
Closed since the second review
- macOS
make test. The three call sites passDriver: "fuse"(internal/fs/drive9_mount_audit_test.go:175,:318-319,:582). The three tests pass on darwin, and so does the rest of the suite. fs.unmount_failed_after_drain. It is keyed ondrain.Status == "drained", exits1, and offers--ignore-absentonly whenmountListedsays the mount is gone (internal/fs/drive9_companion.go:1385-1398,:1422-1428). Under--forcewith a failingumountI now get the companion's ownfs.companion_failed.- The locator's root. It is resolved before the mount runs when the audit has none (
internal/fs/drive9_mount_audit.go:66-73). A--no-auto-unpackmount without--local-rootrecords the default root and its unmount replays/src. The dead-end advice is gone, and--output textprints the checks. - Absolute values with a
.or..segment. They are refused (internal/fs/mount_pack_paths.go:33-44). The 140-pair comparison no longer has a pair where ti replays a value the companion refuses, apart from the normalization difference the author named. - The rest. The two mapping functions have literal vectors (
internal/fs/mount_pack_paths_test.go:14,:45), the blank-root test asserts its message, the dry-run rule is pinned (internal/fs/drive9_unmount_pack_paths_test.go:476), and the README, AGENTS.md, the release notes and the PR description match the code.
What looks good
- Every fix line of these five commits that I reverted (12 of 14) fails a test, including the two branches the second review found unpinned.
- Resolving the locator's root before the mount runs, with its own error, is the right shape: nothing is started when the root cannot be known.
- The advice now depends on a fact (
mountListed) instead of on which branch failed, and it errs toward withholding--ignore-absent. - Pack-path logic sits in one file with one normalizer, and
mount.gogot smaller.
Should fix (non-blocking, strong)
1. The new live test cannot fail for the reason it exists
TestLiveFSMountPackPathPacksOverlay (e2e/live_test.go:1561) mounts with --mount-profile portable (:1608) and checks the claim by reading the directory back after unpacking the explicit archive. The portable profile carries / as its own pack path (cmd/drive9/cli/profile.go:236), and the companion packs every archive with the mount's profile pack paths as well as the --pack-path values (cmd/drive9/cli/mount.go:2601-2616). So the whole overlay is in that archive whether or not ti replays anything.
I built the archive with the companion's own writePackArchive at 81bb0d92, over an overlay that holds cached/item.txt:
| profile | replayed --pack-path |
result |
|---|---|---|
| portable | /cached |
archive holds cached/ |
| portable | none | archive holds cached/ |
| coding-agent | /cached |
archive holds cached/ |
| coding-agent | none | drive9 pack: path arguments are required unless the profile config has [pack] paths |
The other two assertions hold without the fix as well: the mount result has carried pack_paths since before this PR, and no skipped status appears when no check is reported. A green run will show that the real companion accepts the flag combination and that the flow completes, not that the directory is in the archive because of the replay.
Fix: mount with coding-agent on e2e/live_test.go:1608 and pass the same profile to the unpack on e2e/live_test.go:1624. coding-agent has no profile pack paths (cmd/drive9/cli/profile.go:224), so the unmount fails without the replay and succeeds with it. Reword the comment at e2e/live_test.go:1613-1614 ("the archive holds exactly the paths replayed from the mount"), and add the test to the focused target: make live-e2e-fs enumerates test names (Makefile:73) and does not include it, while make live-e2e does (Makefile:64). The comment at e2e/live_test.go:1559 should name both.
Nits
- The text output of checks. Nothing pins it: removing the loop in
UnmountResult.Human()(internal/fs/mount.go:837-846) leaves every test green. One assertion onHuman()inTestUnmountForwardsOnlyPathsStillInTheOverlaywould do. The loop also prints thedraincheck that--ignore-absentcan add, so that output now carries the same drain message twice:drain: <message>anddrain: failed (<message>). Decide whether that check should print. - The advice in the detached branch (
internal/fs/drive9_companion.go:1396) offers--no-auto-packfirst. Once the companion's state is gone, that retry stops at the drain gate, because ti still drains a FUSE locator unless--forceis passed and returns the drain error without--ignore-absent. One wasted attempt. Lead with the flag that completes. - README (
README.md:218): "a relative value may not be empty". An empty or blank value is dropped, not refused (internal/fs/mount_pack_paths.go:89); only a value with an empty segment is refused. The PR description says the same. - The normalization limit is stated only in the PR description, and only in one direction. Say it at the
Lstat(internal/fs/drive9_companion.go:1458): the companion normalizes to NFC and this check compares bytes, so a name in another form is skipped, or replayed and then not found after the detach. The mount-time refusal is also a subset of the companion's rule, which also refuses control characters and invalid UTF-8. - Same names, different rules. The comments say "the companion's
joinArchivePath" and "drive9'sresolvePackPath" (internal/fs/mount_pack_paths.go:17,:35), and this package has an older copy of both ininternal/fs/pack.go(internal/fs/pack.go:1148,:1206) whose pack entry point has no caller (internal/fs/pack.go:350) and which has drifted:/a/../bis accepted there (internal/fs/pack.go:1194-1202) and refused here. Name the companion file in the comments and delete the old copy in a follow-up. - The replay rule is written twice, in inverse form:
internal/fs/drive9_companion.go:1361andinternal/fs/mount.go:395. One predicate would keep them together. Optional. TestMountRecordsRootWithoutAutoUnpackdoes not clearXDG_CACHE_HOME, which the neighbouring tests do (internal/fs/drive9_mount_audit_test.go:194,:225). On Linux with it set, the seeded overlay lands outside the temp home.- Fine to leave. Under
--forceon a mount whose companion state is gone, a recorded value that is still in the overlay is replayed, and the companion'sread mount state for packerror comes back asfs.companion_failed. The error is honest and--no-auto-packand--ignore-absentboth complete.
Recommendation
Comment. The code closes the second review. What remains is the live test's choice of profile, which decides whether its first green run means anything.
The live test mounted with `portable`, whose own pack path `/` puts the whole overlay into every archive, so it passed with or without the replay: its first green run would have confirmed the flag combination, not the fix. Mount with `coding-agent`, which carries no pack paths of its own, so the unmount fails with "path arguments are required" unless ti replays the recorded value. Pass the same profile to the unpack, correct the comment that claimed the archive holds exactly the replayed paths, and register the test in `make live-e2e-fs`, which enumerates test names.
Say the replay rule once (`replayPackPaths`), so the dry run predicts exactly what execution does instead of keeping an inverse copy of it. Lead the post-drain advice with the flag that completes: once the companion state is gone, `--no-auto-pack` stops at the drain gate, so a detached mount is offered `--ignore-absent` first, and a listed mount keeps the record. Print the unmount checks in the text output without the drain check, which already has its own line, and pin that output. Comments: name the companion file the mappings mirror and the older drifted copy in `pack.go`, state that the mount-time refusal is a subset of the companion's rule, and record the NFC limit at the byte comparison. README: a blank value is dropped, not refused. Clear `XDG_CACHE_HOME` in the locator-root test, as the neighbouring tests do.
|
Addressed in 1. The live test now depends on the replay. It mounts and unpacks with Nits:
One request: a |
mornyx
left a comment
There was a problem hiding this comment.
Review summary
Both commits do what the third review asked, and the only change to behaviour in them, the shared predicate and the two shapes of the advice, holds on every path I tried. make test passes on this darwin/arm64 host at 1b0f0d78 (47 packages), and the full e2e suite passes against a make build binary (47 tests; the live ones skip as designed).
Nothing remains that needs another commit on this PR.
Closed since the third review
- The live test depends on the replay. It mounts and unpacks with
coding-agent(e2e/live_test.go:1612,:1630). The unmount it runs sends--pack :<archive> --no-auto-pack --pack-path /cached, and with that profile the companion packscached/only because of the replayed path; without it the pack has no paths and fails. The test is listed inmake live-e2e-fs(Makefile:73). It has still never been run. Its first run belongs to the live workflow, and that run is what confirms the archive claim against the real companion. - One predicate.
replayPackPaths(internal/fs/mount.go:396-398) is used by execution (internal/fs/drive9_companion.go:1361) and by the dry run (internal/fs/mount.go:404), and it is the same rule as before for all four flag combinations. Reverting either call site, or the predicate, fails a test. - The advice has two shapes, and each is pinned: a mount that is still listed is offered
--no-auto-packand told why not to drop the record; a mount that is no longer listed is offered--ignore-absentfirst (internal/fs/drive9_companion.go:1398-1403). - The text output is pinned. Removing the loop in
UnmountResult.Human()failsTestUnmountForwardsOnlyPathsStillInTheOverlay, and a tolerated drain failure now prints once. - The README wording, the normalization note at the
Lstat, the companion file names ininternal/fs/mount_pack_paths.goandXDG_CACHE_HOMEin the root test are as asked.
What looks good
- The predicate is a three-line function whose comment says why both callers must share it. That is the right size for it.
- The live test's comment explains the choice of profile, so the next reader will not simplify it back to
portable.
Optional, for a follow-up. Neither needs a new commit here.
- The second assertion added in
TestUnmountForwardsOnlyPathsStillInTheOverlay(internal/fs/drive9_unmount_pack_paths_test.go:216) cannot fail. Adraincheck is only ever appended with statusfailed(internal/fs/drive9_companion.go:1380,:1419), and in that test the drain succeeded. So the skip atinternal/fs/mount.go:851-853is still unpinned: removing it fails no test. A result with a tolerated drain failure would pin it. README.md:218says a mount that does not unpack is not audited. Acoding-agentmount with--pack-pathunpacks nothing, and ti still audits it, becauseunpackPossiblecounts the flag values (internal/fs/mount.go:763). The predicate predates this PR.
Recommendation
Approve. Nothing remains that needs another commit on this PR.
|
Took the two "Optional, for a follow-up" items here rather than deferring them ( The drain-check skip is pinned. You were right that the assertion I added could not fail: a README. It no longer implies the audit follows the companion's decision: a mount that unpacks nothing at the companion is not audited, but the predicate counts the effective pack paths, so a The old copy is gone. Head is |
mornyx
left a comment
There was a problem hiding this comment.
Review summary
The deletion is safe. The 27 removed declarations were a closed component with no caller, nothing refers to them on any platform the release builds for, and make test and the full e2e suite pass on this darwin/arm64 host at eafdce57 (47 packages; 47 tests, the live ones skipped). The new assertion pins the skip of the drain check, and the README sentence is now true.
What should be fixed before merge is the record, not the code. The deletion commit's message describes extractPackArchive and the archive/overlay path helpers as "what the live paths use", and says the change "removes the last second copy of the companion's path mapping". Neither is true: 16 functions of internal/fs/pack.go (414 lines) are as unreachable as the 663 lines that went, and they include canonicalArchivePath, the function that accepts /a/../b. The comment the same commit added to internal/fs/mount_pack_paths.go says the same. This repository keeps branch commits and their messages, so this can only be corrected before merge.
This review covers the two commits pushed after the approval on 1b0f0d78. That approval did not cover them.
What was verified
- Platforms. Build and
go vetfor darwin, linux and windows on amd64 and arm64, with CGO off: all clean.go vetcompiles the test files too. - The removed names. No reference anywhere at the head, except comments that name the companion's own
resolvePackPathandjoinArchivePath. - What is still unreachable. A type-checked call graph over
internal/fsat the head (roots:init, package initializers, and the exported functions and methods that other packages reference) reports 16 functions ofinternal/fs/pack.gounreachable, 414 lines. It reports the same forService.mountForeground,Service.autoUnpackMountandService.autoPackAfterUnmount(internal/fs/mount.go:604,:613,:310), forService.RestoreGitWorkspace(internal/fs/git.go:503) and for the ti-native FUSE runtime behind them. - The drift.
canonicalArchivePath("/a/../b")still returns/bwith no error. - The assertion. Removing the skip at
internal/fs/mount.go:851-853now failsTestUnmountIgnoreAbsentAbsentPathStillReportsDrainFailure.
What looks good
- The deleted set was exactly a closed component: four entry points with no caller, everything below them, and no test touching any of it. That made the check mechanical.
- The new assertion sits where the behaviour shows, a tolerated drain failure, and it can fail in both directions.
- The README now states the predicate the code applies instead of the intent behind it.
Should fix (non-blocking, strong)
1. The deletion commit's message, and the comment it added, describe dead code as live
Commit eafdce57 says it kept "extractPackArchive and the overlay audit helpers the mount runs … and the archive/overlay path helpers the FUSE and Git paths call", and that it "removes the last second copy of the companion's path mapping, so the replica in mount_pack_paths.go is the only one to update".
extractPackArchive(internal/fs/pack.go:312) has one caller,Service.autoUnpackMount, which has none.- The path helpers
canonicalArchivePath(internal/fs/pack.go:569),overlayPathForArchivePath(:592),toRemotePath(:1037) andremoteToLocalPath(:1052) are reached only from the ti-native FUSE runtime and from theRestoreGitWorkspacesubtree. Their entries,Service.mountForegroundandService.RestoreGitWorkspace, have no caller. - The audit helpers,
loadPackProfileConfig,validatePackLocalRootanddefaultPackArchivePathare live, as the message says. - The comment at
internal/fs/mount_pack_paths.go:15-17now reads "This package keeps no second copy of those mappings: the legacy one that did drifted (it accepted/a/../b) and is gone". The function that accepted/a/../biscanonicalArchivePath, and it is still in the package. - The reply on the PR thread repeats both claims: "I kept everything the live paths use", and "the replica in
mount_pack_paths.gois the only copy of the mapping to keep in step".
None of this is a regression. Everything listed was equally unreachable at the base, and the 663 lines removed are a strict improvement. What the increment adds is the claim that the rest is live.
Either way of fixing it is fine:
- Finish the deletion. Remove the unreachable read half of
internal/fs/pack.go:extractPackArchive,extractPackEntry,installStagedPack,moveStagedPath,mergeStagedPath,removeManifestPaths,packEntryRel,safeOverlayTarget,ensureNoSymlinkPath,manifestReplacePaths,manifestPathRel,supportedPackFormat,canonicalArchivePath,overlayPathForArchivePath,toRemotePathandremoteToLocalPath, with the types and constants only they use. Their three callers ininternal/fs/mount.gogo with them, and so do thepack_test.gocases that only exercise them (internal/fs/pack_test.go:24,:40,:44). KeepvalidatePackSymlinkTarget, which the live audit calls. The comment is then true as written, and the commit message can be amended to say so. The FUSE runtime and the Git subtree can stay for a follow-up. - Or leave the code and correct the words. Take
extractPackArchiveand the path helpers out of the "live paths" sentence, say that the read half and its caller-less entry points are left for a follow-up, and reword the comment to nameoverlayPathForArchivePathininternal/fs/pack.goas the one other copy.
In both cases, add a line to the PR description saying that it also deletes the legacy pack write path in internal/fs/pack.go. The description is what the merge commit links to.
Nits
AGENTS.md:1299-1300still says "a mount that does not unpack is not audited". The README sentence (README.md:218) was corrected and this twin was not, which invites "fixing" the predicate to match it.internal/fs/drive9_unmount_pack_paths_test.go:216-218: thedrain: drainedassertion, which the latest commit's message calls unable to fail, is still there under a comment that calls it a pin. Delete it. The new assertion covers the skip.
Recommendation
Comment. The deletion is safe and cannot change behaviour. The message that will stay in history, and the comment in the source, call 414 lines of the same dead implementation live; correct them before merge, with the rest of the removal as a follow-up.
The `drain: drained` assertion added earlier could not fail: a `drain` check is only ever appended with status `failed`, and that test drains successfully. It is deleted. The skip is pinned instead where it is observable: `TestUnmountIgnoreAbsentAbsentPathStillReportsDrainFailure` keeps a tolerated drain failure, so removing the skip in `UnmountResult.Human()` prints the same message twice and fails the test. README and AGENTS.md said a mount that does not unpack is not audited, which is not the predicate the code applies: `unpackPossible` counts the effective pack paths, so a `coding-agent` mount with `--pack-path` is audited although that profile carries no unpack paths. Both now say that, so neither invites "fixing" the predicate to match the old sentence.
`ti fs pack-file-system` has delegated to the companion since the drive9 cutover, but `internal/fs/pack.go` still carried the old write path: an entry point with no caller, its source resolution, the archive writers, and a second copy of `resolvePackPath`/`joinArchivePath` that had drifted to accept `/a/../b`. 24 functions and the three types only they used are gone; `pack.go` drops from 1736 to 1073 lines. No behaviour changes: `make test` (47 packages), `gofmt` and the binary e2e suite pass unchanged. What is deliberately left, and why: `internal/fs/pack.go` still holds the legacy *read* half. `overlayPathForArchivePath`, `toRemotePath` and `remoteToLocalPath` are compiled into the ti-native FUSE runtime (`internal/fs/fuse_mount.go: //go:build !windows`), and the rest -- `extractPackArchive` and its helpers, `canonicalArchivePath` included, the function that still accepts `/a/../b` -- is reachable only from `Service.mountForeground`, `Service.autoUnpackMount` and `Service.autoPackAfterUnmount`, which have no caller. That half goes with the FUSE runtime and the `RestoreGitWorkspace` subtree in a follow-up; this commit does not make those paths live, it only removes the ones nothing compiled reaches. The comment in `mount_pack_paths.go` says so, instead of calling the remaining copy gone.
eafdce5 to
d9b6392
Compare
|
You are right about the record, and I rewrote it rather than leaving it. Both commits that landed after your approval are now The message describes what the deletion actually did. It no longer claims The source comment says the same. PR description. It now has a line for the deletion, including what was left and why, since that is what the merge commit links to. Nits:
|
mornyx
left a comment
There was a problem hiding this comment.
Review summary
The rewrite does what the fifth review asked. The two commit messages, the comment at the top of internal/fs/mount_pack_paths.go and the PR description now describe the deletion as it is: the legacy write path is gone, the read half stays, canonicalArchivePath still accepts /a/../b, and that half belongs with the FUSE runtime in a follow-up. The AGENTS.md sentence now matches the README and the code, and the assertion that could not fail is gone.
The tree differs from eafdce57 in three files (AGENTS.md, the test file, internal/fs/mount_pack_paths.go), and the only change inside a function is the three deleted lines of that assertion. Build and go vet are clean for darwin, linux and windows on amd64 and arm64; make test (47 packages) and the full e2e suite (47 tests, the live ones skipped) pass on this darwin/arm64 host at d9b63926.
Nothing remains that needs another commit on this PR.
Closed since the fifth review
- The record. Commit
d9b6392no longer callsextractPackArchiveor the path helpers live. Its "What is deliberately left, and why" paragraph, and the "Dead code" bullet of the PR description, match what a type-checked call graph shows at the head: 16 functions ofinternal/fs/pack.go(414 lines) are unreachable,overlayPathForArchivePath,toRemotePathandremoteToLocalPathare compiled into the ti-native FUSE runtime, and no ti command reaches any of that half. The comment atinternal/fs/mount_pack_paths.go:15-23no longer calls the second copy gone, and namescanonicalArchivePathas the function that still accepts/a/../b. AGENTS.md:1299-1303now states the predicate the code applies, asREADME.md:218does.- The assertion. The
drain: drainedassertion is deleted. The skip inUnmountResult.Human()is still pinned: removing it failsTestUnmountIgnoreAbsentAbsentPathStillReportsDrainFailure, and removing the whole loop still failsTestUnmountForwardsOnlyPathsStillInTheOverlay.
What looks good
- The commit was rewritten while it still could be, instead of leaving a correction in a later message.
- The new comment says what is left and why, and tells the next reader not to "fix" the replica to match the drifted copy.
Recommendation
Approve. This covers d9b63926, including the deletion of the legacy pack write path. Nothing remains that needs another commit on this PR.
Problem
ti fs mount-file-system --pack-path /srcmounts successfully, but the automatic pack written at unmount silently omits/src.The companion's
mounthas no pack-path flag — it deriveseffectivePackPathsfrom the mount profile only (drive9/cmd/drive9/cli/mount.go:576) — so a mount-time forward can never work. The only channel that feeds the automatic pack isdrive9 umount --pack-path(repeatable), which merges the values with the mount's pack state (mount.go:2089-2091,:2254,:2572-2580). ti recorded the flag inMountResult/mountstateand never replayed it; afteraf669e9dropped the (ineffective) mount-time forward, the flag was simply inert.Effect:
--mount-profile portable --pack-path /srcproduces an archive without the local overlay paths the user asked for.Change
Record the values at mount and replay them at unmount, and make every state that reaches the replay one the companion accepts. Both review rounds are addressed; the second round's items are the last four bullets.
normalizeMountPackPathsininternal/fs/mount_pack_paths.go, shared with--dry-run):--pack-pathwith an effective WebDAV driver is refused withfs.pack_path_requires_fuse: a WebDAV mount has no local overlay to pack. The check follows the companion's own--mode autorule (companionMountMode, darwin/windows included).joinArchivePathrejects are refused withfs.invalid_pack_path: backslashes, a./..segment (absolute values included), and a relative value with an empty segment; a blank value is dropped rather than refused.mergeMountPackPaths; the locator only records them.local_root,pack_paths, bothomitempty, only written for a FUSE mount). The root is resolved independently of the unpack decision, so--no-auto-unpackwithout--local-rootstill records the root the companion packs from. Older locators omit both fields, which means "none", so existing mounts replay nothing.<local-root>/overlay(the same mapping the automatic pack uses:resolvePackPathwith the empty local prefix, thenoverlayPathForArchivePath). Values the overlay no longer holds are dropped and reported aspack_pathchecks onUnmountResult— in JSON and, now, in the text output. A locator with paths but no recorded root replays nothing and says so.--no-auto-packstill suppresses the pack and the replay, except beside an explicit--pack-archive-path, which is the companion's own rule.fs.unmount_failed_after_drain, exit code1) says the kernel mount may already be detached and names--no-auto-pack. It offers--ignore-absentonly when the kernel no longer lists the mount, because dropping the record for a live mount hides it from the drain gate and the token guards. A failed unmount whose drain gate was skipped (--force, WebDAV, a locator with no driver) keepsfs.companion_failedand the companion's exit status.auto_pack_pathscheck, including the explicit-archive interaction; one predicate (replayPackPaths) decides for both, so the prediction cannot drift from the execution.internal/fs/pack.gois deleted (24 functions, three types, 1736 -> 1073 lines):ti fs pack-file-systemhas delegated to the companion since the drive9 cutover, so its entry point, source resolution, archive writers and the second copy ofresolvePackPath/joinArchivePath(which accepted/a/../b, the drift that revealed the divergence) had no caller. Nothing compiled reaches any of it, and no behaviour changes. The legacy read half that remains, includingcanonicalArchivePath, is reachable only fromService.mountForeground,Service.autoUnpackMountandService.autoPackAfterUnmount, which have no caller, and from the ti-native FUSE runtime andRestoreGitWorkspace; removing it belongs with those in a follow-up.--pack-pathand--no-auto-packhelp text, the README paragraph (overlay semantics, the skipped-path behaviour, the refusals,--pack-archive-pathadding an archive, and the archive restore still being the mount profile's decision),AGENTS.md(what the locator records, andnormalizeMountPackPathsas the owner of trimming, de-duplication and the refusals), and the v0.2.11 release notes.Tests
make test(47 packages),gofmt,go mod tidy,go vet ./internal/...,go build ./...and the binarye2esuite (against amake buildbinary) are clean.TestMountRejectsPackPathOnWebDAV,TestMountRejectsPackPathFormsThePackRefuses,TestMountRejectsDotSegmentsInAbsolutePackPaths,TestMountAcceptsAbsolutePackPathShapes— the failing shapes never reach a mount, the accepted ones still do.TestMountPackArchivePathMapping,TestMountPackOverlayPathMapping— literal vectors for the replica of the companion's path mapping, becauseseedOverlaybuilds its fixture with the same helpers.TestMountRecordsPackPathsOnLocator,TestMountRecordsRootWithoutAutoUnpack— the locator keeps normalized values, and the root survives--no-auto-unpack.TestUnmountForwardsOnlyPathsStillInTheOverlay,TestUnmountSkipsReplayWithoutRecordedLocalRoot,TestUnmountSkipsReplayForANonFUSELocator— what is replayed and what is skipped, both reported.TestUnmountFailureAfterDrainNamesTheRecovery,TestUnmountFailureAfterDetachedMountOffersIgnoreAbsent,TestUnmountForceFailureKeepsTheCompanionError,TestUnmountKeepsLocatorWhenThePackFails— the post-failure advice, the skipped gate, and the record that must survive for a--no-auto-packretry.TestUnmountReplaysPackPathsForAnExplicitArchive,TestDryRunUnmountReportsPackReplay,TestDryRunKeepsReplayForAnExplicitArchive— the explicit-archive interaction in execution and in the dry run.TestUnmountForceWithMissingOverlayPathSucceeds,TestUnmountLegacyLocatorSendsNoPackFlag,TestUnmountSkipsPackPathsWhenAutoPackDisabled,TestPackPathsAndLocalRootRoundTrip,TestMergeMountPackPathsDropsBlanksAndDuplicates— the surrounding invariants.TestFSMountPackPathReachesUmount(e2e/) — flag → locator →umountargv through the installed layout, plus the WebDAV exit code.TestLiveFSMountPackPathPacksOverlay(e2e/live_test.go) — the live check that the archive really contains the directory, mounted withcoding-agentso it fails without the replay; registered inmake live-e2e-fs. Dispatch-only: it needs FUSE and a provisioned File System (TI_LIVE=1).Notes
--unpack-archive-path(or a profile that unpacks the default archive, such asportable) is what brings them back. The README says so instead of implying the next mount unpacks them automatically.umountaccepts any argv.golang.org/x/textis not a dependency, so a non-ASCII name in another normalization form can be skipped rather than packed. Left as a known limit.