app

package
v1.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 36 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package app holds the use cases of the CLI. It reaches the Bootstrap, the terminal, Git and processes only through ports, and never decides what GTT means: it resolves, selects, invokes and reports.

Index

Constants

View Source
const (
	ChangeInitial    = methodology.Initial
	ChangeRelaxed    = methodology.Relaxed
	ChangeReinforced = methodology.Reinforced
)

Directions of a plan change, as the CLI renders them.

View Source
const (
	DoorSonar = "sonar" // the local server of `gtt sonar`: the page of the human
	DoorMCP   = "mcp"   // `gtt mcp`: Claude, the agent, reading the portfolio over stdio. Read only
)

Door names.

View Source
const (
	OpBacklogSet    = "backlog.set"
	OpInboxAdd      = "inbox.add"
	OpPendingAnswer = "pending.answer"
	OpSonarPrefs    = "sonar.prefs"
)

Operations the Sonar server accepts, in the order of the order's table 2.1.

View Source
const (
	OpSonarSnapshot = "sonar.snapshot"
	OpFindingsList  = "findings.list"
	OpCodeMap       = "code.map"
)

Operations the MCP door reads: three declared operations that change nothing.

View Source
const (
	ToolProjects = "gtt_projects"
	ToolFindings = "gtt_findings"
	ToolReady    = "gtt_ready"
	ToolNeedsYou = "gtt_needs_you"
	ToolEpic     = "gtt_epic"
	ToolActivity = "gtt_activity"
	ToolCode     = "gtt_code"
)

The seven tools of `gtt mcp`, in the order the order's table 12.1 lists them.

View Source
const (
	Pass            = "PASS"
	Warn            = "WARN"
	Fail            = "FAIL"
	CannotDetermine = "CANNOT DETERMINE"
)

Check levels of `gtt doctor`.

View Source
const (
	// MCPPageMax is the most items a tool answers in one page.
	MCPPageMax = 50
	// MCPNeedsFindings and MCPNeedsCode are the Bootstrap releases that bring what the tools read.
	MCPNeedsFindings = "1.25"
	MCPNeedsCode     = "1.26"
)
View Source
const DefaultSourceType = "design-document"

DefaultSourceType is the Bootstrap source type recorded when the human did not state one.

View Source
const (

	// SonarServeNeeds is the Bootstrap release that brings sonar.serve.v1, as the page and the CLI say it.
	SonarServeNeeds = "1.24"
)

Variables

MCPToolOrder lists the tools as they are offered.

Functions

func DoorAllows added in v1.26.0

func DoorAllows(door, op string) bool

DoorAllows reports whether a door may reach an operation.

func DoorOperations added in v1.26.0

func DoorOperations(door string) []string

DoorOperations lists what a door may reach (a copy).

func HumanAuthorityAllowed added in v1.26.0

func HumanAuthorityAllowed(op string) bool

HumanAuthorityAllowed reports whether a human-authority operation is one a door may carry at all.

func LoadSonarSecret added in v1.26.0

func LoadSonarSecret(dir string) ([]byte, error)

LoadSonarSecret reads ~/.gtt/sonar/secret, creating it (mode 0600, in a 0700 folder) the first time.

func MCPTableProblems added in v1.26.0

func MCPTableProblems(table map[string][]string, decl map[string]ports.Operation, partial bool) []string

MCPTableProblems walks a table of tools and operations against what the Bootstrap declares and returns what breaks the rule of the order (12.1): a tool may reach no operation that has human authority, none that mutates, and no ratification verb. An operation the Bootstrap does not declare is a problem too, unless the caller says declarations are partial (an older Bootstrap).

func MCPToolOperations added in v1.26.0

func MCPToolOperations(tool string) []string

MCPToolOperations lists what a tool may reach (a copy).

func MCPToolTable added in v1.26.0

func MCPToolTable() map[string][]string

MCPToolTable is a copy of the table, for the tests that walk it.

func MintSonarCode added in v1.26.0

func MintSonarCode(secret []byte, now time.Time) string

MintSonarCode makes a one-time code: when it was made, a nonce, and the signature of both. It needs the secret, so only a process that can read ~/.gtt/sonar/ can make one.

func ParseSource

func ParseSource(arg string) lifecycle.Source

ParseSource splits a "path[:type]" argument.

func RatificationVerb added in v1.26.0

func RatificationVerb(op string) bool

RatificationVerb reports whether an operation is the ratification of something: approving, promoting, running, undoing, freezing, adopting an ADR. No door may reach one; the page shows the command to copy.

func ReadOperationsFile added in v1.26.0

func ReadOperationsFile(path string) (map[string]ports.Operation, error)

ReadOperationsFile reads the declared operations of a Bootstrap's operations.json.

func SonarConfigPath added in v1.19.0

func SonarConfigPath() string

SonarConfigPath is the portfolio list: ~/.config/gtt/sonar.json (XDG_CONFIG_HOME when set). It is the configuration of Sonar, not the state of a project.

func StageHeading added in v1.23.0

func StageHeading(stage string) string

StageHeading is the heading of a stage with its count as a format, so the translator can give it whole.

func StageOrder added in v1.23.0

func StageOrder() []string

StageOrder lists the stages in pipeline order.

Types

type AgentsSyncResult

type AgentsSyncResult struct {
	Schema      int                `json:"schema"`
	Environment agents.Environment `json:"environment"`
	Synced      []string           `json:"synchronized"`
	Added       []string           `json:"added"`
	Plan        string             `json:"plan,omitempty"`
	Source      string             `json:"source,omitempty"`
	Changed     bool               `json:"changed"`
}

AgentsSyncResult reports a synchronisation.

type App

type App struct {
	Factory   ports.BootstrapFactory
	Resolver  ports.Resolver
	Installer ports.Installer
	Signer    ports.ReleaseSigner
	Runner    ports.Runner
	Git       ports.Git
	Prompt    ports.Prompter
	Report    ports.Reporter
	Upgrader  ports.SelfUpgrader
	Spawner   ports.Spawner // detached processes (the Sonar server and its watchers); nil where unavailable

	Home      string // user-level GTT home
	Cwd       string
	AssumeYes bool // the human pre-answered confirmations with --yes
	// Lang is the interaction language of this invocation; nil is English.
	Lang *core.Language
	// contains filtered or unexported fields
}

App is the set of use cases, wired by the composition root.

func (*App) AdrAdopt added in v1.23.0

func (a *App) AdrAdopt(ctx context.Context, file, by string) (InboxResult, error)

AdrAdopt takes an ADR written by hand in gtt-domain/adr/ into the inbox (F5).

func (*App) AdrNew added in v1.23.0

func (a *App) AdrNew(ctx context.Context, title, file, by string) (InboxResult, error)

AdrNew starts a draft of an ADR (F4): the architect's own text, in the inbox as an IDEA.

func (*App) AgentsCheck

func (a *App) AgentsCheck(ctx context.Context) (agents.Environment, error)

AgentsCheck reports the agent environment. Nothing is modified.

func (*App) AgentsSync

func (a *App) AgentsSync(ctx context.Context, add []string, opts ResolveOptions) (AgentsSyncResult, error)

AgentsSync restores the managed context of declared agents from the authorised source: the Bootstrap catalog the project was installed from. It is idempotent. `add` names agents the human wants to incorporate.

func (*App) Approve added in v1.19.0

func (a *App) Approve(ctx context.Context, epic string) (StepResult, error)

Approve approves an Epic and its design together: the human's act, after seeing it. Approving what is already approved is a success that changes nothing.

func (*App) ArtifactNextID

func (a *App) ArtifactNextID(ctx context.Context, kind, requested string) (NextID, error)

ArtifactNextID asks the Bootstrap for the next free artifact id.

func (*App) Audit

func (a *App) Audit(ctx context.Context) (AuditResult, error)

Audit collects traceability information from the Bootstrap and from the CLI's own records.

func (*App) AutoUpgrade added in v1.23.0

func (a *App) AutoUpgrade(ctx context.Context, now time.Time) string

AutoUpgrade looks for a newer release (cached) and returns the one line to say, or "". In an interactive terminal, with the choice on, it also replaces the binary by the same verified path as `gtt upgrade`.

func (*App) AutoUpgradeOn added in v1.23.0

func (a *App) AutoUpgradeOn() bool

AutoUpgradeOn is true unless the human turned it off (upgrade --auto off, or GTT_NO_AUTO_UPGRADE).

func (*App) ChangeRequest added in v1.7.0

func (a *App) ChangeRequest(ctx context.Context, o ChangeOptions) (ChangeState, error)

ChangeRequest records the human's change request through the Bootstrap. What it does not get from flags it asks; without a terminal, the change and its reason are required. The agent is told to process it through the session's next action - it drafts a proposal and decides nothing.

func (*App) ChangeShow added in v1.7.0

func (a *App) ChangeShow(ctx context.Context) (ChangeState, error)

ChangeShow is `gtt change show`.

func (*App) Check added in v1.7.0

func (a *App) Check(ctx context.Context) (CheckResult, error)

Check verifies the code against the dependency rules of the ratified development method, with the language's own tool. It never corrects code or context: a forbidden dependency is reported as a conflict (exit 1). Without an adapter for the language the method is reported declared-only; with an adapter whose tool is not installed, the result cannot be determined (exit 7) - it is never reported as a pass.

func (*App) Clean

func (a *App) Clean(ctx context.Context, noSnapshot bool) (CleanResult, error)

Clean removes GTT from the current project: exactly the ownership set the Bootstrap reports, and only after an explicit human confirmation.

func (*App) ConfigLanguage

func (a *App) ConfigLanguage(ctx context.Context, lang string) error

ConfigLanguage records the interaction language through the Bootstrap.

func (*App) ConfigPrimary

func (a *App) ConfigPrimary(ctx context.Context, id string) (string, error)

ConfigPrimary changes the Primary ADE explicitly. The Bootstrap validates the change; other integrations are not reinstalled or removed.

func (*App) ContinueAs added in v1.28.0

func (a *App) ContinueAs(ctx context.Context, args []string) (code int, ok bool)

ContinueAs runs the same command with the gtt that has just replaced this one, on the same terminal. GTT_SELF_UPDATED keeps it from looking again. ok is false when the new binary could not be started: the caller then says to run it again.

func (*App) DeliveryPlanFor added in v1.10.0

func (a *App) DeliveryPlanFor(ctx context.Context, lanes bool) (DeliveryPlan, error)

DeliveryPlanFor is `gtt plan [--lanes]`.

func (*App) DeliveryReportFor added in v1.10.0

func (a *App) DeliveryReportFor(ctx context.Context, epic string) (DeliveryReport, error)

DeliveryReportFor is `gtt report [--epic]`.

func (*App) DeliveryReview added in v1.14.0

func (a *App) DeliveryReview(ctx context.Context, lang string, o ReviewOptions) (DeliverySize, error)

DeliveryReview measures, then records the human's answer: from the flags, or by asking on a terminal. With neither it only reports, and says how to answer.

func (*App) DeliverySet added in v1.10.0

func (a *App) DeliverySet(ctx context.Context, o DeliverySetOptions) (DeliveryState, error)

DeliverySet is `gtt delivery set`: an operating answer, allowed at any time.

func (*App) DeliveryShow added in v1.10.0

func (a *App) DeliveryShow(ctx context.Context) (DeliveryState, error)

DeliveryShow is `gtt delivery`: read-only.

func (*App) DeliverySizeFor added in v1.14.0

func (a *App) DeliverySizeFor(ctx context.Context, lang string) (DeliverySize, error)

DeliverySizeFor is the read-only measurement.

func (*App) DesignReset added in v1.8.0

func (a *App) DesignReset(ctx context.Context, opts ResolveOptions) (DesignResetResult, error)

DesignReset starts the design over, before the first freeze: the governed context, Epic designs, ADRs and backlog go back to the Bootstrap's templates, and the elicitation working copies and SOURCE-BRIEF go away. Setup choices and recorded sources stay. Everything changed is copied to a local backup first. After a freeze there is no reset: a change to the ratified design is a change request.

func (*App) DevMethodList added in v1.7.0

func (a *App) DevMethodList(ctx context.Context, lang string) (DevMethodCatalog, error)

DevMethodList is `gtt dev-method list`.

func (*App) DevMethodShow added in v1.7.0

func (a *App) DevMethodShow(ctx context.Context) (DevMethodState, error)

DevMethodShow is `gtt dev-method`: read-only.

func (*App) Doctor

func (a *App) Doctor(ctx context.Context) (DoctorResult, error)

Doctor runs CLI-native operational diagnostics. It reports; it never repairs anything.

func (*App) ExportClean

func (a *App) ExportClean(ctx context.Context, dest string) (ExportResult, error)

ExportClean writes a clean delivery copy. The development project is not modified; what is excluded is exactly what the Bootstrap policy lists.

func (*App) FindProjects added in v1.19.0

func (a *App) FindProjects(root string) []string

FindProjects lists the GTT projects under root, to two levels, without descending into a project.

func (*App) Freeze

func (a *App) Freeze(ctx context.Context) (string, error)

Freeze is a facade over the Bootstrap freeze. Ratification is a human act: it is asked in a terminal and cannot be pre-answered.

func (*App) IdeaAdd added in v1.19.0

func (a *App) IdeaAdd(ctx context.Context, o IdeaAddOptions) (IdeaResult, error)

IdeaAdd writes an idea (F1) or a change request (F2) into the inbox, exactly as given: the text travels in a file, so a newline, a quote or a dollar sign cannot change what is stored. The Bootstrap shows what it will create and the human confirms (--yes pre-authorizes). A Bootstrap from before the inbox only keeps plain ideas.

func (*App) IdeaDrop added in v1.19.0

func (a *App) IdeaDrop(ctx context.Context, ref string) (IdeaResult, error)

func (*App) IdeaPark added in v1.19.0

func (a *App) IdeaPark(ctx context.Context, ref string) (IdeaResult, error)

IdeaPark and IdeaDrop are the human's: set an idea aside, or discard it.

func (*App) Ideas added in v1.19.0

func (a *App) Ideas(ctx context.Context, all bool) (IdeaList, error)

Ideas lists the ideas (all=true adds the dropped ones).

func (*App) Inbox added in v1.23.0

func (a *App) Inbox(ctx context.Context, q InboxQuery) (InboxList, error)

Inbox lists the entries (all=true adds the closed, parked and rejected ones).

func (*App) InboxDrop added in v1.23.0

func (a *App) InboxDrop(ctx context.Context, ref, reason string) (InboxResult, error)

InboxDrop discards an idea (T21).

func (*App) InboxMigrate added in v1.23.0

func (a *App) InboxMigrate(ctx context.Context) (InboxMigration, error)

InboxMigrate is `gtt inbox migrate`: the migration of a 1.22 project, on its own.

func (*App) InboxPark added in v1.23.0

func (a *App) InboxPark(ctx context.Context, ref, reason string) (InboxResult, error)

InboxPark sets an entry aside without going through its REV (T21).

func (*App) InboxPriority added in v1.23.0

func (a *App) InboxPriority(ctx context.Context, ref, priority string) (InboxResult, error)

InboxPriority changes the priority of an accepted entry (T22): urgent, normal or low (or urgente, baja).

func (*App) InboxReject added in v1.23.0

func (a *App) InboxReject(ctx context.Context, ref, reason string) (InboxResult, error)

InboxReject discards a proposal without going through its REV (T21).

func (*App) InboxReopen added in v1.23.0

func (a *App) InboxReopen(ctx context.Context, ref string) (InboxResult, error)

InboxReopen brings a parked entry back (T20).

func (*App) InboxShow added in v1.23.0

func (a *App) InboxShow(ctx context.Context, ref string) (InboxEntryView, error)

InboxShow is `gtt inbox show REF`: the entry with its trail.

func (*App) Init

func (a *App) Init(ctx context.Context, o InitOptions) (InitResult, error)

Init is the primary orchestration workflow.

func (*App) Inspect

func (a *App) Inspect(ctx context.Context) (InspectResult, error)

Inspect shows where things are. It does not interpret architecture.

func (*App) LaunchPrimary

func (a *App) LaunchPrimary(ctx context.Context) error

LaunchPrimary starts the Primary ADE in the project. It is only ever called after the human asked for it.

func (*App) MCPCall added in v1.26.0

func (a *App) MCPCall(ctx context.Context, tool string, args MCPArgs) (MCPAnswer, error)

MCPCall answers one tool. It does not fail for what a repo cannot give (an older Bootstrap, an unreadable snapshot): that is a normal answer that says so. An error is a misuse of the tool.

func (*App) MethodCheck

func (a *App) MethodCheck(ctx context.Context) (DoctorResult, error)

MethodCheck verifies that the plan configuration is coherent: a plan is selected and supported, every operating-policy value is one the CLI can execute, and the Bootstrap's own contract and validation checks pass.

func (*App) MethodSet

func (a *App) MethodSet(ctx context.Context, id, adr string) (MethodResult, error)

MethodSet records a plan chosen by the human. Whether the transition is allowed is the Bootstrap's decision; a refusal is reported, not overridden.

func (*App) MethodShow

func (a *App) MethodShow(ctx context.Context) (MethodResult, error)

MethodShow reports the Autonomy Profile in force, in the Bootstrap's words.

func (*App) OpenPage added in v1.19.0

func (a *App) OpenPage(ctx context.Context, target string) error

OpenPage opens the generated page in the default browser. It is a convenience: when it cannot, the path printed by the command is enough.

func (*App) PendingEvents added in v1.12.0

func (a *App) PendingEvents(ctx context.Context, all bool) (PendingList, error)

PendingEvents lists what waits for the human (all=true adds the marked ones).

func (*App) PendingRespond added in v1.12.0

func (a *App) PendingRespond(ctx context.Context, ref, reply string) (PendingAnswer, error)

PendingRespond is the human's act. It shows what it will write, then writes it through pending.answer with confirmed_by_human. `ok` alone approves every decision that is still pending; there is no --yes and an agent is denied it.

func (*App) ProjectBootstrapNotice added in v1.23.0

func (a *App) ProjectBootstrapNotice(ctx context.Context, now time.Time) string

ProjectBootstrapNotice says, once a day per project and without network, that the Bootstrap of the project you are in is older than the one this gtt ships (`gtt update` is the human's act that brings it up).

func (*App) Promote added in v1.7.0

func (a *App) Promote(ctx context.Context, set string) (StepResult, error)

Promote applies a staged promotion set: the human's act, after seeing it.

func (*App) ProposalShow added in v1.7.0

func (a *App) ProposalShow(ctx context.Context, name string) (ProposalView, error)

ProposalShow is `gtt proposals show <name>`.

func (*App) ProposalWithdraw added in v1.7.0

func (a *App) ProposalWithdraw(ctx context.Context, name, by string) (StepResult, error)

ProposalWithdraw archives a draft nobody will promote (a human act).

func (*App) Proposals added in v1.7.0

func (a *App) Proposals(ctx context.Context) (ProposalsResult, error)

Proposals is `gtt proposals`.

func (*App) ReleaseKeygen

func (a *App) ReleaseKeygen(dir, id string) (ports.KeyPair, error)

ReleaseKeygen creates a release signing key pair in dir.

func (*App) ReleaseSign

func (a *App) ReleaseSign(ctx context.Context, root, keyFile string) (ports.SignResult, error)

ReleaseSign signs a Bootstrap package directory with a release key. It is a publisher's operation: it writes only the package's signature file.

func (*App) Resume

func (a *App) Resume(ctx context.Context) (ResumeResult, error)

Resume reconstructs operational context from actual state: the Bootstrap derives it from the repository, never from an agent's recollection.

func (*App) RunExecute added in v1.11.0

func (a *App) RunExecute(ctx context.Context, ref string) (RunResult, error)

RunExecute is the human's act. It shows the steps, asks once when the run changes something (never pre-answered: there is no --yes here), and executes through run.execute with confirmed_by_human. A run that changes nothing needs no question and runs without a terminal.

func (*App) RunPending added in v1.11.0

func (a *App) RunPending(ctx context.Context) (RunList, error)

RunPending lists the runs waiting for the human.

func (*App) RunReview added in v1.11.0

func (a *App) RunReview(ctx context.Context, ref string) (RunCheck, error)

RunReview is the Bootstrap's review of one run, or of all of them.

func (*App) RunShow added in v1.11.0

func (a *App) RunShow(ctx context.Context, ref string) (RunItem, error)

RunShow is one pending run in full.

func (*App) SelfUpgrade added in v1.28.0

func (a *App) SelfUpgrade(ctx context.Context) (upgraded, note string)

SelfUpgrade is the first half of `gtt update`: the Bootstrap a gtt installs is the one it ships with, so one command that brings the whole suite up starts by bringing gtt itself up. It returns the release gtt was replaced by ("" when it did not change) and one line to say, "" when there is nothing to say. It never fails an update: not reaching the network, or a channel gtt cannot replace itself in, is said in a line and the update goes on with the Bootstrap this gtt ships. It runs the same verified path as `gtt upgrade`.

func (*App) SetAutoUpgrade added in v1.23.0

func (a *App) SetAutoUpgrade(on bool) error

SetAutoUpgrade records the human's choice: whether gtt replaces itself when it finds a newer release.

func (*App) SnapshotCreate

func (a *App) SnapshotCreate(ctx context.Context) (snapshot.Info, error)

SnapshotCreate is `gtt snapshot create`.

func (*App) SnapshotList

func (a *App) SnapshotList(ctx context.Context) []snapshot.Info

SnapshotList is `gtt snapshot list`.

func (*App) Sonar added in v1.19.0

func (a *App) Sonar(ctx context.Context, ro ResolveOptions) (SonarResult, error)

Sonar generates the page of the current repo. A Bootstrap without sonar.v1 answers in one line and the command ends well: nothing is broken, the repo only needs an update.

func (*App) SonarAdd added in v1.19.0

func (a *App) SonarAdd(_ context.Context, path string) (SonarList, error)

SonarAdd adds a repo to the portfolio list. The repo is not touched.

func (*App) SonarAll added in v1.19.0

func (a *App) SonarAll(ctx context.Context, ro ResolveOptions) (SonarResult, error)

SonarAll builds the portfolio page: each repo answers with its own Bootstrap (sonar.snapshot), and the newest of those Bootstraps draws the page (sonar.render). A repo that cannot answer is a row that says "update GTT in this repo"; the rest goes on.

func (*App) SonarFolder added in v1.19.0

func (a *App) SonarFolder(ctx context.Context, root string, ro ResolveOptions) (SonarResult, error)

SonarFolder shows every GTT project found under a folder: no list to keep, just go there and run it.

func (*App) SonarListRepos added in v1.19.0

func (a *App) SonarListRepos(ctx context.Context) (SonarList, error)

SonarListRepos lists the portfolio with how each repo stands (read only).

func (*App) SonarOpen added in v1.26.0

func (a *App) SonarOpen(ctx context.Context, o SonarOpenOptions) (SonarResult, error)

SonarOpen starts the server (or finds the one that runs), tells it which repos to show, and opens the browser with a one-time code that the page exchanges for the human's cookie.

func (*App) SonarRemove added in v1.19.0

func (a *App) SonarRemove(_ context.Context, path string) (SonarList, error)

SonarRemove takes a repo out of the portfolio list. The repo is not touched.

func (*App) SonarServe added in v1.26.0

func (a *App) SonarServe(ctx context.Context) error

SonarServe is the daemon: it listens on 127.0.0.1, writes {pid, port}, keeps the watchers, and closes after 8 hours without use or when told to. It returns when the server is closed.

func (*App) SonarStop added in v1.26.0

func (a *App) SonarStop(_ context.Context) (SonarResult, error)

SonarStop closes the server that runs, if any.

func (*App) SourcesApply

func (a *App) SourcesApply(ctx context.Context, paths []string) (SourcesResult, error)

SourcesApply processes the initial MDs. Paths named by the human are thereby selected.

func (*App) SourcesList

func (a *App) SourcesList(ctx context.Context) (SourcesResult, error)

SourcesList reports the tracking state without changing anything.

func (*App) Status

func (a *App) Status(ctx context.Context, withValidation bool) (StatusResult, error)

Status reports deterministic project state. It modifies nothing.

func (*App) Sync

func (a *App) Sync(ctx context.Context, opts ResolveOptions) (SyncResult, error)

Sync does the deterministic upkeep in one run: agent context, initial source tracking, and the Bootstrap's own maintenance (protection registry, index, validation). Nothing here is a governed decision.

func (*App) Undo added in v1.7.0

func (a *App) Undo(ctx context.Context, set string) (StepResult, error)

Undo puts back what the last promotion replaced. It is never an unfreeze: when that promotion froze, the Bootstrap records a new freeze over the earlier state and keeps the history.

func (*App) Update

func (a *App) Update(ctx context.Context, o UpdateOptions) (UpdateResult, error)

Update replaces the Bootstrap package content of a project with another release, transactionally. Project state - ADEs, Primary, plan, language, sources, governed artifacts - is not package content and is not touched; a package file changed since install is preserved: its difference is shown, and it is replaced only when the human confirms it in a terminal (--yes does not).

func (*App) Upgrade added in v1.23.0

func (a *App) Upgrade(ctx context.Context, check bool, to string) (UpgradeResult, error)

Upgrade replaces this binary with a newer release (or, with an explicit target, any release). It touches no project. check only reports. The human confirms unless --yes was given.

func (*App) Validate

func (a *App) Validate(ctx context.Context) (ValidateResult, error)

Validate delegates to the Bootstrap's single validation entry point. It is non-interactive, launches no ADE and modifies no governed artifact.

func (*App) Version

func (a *App) Version(ctx context.Context) VersionResult

Version reports the CLI release, the Bootstrap release it pins and, in a GTT project, the installed Bootstrap.

type AuditResult

type AuditResult struct {
	Schema     int                   `json:"schema"`
	Generated  string                `json:"generated_at"`
	Project    string                `json:"project"`
	CLI        string                `json:"cli_version"`
	Bootstrap  BootstrapInfo         `json:"bootstrap"`
	Resolution *lifecycle.Resolution `json:"resolution,omitempty"`
	Status     json.RawMessage       `json:"status"`
	Sources    json.RawMessage       `json:"sources"`
	Tracking   SourcesResult         `json:"initial_sources"`
	Validation validation            `json:"validation"`
	Snapshots  []snapshot.Info       `json:"recovery_snapshots"`
	History    []lifecycle.Event     `json:"history"`
	View       bootstrapStatus       `json:"-"`
	ADENames   map[string]string     `json:"ade_names"`
}

AuditResult is `gtt audit`: operational traceability, not governance.

type BootstrapCheck added in v1.1.0

type BootstrapCheck struct {
	Version  string `json:"version"`  // installed
	Required string `json:"required"` // the release this run requires
	Pinned   string `json:"pinned"`   // the release this CLI ships with
	Verified bool   `json:"verified"`
	// Modified are package files changed locally since they were installed;
	// Missing are package files that are gone. Neither is ever repaired
	// without the human's confirmation.
	Modified []string `json:"modified_locally,omitempty"`
	Missing  []string `json:"missing,omitempty"`
}

BootstrapCheck is what `gtt init` found when a Bootstrap was already in the project.

type BootstrapInfo

type BootstrapInfo struct {
	ID             string `json:"id"`
	Version        string `json:"version"`
	Schema         int    `json:"schema"`
	Channel        string `json:"channel"`
	ScaffoldLayout int    `json:"scaffold_layout"`
	Canon          string `json:"canon"`
	Compatibility  string `json:"compatibility"`
}

BootstrapInfo identifies the Bootstrap a project runs.

type BootstrapPin added in v1.1.0

type BootstrapPin struct {
	Version string `json:"version"`
	Tag     string `json:"tag"`
}

BootstrapPin names the Bootstrap release a CLI release ships with.

type ChangeOptions added in v1.7.0

type ChangeOptions struct {
	Change, Reason, Trigger, Scope, Impact, Risk, Priority, By string
	Replace                                                    bool
}

ChangeOptions are the request fields given on the command line.

type ChangeState added in v1.7.0

type ChangeState struct {
	Schema    int               `json:"schema"`
	State     string            `json:"state"` // absent | empty | pending | processed
	ID        string            `json:"id"`
	Fields    map[string]string `json:"fields"`
	Proposals []string          `json:"proposals"`
	// Primary is the ADE that will be told to process it (via the session's next action).
	Primary string `json:"primary,omitempty"`
	// Output is what the Bootstrap said when it recorded the request.
	Output string `json:"output,omitempty"`
}

ChangeState is the change request as the Bootstrap reads it.

type Check

type Check struct {
	Name   string `json:"name"`
	Level  string `json:"level"`
	Detail string `json:"detail,omitempty"`
}

Check is one diagnostic.

type CheckResult added in v1.7.0

type CheckResult struct {
	Schema int `json:"schema"`
	// Status: pass | conflict | declared-only | open | not-declared | cannot-determine.
	Status       string                 `json:"status"`
	Packs        []string               `json:"packs"`
	Declared     string                 `json:"declared_verification,omitempty"` // what the Method Lock declares
	Verification string                 `json:"verification"`                    // what this run actually verified
	Language     string                 `json:"language,omitempty"`
	Adapter      string                 `json:"adapter,omitempty"`
	Supported    []string               `json:"supported_languages"`
	Checked      []string               `json:"checked_rules"`
	NotInMap     []string               `json:"rules_not_in_map,omitempty"`
	AuditOnly    []string               `json:"audit_only_rules,omitempty"`
	Conflicts    []conformance.Conflict `json:"conflicts"`
	Note         string                 `json:"note,omitempty"`
}

CheckResult is `gtt check`: Method Conformance of the code.

type CleanResult

type CleanResult struct {
	Schema   int      `json:"schema"`
	Removed  []string `json:"removed"`
	Kept     []string `json:"kept"`
	Snapshot string   `json:"snapshot,omitempty"`
}

CleanResult is `gtt clean`.

type DeliveryBaseline added in v1.14.0

type DeliveryBaseline struct {
	At          string   `json:"at"`
	OpenStories int      `json:"open_stories"`
	RemainingH  *float64 `json:"remaining_h"`
}

DeliveryBaseline is the size when the human declared the plan.

type DeliveryCalibration added in v1.10.0

type DeliveryCalibration struct {
	Measured     int      `json:"measured"`
	Needed       int      `json:"needed"`
	Uncalibrated bool     `json:"uncalibrated"`
	Ratio        *float64 `json:"ratio"`
}

DeliveryCalibration says how far the estimates are measured.

type DeliveryChoice added in v1.14.0

type DeliveryChoice struct {
	ID    string `json:"id"`
	Label string `json:"label"`
}

DeliveryChoice is one way forward the Bootstrap offers in the review.

type DeliveryFloor added in v1.16.0

type DeliveryFloor struct {
	Declared bool     `json:"declared"`
	MinH     *float64 `json:"min_h"`
	State    string   `json:"state"`
}

DeliveryFloor is the minimum the human declared, if any.

type DeliveryFront added in v1.10.0

type DeliveryFront struct {
	Lane      string   `json:"lane"`
	Owners    []string `json:"owners"`
	Epics     []string `json:"epics"`
	Touches   []string `json:"touches"`
	DependsOn []string `json:"depends_on"`
	DoneWhen  []string `json:"done_when"`
	Worktree  string   `json:"worktree"`
}

DeliveryFront is one front of `gtt plan --lanes`.

type DeliveryGrowth added in v1.14.0

type DeliveryGrowth struct {
	StoriesAdded int  `json:"stories_added"`
	StoriesPct   *int `json:"stories_pct"`
	HoursPct     *int `json:"hours_pct"`
}

DeliveryGrowth is the change since the baseline.

type DeliveryLever added in v1.14.0

type DeliveryLever struct {
	Epic   string  `json:"epic"`
	SavesH float64 `json:"saves_h"`
	Lever  string  `json:"lever"`
}

DeliveryLever is one thing the plan says could shorten the work.

type DeliveryOption added in v1.10.0

type DeliveryOption struct {
	ID          string `json:"id"`
	Label       string `json:"label"`
	Recommended bool   `json:"recommended"`
	Days        int    `json:"days"`
}

DeliveryOption is one answer.

type DeliveryPlan added in v1.10.0

type DeliveryPlan struct {
	Schema      int                 `json:"schema"`
	Supported   bool                `json:"supported"`
	Profile     string              `json:"profile"`
	Calibration DeliveryCalibration `json:"calibration"`
	Lanes       any                 `json:"lanes"`
	Chain       []string            `json:"chain"`
	ChainHours  float64             `json:"chain_hours"`
	Days        int                 `json:"days"`
	ETA         string              `json:"eta"`
	Deadline    string              `json:"deadline"`
	Fits        *bool               `json:"fits"`
	Late        *struct {
		Days int `json:"late_days"`
	} `json:"late"`
	Levers []struct {
		Epic     string  `json:"epic"`
		SavesH   float64 `json:"saves_h"`
		Lever    string  `json:"lever"`
		Critical bool    `json:"on_critical_chain"`
	} `json:"levers"`
	Unestimated []string `json:"unestimated"`
	OverCap     []string `json:"over_cap"`
	Cycles      []string `json:"cycles"`
	Waiting     []struct {
		Story string  `json:"story"`
		Hours float64 `json:"waiting_h"`
	} `json:"waiting_on_you"`
	// WorkTrees is the `--lanes` view: one entry per front.
	Fronts []DeliveryFront `json:"fronts,omitempty"`
}

DeliveryPlan is `gtt plan` or `gtt plan --lanes`; only one of the two sets is filled.

type DeliveryQuestion added in v1.10.0

type DeliveryQuestion struct {
	ID      string              `json:"id"`
	Key     string              `json:"key"`
	AskedBy string              `json:"asked_by"`
	OnlyIf  map[string][]string `json:"only_if"`
	Prompt  string              `json:"prompt"`
	Note    string              `json:"note"`
	Options []DeliveryOption    `json:"options"`
}

DeliveryQuestion is one setup question, as the Bootstrap declares it.

type DeliveryQuestions added in v1.10.0

type DeliveryQuestions struct {
	Schema    int                `json:"schema"`
	Questions []DeliveryQuestion `json:"questions"`
}

DeliveryQuestions is `delivery.questions`.

type DeliveryReport added in v1.10.0

type DeliveryReport struct {
	Schema       int                 `json:"schema"`
	Supported    bool                `json:"supported"`
	Uncalibrated bool                `json:"uncalibrated"`
	Calibration  DeliveryCalibration `json:"calibration"`
	Epics        []struct {
		Epic        string   `json:"epic"`
		Status      string   `json:"status"`
		Lane        string   `json:"lane"`
		EstimateH   *float64 `json:"estimate_h"`
		Percent     int      `json:"percent"`
		PercentBy   string   `json:"percent_by"`
		Stories     int      `json:"stories"`
		StoriesDone int      `json:"stories_done"`
		RealH       float64  `json:"real_h"`
	} `json:"epics"`
	Forecast struct {
		Chain    []string `json:"chain"`
		Hours    float64  `json:"hours"`
		ETA      string   `json:"eta"`
		Deadline string   `json:"deadline"`
		Fits     *bool    `json:"fits"`
	} `json:"forecast"`
	PlannedH float64 `json:"planned_h"`
	RealH    float64 `json:"real_h"`
	Signals  []struct {
		Rule     string `json:"rule"`
		Artifact string `json:"artifact"`
		Detail   string `json:"detail"`
	} `json:"signals"`
}

DeliveryReport is `gtt report`.

type DeliverySetOptions added in v1.10.0

type DeliverySetOptions struct {
	Who, Lanes, Horizon, Pace, Priority, ThirdParty, Restrictions, EpicCap, Team, Preset, ScopeCap, ScopeMin, GrowthPct string
	Rebase                                                                                                              bool
}

DeliverySetOptions are the answers given on the command line.

type DeliverySize added in v1.14.0

type DeliverySize struct {
	Schema       int               `json:"schema"`
	Supported    bool              `json:"supported"`
	Declared     bool              `json:"declared"`
	Pace         string            `json:"pace"`
	Deadline     string            `json:"deadline"`
	OpenStories  int               `json:"open_stories"`
	DoneStories  int               `json:"done_stories"`
	LiveEpics    int               `json:"live_epics"`
	OpenEpics    int               `json:"open_epics"`
	CoveragePct  int               `json:"coverage_pct"`
	Measurable   bool              `json:"measurable"`
	RemainingH   *float64          `json:"remaining_h"`
	DaysOfWork   *int              `json:"days_of_work"`
	Fronts       int               `json:"fronts"`
	CapacityH    *float64          `json:"capacity_h"`
	OfCapacity   *int              `json:"of_capacity_pct"`
	GrowthLimit  float64           `json:"growth_pct_limit"`
	Target       DeliveryTarget    `json:"target"`
	Baseline     *DeliveryBaseline `json:"baseline"`
	Growth       *DeliveryGrowth   `json:"growth"`
	Choices      []DeliveryChoice  `json:"choices"`
	SlimNote     string            `json:"slim_note"`
	ExpandNote   string            `json:"expand_note"`
	TotalH       *float64          `json:"total_h"`
	Floor        DeliveryFloor     `json:"floor"`
	PaceValues   map[string]string `json:"pace_values"`
	Prompts      map[string]string `json:"prompts"`
	Action       string            `json:"action,omitempty"`
	Levers       []DeliveryLever   `json:"levers,omitempty"`
	ChangedState *DeliveryState    `json:"state,omitempty"`
}

DeliverySize is `delivery.size`.

type DeliveryState added in v1.10.0

type DeliveryState struct {
	Schema     int            `json:"schema"`
	Supported  bool           `json:"supported"`
	Declared   bool           `json:"declared"`
	State      map[string]any `json:"state"`
	Thresholds map[string]any `json:"thresholds"`
	Profile    string         `json:"profile"`
}

DeliveryState is `gtt delivery`: the setup answer and what is in force.

type DeliveryTarget added in v1.14.0

type DeliveryTarget struct {
	Declared bool     `json:"declared"`
	CapH     *float64 `json:"cap_h"`
	State    string   `json:"state"`
	OverPct  *int     `json:"over_pct"`
}

DeliveryTarget is the cap the human declared, if any.

type DesignResetResult added in v1.8.0

type DesignResetResult struct {
	Schema   int      `json:"schema"`
	Restored []string `json:"restored"`
	Removed  []string `json:"removed"`
	Backup   string   `json:"backup"`
}

DesignResetResult is `gtt design reset`.

type DevMethodCatalog added in v1.7.0

type DevMethodCatalog struct {
	Schema    int                 `json:"schema"`
	Lang      string              `json:"lang"`
	Questions []DevMethodQuestion `json:"questions"`
}

DevMethodCatalog is `gtt dev-method list`.

type DevMethodExtra added in v1.7.0

type DevMethodExtra struct {
	ID      string `json:"id"`
	Records string `json:"records"`
	Label   string `json:"label"`
	Summary string `json:"summary"`
}

DevMethodExtra is an option that is not a pack (help me choose, direct).

type DevMethodForce added in v1.7.0

type DevMethodForce struct {
	Source string `json:"source"` // lock | setup | none
	Status string `json:"status"` // ratified | open | selected | not declared
	Style  IDList `json:"style"`
	Start  string `json:"start"`
	Packs  IDList `json:"packs"`
}

DevMethodForce is what applies now: the lock, else the setup answer, else nothing.

type DevMethodLock added in v1.7.0

type DevMethodLock struct {
	Present      bool   `json:"present"`
	Style        IDList `json:"style"`
	Start        string `json:"start"`
	Status       string `json:"status"`
	LockedBy     string `json:"locked_by"`
	Verification string `json:"verification"`
	Gap          string `json:"gap"`
}

DevMethodLock is the Method Lock as the Bootstrap reads it.

type DevMethodOption added in v1.7.0

type DevMethodOption struct {
	ID               string   `json:"id"`
	Name             string   `json:"name"`
	Kind             string   `json:"kind"`
	Recommended      bool     `json:"recommended"`
	RequiresADR      bool     `json:"requires_adr"`
	Verification     string   `json:"verification"`
	WhatItIs         string   `json:"what_it_is"`
	FitsWhen         string   `json:"fits_when"`
	IncompatibleWith []string `json:"incompatible_with"`
}

DevMethodOption is one Method Pack.

type DevMethodQuestion added in v1.7.0

type DevMethodQuestion struct {
	ID       string            `json:"id"`
	Order    int               `json:"order"`
	Multiple bool              `json:"multiple"`
	Prompt   string            `json:"prompt"`
	Options  []DevMethodOption `json:"options"`
	Extra    []DevMethodExtra  `json:"extra_options"`
}

DevMethodQuestion is one setup question, as the Bootstrap declares it.

type DevMethodState added in v1.7.0

type DevMethodState struct {
	Schema    int            `json:"schema"`
	Supported bool           `json:"supported"`
	Frozen    bool           `json:"frozen"`
	InForce   DevMethodForce `json:"in_force"`
	Lock      DevMethodLock  `json:"lock"`
	Change    string         `json:"change"`
}

DevMethodState is `gtt dev-method`: the method in force, read-only.

type DoctorResult

type DoctorResult struct {
	Schema int            `json:"schema"`
	Checks []Check        `json:"checks"`
	Totals map[string]int `json:"totals"`
}

DoctorResult is `gtt doctor`.

type DomainState added in v1.28.0

type DomainState struct {
	State  string   `json:"state,omitempty"` // "pending" (a release declared a change of structure) or "in-progress" (a migration was begun)
	Needed bool     `json:"needed"`
	Why    []string `json:"why,omitempty"`
	Epics  int      `json:"epics"`
}

DomainState is the Bootstrap's answer to `domain.status`.

type ExportResult

type ExportResult struct {
	Schema int `json:"schema"`
	export.Result
	KeptForReview []string `json:"kept_requires_confirmation"`
}

ExportResult is `gtt export --clean`.

type Handoff

type Handoff struct {
	PrimaryADE       string   `json:"primary_ade"`
	PrimaryName      string   `json:"primary_name"`
	InstructionEntry string   `json:"instruction_entry"`
	ReadFirst        []string `json:"read_first"`
	Questionnaire    string   `json:"questionnaire,omitempty"`
	// NextAction is the Bootstrap's own words for what the human does next
	// (elicitation handoff.next_action), set only while the Bootstrap reports
	// the questionnaire open. Empty with a Bootstrap that declares none.
	NextAction string `json:"next_action,omitempty"`
	Launchable bool   `json:"launchable"`
}

Handoff is what the CLI delivers to the Primary ADE: where the Bootstrap's own instructions are. The CLI writes no instructions.

type IDList added in v1.7.0

type IDList []string

IDList is a list of pack ids. The Bootstrap writes an undecided list as the single word OPEN; it is read as ["OPEN"].

func (*IDList) UnmarshalJSON added in v1.7.0

func (l *IDList) UnmarshalJSON(data []byte) error

UnmarshalJSON accepts a list, a single string or null.

type IdeaAddOptions added in v1.23.0

type IdeaAddOptions struct {
	Text, File, By string
	// About is the ref (EPIC-n, STORY-n, GAP-n, a design item) the idea is about; the Bootstrap writes `About:` in its header.
	About string
	Now   bool
	// Type is idea (the default) or solicitud; a request carries its fields instead of free text.
	Type                                                   string
	Change, Reason, Trigger, Scope, Impact, Risk, Priority string
}

IdeaAddOptions are the flags of `gtt idea add`.

type IdeaItem added in v1.19.0

type IdeaItem struct {
	Ref     string `json:"ref"`
	Title   string `json:"title"`
	State   string `json:"state"`
	To      string `json:"to"`
	Created string `json:"created"`
	Path    string `json:"path"`
}

IdeaItem is one idea, as `idea.list` declares it.

type IdeaList added in v1.19.0

type IdeaList struct {
	Schema int        `json:"schema"`
	Ideas  []IdeaItem `json:"ideas"`
	New    int        `json:"new"`
}

IdeaList is `gtt idea list`.

type IdeaResult added in v1.19.0

type IdeaResult struct {
	Schema  int    `json:"schema"`
	Output  string `json:"output"`
	Message string `json:"message,omitempty"`
}

IdeaResult is what an idea act wrote. A Bootstrap without the inbox (and without ideas) gets Message, one line.

type InboxEntry added in v1.23.0

type InboxEntry struct {
	Ref         string       `json:"ref"`
	Type        string       `json:"type"`
	Origin      string       `json:"origin"` // human | agent
	From        string       `json:"from"`
	Title       string       `json:"title"`
	Level       string       `json:"level"`
	Stage       string       `json:"stage"`
	Priority    string       `json:"priority"`
	DaysInStage int          `json:"days_in_stage"`
	Event       string       `json:"event"`
	Command     string       `json:"command"`
	Path        string       `json:"path"`
	Created     string       `json:"created"`
	Now         bool         `json:"now"`
	Trail       []InboxTrail `json:"trail,omitempty"`
	Text        string       `json:"text,omitempty"`
}

InboxEntry is one entry as `inbox.list` and `inbox.show` declare it.

type InboxEntryView added in v1.23.0

type InboxEntryView struct {
	Schema    int        `json:"schema"`
	Supported bool       `json:"supported"`
	Message   string     `json:"message,omitempty"`
	Entry     InboxEntry `json:"entry"`
}

InboxEntryView is `gtt inbox show`.

type InboxList added in v1.23.0

type InboxList struct {
	Schema    int            `json:"schema"`
	Supported bool           `json:"supported"`
	Message   string         `json:"message,omitempty"`
	Entries   []InboxEntry   `json:"entries"`
	Counts    map[string]int `json:"counts,omitempty"`
}

InboxList is `gtt inbox`.

type InboxMigration added in v1.23.0

type InboxMigration struct {
	Offered bool   `json:"offered"`           // the Bootstrap has inbox.migrate
	Report  string `json:"report,omitempty"`  // what it would do, or did
	Applied bool   `json:"applied"`           // it was done
	Pending bool   `json:"pending,omitempty"` // there is something to migrate and it was not confirmed
}

InboxMigration is what the migration of a 1.22 project said and did.

type InboxQuery added in v1.23.0

type InboxQuery struct {
	All    bool
	Origin string // human | agent
}

InboxQuery are the filters of `gtt inbox`.

type InboxResult added in v1.23.0

type InboxResult struct {
	Schema    int    `json:"schema"`
	Supported bool   `json:"supported"`
	Message   string `json:"message,omitempty"`
	Action    string `json:"action,omitempty"`
	Target    string `json:"target,omitempty"`
	Applied   bool   `json:"applied"`
	Output    string `json:"output,omitempty"`
}

InboxResult reports a human act on the inbox carried out through the Bootstrap.

type InboxTrail added in v1.23.0

type InboxTrail struct {
	Key   string `json:"key"`
	Value string `json:"value"`
	At    string `json:"at"`
	Actor string `json:"actor"`
}

InboxTrail is one dated line of an entry's trail.

type InitOptions

type InitOptions struct {
	Resolve         ResolveOptions
	ADEs            []string
	Primary         string
	Language        string
	Method          string
	DevStyle        string // development method: pack ids, comma separated, or "help"
	DevStart        string // how to start: a pack id, "direct" or "help"
	DeliveryWho     string // who builds: solo, solo-multi or team
	DeliveryLanes   string // parallel fronts: a number or "propose"
	DeliveryHorizon string // days, weeks, month or none
	DeliveryTeam    string // team member names, comma separated
	Sources         []string
	NoSources       bool
	Questionnaire   string // "", "yes", "no"
	Launch          bool
	Resume          bool
	Rollback        bool
	Snapshot        string // explicit recovery snapshot to restore
	NoRestore       bool
}

InitOptions are the answers the human gave on the command line. Anything left empty is asked; without a terminal it is refused, never inferred.

type InitResult

type InitResult struct {
	Schema      int                  `json:"schema"`
	Outcome     string               `json:"outcome"` // initialized | already-initialized | updated | restored | rolled-back
	Project     string               `json:"project"`
	Bootstrap   lifecycle.Resolution `json:"bootstrap"`
	Selections  lifecycle.Selections `json:"selections"`
	Sources     []SourceReport       `json:"sources,omitempty"`
	Validation  string               `json:"validation"`
	Handoff     *Handoff             `json:"handoff,omitempty"`
	DesignState string               `json:"design_state"` // sources-selected | questionnaire | none
	// Installed is the check of a Bootstrap that was already in the project.
	Installed *BootstrapCheck `json:"installed_bootstrap,omitempty"`
	// Update is what changed when the human confirmed moving it to the
	// required release.
	Update *UpdateResult `json:"update,omitempty"`
	// DevMethodNote says why init does not ask the development method again.
	DevMethodNote string `json:"dev_method_note,omitempty"`
}

InitResult is the outcome of `gtt init`.

type InspectResult

type InspectResult struct {
	Schema       int                   `json:"schema"`
	ProjectRoot  string                `json:"project_root"`
	GitRoot      string                `json:"git_root,omitempty"`
	CLI          string                `json:"cli_version"`
	Bootstrap    BootstrapInfo         `json:"bootstrap"`
	Resolution   *lifecycle.Resolution `json:"resolution,omitempty"`
	Capabilities []ports.Capability    `json:"capabilities"`
	Operations   []string              `json:"operations"`
	Agents       agents.Environment    `json:"agents"`
	Plan         methodology.Plan      `json:"methodology"`
	Sources      json.RawMessage       `json:"sources"`
	Scaffold     []string              `json:"scaffold_paths"`
	OwnedByGTT   json.RawMessage       `json:"gtt_owned"`
	Templates    json.RawMessage       `json:"templates"`
	Frozen       bool                  `json:"frozen"`
	Session      bool                  `json:"session_exists"`
}

InspectResult is `gtt inspect`: topology and installation state.

type LastPromotion added in v1.7.0

type LastPromotion struct {
	Promotion *struct {
		Name  string   `json:"name"`
		At    string   `json:"at"`
		Files []string `json:"files"`
		Froze bool     `json:"froze"`
	} `json:"promotion"`
	Undoable bool     `json:"undoable"`
	Problems []string `json:"problems"`
}

LastPromotion is what `gtt undo` would put back.

type MCPAnswer added in v1.26.0

type MCPAnswer struct {
	Summary string
	Data    map[string]any
}

MCPAnswer is one tool's answer: ONE summary line in the project's language and compact JSON.

func (MCPAnswer) JSON added in v1.26.0

func (m MCPAnswer) JSON() string

JSON is the compact JSON of the answer.

type MCPArgs added in v1.26.0

type MCPArgs struct {
	Repo   string // a repo of the portfolio: its folder name or its path
	Plane  string
	Owner  string
	Level  string
	Ref    string
	Epic   string
	Story  string
	Offset int
	Limit  int
}

MCPArgs is what any tool may be asked; each tool reads the fields it declares.

type MethodResult

type MethodResult struct {
	Schema  int                  `json:"schema"`
	Plan    methodology.Plan     `json:"plan"`
	Choices []methodology.Choice `json:"choices,omitempty"`
	// Change says what the change just made means, from the Bootstrap's contract.
	Change *methodology.Change `json:"change,omitempty"`
}

MethodResult is `gtt autonomy show` (alias: gtt method).

type NextID

type NextID struct {
	Schema     int             `json:"schema"`
	ID         string          `json:"id"`
	Resolution string          `json:"resolution"`
	Automatic  bool            `json:"automatic"`
	Detail     json.RawMessage `json:"detail"`
}

NextID is the artifact identity allocator: the Bootstrap finds the next free id; under a plan that resolves identity automatically the CLI simply reports the id to use, otherwise it reports a proposal.

type PendingAnswer added in v1.12.0

type PendingAnswer struct {
	Schema   int      `json:"schema"`
	Answered []string `json:"answered"`
	Output   string   `json:"output"`
	// Review is true when the answer decided a REV: the Bootstrap applied it at once, nothing waits for the agent.
	Review bool `json:"review,omitempty"`
}

PendingAnswer is `gtt answer`: what was written, per event.

type PendingItem added in v1.12.0

type PendingItem struct {
	ID          string            `json:"id"`
	Number      int               `json:"number"`
	Kind        string            `json:"kind"` // ASK | DEC | REV
	Title       string            `json:"title"`
	Class       string            `json:"class"`
	Created     string            `json:"created"`
	State       string            `json:"state"` // open | answered | attended
	Answer      string            `json:"answer"`
	Blocks      string            `json:"blocks"`
	Recommended int               `json:"recommended"`
	Options     []string          `json:"options"`
	Notes       map[string]string `json:"notes"`
	Topic       string            `json:"topic"`
	Discuss     bool              `json:"discuss"`
	Closing     []string          `json:"closing"`
	Path        string            `json:"path"`
}

PendingItem is one event, as `pending.list` declares it.

type PendingList added in v1.12.0

type PendingList struct {
	Schema    int           `json:"schema"`
	Supported bool          `json:"supported"`
	Events    []PendingItem `json:"events"`
	Open      int           `json:"open"`
}

PendingList is `gtt pending`.

type Project

type Project struct {
	Root      string
	Detection project.Detection
	B         ports.Bootstrap
	Release   ports.Release
	Store     lifecycle.Store
}

Project is an installed project bound to its Bootstrap runtime.

type Proposal added in v1.7.0

type Proposal struct {
	Name    string   `json:"name"`
	Path    string   `json:"path"`
	Kind    string   `json:"kind"`
	Title   string   `json:"title"`
	Request string   `json:"request"`
	State   string   `json:"state"`
	Files   []string `json:"files,omitempty"`
}

Proposal is one draft under gtt-domain/proposals/.

type ProposalView added in v1.7.0

type ProposalView struct {
	Schema   int      `json:"schema"`
	Proposal Proposal `json:"proposal"`
	Content  string   `json:"content"`
}

ProposalView is `gtt proposals show`.

type ProposalsResult added in v1.7.0

type ProposalsResult struct {
	Schema    int         `json:"schema"`
	Request   ChangeState `json:"request"`
	Proposals []Proposal  `json:"proposals"`
	// Inbox is the agent's side of the inbox (the proposals as PROP-NNN, by stage), when the Bootstrap has it.
	Inbox *InboxList `json:"inbox,omitempty"`
}

ProposalsResult is `gtt proposals`.

type ResolveOptions

type ResolveOptions struct {
	Path    string
	Version string
	Offline bool
}

ResolveOptions are the human's Bootstrap resolution flags.

type ResumeResult

type ResumeResult struct {
	Schema      int             `json:"schema"`
	Project     string          `json:"project"`
	Context     json.RawMessage `json:"session_context"` // the Bootstrap document, verbatim
	Text        string          `json:"-"`
	Interrupted string          `json:"interrupted_init,omitempty"`
	Handoff     *Handoff        `json:"handoff,omitempty"`
}

ResumeResult is `gtt resume`: session context derived from project state.

type ReviewOptions added in v1.14.0

type ReviewOptions struct {
	Keep, SinglePass bool
	ScopeCap         string
	ScopeMin         string
	GrowthPct        string
}

ReviewOptions are the choices given on the command line; without them a terminal is asked.

type RunCheck added in v1.11.0

type RunCheck struct {
	Schema int  `json:"schema"`
	OK     bool `json:"ok"`
	Runs   []struct {
		ID       string       `json:"id"`
		OK       bool         `json:"ok"`
		Findings []RunFinding `json:"findings"`
	} `json:"runs"`
}

RunCheck is `gtt run check`.

type RunFinding added in v1.11.0

type RunFinding struct {
	Rule    string `json:"rule"`
	Level   string `json:"level"`
	Where   string `json:"where"`
	Message string `json:"message"`
}

RunFinding is one result of the Bootstrap's review (RUN-01 to RUN-09).

type RunItem added in v1.11.0

type RunItem struct {
	ID        string       `json:"id"`
	Number    int          `json:"number"`
	Title     string       `json:"title"`
	What      string       `json:"what"`
	Why       string       `json:"why"`
	Changes   string       `json:"changes"`
	Checks    []string     `json:"checks"`
	Steps     []RunStep    `json:"steps"`
	Next      string       `json:"next"`
	Generated bool         `json:"generated"`
	State     string       `json:"state"`
	OK        bool         `json:"ok"`
	Findings  []RunFinding `json:"findings"`
}

RunItem is one pending run, as `run.list` declares it.

type RunList added in v1.11.0

type RunList struct {
	Schema    int       `json:"schema"`
	Supported bool      `json:"supported"`
	Runs      []RunItem `json:"runs"`
}

RunList is `gtt run`.

type RunResult added in v1.11.0

type RunResult struct {
	Schema  int    `json:"schema"`
	ID      string `json:"id"`
	Applied bool   `json:"applied"`
	Output  string `json:"output"`
}

RunResult is `gtt run <n>`.

type RunStep added in v1.11.0

type RunStep struct {
	Title   string `json:"title"`
	Command string `json:"command"`
}

RunStep is one step of a plan.

type SonarList added in v1.19.0

type SonarList struct {
	Schema int         `json:"schema"`
	Config string      `json:"config"`
	Repos  []SonarRepo `json:"repos"`
}

SonarList is `gtt sonar list`.

type SonarOpenOptions added in v1.26.0

type SonarOpenOptions struct {
	All    bool
	Log    bool
	NoOpen bool
}

SonarOpenOptions are the flags of `gtt sonar`.

type SonarRepo added in v1.19.0

type SonarRepo struct {
	Path    string `json:"path"`
	Name    string `json:"name,omitempty"`
	Version string `json:"bootstrap_version,omitempty"`
	State   string `json:"state"` // ok | update | not-gtt | incompatible | missing
	Reason  string `json:"reason,omitempty"`
}

SonarRepo is one repo of the portfolio and how it answered.

type SonarResult added in v1.19.0

type SonarResult struct {
	Schema    int         `json:"schema"`
	Supported bool        `json:"supported"`
	Page      string      `json:"page,omitempty"`
	Message   string      `json:"message,omitempty"`
	Repos     []SonarRepo `json:"repos,omitempty"`
	// Served: `gtt sonar` started or found the server. URL is the address with the one-time code (only with --no-open).
	Served bool     `json:"served,omitempty"`
	Port   int      `json:"port,omitempty"`
	URL    string   `json:"url,omitempty"`
	Notes  []string `json:"notes,omitempty"` // repos shown read only, and the release each one needs
}

SonarResult is `gtt sonar`.

type SonarServer added in v1.26.0

type SonarServer struct {
	App    *App
	Dir    string // ~/.gtt/sonar: the secret, server.json, the rendered pages
	Secret []byte
	Now    func() time.Time
	// Render draws the page from the snapshot files; nil uses the Bootstrap (sonar.render, or its script).
	Render func(ctx context.Context, served bool, files []string, out string) error
	// Stop is called when the human asks the server to close (the daemon closes its listener).
	Stop func()
	// contains filtered or unexported fields
}

SonarServer is the HTTP side. It is built by SonarServe (the daemon) and by the tests, which inject the clock.

func (*SonarServer) Handler added in v1.26.0

func (s *SonarServer) Handler() http.Handler

Handler is the whole server.

func (*SonarServer) IdleSince added in v1.26.0

func (s *SonarServer) IdleSince() time.Time

IdleSince is when the server was last used.

func (*SonarServer) Register added in v1.26.0

func (s *SonarServer) Register(paths []string)

Register adds repos to what the server shows (idempotent) and drops the cache.

func (*SonarServer) SetPort added in v1.26.0

func (s *SonarServer) SetPort(p int)

SetPort tells the server the port it listens on (Host and Origin are checked against it).

type SonarServerInfo added in v1.26.0

type SonarServerInfo struct {
	PID  int `json:"pid"`
	Port int `json:"port"`
}

SonarServerInfo is ~/.gtt/sonar/server.json: where the server listens. It holds no secret.

type SourceReport

type SourceReport struct {
	Path    string `json:"path"`
	State   string `json:"state"`
	Outcome string `json:"outcome"` // applied | unchanged | pending | failed
	Reason  string `json:"reason,omitempty"`
}

SourceReport is the outcome for one initial MD.

type SourcesResult

type SourcesResult struct {
	Schema  int            `json:"schema"`
	Sources []SourceReport `json:"sources"`
	// contains filtered or unexported fields
}

SourcesResult is the result of a tracking run.

func (SourcesResult) Failed

func (r SourcesResult) Failed() bool

Failed reports whether any document failed.

type StatusResult

type StatusResult struct {
	Schema    int                `json:"schema"`
	Project   string             `json:"project"`
	CLI       string             `json:"cli_version"`
	Bootstrap BootstrapInfo      `json:"bootstrap"`
	ADENames  map[string]string  `json:"ade_names"`
	Status    json.RawMessage    `json:"status"` // the Bootstrap status document, verbatim
	Agents    agents.Environment `json:"agents"`
	Sources   SourcesResult      `json:"initial_sources"`
	Delivery  string             `json:"delivery,omitempty"` // the Bootstrap's summary of the delivery plan; empty when it has none
	View      bootstrapStatus    `json:"-"`
}

StatusResult is `gtt status`.

type StepResult added in v1.7.0

type StepResult struct {
	Schema  int    `json:"schema"`
	Action  string `json:"action"`
	Target  string `json:"target,omitempty"`
	Applied bool   `json:"applied"`
	Output  string `json:"output"`
}

StepResult reports a human act carried out through the Bootstrap.

type SyncResult

type SyncResult struct {
	Schema   int              `json:"schema"`
	Agents   AgentsSyncResult `json:"agents"`
	Sources  SourcesResult    `json:"initial_sources"`
	Maintain string           `json:"maintain"`
	Pending  bool             `json:"human_action_pending"`
}

SyncResult is `gtt sync`.

type UpdateOptions

type UpdateOptions struct {
	Resolve  ResolveOptions
	Base     string // catalog of the installed version, when no install ledger exists
	Rollback bool
}

UpdateOptions are the flags of `gtt update`.

type UpdateResult

type UpdateResult struct {
	Schema    int      `json:"schema"`
	Outcome   string   `json:"outcome"` // updated | already-current | rolled-back
	From      string   `json:"from"`
	To        string   `json:"to"`
	Replaced  []string `json:"replaced"`
	Added     []string `json:"added"`
	Removed   []string `json:"removed"`
	Preserved []string `json:"preserved_modified"`
	// Overwritten are locally modified files the human confirmed replacing.
	Overwritten []string `json:"replaced_modified,omitempty"`
	Snapshot    string   `json:"snapshot,omitempty"`
	// Inbox is the migration of a 1.22 project to the inbox, when the new Bootstrap offers it.
	Inbox *InboxMigration `json:"inbox,omitempty"`
	// Findings are what the new Bootstrap's validators report on the project's own content (a project
	// older than the validators fails them). They are work to do, never a reason to leave the project on the old release.
	Findings []string `json:"findings,omitempty"`
	// DomainBackup is the zip of the project's gtt-domain/ kept outside the project before the update.
	DomainBackup string `json:"domain_backup,omitempty"`
	// Domain says whether the project's gtt-domain must be brought to the format of the new Bootstrap: that is the
	// agent's work (it reads the content), and the order reaches it as the next action. The update never touches gtt-domain/.
	Domain *DomainState `json:"domain,omitempty"`
	// Reconciled says the identity of files moved or removed since the install was brought up to date.
	Reconciled bool `json:"reconciled,omitempty"`
}

UpdateResult is `gtt update`.

type UpgradeResult added in v1.23.0

type UpgradeResult struct {
	Schema    int                `json:"schema"`
	Installed string             `json:"installed"`
	Latest    string             `json:"latest,omitempty"`
	Target    string             `json:"target,omitempty"`
	Status    string             `json:"status"` // up-to-date, ahead, available, upgraded
	Changed   bool               `json:"changed"`
	Plan      *ports.UpgradePlan `json:"plan,omitempty"`
}

UpgradeResult is what `gtt upgrade` found and did.

type ValidateResult

type ValidateResult struct {
	Schema    int        `json:"schema"`
	Bootstrap string     `json:"bootstrap_version"`
	Result    string     `json:"result"`
	Report    validation `json:"report"`
}

ValidateResult is `gtt validate`: the Bootstrap's verdict, unaltered.

type VersionResult

type VersionResult struct {
	Schema       int      `json:"schema"`
	CLI          string   `json:"cli_version"`
	Capabilities []string `json:"cli_capabilities"`
	Schemas      []int    `json:"bootstrap_schemas"`
	// Pinned is the Bootstrap release this CLI release ships with.
	Pinned    BootstrapPin `json:"pinned_bootstrap"`
	Bootstrap *struct {
		Version       string `json:"version"`
		Schema        int    `json:"schema"`
		Channel       string `json:"channel"`
		Compatibility string `json:"compatibility"`
		MatchesPin    bool   `json:"matches_pin"`
	} `json:"bootstrap,omitempty"`
}

VersionResult is `gtt version`.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL