test(memory-sync): sandbox the cross-machine profiles E2E test - #75
Merged
Conversation
added 2 commits
August 5, 2026 18:43
The test loaded the real committed profiles and overrode only --root-dir/--state-dir/--remote, so the machine-absolute syncPaths sources leaked: on the mini it copied live ~/.harness/machine-state and ~/.harness/frictions content into the test remote, and on any machine whose home is not /Users/lannguyensi it died on EACCES mkdir. Remap only the two machine-absolute sources into per-machine fake-HOME dirs inside the sandbox via a derived --config file (the env-var route, AGENT_MEMORY_SYNC_SYNC_PATHS, was measured NOT to apply here: loaded settings override env in resolveRunConfig's merge), keep every other profile field verbatim, and guard with an assertion that fails loudly if any resolved source escapes the sandbox (negative control: guard fires in 16ms with the offending path when the remap is disabled). Cross-machine property still exercised, both directions, via seeded owner files and a fresh-state probe pull. Committed profiles unchanged (md5+mtime verified). CI-green on ubuntu explained from code: missing source dirs are skipped by collectLocalSyncFiles' existsSync guard. Task: 112a0864
Review round: the derived configs still carried the real rootDir/stateDir/remoteUrl verbatim, and hermeticity for those three rested on unasserted CLI flags in machineArgs. Defense in depth: the remap now rewrites all three to sandboxed values in the derived config (observable no-op, CLI overrides win) AND machineArgs asserts containment through one shared choke point before building argv (negative control: pointing --root-dir at the real home fails before any CLI call). The syncPaths guard also resolves relative sources against the sandboxed rootDir instead of skipping them, the probe pull asserts appliedFiles like its siblings, and a missing remap destination now fails with a named message. Task: 112a0864
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.
Task 112a0864: the cross-machine profiles E2E test loaded the real committed profiles, whose machine-absolute syncPaths sources made it (a) fail with EACCES on any machine whose home is not /Users/lannguyensi (the MacBook) and (b) silently read LIVE operational state on the mini — measured: real ~/.harness/machine-state and ~/.harness/frictions content (4878 bytes of live friction exports) copied verbatim into the test remote.
What changed
Verification