Documentation
¶
Overview ¶
Package model holds the public facts document (contract:cli.public-facts v1) and its exported constants.
Purpose: one Go type for .github/facts.json, shared by tools/facts (which writes and checks it) and tools/schemagen (which derives the JSON Schema), so the document and its schema cannot drift. Inputs: none. Outputs: the Facts type and constants. Constraints: struct fields are declared in the document's key order (sorted, `_generated` first), because encoding/json writes struct fields in declaration order and the contract requires sorted keys. No timestamps and no machine-dependent values.
Index ¶
Constants ¶
const ( // SchemaVersion is the schema_version value of a v1 document. SchemaVersion = "1" // Generated is the _generated marker (hand-edit warning). Generated = "GENERATED BY tools/facts — DO NOT HAND EDIT" // ContractMode is the compat mode the committed command registry documents. ContractMode = "v1.5" // VersionPattern is the shape of Facts.Version (the .github/VERSION value). VersionPattern = `^[0-9]+\.[0-9]+\.[0-9]+([-+][0-9A-Za-z.-]+)?$` // SHA256Pattern is the shape of the source hashes. SHA256Pattern = `^[0-9a-f]{64}$` )
Contract constants.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counts ¶
type Counts struct {
Commands int `json:"commands"`
Core int `json:"core"`
CoreMissing []string `json:"core_missing"`
TopLevel int `json:"top_level"`
}
Counts are copied from the registry's counts block.
type Facts ¶
type Facts struct {
Generated string `json:"_generated"`
ContractMode string `json:"contract_mode"`
Counts Counts `json:"counts"`
SchemaVer string `json:"schema_version"`
Sources Sources `json:"sources"`
Verbs []string `json:"verbs"`
Version string `json:"version"`
}
Facts is .github/facts.json.