Documentation
¶
Overview ¶
Package tracking records which initial Markdown sources the CLI has read, applied and validated. Identity is by content hash, never by file name. The record is derived operational state under .gtt/cli/: it can be rebuilt and is never a source of truth about the project.
Index ¶
Constants ¶
const ( Discovered = "DISCOVERED" Read = "READ" Applied = "APPLIED" Validated = "VALIDATED" Failed = "FAILED" )
States of an initial MD.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
Path string `json:"path"`
SHA256 string `json:"sha256"`
State string `json:"state"`
DiscoveredAt string `json:"discovered_at"`
ReadAt string `json:"read_at,omitempty"`
AppliedAt string `json:"applied_at,omitempty"`
ValidatedAt string `json:"validated_at,omitempty"`
Error string `json:"error,omitempty"`
Changed bool `json:"changed,omitempty"` // content differs from the last processed version
Previous []Version `json:"previous,omitempty"`
}
Entry is the tracking record of one document.
func (*Entry) MarkApplied ¶
MarkApplied records a successful application. It is refused unless the content was read first.
func (*Entry) MarkFailed ¶
MarkFailed records a failure. A failed document is never APPLIED.
func (*Entry) MarkValidated ¶
MarkValidated records a successful validation. It is refused unless the content was applied: READ + APPLIED is recorded only after both happened.
type Ledger ¶
type Ledger struct {
Schema int `json:"schema"`
Notice string `json:"notice"`
Entries map[string]*Entry `json:"entries"`
}
Ledger is .gtt/cli/tracking.json.
type Store ¶
type Store struct {
Root string
// Path is the record the Bootstrap declares, relative to Root. Empty
// means the CLI's own location under .gtt/cli/, which is also read as a
// fallback until the declared record holds entries.
Path string
}
Store persists the ledger of one project.