Skip to content

Spawn guard: detect new console-less entry points instead of a hand-maintained list #1933

Open

Description

@amrmelsayed

Follow-up from #1919 / PR #1932.

packages/codev/src/__tests__/windows-console-spawn-guard.test.ts checks every child_process call reachable from a hand-maintained list of console-less entry points (CONSOLE_LESS_ENTRY_POINTS: Tower, afx spawn, afx tower, afx cleanup, the porch CLI, the VS Code extension host). The list cannot notice a new console-less entry point: a new detached: true launch, or a CLI newly launched hidden (as execCodevCli made porch and afx cleanup), adds a process whose spawns the guard never scans.

Proposal

Add a second assertion that enumerates every detached: true spawn site (and every spawnCodevCli / execCodevCli call) in the repo and compares the launched program against an explicit allowlist mapped to an entry in CONSOLE_LESS_ENTRY_POINTS. A new site fails until it is mapped to an entry point (so its graph is scanned) or explicitly allowlisted with a reason.

Also worth closing while there (known guard limits, documented in its header)

  • Follows relative imports only: spawns inside other workspace packages (e.g. codev-sdk) are not scanned.
  • Recognises named and dynamic-import-destructured child_process bindings only, not import * as cp or require.

Activity

  1. added
    area/tower
    on Nov 18, 2026
  2. amrmelsayed commented on Nov 18, 2026

    @amrmelsayed
    CollaboratorAuthor

    Linked from PR #1932.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/tower

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions