Documentation
¶
Index ¶
- Constants
- func CheckPolicy(def CommandDef, args []string) bool
- func CommandFromArgv0(argv0 string) string
- func EarlyReject(raw, command string, args []string) (string, bool)
- func EarlyRejectFromEnv(command string, args []string) (string, bool)
- func ResolveCloneBranchRef(run GitRunFunc, branch, baseBranch, baseBranchForkPoint string) (created bool, err error)
- type BindMount
- type BoidExecutor
- type BoidOp
- type BoidRequest
- type Broker
- func (b *Broker) GetContext(token string) (TokenContext, bool)
- func (b *Broker) Handle(req *ExecRequest) *ExecResponse
- func (b *Broker) Register(commands map[string]CommandDef, builtinPolicies map[string]BuiltinPolicy, ...) string
- func (b *Broker) RegisterWithSecrets(commands map[string]CommandDef, builtinPolicies map[string]BuiltinPolicy, ...) string
- func (b *Broker) Start(ctx context.Context) error
- func (b *Broker) Stop()
- func (b *Broker) TLSListenAddr() string
- func (b *Broker) Unregister(token string)
- type BuiltinPolicy
- type CloneSpec
- type CommandDef
- type ExecRequest
- type ExecResponse
- type FetchRequest
- type FileWrite
- type GitRunFunc
- type HarnessType
- type Mount
- type MountType
- type PortStore
- type Profile
- type ProjectResolver
- type Proxy
- type ProxyManager
- type RejectRule
- type SecretResolver
- type Spec
- type StreamChunk
- type Symlink
- type TokenContext
Constants ¶
const ( StreamTypeStdout = "stdout" StreamTypeStderr = "stderr" StreamTypeExit = "exit" StreamTypeKill = "kill" )
StreamChunk is one unit in the streaming host-command protocol (Streaming=true).
Broker → Shim: type "stdout"/"stderr" carry Data; type "exit" carries ExitCode. Shim → Broker: type "kill" requests SIGTERM on the host process group.
const ( DefaultProxyPortRangeLow = 30000 DefaultProxyPortRangeHigh = 32767 )
DefaultProxyPortRangeLow/High bound the default allocation band.
The band sits deliberately BELOW the kernel's ephemeral port range, which is 32768-60999 on every machine boid runs on (`net.ipv4.ip_local_port_range`, verified on both the host and inside the daemon container). Drawing a FIXED port from the ephemeral range would mean that whenever some unrelated outgoing connection happens to hold that number as its source port at restart time, the bind fails — a failure mode the old `:0` allocation could not have, because it always took whatever was free. An operator who has lowered ip_local_port_range can move the band with PortRangeLow/PortRangeHigh.
const HostCommandRulesEnv = "BOID_HOST_COMMAND_RULES"
HostCommandRulesEnv is the name of the env var the dispatcher injects with a compact JSON map of command name -> reject rules (see internal/dispatcher/sandbox_builder.go). The shim reads it to reject obviously-doomed invocations before paying for a broker round trip. The broker remains the authority: this is a UX fast path only, and any parse failure or non-match here simply falls through to the broker check.
const PayloadPatchMaxBytes = 10 * 1024 * 1024
PayloadPatchMaxBytes caps the size of a single BoidOpTaskUpdatePayloadPatch request's PayloadPatch content (whether read from a file, stdin, or an inline CLI value). Unlike most of the shim's other file-reading flags (--payload-file, --patch-file, ...), this content crosses the broker RPC boundary into the daemon process — a shared, long-lived process — so an unbounded read is a real OOM vector, not just a local-runner concern. Enforced at two independent points (defense in depth, Phase 5b PR7 codex review Major 3, wiring-seams.md #17): the shim's own read (internal/sandbox/boid_shim.go's readPayloadPatchSource, so an oversized input never even reaches the wire) and the broker's request handler (internal/sandbox/broker.go), which re-checks independently so a shim bypass or a future second caller can't skip the limit. Matches api.AttachmentMaxFileBytes's existing 10 MB precedent (Phase 5b PR2).
Variables ¶
This section is empty.
Functions ¶
func CheckPolicy ¶
func CheckPolicy(def CommandDef, args []string) bool
func CommandFromArgv0 ¶
CommandFromArgv0 returns the declared short (host_commands.<name>) name for this shim invocation, derived from its argv[0]'s basename. As of the 5a-3 cutover (docs/plans/phase5-shim-and-task-context.md, "5a: shim 固定ディレク トリ化" PR3) every shim's bind-mount basename == its declared short name by construction (sandbox_builder's sandboxShimBinDir + hostCommandSymlinks materialize `/run/boid/bin/<name>` symlinks pointing at the boid multi-call binary), so the basename is always a trustworthy source of truth. The pre-5a-3 BOID_HOST_COMMAND_NAMES env-map / ResolveShimCommandName escape hatch for aliased host_commands.<name>.path entries was retired in the same change — the alias case now resolves at the dispatcher (symlink named after the declared name), not inside the shim.
func EarlyReject ¶ added in v0.0.9
EarlyReject checks command/args against the reject rules encoded in raw (the BOID_HOST_COMMAND_RULES JSON payload) and returns the same rejection message the broker would produce, plus true, on the first matching rule. Malformed JSON, an absent command entry, or no matching rule all yield ("", false) so callers fall through to the broker's own check.
func EarlyRejectFromEnv ¶ added in v0.0.9
EarlyRejectFromEnv is the thin env-reading wrapper around EarlyReject used by shimMain.
func ResolveCloneBranchRef ¶ added in v0.1.0
func ResolveCloneBranchRef(run GitRunFunc, branch, baseBranch, baseBranchForkPoint string) (created bool, err error)
ResolveCloneBranchRef resolves and checks out a task's working branch in a freshly cloned repository, sharing the exact algorithm between the sandbox-internal runner path (internal/sandbox/runner/clone.go's resolveCloneBranch) and the daemon-side per-job clone path (internal/dispatcher/checkout.go's PrepareJobCheckout) — PR834 PR-2b round-2 codex review flagged the two paths as divergent: PrepareJobCheckout ran an unconditional `git checkout -B <branch> origin/<branch>`, missing both the ClassifyBaseBranch case-3 "create a missing base branch from a fork point" handling and the "origin/" prefix stripping a project.yaml base_branch can carry — both of which this package's own CloneSpec.BaseBranch/BaseBranchForkPoint already declare for the sandbox-internal path. Rather than have PrepareJobCheckout reimplement that logic a second time (and risk it drifting out of sync again), both call sites now share this one implementation.
branch is the ref ultimately checked out; baseBranch is the ref whose tip provides the starting point — identical to branch for every current production caller (orchestrator.BuildCloneDeclaration: CheckoutOnly is always true, so every task occupies its own BaseBranch directly), but kept as a separate parameter rather than collapsed away, mirroring CloneDeclaration's own "kept as an explicit field... so the declaration shape stays self-describing" convention. Both may legitimately carry an "origin/" prefix (a project.yaml `base_branch: origin/main`) — this function strips it consistently from both before creating/checking out the local branch, so the resulting local branch is always named "main", never "origin/main".
baseBranchForkPoint, when set, is used to create baseBranch locally if it resolves on neither origin nor locally yet (ClassifyBaseBranch case 3, mirrored here since a fresh clone has no local branches yet beyond the default one `git clone` itself checked out); empty falls back to refs/remotes/origin/HEAD.
run executes a git subcommand against the target working directory (the caller's closure captures both the directory and which git binary to invoke); this function performs no I/O itself beyond calling run, so it stays unit-testable with a fake run that never shells out to a real git binary.
Returns whether a new local base branch was created from a fork point (created == true) — callers that emit their own diagnostics on that event (runner-state.json's "clone-base-branch-created" marker) use this instead of re-deriving it.
Types ¶
type BindMount ¶
type BindMount struct {
Source string
Target string // if empty, defaults to Source
Mode string // "rw" | "" (ro default)
IsFile bool // if true, treat target as a file (touch before bind, skip type detection)
Optional bool // if true, skip mount when Source does not exist on the host
}
BindMount is the dispatcher-facing DTO for arbitrary bind-mount requests. It is used by the dispatcher boundary (via SandboxSpec.AdditionalBindings) and is converted into Mount entries at the edge. The sandbox layer itself works in terms of Mount only.
type BoidExecutor ¶
type BoidExecutor interface {
ExecuteBoidBuiltin(ctx context.Context, tokenCtx TokenContext, req *BoidRequest) *ExecResponse
}
BoidExecutor performs typed boid builtin operations after broker validation.
ctx is the broker-side request context. For most ops it carries no deadline, but for the blocking BoidOpTaskAsk it is cancelled when the broker shuts down or the sandbox connection closes, so the server-side handler can stop waiting for an answer and clean up.
type BoidOp ¶
type BoidOp string
const ( BoidOpJobDone BoidOp = "job_done" BoidOpJobList BoidOp = "job_list" BoidOpJobShow BoidOp = "job_show" BoidOpJobLog BoidOp = "job_log" BoidOpActionSend BoidOp = "action_send" BoidOpAgentStop BoidOp = "agent_stop" BoidOpTaskCreate BoidOp = "task_create" BoidOpTaskGet BoidOp = "task_get" BoidOpTaskUpdate BoidOp = "task_update" BoidOpTaskImport BoidOp = "task_import" BoidOpTaskReopen BoidOp = "task.reopen" BoidOpTaskList BoidOp = "task_list" BoidOpTaskNotify BoidOp = "task_notify" BoidOpTaskAnswer BoidOp = "task_answer" BoidOpTaskAsk BoidOp = "task_ask" BoidOpTaskDelete BoidOp = "task_delete" // Phase 5b PR1 task-context RPCs (docs/plans/phase5-shim-and-task-context.md): // pull-based replacements for the dispatch-time context files // ($HOME/.boid/context/{task,instructions,environment,payload}.{yaml,json}). // The 5b-6 cutover PR retired that file-based materialization entirely // (sandbox_builder.go's contextFiles/buildEnvironmentYAML) — these four // ops are now the sole source of task/instructions/environment/payload // data for an in-sandbox caller. BoidOpTaskCurrent BoidOp = "task_current" BoidOpTaskInstructions BoidOp = "task_instructions" BoidOpTaskEnv BoidOp = "task_env" BoidOpTaskPayload BoidOp = "task_payload" // Phase 5b PR2 attachments RPCs (docs/plans/phase5-shim-and-task-context.md): // pull-based replacement for the dispatch-time attachments bind // (`~/.boid/attachments`, sandbox_builder.go's former per-task RO mount // of `<AttachmentsRoot>/tasks/<task_id>/attachments`). The 5b-6 cutover // PR retired that bind entirely — these two ops are now the sole // in-sandbox read path for attachments. BoidOpTaskAttachmentsList BoidOp = "task_attachments_list" BoidOpTaskAttachmentsGet BoidOp = "task_attachments_get" // Phase 5b PR7 (docs/plans/phase5-shim-and-task-context.md): the // job_done payload_patch direct-pass RPC. `boid task update // --payload-patch @-` sends this instead of the agent writing // $HOME/.boid/output/payload_patch.json for postJobDone/JobDone to pick // up later — it applies immediately, with the SAME merge semantics // (orchestrator.MergePayloadPatch, gated by the firing hook's own // Traits.Produces) rather than BoidOpTaskUpdate's simpler top-level // shallow merge. JobID-scoped like TaskInstructions/Env/Payload (not // TaskID-scoped): the allowedTraits gate is sourced from the // dispatcher.JobContextSnapshot captured for the CALLING job at dispatch // time (never re-resolved live against project meta — a TOCTOU // staleness bug codex review caught, see wiring-seams.md #17's Major 1), // which only exists per-job. The file-based fallback (decision 6/7, // wiring-seams.md #13's PR6 update) is untouched by this op and remains // available as a secondary path — full retirement is deferred to Phase 6. BoidOpTaskUpdatePayloadPatch BoidOp = "task_update_payload_patch" // BoidOpProjectBehaviors backs `boid project behaviors <project-ref>` from // inside the sandbox — added so a "meta project" task (one whose job is // to look across multiple projects, e.g. cross-project issue triage) can // discover another project's task_behaviors without a host-only `boid // project` CLI invocation. Scoped like BoidOpTaskList/BoidOpTaskCreate: // the broker resolves BoidRequest.ProjectID (UUID, exact name, or partial // name) via ProjectResolver and then enforces // TokenContext.AllowsProject, so a caller can only ever see behaviors for // projects within its own token's workspace scope — never an arbitrary // project on the daemon. BoidOpProjectBehaviors BoidOp = "project_behaviors" // BoidOpProjectList backs `boid project list` from inside the sandbox — // lets a "meta project" task discover which projects it can even ask // BoidOpProjectBehaviors about, rather than requiring it to already know // every project ref up front. Unlike BoidOpProjectBehaviors there is no // caller-supplied ref to resolve: the executor enumerates // TokenContext.AllowedProjectIDs (falling back to the caller's own // ProjectID when that is empty, same fallback BoidOpTaskList's // no-project/no-workspace branch uses) — a value stamped into the token // at dispatch time from the workspace's peer-project set // (dispatcher.allowedProjectIDs), never something a sandboxed request // can widen. So the result is unconditionally scoped to the caller's own // workspace; there is intentionally no way to list projects daemon-wide // the way the host-only `boid project list` does. BoidOpProjectList BoidOp = "project_list" // BoidOpTaskWake backs `boid task wake <task-id>` from inside the sandbox // (docs/plans/cross-project-issue-triage.md Phase 1 PR-4, 論点10: the // third wake category — "source event", e.g. "Jira moved" — is a // workspace judgment call (khi's collector/evaluate loop, nose-approved), // but had no execution口 before this op; wake_at and wake_task_id-based // wakes are daemon-internal and already handled by QueueSweepLoop). This // is a thin wrapper around the SAME api.WorkflowService.Wake the HTTP // API / Web UI already call — NOT a new capability, and NOT a bypass of // the wake_triaged/wake_ready IsManualAction guard: a direct `boid // action send --type wake_ready` is still rejected (StateMachine. // IsManualAction returns false for both), because Wake resolves the // correct target status itself via ParkedFrom rather than trusting a // caller-supplied action type. Scoped like BoidOpActionSend: the broker // only validates TaskID is present; the executor enforces // TokenContext.AllowsProject before calling Wake. BoidOpTaskWake BoidOp = "task_wake" // BoidOpTaskTriageGet / BoidOpTaskTriageList back `boid task triage // <task-id>` and `boid task triage --list [--status S] [--project P]` // from inside the sandbox (docs/plans/cross-project-issue-triage.md Phase // 1 PR-5a). // // 決定14 makes the daemon the SOLE source of truth for a triage task's // state — khi retires its own decisions log and fold, keeping only claims // and the note body. That only works if the workspace side can read the // state back, and before PR-5a there was no read path at all: the sidecar // was reachable only from inside the daemon (Web UI enrichment), and // BoidOpTaskGet returns orchestrator.Task's own columns, which // deliberately exclude everything triage-specific. // // These are strictly READ ops over data the calling workspace already // owns, so they do not widen 決定2's boundary (the same reasoning that // already allows brokered task_list of the caller's own workspace — // 実測結果 項10). Scoping matches BoidOpActionSend/BoidOpTaskWake: the // broker only checks shape, the executor enforces // TokenContext.AllowsProject before returning anything. BoidOpTaskTriageGet BoidOp = "task_triage_get" BoidOpTaskTriageList BoidOp = "task_triage_list" )
type BoidRequest ¶
type BoidRequest struct {
Op BoidOp `json:"op"`
JobID string `json:"job_id,omitempty"`
TaskID string `json:"task_id,omitempty"`
TaskField string `json:"task_field,omitempty"`
// ProjectID is extracted by the shim for broker authorization / project
// resolver; it is also present inside CreatePatch when the YAML includes
// project_id. The executor prefers createReq.ProjectID from CreatePatch
// and falls back to this field, then to ctx.ProjectID.
ProjectID string `json:"project_id,omitempty"`
ExitCode int `json:"exit_code,omitempty"`
Output string `json:"output,omitempty"`
// CreatePatch is a JSON-serialised api.CreateTaskRequest. The shim builds
// it from the full YAML map so that every field (including previously
// dropped ones such as instructions, traits, readonly, worktree,
// branch_prefix, id) is forwarded without enumeration.
CreatePatch json.RawMessage `json:"create_patch,omitempty"`
// UpdatePatch is a JSON-serialised api.UpdateTaskRequest. The shim
// assembles it from --patch-file and/or individual flags (--title,
// --description, --payload-file).
UpdatePatch json.RawMessage `json:"update_patch,omitempty"`
// task import fields
ImportTasks []json.RawMessage `json:"import_tasks,omitempty"`
ImportProjectOverride string `json:"import_project_override,omitempty"`
// task list fields
WorkspaceID string `json:"workspace_id,omitempty"`
Status string `json:"status,omitempty"`
Limit int `json:"limit,omitempty"`
// task notify fields
Message string `json:"message,omitempty"`
Ask string `json:"ask,omitempty"`
QuestionID string `json:"question_id,omitempty"`
Progress string `json:"progress,omitempty"`
Done string `json:"done,omitempty"`
Fail string `json:"fail,omitempty"`
// task answer fields
Answer string `json:"answer,omitempty"`
// task ask fields. Question carries the blocking-RPC question text for
// `boid task ask <text>`. The broker holds the connection open until the
// answer arrives; the answer is returned verbatim in ExecResponse.Stdout
// (the boid builtin reply framing is ExecResponse, so no separate
// BoidResponse type is needed).
Question string `json:"question,omitempty"`
// task delete fields
Force bool `json:"force,omitempty"`
// action send fields
ActionType string `json:"action_type,omitempty"`
Payload []byte `json:"payload,omitempty"`
// task attachments get fields. AttachmentName addresses one attachment
// by its exact basename — see api.ReadAttachment for the traversal
// guard (no path separators, no ".."). Unused by
// BoidOpTaskAttachmentsList.
AttachmentName string `json:"attachment_name,omitempty"`
// PayloadPatch carries the raw patch body for BoidOpTaskUpdatePayloadPatch
// — the JSON that would otherwise go inside a file-based
// {"payload_patch": ...} envelope (docs/*/reference/hook-contract.md).
// Unlike UpdatePatch (a JSON-serialised api.UpdateTaskRequest consumed by
// a top-level shallow merge), this is merged via
// orchestrator.MergePayloadPatch — see api.TaskAppService.UpdateTaskPayloadPatch.
PayloadPatch json.RawMessage `json:"payload_patch,omitempty"`
}
type Broker ¶
type Broker struct {
SocketPath string
BoidBinary string
BoidExecutor BoidExecutor
ProjectResolver ProjectResolver
// TLSAddr, when non-empty, additionally binds a TCP+mTLS listener at
// this address (docs/plans/phase6-container-backend.md §PR4/§決定5:
// "gateway / broker / dockerproxy はサービス名 (DNS) + TCP (mTLS) で到達す
// る"). This is purely additive — the UNIX socket above (SocketPath)
// is bound exactly as before regardless of TLSAddr, so the userns
// backend's sandbox-side broker RPC client (which still dials
// SocketPath) is unaffected. TLSConfig must be non-nil whenever
// TLSAddr is set (see internal/mtls.CA.ServerTLSConfig for how to
// build one with mutual-TLS auth wired up); a caller that leaves
// TLSAddr empty (the zero value, matched by every existing caller and
// test today) gets the pre-PR4 UNIX-only behavior unchanged.
//
// internal/server.Server sets these (when its Config.TLSDir is
// configured) so a real daemon actually binds this listener
// alongside the UNIX socket. No client dials it yet in PR4 — the
// container backend that will is PR5 — so today it is a live but
// unconsumed listener, exercised directly by
// TestBrokerTCPListener_MutualTLSHandshake.
TLSAddr string
TLSConfig *tls.Config
// contains filtered or unexported fields
}
func (*Broker) GetContext ¶
func (b *Broker) GetContext(token string) (TokenContext, bool)
func (*Broker) Handle ¶
func (b *Broker) Handle(req *ExecRequest) *ExecResponse
Handle dispatches a request using the broker's base context. Retained for callers (mainly tests) that drive the broker synchronously without a per-connection context; the live socket path uses handle with a request ctx.
func (*Broker) Register ¶
func (b *Broker) Register(commands map[string]CommandDef, builtinPolicies map[string]BuiltinPolicy, ctx TokenContext) string
func (*Broker) RegisterWithSecrets ¶
func (b *Broker) RegisterWithSecrets(commands map[string]CommandDef, builtinPolicies map[string]BuiltinPolicy, ctx TokenContext, resolver SecretResolver) string
func (*Broker) TLSListenAddr ¶ added in v0.1.0
TLSListenAddr returns the bound address of the TCP+mTLS listener (e.g. "127.0.0.1:54321"), or "" if TLSAddr was empty or Start has not bound it yet.
func (*Broker) Unregister ¶
type BuiltinPolicy ¶
type BuiltinPolicy struct {
AllowedOps map[string]struct{}
// AllowedCwdRoots lists additional cwd roots permitted for this builtin
// beyond the per-token entry root (project/worktree dir). Used so that
// e.g. gate jobs can target /tmp or the host project dir without the
// broker needing to know the role itself.
AllowedCwdRoots []string
}
BuiltinPolicy defines which operations are permitted for a named builtin command. It is stamped at token registration time by the planner and checked at dispatch time by the broker, keeping all role-based authorization logic outside the broker itself.
func (BuiltinPolicy) Allows ¶
func (p BuiltinPolicy) Allows(op string) bool
Allows reports whether op is in the allowed set.
func (BuiltinPolicy) AllowsCwd ¶
func (p BuiltinPolicy) AllowsCwd(cwd string) bool
AllowsCwd reports whether cwd is within any of the policy's additional cwd roots.
type CloneSpec ¶ added in v0.0.10
type CloneSpec struct {
// Enabled gates the entire sequence.
Enabled bool
// URL is the full gateway clone URL, e.g.
// "http://10.0.2.2:<port>/j/<job-token>/<host>/<owner>/<repo>.git". It
// carries a live job token — see runner/state.go's redactCloneURLToken,
// which strips the token before this value (or anything derived from
// it) is written to runner-state.json.
URL string
// ReferenceDir is the sandbox-internal path of the RO bind-mounted host
// repo `.git` used as `git clone --reference`. Empty (or missing on
// disk at clone time) disables --reference: the clone still succeeds,
// just without the object-sharing optimization
// (docs/plans/container-based-boid.md: 「--reference を欠いても遅くなる
// だけで正しく動く」— graceful degradation, not a hard dependency).
ReferenceDir string
// TargetDir is the sandbox-internal neutral path to clone into
// (docs/plans/git-gateway-cutover.md: 「clone 先は sandbox 内の中立 path
// /workspace」). An existing TargetDir is removed before cloning, so
// reopen (re-running this same sequence) is idempotent by re-clone
// rather than fetch-in-place.
TargetDir string
// RealGitBin is the sandbox-internal path of a real (non-shimmed) git
// binary, bind-mounted read-only alongside boid's git-shim overlay so
// the runner's own clone/branch-resolution git invocations are not
// routed through the broker-dispatch git builtin. PR6 removes the shim
// entirely; until then this is the only genuine git binary inside the
// sandbox. Empty falls back to a bare "git" lookup on $PATH (which, in
// production dispatch, would resolve to the shim — harmless today since
// production JobSpecs never set Enabled).
RealGitBin string
// Branch, BaseBranch, CheckoutOnly and BaseBranchForkPoint mirror
// orchestrator.CloneDeclaration 1:1 — see that type's doc comments for
// the exact resolution semantics.
Branch string
BaseBranch string
CheckoutOnly bool
BaseBranchForkPoint string
}
CloneSpec is the runner-inner-child-facing declaration of the sandbox- internal git clone + branch resolution launch sequence (docs/plans/git-gateway-cutover.md PR5: 「runner の clone 実行機構 + branch 宣言」). It is the sandbox.Spec-level counterpart of orchestrator.CloneDeclaration: dispatcher's BuildSandboxSpec fills in the concrete gateway clone URL, the sandbox-internal mount paths, and the real (non-shimmed) git binary path that orchestrator has no business knowing about.
The zero value (Enabled == false) is a complete no-op: runner-inner-child skips the whole sequence and the existing worktree bind-mount path runs exactly as it did before PR5. Only test callers construct a CloneSpec with Enabled == true until the PR6 cutover switches dispatch over to this path by default.
type CommandDef ¶
type CommandDef struct {
Name string
Path string
AllowedPatterns []string
DeniedPatterns []string
AllowedSubcommands []string
Env map[string]string
RejectRules []RejectRule
// MissingSecrets lists "ENV_NAME (secret:key)" entries for env vars that
// the kit declared via the "secret:" prefix but failed to resolve at
// register time. When non-empty, the broker rejects exec requests for
// this command (fail-closed) instead of silently letting host env /
// host-side config fallbacks take over.
MissingSecrets []string
}
CommandDef is the canonical sandbox-side policy for brokered host commands. Dispatcher and orchestrator mirror this shape as transport data, but the policy semantics live here.
func (CommandDef) MissingSecretsMessage ¶ added in v0.0.6
func (d CommandDef) MissingSecretsMessage() string
MissingSecretsMessage returns the human-readable rejection message used when a host_command is invoked despite unresolved declared secrets. Returns an empty string if MissingSecrets is empty.
type ExecRequest ¶
type ExecRequest struct {
Command string `json:"command"`
Args []string `json:"args"`
Cwd string `json:"cwd,omitempty"`
Token string `json:"token"`
Boid *BoidRequest `json:"boid,omitempty"`
Fetch *FetchRequest `json:"fetch,omitempty"`
Streaming bool `json:"streaming,omitempty"`
}
ExecRequest carries a broker-mediated host command invocation. The broker never wires caller-provided stdin into the host process (see the host command gate in broker.go / broker_streaming_linux.go); host commands always run with stdin connected to /dev/null.
type ExecResponse ¶
type ExecResponse struct {
ExitCode int `json:"exit_code"`
Stdout string `json:"stdout"`
Stderr string `json:"stderr"`
}
func ExecFetch ¶ added in v0.0.5
func ExecFetch(req *FetchRequest) *ExecResponse
ExecFetch performs an HTTP GET on the host (no broker involved) and returns the result as an ExecResponse. Used by the `boid fetch` CLI subcommand.
func RunBoidShim ¶
func RunBoidShim(args []string) (*ExecResponse, error)
func ShimExec ¶
func ShimExec(command string, args []string) (*ExecResponse, error)
ShimExec sends a host command request to the broker using the streaming protocol so that stdout/stderr is forwarded in real-time and signals (Ctrl-C) are propagated to the host process group.
command is the declared short name from CommandFromArgv0 — as of 5a-3 (docs/plans/phase5-shim-and-task-context.md) the shim's bind-mount basename always equals its declared short name, so this is what the broker's Commands map is keyed by (dispatcher.ResolveHostCommands' byName view). The pre-5a-3 absolute-bind-mount-path Command shape and the broker's corresponding Path-scan fallback were both retired in the same change.
type FetchRequest ¶ added in v0.0.5
type FetchRequest struct {
URL string `json:"url"`
}
FetchRequest carries the parameters for a broker-mediated HTTP GET. Only GET is supported; the broker performs the request on the host and returns the response body (HTML converted to markdown, other types verbatim).
type FileWrite ¶
FileWrite describes a file to materialize inside the sandbox. Content is written verbatim (shell-quoted at render time); the parent directory is created with mkdir -p beforehand.
type GitRunFunc ¶ added in v0.1.0
GitRunFunc runs a single git subcommand (args, without the leading "git") against a directory a closure captures, returning any error from the underlying process. Both internal/dispatcher's and internal/sandbox/ runner's own git-exec primitives can be adapted to this shape with a one-line closure — see their respective call sites of ResolveCloneBranchRef below.
type HarnessType ¶ added in v0.0.6
type HarnessType string
HarnessType identifies which HarnessAdapter the runner should hand the process off to via adapter.Run(). Phase 3-d (PR1) made this field invariant non-empty for every dispatched job — hook / session / exec all resolve to shell / claude / codex / opencode. The empty string is no longer a valid value and the runner-inner-child rejects it; the legacy runExecArgv fallback was retired in the same change.
const ( // HarnessShell routes through internal/adapters/shell.Adapter.Run() and // is the fall-through for hooks without an `agent:` declaration, every // `boid exec` job, and the default for unknown agent values. Shell // adapter forwards SIGUSR1 / SIGWINCH and normalises stop-signal exits // like the agent adapters do but performs no session resolution. HarnessShell HarnessType = "shell" // HarnessClaude routes through internal/adapters/claude.Adapter.Run(). HarnessClaude HarnessType = "claude" // HarnessCodex routes through internal/adapters/codex.Adapter.Run(). // Added in Phase 3-c as a prototype to validate the HarnessAdapter // abstraction beyond claude. Minimum implementation: 1-turn launch with // signal forwarding; session resume / payload patch are deliberately // left as no-ops (see docs/plans/agent-aware-boid.md Phase 3-c). HarnessCodex HarnessType = "codex" // HarnessOpenCode routes through internal/adapters/opencode.Adapter.Run(). // Phase 3-c prototype, same scope as HarnessCodex. HarnessOpenCode HarnessType = "opencode" )
type Mount ¶
type Mount struct {
// Source is what gets mounted, and its SPELLING selects between two
// kinds. An absolute path is a host path; anything else is taken to be a
// docker NAMED VOLUME name — that is the whole of
// internal/sandbox/realization.classifySource's rule, and PR6 of
// docs/plans/workspace-home-volume-persistence.md (論点 e option (i))
// deliberately reuses it rather than adding a MountType, so the workspace
// HOME mount is an ordinary MountBind whose Source is
// dockerres.WorkspaceHomeVolumeName(...). Empty for tmpfs.
//
// The consequence worth stating: a relative path that reaches this field
// by accident is not a broken path, it is a volume name. The container
// backend fails Launch closed on one that does not match docker's volume
// grammar (dockerres.IsValidVolumeName), but a *plausible-looking* one
// would be created as a junk volume, so callers must never construct this
// value by joining onto something that might not be absolute.
Source string
Target string // absolute path inside sandbox
Type MountType
ReadOnly bool
Slave bool // mount --make-rslave after mounting
IsFile bool // target is a file, not a directory
DetectType bool // detect file vs dir at runtime (if/elif)
Guard string // shell test expression; if non-empty, wrap in if [ $Guard ]; then
NeedsDirs []string // subdirs to create under Target before ro remount
// HostBacked overrides realization.classifySource's default treatment
// of a `/workspace`/`/workspace/<name>` Target as container-local
// (决定 4/10, docs/plans/phase6-container-backend.md) — when true, Source
// is classified as a real host-path bind (MountSourceHostPath) even
// though Target falls under the sandbox-internal clone parent dir.
// Used by dispatcher.cloneMounts (docs/plans/volume-only-daemon.md
// §論点b, PR-2b "per-job clone at dispatch time"): when the daemon has
// already pre-populated Source via dispatcher.PrepareJobCheckout
// (`git clone file://<bare-repo>` into a per-job staging dir under
// a host-visible runtimes root), the container backend must bind that
// real directory in — not skip it as "the in-container clone target,
// created fresh". Ignored by the userns backend (internal/sandbox/
// realization is container-backend-only; userns never calls
// classifySource at all — see that package's own doc comment) and by
// every pre-PR-2b caller (default false, byte-for-byte unchanged
// classification).
HostBacked bool
}
Mount describes a single filesystem mount applied inside the sandbox. Types: bind, rbind, tmpfs. Flags cover read-only remount, file vs dir handling, slave propagation, guards, and required sub-directory creation.
type PortStore ¶ added in v0.2.4
type PortStore interface {
// LoadPort returns the port recorded for key. ok is false when the key
// has no record yet.
LoadPort(key string) (port int, ok bool, err error)
// SavePort records port as key's allocation, replacing any previous
// record for that key.
SavePort(key string, port int) error
// ReservedPorts returns every recorded reservation as port -> key.
//
// The allocator needs this because "is this port free?" and "is this
// port spoken for?" are different questions here: listeners are created
// lazily at dispatch time, so a workspace that has not run since the
// last restart has a reservation with nothing listening on it. Binding
// such a port succeeds and would silently steal it.
ReservedPorts() (map[int]string, error)
}
PortStore persists the port allocated to a proxy key across daemon restarts. Implemented outside this package (internal/sandbox must not import internal/db) and injected, the same shape dispatcher.ProxyAllocator already uses in the other direction.
Both methods are best-effort from the manager's point of view: an error from either degrades port stability but never fails dispatch.
type Profile ¶ added in v0.0.8
type Profile int
Profile selects the sandbox filesystem layout strategy. The zero value (ProfileDefault) preserves the existing behaviour so callers that do not set the field are unaffected.
const ( // ProfileDefault is the standard layout: a small set of host system dirs // (/bin, /sbin, /lib, /lib64, /usr, /etc) are ro-rbind-mounted plus // /dev, /proc, and a /tmp tmpfs. Broker socket and registration proceed // normally. This is the zero value; any Spec where Profile is not set // explicitly uses this layout. ProfileDefault Profile = iota // ProfileInit is the host-scan layout used by kit-init / workspace-configure // generation scripts. The entire host root (/) is ro-rbind-mounted so the // agent can discover installed tools without needing explicit allowlists. // Broker registration and the broker socket mount are both skipped because // init scripts do not call back into boid host-commands. ProfileInit )
type ProjectResolver ¶
ProjectResolver maps a project reference (UUID, exact name, or partial name) to a concrete project UUID. The broker calls it just before the UUID-based AllowsProject authorization check so that sandbox-side callers (e.g. plan agents) can use project names while the broker continues to enforce workspace isolation in UUID space. When nil, the broker passes refs through verbatim (tests and UUID-only callers).
type Proxy ¶
type Proxy struct {
// BindHost, when non-empty, overrides Start's default loopback-only
// bind ("127.0.0.1") — see ProxyManager.BindHost's own doc comment for
// the container-backend rationale ([Blocker 2, PR7 codex review]). Must
// be set before Start is called; changing it afterward has no effect on
// an already-bound listener.
BindHost string
// DesiredPort, when non-zero, is the port Start binds to instead of
// letting the kernel pick an ephemeral one (`:0`). Start returns the
// bind error unchanged when the port is unavailable — deciding whether
// that is fatal or worth retrying on another port belongs to the
// caller, not here (ProxyManager treats it as retryable; see
// docs/plans/egress-proxy-stable-port.md). Must be set before Start.
DesiredPort int
// contains filtered or unexported fields
}
func (*Proxy) SetAllowed ¶ added in v0.0.8
SetAllowed replaces the proxy egress allowlist atomically. Subsequent CONNECT and HTTP-forward requests use the new list. Existing CONNECT tunnels (hijacked TCP connections) are unaffected — that is intentional: once an egress decision has been made for a long-lived TLS connection, pulling its destination out of the allowlist mid-stream would surface as an opaque socket close to the sandbox. Sandboxes that reconnect after SetAllowed will be re-validated against the new list.
func (*Proxy) Stop ¶
func (p *Proxy) Stop()
Stop closes the listener and every connection served through it.
Both the server AND the listener are closed, which looks redundant but is not: Start hands the listener to http.Server.Serve on a NEW GOROUTINE, and if Stop's Close lands before that goroutine gets scheduled, Serve's own trackListener call sees the already-shutting-down server, returns ErrServerClosed immediately, and never closes the listener it was handed. The socket then stays bound for the life of the process.
Harmless while ports were ephemeral — nothing ever asked for that number again. Not harmless now that a port is meant to be reused across restarts: found by TestProxyManager_ReusesPersistedPort failing on CI (a loaded machine loses that race far more often than a developer's), where the leaked listener kept the port and the "restarted" manager had to reallocate — i.e. exactly the port drift this feature exists to prevent.
type ProxyManager ¶ added in v0.0.8
type ProxyManager struct {
// BindHost, when non-empty, overrides the loopback-only default
// ("127.0.0.1") every listener GetOrCreate starts binds to ([Blocker 2,
// PR7 codex review] — docs/plans/phase6-container-backend.md §決定5).
// A container-backend deploy runs the daemon inside its own container;
// a sibling job container reaches the egress proxy over the shared
// compose network by this daemon container's own IP, which a
// loopback-bound listener is unreachable from — see internal/server's
// composeBindHost doc comment for the full rationale. Set once, before
// Start (internal/server's New(), based on the config-selected sandbox
// backend — §決定11's global-not-per-job selection), and never changed
// again: every listener this manager ever creates (the default
// workspace one included) shares the same bind host for the life of
// the process. Empty (every pre-PR7 caller/test) preserves the
// original "127.0.0.1" behavior exactly.
BindHost string
// PortStore, when non-nil, makes a listener's port survive daemon
// restarts: the port allocated for a key is written here and reused on
// the next process lifetime (docs/plans/egress-proxy-stable-port.md).
//
// Why this exists: Proxy ports used to be pure `:0` ephemeral, so every
// daemon restart moved every workspace's egress proxy to a new port.
// Tools that read the proxy from the environment (curl, git, boid's own
// traffic) never noticed, but tools that BAKE it into a config file did
// — a `~/.npmrc` on the persistent workspace HOME volume carrying a
// long-dead port made npm/pnpm retry ECONNREFUSED on a one-minute
// backoff, which reads as a hang rather than an error. See the design
// doc's 背景 section for the incident this came from.
//
// nil (every pre-feature caller and every test that builds a bare
// ProxyManager) keeps the original ephemeral behaviour exactly.
PortStore PortStore
// PortRangeLow/PortRangeHigh bound the band new ports are allocated
// from, inclusive. Zero means DefaultProxyPortRange{Low,High}. Only
// consulted when PortStore is set.
PortRangeLow int
PortRangeHigh int
// contains filtered or unexported fields
}
ProxyManager owns a set of long-lived per-workspace HTTP(S) egress proxies. Each workspace gets its own listener on a distinct loopback port; the allowlist of every listener can be live-swapped via Proxy.SetAllowed so dispatch-time changes (workspace.yaml edits, new kit, …) take effect immediately for the next sandbox without restarting the listener.
Concurrent sandboxes launched under the same workspace share one listener — when their resolved allowlists differ, the most recent dispatch wins. This matches the semantics of the rest of the workspace surface (env, kits, …) where workspace state is read fresh at dispatch time and not frozen per-sandbox.
A ProxyManager is created via NewProxyManager and must be started with Start(ctx) before GetOrCreate is called. StopAll closes every listener; the manager is single-shot and must not be reused after StopAll.
Design rationale: per-workspace port separation (rather than embedded HTTPS_PROXY basic-auth) was chosen for client compatibility — many tools in the wild parse the proxy URL loosely or ignore the userinfo entirely.
func NewProxyManager ¶ added in v0.0.8
func NewProxyManager() *ProxyManager
NewProxyManager returns a fresh, unstarted ProxyManager.
func (*ProxyManager) Count ¶ added in v0.0.8
func (m *ProxyManager) Count() int
Count returns the number of active per-workspace listeners. Useful for diagnostics and tests; not part of the dispatch hot path.
func (*ProxyManager) GetOrCreate ¶ added in v0.0.8
func (m *ProxyManager) GetOrCreate(workspaceID string, allowed []string) (int, error)
GetOrCreate returns the port of the listener bound to workspaceID after (re)applying allowed as its egress allowlist. If no listener exists yet for workspaceID, a new one is started on a free loopback port.
allowed is copied internally — callers may mutate the slice after the call. An empty workspaceID is a programmer error: the manager refuses to allocate an unkeyed listener.
func (*ProxyManager) Start ¶ added in v0.0.8
func (m *ProxyManager) Start(ctx context.Context)
Start binds the manager to ctx. Listener teardown follows ctx cancellation; StopAll() is the explicit alternative.
func (*ProxyManager) StopAll ¶ added in v0.0.8
func (m *ProxyManager) StopAll()
StopAll closes every listener owned by the manager. Subsequent GetOrCreate calls return an error.
type RejectRule ¶ added in v0.0.9
RejectRule declares a pattern that rejects an invocation with a human-readable reason. Match is a glob over the joined args string with the same semantics as allow/deny patterns (globMatch below). Enforced by gateHostCommand (broker.go) as the authority, and mirrored by the shim's EarlyReject fast path (shim_reject.go), which needs the json tags.
type SecretResolver ¶
type Spec ¶
type Spec struct {
// ID is the job id; it namespaces the generated /tmp/boid-<ID>-* files.
ID string
// --- Filesystem primitives ---
// Mounts are applied in order to compose the sandbox root filesystem.
Mounts []Mount
// Files are materialized inside the sandbox (after pivot_root) before the
// entry command runs.
Files []FileWrite
// Symlinks are created inside the sandbox.
Symlinks []Symlink
// --- Network ---
// ProxyPort, when > 0, engages the nft drop policy + HTTP proxy env vars.
ProxyPort int
// --- Process ---
// Argv is the program and arguments to invoke (POSIX argv).
Argv []string
// WorkDir is the cwd for the entry process. Also used as the cwd reported to
// the broker for the job-done call (must be within the project/worktree root).
WorkDir string
// Env is the environment for the entry process.
Env map[string]string
// StdinBytes, when non-empty, is piped into the entry's stdin.
StdinBytes []byte
// StdoutCaptureFile, when non-empty, redirects stdout to that sandbox-internal
// path. Doubles as the job-done output fallback when no payload patch exists.
StdoutCaptureFile string
// TTY, when true, the entry process inherits the caller's PTY on stdio.
TTY bool
// --- Completion / broker ---
// Foreground indicates a user-facing job (boid exec): stdout/stderr are
// inherited and no broker job-done callback fires on exit. Hook jobs leave
// this false so the runner posts `boid job done` through the broker.
// Broker socket path and token are carried in Env (BOID_BROKER_SOCKET /
// BOID_BROKER_TOKEN).
//
// Phase 6 PR8 (docs/plans/phase6-container-backend.md §決定 9) retired the
// sibling PayloadPatchPath field: agents / hook scripts now apply their
// payload patch immediately via the broker's `boid task update
// --payload-patch` RPC instead of writing a well-known
// $HOME/.boid/output/payload_patch.json the runner used to read back as
// the job-done output — see runner.resolveJobOutput's doc comment.
Foreground bool
// --- Bookkeeping ---
// RootDir, if non-empty, is the host directory used as the sandbox ROOT (a
// tmpfs is mounted on it). Go-side cleanup removes it after exit.
RootDir string
// CleanupPaths are removed by runner-outer after the sandbox process tree
// exits (used for staging dirs). Removal runs in the host mount namespace,
// where the sandbox's bind mounts are already gone.
CleanupPaths []string
// HarnessType, when non-empty, directs runner-inner-child to hand the
// agent process off to the matching HarnessAdapter.Run() instead of
// exec-ing Argv verbatim. Empty preserves the legacy exec path used by
// boid exec jobs and any non-agent hook job. See sandbox.HarnessType.
HarnessType HarnessType
// UserAnswer carries the Q&A reply that should be threaded into the
// adapter's RunContext.UserAnswer. Empty for fresh starts and for resumes
// without a Q&A reply.
UserAnswer string
// Profile selects the filesystem layout strategy. Zero value (ProfileDefault)
// preserves the existing behaviour. Set to ProfileInit for kit-init /
// workspace-configure generation scripts that need to read the full host FS.
Profile Profile
// Clone declares the opt-in sandbox-internal clone + branch resolution
// sequence runner-inner-child performs before handing off to the
// harness (docs/plans/git-gateway-cutover.md PR5). Zero value
// (Clone.Enabled == false) is a no-op — see CloneSpec's doc comment.
Clone CloneSpec
// ContainerImage is the container backend's image-selection input
// (docs/plans/phase6-container-backend.md §PR5, §決定 2/11): the
// workspace-level `orchestrator.WorkspaceMeta.ContainerImage` override,
// threaded through unchanged from SandboxRuntimeInfo.ContainerImage by
// BuildSandboxSpec. Empty means "use the backend's configured default
// image" (the shared boid base image, §決定 2). The userns backend
// never reads this field — it has no notion of images. When non-empty,
// containerBackend.Launch treats it as a workspace override that must
// pass the "derived from the boid base image" check (§決定 11) before
// use: `docker inspect` the image and require the
// `boid.runner_protocol` label to match, rejecting Launch otherwise.
ContainerImage string
// HomeSkeletonRoot is the absolute in-sandbox path the workspace HOME is
// mounted at, i.e. $HOME. It is the root HomeSkeletonDirs' entries are
// relative to, and — because the HOME mount is the whole of the workspace
// home volume — it is also the point that separates an in-container path
// from a path INSIDE the volume.
//
// That second role is why it is carried at all rather than being implied.
// The only repair for what HomeSkeletonDirs detects is deleting the
// offending directory from the host side (`docker volume inspect`'s
// Mountpoint, under `podman unshare` or `sudo`), and the path to give the
// operator there is <Mountpoint>/<the entry>, NOT <Mountpoint>/<the
// in-container absolute path>. Those differ by exactly this prefix, and
// naming the wrong one sends the operator to a path that does not exist:
// they delete nothing, the uid-0 directory survives, and the next job fails
// the same check — a loop the error itself caused (codex review of PR6,
// Major 2).
//
// Empty when HomeSkeletonDirs is empty. A non-empty skeleton with no root
// is a wiring bug and the runner fails the job rather than resolving the
// entries against whatever the process's cwd happens to be.
HomeSkeletonRoot string
// HomeSkeletonDirs are directories, RELATIVE to HomeSkeletonRoot, that
// must already exist and be owned by the uid the sandbox runs as before
// the harness starts. The container runner checks them and fails the job
// when one is not (internal/sandbox/runner's verifyHomeSkeleton).
//
// Relative rather than absolute so that they are the same values the rest
// of the mechanism already speaks in: dispatcher.workspaceHomeSkeletonDirs
// produces them relative to the home, the init container's prelude mkdir's
// them relative to the home, and the completion marker records them
// relative to the home. An absolute spelling here would be a fourth
// representation, convertible back only by string surgery at the point
// where it matters most (see HomeSkeletonRoot).
//
// They are the workspace HOME's bind-target ancestors — .claude and
// .claude/skills. The check exists because an ABSENT bind target is created
// by the container ENGINE, at container start, as uid 0: measured on podman
// 4.9.3 with a named-volume home and keep-id, ~/.claude comes out
// root-owned and the uid-1000 harness can no longer write
// ~/.claude/.credentials.json, which under rootless podman neither it nor
// the daemon can repair (the host-side owner is a subuid). The symptom
// without this check is not an error but a workspace whose authentication
// silently stops persisting.
//
// # Why the per-skill LEAVES are not in here
//
// The set the prelude creates also has one entry per embedded skill
// (.claude/skills/<name>), and those are deliberately excluded: each is
// itself a read-only bind target in this same Spec, so by the time this
// process runs, os.Stat on one reads the BIND SOURCE — the daemon-side
// materialized skill directory — not the directory inside the volume. A
// check that cannot observe its subject is not a weaker check, it is a
// different one, and dispatcher.homeSkeletonDirs drops any entry a mount
// covers rather than pretending otherwise. See its doc comment for what
// that leaves exposed (a stale, empty, root-owned leaf survives in the
// volume, harmlessly, until a release stops shipping that skill).
//
// Verification lives HERE rather than on the daemon side because PR6 of
// docs/plans/workspace-home-volume-persistence.md made the home a docker
// named volume: the daemon can neither stat nor repair anything inside it.
// 論点 e-2 requires the check to sit outside whatever creates these
// directories (the init container's prelude does), and the job container
// satisfies that while also being the only place that observes the state
// the harness will actually meet — after the engine's auto-creation, as the
// harness's own uid.
//
// Empty means "nothing to check": test wiring, and any sandbox with no
// workspace home (the tmpfs-HOME degrade in dispatcher.homeMounts).
HomeSkeletonDirs []string
}
Spec describes a sandbox invocation in primitives only. The sandbox layer knows nothing about Role / Task / Job / Broker / Hook — all of those are the caller's concern. Everything needed to build and run the sandbox must already be present as mounts, files, env, argv, etc.
Spec is JSON-serialized by the dispatcher to /tmp/boid-<ID>-runner-spec.json and read back by the go-native runner subcommands (runner-outer / runner-inner / runner-inner-child). All fields are exported so the default encoding/json round-trip is exact.
type StreamChunk ¶
type Symlink ¶
type Symlink struct {
LinkPath string // absolute path inside sandbox (where the symlink is created)
LinkTarget string // what the symlink points to (resolved relative to LinkPath)
}
Symlink describes a symlink to create inside the sandbox.
type TokenContext ¶
type TokenContext struct {
JobID string
TaskID string
ProjectID string
WorkspaceID string
AllowedProjectIDs []string
Role string
// ProjectDir is the project's host-side work directory. Independent of
// spec.Visibility.ProjectDir (which drives sandbox mount layout and is
// intentionally empty for gate jobs): host-side operations the broker
// performs on behalf of the sandbox (host-command cwd) have their own
// notion of "which project are we operating on" that doesn't care
// whether the sandbox itself can see the tree.
ProjectDir string
// SandboxRoot is the sandbox-internal (not host-side) root directory a
// clone-mode job's filesystem lives under — a name-scoped subdirectory
// of the neutral parent path "/workspace" (docs/plans/git-gateway-cutover.md
// PR6 cutover; workspace 親化リファクタリング, nose 2026-07-13 decision),
// set by dispatcher when spec.Visibility.Clone != nil. Unlike ProjectDir
// this is never a host path: clone-mode jobs have no host directory the
// sandbox's own filesystem corresponds to, so cwd-based authorization
// (validateBoidBuiltinCwd's entryRoot) must compare against this
// sandbox-side path instead. Empty for every non-clone job.
SandboxRoot string
}
func (TokenContext) AllowsProject ¶
func (c TokenContext) AllowsProject(projectID string) bool
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package backend defines the SandboxBackend/SandboxSession seam that separates "how a sandboxed agent process is launched and attached to" from the dispatcher's job orchestration.
|
Package backend defines the SandboxBackend/SandboxSession seam that separates "how a sandboxed agent process is launched and attached to" from the dispatcher's job orchestration. |
|
Package brokerclient holds the low-level transport for talking to the boid broker over its UNIX socket or its TCP(mTLS) listener, plus a self-contained JobDone helper.
|
Package brokerclient holds the low-level transport for talking to the boid broker over its UNIX socket or its TCP(mTLS) listener, plus a self-contained JobDone helper. |
|
Package realization translates a backend-neutral sandbox.Spec into the intermediate representation a container backend needs to build a `docker create` call: volumes/binds, tmpfs mounts, environment, working directory and argv (docs/plans/phase6-container-backend.md §PR3).
|
Package realization translates a backend-neutral sandbox.Spec into the intermediate representation a container backend needs to build a `docker create` call: volumes/binds, tmpfs mounts, environment, working directory and argv (docs/plans/phase6-container-backend.md §PR3). |
|
Package runner is the container-backend sandbox runner entry point (`boid runner-container`, runner_container_linux.go's RunContainer).
|
Package runner is the container-backend sandbox runner entry point (`boid runner-container`, runner_container_linux.go's RunContainer). |