Documentation
¶
Overview ¶
Package scaffold holds the client-independent setup documents and the setup request assembly that `seamark init` and the console share. The code moved here from internal/cli so both surfaces plan the same files; the CLI keeps its own narration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BinaryPath ¶
func BinaryPath() string
BinaryPath returns the absolute path of the running seamark binary for hook commands. A Homebrew Cellar path maps to the stable opt path so an upgrade does not break installed hooks.
The hooks invoke this exact install, whatever the PATH of the agent is. When the path cannot be resolved, the bare name is the fallback.
func Documents ¶
func Documents(gateMode string) []integration.Document
Documents returns the client-independent setup documents: the starter policy, lessons and config files, and the .gitignore carve-outs. gateMode selects the starter policy mode line.
The setup coordinator guards and writes these documents with the client documents, so one preflight covers every write. Narrate stays nil, because each surface describes an operation in its own words.
func Request ¶
func Request(reg *integration.Registry, root, binary string, setups []integration.ClientSetup, requestedGate string) (req integration.SetupRequest, gateMode string)
Request assembles the setup request that init and the console plan. requestedGate is "" to keep the installed gate mode. It returns the request and the gate mode that the starter policy uses.
Only the clients that get a gate hook in this run supply the installed mode. A client without a gate hook cannot keep a mode.
func ResolveGateMode ¶
ResolveGateMode picks the gate mode for a setup run: the requested mode, else the installed managed mode, else warn. An empty request keeps what a previous run installed, because setup must never add or remove enforcement implicitly.
func StarterPolicy ¶
StarterPolicy returns the policy scaffold for a gate mode. The template is in warn mode, and enforce swaps the one mode line. Thus `init --gate-mode enforce` writes a policy file that agrees with the hook it installs.
Types ¶
This section is empty.