Documentation
¶
Overview ¶
Package sandbox is the declaration of what a program may hold: a named, stack-deployed bundle that says which secrets a piece of work is handed and under which names. A run grant (chassis/authn) names sandboxes; the chassis opens one when a rule starts a command with `WITH grant, sandbox` or when a program the work runs asks for it through `txco sandbox`. The program never picks a secret by name: it gets what the sandbox says.
A stack declares a sandbox as one small YAML file under the reserved SANDBOXES/ subtree, beside OUTLETS/ and DATASETS/:
OPS/<stack>/SANDBOXES/<name>.yaml
The file deploys with `txco apply` as a stack_files row (inline on a single node, fingerprint + CAS on the fleet — the OUTLETS/ treatment) and is validated at apply; nothing is released until a run grant that names the sandbox is opened.
This file is the leaf layer: the reserved-path vocabulary, with no dependency on stores, so the CLI, the admin producer and the control-event applier can import it cheaply.
Index ¶
Constants ¶
const ( // MaxEnv bounds the variables one sandbox sets. MaxEnv = 32 // MaxDescription bounds the free-text note. MaxDescription = 256 )
Ceilings on one declaration. A run grant holds at most a handful of sandboxes, each a handful of variables; chassis/authn bounds the row.
const ( Dir = "SANDBOXES" DeclExt = ".yaml" )
Reserved top-level directory and the declaration extension.
const KindSecret = "secret"
Reference kinds. A reference is `<kind>:<name>`; `secret:` is the one kind today, the secret store's name grammar (chassis/secrets).
const ReservedVarPrefix = "TXCO_"
ReservedVarPrefix names the variables the chassis sets itself when it starts a program under a run grant (TXCO_RUN, TXCO_RUN_GRANT, …). A sandbox may not set one.
Variables ¶
var ErrNotDeclared = errors.New("sandbox: not declared")
ErrNotDeclared: the stack's active version has no SANDBOXES/<name>.yaml.
Functions ¶
func DeclNames ¶
DeclNames returns the keys of a declaration map, sorted — for "unknown sandbox X, have [a b c]" messages and deterministic validation order.
func IsSandboxPath ¶
IsSandboxPath reports whether a stack_files path lives under SANDBOXES/.
func Name ¶
Name returns the sandbox a declaration path belongs to: "SANDBOXES/github.yaml" → "github". It returns "" when the path is not under SANDBOXES/, is nested, has the wrong extension, or names an invalid sandbox — the same shape validateStackFilePath enforces at upload.
Types ¶
type Decl ¶
Decl is one SANDBOXES/<name>.yaml: what a program that opens the sandbox is handed, under which names. Only what the chassis enforces is declared here; a key it does not enforce is a deploy error, not a promise.
description: what a deploy step holds # optional env: GH_TOKEN: secret:GITHUB_PAT # variable: reference
Parsed strictly: an unknown key is a deploy error, not a silent ignore.