Documentation
¶
Overview ¶
Package core holds the CLI's own identity and its exit and error contract. It depends on nothing but the standard library.
Index ¶
Constants ¶
const BootstrapID = "gtt-bootstrap"
BootstrapID is the only Bootstrap identity this CLI operates.
const BootstrapPin = "1.6.0"
BootstrapPin is the exact GTT Bootstrap release this CLI release ships with. Pinning the CLI therefore pins the Bootstrap. It is resolved from its release tag (BootstrapTag), never from a branch head; another release is used only when the human names it explicitly.
const OutputSchema = 1
OutputSchema is the version of every JSON document the CLI emits.
Variables ¶
var BootstrapSchemas = []int{1}
BootstrapSchemas are the Bootstrap schema versions this CLI understands.
var CLICapabilities = []string{"contract.negotiate.v1", "operation.execute.v1"}
CLICapabilities are the capability ids this CLI declares to a Bootstrap during negotiation.
var ErrCancelled = &Error{Code: ExitCancelled, What: "Cancelled."}
ErrCancelled is returned when the human declines.
var SupportedCapabilities = map[string]int{
"project.detect": 1,
"ade.detect": 1,
"ade.install": 1,
"template.materialize": 1,
"methodology.profile": 1,
"source.select": 1,
"validation": 1,
"status": 1,
"freeze": 1,
"session-context": 1,
"export-policy": 1,
"recovery": 1,
"guard": 1,
"retrieval": 1,
"developer-experience": 1,
}
SupportedCapabilities maps each Bootstrap capability this CLI consumes to the version it implements. A Bootstrap that offers one of these at another version is refused; a capability not listed here is simply not used.
var Version = baseVersion
Version is the CLI release. Each release pins one Bootstrap release (BootstrapPin) with the same number: GTT is released as a suite (ADR-005), and compatibility is still negotiated, never assumed. Release builds set it with -ldflags; `go install module@vX.Y.Z` takes it from the module version; a plain source build keeps this base value.
Functions ¶
func BootstrapTag ¶ added in v1.1.0
BootstrapTag is the release tag of a Bootstrap version.
func ParseSemver ¶
ParseSemver parses MAJOR.MINOR.PATCH; ok is false for anything else.
Types ¶
type Error ¶
type Error struct {
Code ExitCode
What string
Why string
Next string
Unmodified bool // true when the project is known to be untouched
Err error
}
Error is a user-facing error: what happened, why, and what to do next.
type ExitCode ¶
type ExitCode int
ExitCode is the v1.0 exit contract.
const ( ExitOK ExitCode = 0 ExitFailure ExitCode = 1 // validation / operational failure ExitIncompatible ExitCode = 2 // CLI/Bootstrap incompatibility ExitUsage ExitCode = 3 // invalid invocation ExitCancelled ExitCode = 4 // user cancellation ExitConflict ExitCode = 5 // project state conflict ExitIntegrity ExitCode = 6 // Bootstrap integrity failure )