Documentation
¶
Overview ¶
Package version carries the version of this build and collects the provenance a published bundle can prove about itself.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Value = "0.10.3"
Functions ¶
This section is empty.
Types ¶
type GrammarProvenance ¶
type GrammarProvenance struct {
Manifest string `json:"manifest"`
SHA256 *string `json:"sha256"`
Versions []GrammarVersion `json:"versions"`
}
GrammarProvenance identifies the pinned grammar manifest and its entries.
type GrammarVersion ¶
type GrammarVersion struct {
Name string `json:"name"`
Version string `json:"version"`
Commit string `json:"commit"`
}
GrammarVersion is the compact grammar identity exposed by provenance.
type Provenance ¶
type Provenance struct {
Kivgraph string `json:"kivgraph"`
Commit *string `json:"commit"`
Dirty *bool `json:"dirty"`
Go string `json:"go"`
Node *string `json:"node"`
TypeScript *string `json:"typescript"`
TypeScriptFallback *string `json:"typescript_fallback"`
Ladybug string `json:"ladybug"`
GoLadybug string `json:"go_ladybug"`
Schema int `json:"schema"`
SnapshotRowFormat uint32 `json:"snapshot_row_format"`
Resolver *string `json:"resolver"`
Grammars GrammarProvenance `json:"grammars"`
// RustAnalyzer is the engine the bundle carries for Rust. A development
// binary ships none and reports null: the analyzer it would run comes
// from the PATH and is not part of this build's provenance.
RustAnalyzer *string `json:"rust_analyzer"`
}
Provenance is the stable machine-readable output of `kivgraph version --json`. Fields unavailable outside a distribution bundle are represented as null rather than guessed values.
func Collect ¶
func Collect(executablePath, workingDir string) (Provenance, error)
Collect describes the running process, and never the directory it was invoked from. Provenance comes from the manifest of the bundle this executable lives in -- resolved from the executable path, not from workingDir, which only locates the grammar manifest of a development checkout. A manifest found there that names another release or another target does not describe this process and is refused rather than preferred.
The version is always the compiled Value: a manifest can enrich provenance, never rename the binary. Without a bundle manifest the unavailable values are explicit nulls, because a guess read off a neighbouring directory is what this output exists to avoid.