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
Context (PR #33 self-review M7): internal/runtime.Runtime has TargetGOOS() string and internal/judge separately calls platform.Host(). When the runtime is NoneRuntime and host==target, the two channels agree. Any future "host=Windows + target=Linux" runtime (Docker, k8s, remote) breaks: the planner uses the host's bash to assemble a command that then runs in the target's shell.
Partial step landed in PR #33: TargetGOOS() was promoted to a required method on the Runtime interface so future runtimes don't silently default to linux. This is a stopgap — the underlying problem (two independent "what platform are we targeting" channels) is unchanged.
Proposal:
Add Shell() platform.HostShell to the Runtime interface (or a sub-interface). NoneRuntime returns platform.Host(); OpenSandboxRuntime returns a fixed POSIX descriptor.
Fold TargetGOOS() into Shell(): callers that currently do rt.TargetGOOS() == "windows" switch to inspecting the Shell descriptor (rt.Shell().IsBash, or a typed Shell().GOOS field). Then drop the standalone TargetGOOS() method from the interface — the in-PR addition was the cost of incomplete refactoring and should not survive.
Acceptance: every call site that today reads rt.TargetGOOS() either disappears or reads a structured field of rt.Shell(). The Runtime interface shrinks by one method overall (Shell + 0 other = TargetGOOS + nothing).
Tracked from: PR #33 self-review M7. PR #33 added the required-method stopgap; this issue tracks the proper resolution.
Context (PR #33 self-review M7):
internal/runtime.RuntimehasTargetGOOS() stringandinternal/judgeseparately callsplatform.Host(). When the runtime is NoneRuntime and host==target, the two channels agree. Any future "host=Windows + target=Linux" runtime (Docker, k8s, remote) breaks: the planner uses the host's bash to assemble a command that then runs in the target's shell.Partial step landed in PR #33:
TargetGOOS()was promoted to a required method on theRuntimeinterface so future runtimes don't silently default tolinux. This is a stopgap — the underlying problem (two independent "what platform are we targeting" channels) is unchanged.Proposal:
Shell() platform.HostShellto the Runtime interface (or a sub-interface). NoneRuntime returnsplatform.Host(); OpenSandboxRuntime returns a fixed POSIX descriptor.TargetGOOS()intoShell(): callers that currently dort.TargetGOOS() == "windows"switch to inspecting the Shell descriptor (rt.Shell().IsBash, or a typedShell().GOOSfield). Then drop the standaloneTargetGOOS()method from the interface — the in-PR addition was the cost of incomplete refactoring and should not survive.platform.GOOSWindows / Linux / Darwinconsts already added in PR feat: first-class Windows support across CLI, runtime, and judges #33.Acceptance: every call site that today reads
rt.TargetGOOS()either disappears or reads a structured field ofrt.Shell(). TheRuntimeinterface shrinks by one method overall (Shell + 0 other = TargetGOOS + nothing).Tracked from: PR #33 self-review M7. PR #33 added the required-method stopgap; this issue tracks the proper resolution.