You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Compiler] Introduce one bounded subprocess supervisor for all external tools
Priority
High — reliability, security hardening, and cross-platform consistency
Context
GOWDK invokes external processes from multiple compiler, generator, tooling, and test paths. Current examples include:
Go package inspection and go list;
build-data helper execution;
executable configuration and addon helpers;
generated application and binary compilation;
WASM compilation;
Tailwind and other external CSS tooling;
contract and type inspection helpers;
audit/test subprocesses;
dev-server child processes;
doctor and tool-version checks;
playground execution.
These call sites currently use a mixture of exec.Command, exec.CommandContext, direct Output, custom stderr buffers, and command-specific timeout or cleanup behavior.
Issue #672 correctly scopes a versioned executable-addon host, but the broader compiler still lacks one process execution contract.
Problem
Independent subprocess implementations create recurring defects and inconsistent behavior:
Some commands can run indefinitely while others are cancellable.
Output capture is often unbounded or formatted differently.
Environment inheritance differs by call site and can expose runtime secrets to compilation helpers unnecessarily.
Child/descendant cleanup differs between Unix and Windows.
Errors expose inconsistent command, exit, signal, and stderr context.
Secret redaction is not guaranteed at the process boundary.
Tool cache, module, workspace, proxy, and network policies are duplicated or implicit.
Dev, CI, and one-shot commands can react differently to the same external-tool failure.
New integrations are likely to copy an existing partial implementation.
Goal
Create one internal subprocess supervision package used by all compiler-owned external command execution. The package should make execution bounded, cancellable, observable, testable, and cross-platform by default.
Proposed architecture
Introduce an internal package with a narrow API, for example:
[Compiler] Introduce one bounded subprocess supervisor for all external tools
Priority
High — reliability, security hardening, and cross-platform consistency
Context
GOWDK invokes external processes from multiple compiler, generator, tooling, and test paths. Current examples include:
go list;These call sites currently use a mixture of
exec.Command,exec.CommandContext, directOutput, custom stderr buffers, and command-specific timeout or cleanup behavior.Issue #672 correctly scopes a versioned executable-addon host, but the broader compiler still lacks one process execution contract.
Problem
Independent subprocess implementations create recurring defects and inconsistent behavior:
Goal
Create one internal subprocess supervision package used by all compiler-owned external command execution. The package should make execution bounded, cancellable, observable, testable, and cross-platform by default.
Proposed architecture
Introduce an internal package with a narrow API, for example:
The exact API may differ, but call sites should not manage raw
os/exec.Cmdlifecycle directly unless a documented low-level exception is approved.Required behavior
Context and deadlines
Process-tree management
go, compiler, test, Tailwind, generated binaries, or helper descendants running.Bounded I/O
Environment policy
Define named policies rather than ad hoc
os.Environ()use, such as:InheritDeveloperEnvironmentfor explicitly trusted local commands;CompilerEnvironmentwith runtime/deployment secrets removed;GoToolEnvironmentwith deliberateGOWORK,GOPROXY,GOSUMDB, cache, tags, and target settings;IsolatedEnvironmentfor playground/hosted execution.Environment keys and values included in diagnostics must be allowlisted and secret-redacted.
Error model
Return a typed error containing:
Do not require callers to parse error-message substrings to classify failures.
Observability
Emit structured lifecycle events suitable for build reports and timings:
Events must avoid logging secrets, bearer credentials, private environment values, or unsafe command arguments.
Migration plan
gowdk.config.goloading under one explicit execution model #665 and Version and harden the executable addon bridge #672.exec.Command/exec.CommandContextusage outside the supervisor and an explicit allowlist.Non-goals
Test plan
The supervisor should have deterministic tests for:
Add integration coverage for representative consumers:
go list/binding inspection;gowdk testexternal browser command.Acceptance criteria
os/execcall sites.Related
gowdk.config.goloading under one explicit execution model #665 — unified config execution model