fix(memory-sync): template carries machine-state entry; profile guard test derives structurally - #74
Merged
Conversation
added 3 commits
August 5, 2026 12:51
…rives profiles structurally linux.example.json now includes a placeholder machine-state syncPaths entry (mirroring linux.json/macbook.json's lockstep form) so a fourth machine copied from the template starts with it present instead of repeating the hand-patch divergence closed for the third machine. The cross-machine guard test derives its profile file list via readdirSync instead of a hardcoded array, so the machine-state loop now runs over every committed profile including the template, and a new invariant loop pins rootDir/stateDir as absolute, un-expanded, and stateDir outside rootDir across all profiles. docs/machine-setup.md sections c/e/f updated to match; no more "template does not yet include a machine-state entry" language.
Adds a non-vacuity guard to listProfileFiles() so an emptied or renamed profiles/ directory fails loudly instead of silently shrinking test coverage. Rewords the template's syncPaths comment to match the real profiles verbatim, adds ownerScoped: true to the template's frictions entry (closing the gap that forced the ownerScoped test to hand-exclude the template), and switches the ownerScoped test and the stateDir-outside-rootDir check to derive their inputs structurally. Brings the docs snippets and prose in line with the ownerScoped shape.
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.
Tasks: 10df0d9d + 105d28dd (agent-tasks; the second is an older duplicate of the first, both closed by this PR).
Closes the two review findings deliberately left out of PR #71:
Template (profiles/linux.example.json)
/home/<linux-username>/.harness/machine-state, destinationmachine-state, kind directory,ownerScoped: true(lockstep shape of the real profiles)ownerScoped: truealso on the frictions entry (all three real profiles have it; a template copy without it would re-open the push-echo path closed by 06d09cde) and the FIRST-entry comment wording aligned with macbook/mac-miniGuard test (tests/integration/cross-machine-profiles.test.ts)
~, stateDir outside rootDir via path.posix.relative (no sibling-prefix or..-normalization false results)Docs (machine-setup.md c/e/f)
ownerScoped: true, and one sentence names the flag as the owner-writes-only mechanismVerification:
~, nesting stateDir under rootDir, deleting the template, emptying profiles/ each turn the suite red with a pointed message; sibling-prefix control (/a/b vs /a/bc) passesKnown CI risk: tests/integration/watch-mirror-delete.test.ts is a pre-existing load-dependent flake (tracked in task c71de504); if the coverage job goes red there, it is unrelated to this diff.