Skip to content

Orphan guard replaces leakless #46

Closed

Description

@Fly-Playgroud

Parent

Spec: #33 (Baseline release). Section numbers refer to its Implementation Decisions.

What to build

A browser wand launched dies with the wand process even when that process is killed hard, with no guard process, no embedded binary and no file dropped at launch: the Orphan guard is a job object on Windows, Pdeathsig on Linux and the Pipe tether on every POSIX platform. Spec section 7; ADR-0007; ticket #11.

Acceptance criteria

  • leakless is removed from go.mod; the module contains no embedded executable; a launch writes no executable anywhere.
  • Windows: the browser joins a kill-on-close job object through golang.org/x/sys/windows. Linux, every GOARCH including loong64: Pdeathsig SIGKILL plus Setpgid, set from a goroutine that locks its OS thread for the browser's lifetime. Every POSIX platform: --remote-debugging-pipe passed with descriptors 3 and 4 created and held unused by wand; Windows passes no pipe. CDP stays on the WebSocket and Launch() still returns a URL.
  • Launcher.Leakless(bool) keeps its name and defaults (on in New(), off in NewUserMode()); off means no job object, no Pdeathsig and no pipe; the process-group kill on Kill() and Cleanup() remains for browsers that reject the flag.
  • Tests in the launcher suite using Go's helper-process pattern: the test re-executes its own binary as the driver, the driver launches a browser and reports the PID, the test kills the driver hard (SIGKILL, or TerminateProcess on Windows) and asserts the browser is gone within a bound; one test per mechanism (job object on Windows, Pdeathsig on Linux, the Pipe tether on macOS and on Linux with Pdeathsig disabled in the helper), plus one asserting a Leakless(false) launch survives the driver's death and is then cleaned up.
  • A deliberately failing local run of the root suite leaves no browser behind once the test binary exits.
  • The PR names rod #720, #1214, #1229, #1232 and #865 as resolved by removal.

Blocked by

Metadata

Metadata

Assignees

Labels

ready-for-agentFully specified, ready for an AFK agent

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions