fix(mount): tolerate ACL-filtered undercounts in complete-v1 verify
Summary
complete-v1snapshot verification compared the caller-visiblefs/treecount against the raw manifest'sfilesExpected. On workspaces whose ACL denies reads for some snapshot files (e.g.AgentWorkforce/cloud's root/.relayfile.acldenying**/credentials*), the tree legitimately shows fewer entries than the manifest counted, and both the tar-seed and full-tree verification hard-failed forever — the mount could never converge.- Both verification paths now distinguish overcount from undercount:
- Overcount always fails — server returned more than the manifest.
- Undercount requires explicit ACL evidence: a
.relayfile.aclmarker visible inside the listed subtree, or a successful/403 marker probe on the contents root or its ancestors.403counts as evidence because the read was enforced; other probe errors fail closed. - With evidence, verification continues strictly: every listed file is still content-verified (tar bytes or per-file pull), so a broken projection cannot silently materialize a partial tree.
Companion to relayfile-cloud PR #311, which makes the merged tar export ACL-filter the same way (deny → filtered fall-through instead of hard-403).
Test plan
-
TestPullRemoteFullGithubTarSeedToleratesAclFilteredCount— undercount + ancestor marker probe evidence → seeds cleanly -
TestPullRemoteFullGithubTarSeedRejectsUndercountWithoutAclMarkers— undercount, no markers → hard fail before tar export - Existing strict-mismatch test preserved (marker-free fixtures still fail)
-
go test ./internal/mountsync— full suite green -
gofmtclean
Generated with Devin
[!NOTE]
Medium Risk
Changes complete-v1 mount verification and ACL interpretation; behavior is intentionally fail-closed on probe failures, but incorrect marker matching could allow a partial tree or block legitimate mounts.
Overview
complete-v1 GitHub snapshot checks no longer treat every filesExpected undercount as corruption when workspace ACL can hide files from the caller.
Overcounts still fail immediately. Undercounts only proceed after workspaceAclMayFilterView finds real read-deny evidence: .relayfile.acl paths seen during listing (persisted as BootstrapAclMarkers for resumable bootstrap) and/or ancestor marker probes via ReadFile (403 counts as enforcement; other errors fail closed). Rules are parsed from marker body text or from new RemoteFile.Semantics.Permissions. Live ACL markers are excluded from the strict file counter so they do not mask missing snapshot files.
The same logic applies on tar-seed tree verification and on bounded bootstrap traversal end checks; listed files remain strictly content-verified either way.
Reviewed by Cursor Bugbot for commit 77d481f8d7935cf6580173ca5045c35ac9a51d20. Bugbot is set up for automated code reviews on this repo. Configure here.