Documentation
¶
Index ¶
- Constants
- type Entry
- type State
- func (s *State) CatalogVersionRecorded() string
- func (s *State) Delete(tool, key string)
- func (s *State) Get(tool, key string) (Entry, bool)
- func (s *State) HomontoVersionRecorded() string
- func (s *State) Keys(tool string) []string
- func (s *State) Save(dir string) error
- func (s *State) Set(tool, key, desired, appliedHash string)
- func (s *State) SetCatalogVersion(v string)
- func (s *State) SetFrameworkVersion(name, version string)
- func (s *State) SetHomontoVersion(v string)
- func (s *State) SetSubagentRenderFingerprint(v string)
- func (s *State) SubagentRenderFingerprintRecorded() string
Constants ¶
const CurrentStateSchemaVersion = 1
CurrentStateSchemaVersion is the state.json schema version this binary writes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
Entry is the last-applied record for one managed key. Desired holds the unresolved value (may contain ${...} tokens); Applied holds a non-secret sha256 of the resolved value that was written to disk. Neither field ever contains a plaintext secret, so state.json is safe to share.
type State ¶
type State struct {
// SchemaVersion is the state.json format version. Absent/0 means a legacy
// (pre-versioning) file and is treated as the current version; a value greater
// than CurrentStateSchemaVersion is rejected fail-closed at load.
SchemaVersion int `json:"schemaVersion,omitempty"`
Managed map[string]map[string]Entry `json:"managed"`
CatalogVersion string `json:"catalogVersion,omitempty"`
// HomontoVersion is the homonto binary version that performed the last apply.
// It lets `onto` detect a binary/framework version skew (its own version vs
// the homonto that projected the framework) and lets `homonto update` report
// the transition. Absent on legacy state files.
HomontoVersion string `json:"homontoVersion,omitempty"`
// FrameworkVersions records the version of each builtin framework at the last
// apply (framework name -> version), so a version history is written down.
FrameworkVersions map[string]string `json:"frameworkVersions,omitempty"`
// SubagentRenderFingerprint digests the config-derived inputs behind the last
// subagent materialization (the per-tool model routes). A subagent's rendered
// frontmatter depends on config, not only on the catalog, so the catalog
// version alone cannot gate materialization: editing a model route leaves the
// version untouched and would otherwise freeze the rendered agents at their
// old model forever. Absent = force re-render.
SubagentRenderFingerprint string `json:"subagentRenderFingerprint,omitempty"`
}
State is the last-applied snapshot, keyed tool -> managed key -> Entry. CatalogVersion is the embedded-catalog version last successfully materialized; it is global (not per-tool) and omitted when empty so pre-catalog state.json files stay backward-compatible (absent = "force materialize").
func (*State) CatalogVersionRecorded ¶
CatalogVersionRecorded returns the catalog version last materialized, or "".
func (*State) HomontoVersionRecorded ¶ added in v0.1.5
HomontoVersionRecorded returns the homonto binary version that last applied, or "" for a legacy/never-applied state.
func (*State) Save ¶
Save writes the state atomically (temp + fsync + rename), creating dir if needed. state.json is one of homonto's own control-plane files, so it is written no-follow (a symlinked target is refused, never followed) at 0600.
func (*State) SetCatalogVersion ¶
SetCatalogVersion records the catalog version after a successful materialize.
func (*State) SetFrameworkVersion ¶ added in v0.1.5
SetFrameworkVersion records one framework's version at apply time.
func (*State) SetHomontoVersion ¶ added in v0.1.5
SetHomontoVersion records the homonto binary version at apply time. An empty value (unstamped/dev build) is ignored so a dev run never overwrites a real recorded version with a placeholder.
func (*State) SetSubagentRenderFingerprint ¶ added in v0.2.0
SetSubagentRenderFingerprint records the render fingerprint after a successful subagent materialize.
func (*State) SubagentRenderFingerprintRecorded ¶ added in v0.2.0
SubagentRenderFingerprintRecorded returns the render fingerprint behind the last subagent materialization, or "" (never materialized / legacy state).