gstack/browse
현성 f66aedb656 feat(browse): auto-cookie persistence module (opt-in, persistent-cookie-only)
Core of an opt-in layer that lets a device-trust cookie survive a headless
daemon restart. The daemon uses a non-persistent Playwright context, so a
restart drops all in-memory cookies and a __Host--bound web device identity
re-registers on the next visit.

This module (no wiring yet):
- isAutoCookiePersistEnabled: gated on BROWSE_AUTO_COOKIE_PERSIST (off by
  default — auto-persisting auth cookies to plaintext-on-disk is a security
  escalation from ephemeral-profile semantics, so it must be opt-in).
- filterPersistableCookies: persistent (expires !== -1, unexpired) cookies
  only; drops session cookies, internal-network domains, and honors an
  optional BROWSE_AUTO_COOKIE_DOMAINS allowlist. Fields (incl. __Host-
  host-only domain and partitionKey) preserved verbatim.
- load/save as a Playwright storageState-shaped object ({cookies, origins:[]});
  never persists localStorage/pages. Hash short-circuit skips no-op writes.
- Per-workspace state file keyed by hash(realpath(projectDir)) + a mkdir-atomic
  exclusive lock with conservative dead-pid stale reclaim, so concurrent
  daemons (separate worktrees) never last-writer-wins the same slot.
- Writes go through writeSecureFileAtomic; a one-time plaintext warning fires
  when enabled.

Validated against Playwright 1.58.2: a persistent __Host- cookie survives the
cookies() -> JSON -> newContext({storageState}) round-trip intact.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 19:17:04 +09:00
..
bin feat: multi-agent support — gstack works on Codex, Gemini CLI, and Cursor (v0.9.0) (#226) 2026-03-19 18:20:50 -07:00
scripts fix: ngrok Windows build + close CI error-swallowing gap (v0.18.0.1) (#1024) 2026-04-16 13:49:04 -07:00
src feat(browse): auto-cookie persistence module (opt-in, persistent-cookie-only) 2026-07-07 19:17:04 +09:00
test v1.57.10.0 feat: Codex review default-on across review/ship/plan/docs (#1966) 2026-06-10 21:14:58 -07:00
PLAN-snapshot-dropdown-interactive.md fix: snapshot -i auto-detects dropdown/popover interactive elements (#845) 2026-04-05 22:57:45 -07:00
SKILL.md v1.58.1.0 feat: hermetic local E2E + Conductor prose AskUserQuestion (#2004) 2026-06-14 11:40:57 -07:00
SKILL.md.tmpl v1.57.8.0 feat: browse js/eval --out render-to-file (canonical Chromium for offline rendering) (#1929) 2026-06-09 21:02:30 -07:00