Repository navigation
fix(browser): start headed Chrome from nested homes; keep a desktop test out of the real home - #108
Merged
Merged
Conversation
…s start A headed browser session under a deeply nested PICKFORGE_HOME never started: Chrome's process singleton binds a Unix socket at $TMPDIR/com.google.Chrome.*/SingletonSocket, sun_path is 108 bytes, and the session-confined TMPDIR pushed the path past it. Chrome aborted with "Socket path too long" during the #17 acceptance pass, and the session record went to error. The failure is deterministic for any home path longer than roughly 60 bytes. Chrome now receives TMPDIR=/tmp/pickforge-browser-<uid>/<sha256(sessionDir)[:16]>, a symlink into the session's own tmp directory. The socket and every Chrome temp file still live under the session directory and are removed with it. The per-uid alias root must be a real directory owned by the invoking user at mode 0700, an existing alias is refused rather than reused, and removal unlinks only a symlink that resolves to this session's tmp directory. Destroy and failed-start cleanup remove the alias with the rest of the runtime. Tests: alias lifecycle unit tests (create, refuse existing, refuse foreign symlink or real directory on removal, sibling sessions share one root), the fake-Chrome session tests assert the alias and its root permissions, and the real-Chrome integration test starts a session from a nested home and checks the singleton directory landed inside the session tmp. Refs #17 Refs #89
…ated home "records a screenshot artifact in a run" created its run with createRun's default env, so with the default "home" storage mode every run of the suite wrote a desktop-shot run into the developer's real ~/.pickforge/lab. The #17 acceptance pass caught fifteen of them appearing in the real home while a sibling worktree ran the suite. Pass the test's isolated env instead. A canary PICKFORGE_HOME reproduced the leak before the change and is empty after it. Refs #89
…xt start The alias key is derived from the session directory, so a symlink left in /tmp/pickforge-browser-<uid>/ after a session directory was removed without a destroy (a deleted PICKFORGE_HOME, or a test that deliberately keeps a failed session's runtime for the reaper and then deletes its temp root) would have made a later session with the same key fail with "already exists". Now an entry at the alias path is classified first: this session's own alias is reused, a dangling symlink is replaced (only this uid can create entries in the 0700 root), and anything else, a symlink to a live foreign directory or a real directory, is still refused. The full gate run left two such dangling aliases behind from startup.test.ts, whose "unconfirmed Xvfb cleanup" case keeps the runtime on purpose. Its afterEach now removes the alias before the temp root goes. Refs #17 Refs #89
This was referenced Sep 5, 2026
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.
Refs #17
Refs #89
Why
The #17 acceptance pass on current main (
c4b601d) hit two defects that are not visible in CI:PICKFORGE_HOME. Chrome's process singleton binds a Unix socket at$TMPDIR/com.google.Chrome.*/SingletonSocket;sun_pathis 108 bytes, and the session-confinedTMPDIRunder the session directory pushed the path over it. The first browser session of the pass died withFATAL: Socket path too longand the record went toerror(issue17-final/logs/create-browser-1.json). Any home path longer than roughly 60 bytes reproduces it deterministically.records a screenshot artifact in a runcalledcreateRunwithout the test's isolated env, so the defaulthomestorage put adesktop-shotrun under the real~/.pickforge/lab/projects/...on every suite run. Fifteen of them appeared in the real home during the pass while a sibling worktree ran the suite.What
TMPDIR=/tmp/pickforge-browser-<uid>/<sha256(sessionDir)[:16]>, a symlink into the session's owntmpdirectory, so the socket and every Chrome temp file still live under the session directory and are deleted with it. The alias root must be a real directory owned by the invoking user at mode0700; an existing alias is refused, not reused; removal unlinks only a symlink that resolves to this session'stmp; destroy and failed-start cleanup remove it with the rest of the runtime.startup.test.ts, whoseafterEachnow removes its alias.createRun.SECURITY.mdanddocs/releases/UNRELEASED.mddescribe the alias.Tests
packages/browser/test/chrome-tmp-alias.test.ts: publish, refuse an existing alias, two sessions under one root, no-op removal, refuse a foreign symlink, refuse a real directory, remove an owned alias without touching the session tree.0700mode, and that destroy removes it.TMPDIRin/proc/<pid>/environ, and checks the singleton directory landed inside the sessiontmp.PICKFORGE_HOMEfor the desktop-linux suite: adesktop-shotrun appears before the change, nothing after.Gate results and the full acceptance evidence for #17 (real watch, takeover, concurrency, sensitive-evidence, cleanup, recordings, independent vision verdict) are in
~/Projects/Boards/pickforge/0.4-release/issue17-final/REPORT.md. Issue #17 stays open until this PR is merged and its evidence is recorded.