manifest

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AliasMapping

type AliasMapping struct {
	OldAnchor string
	NewAnchor string
	StableID  string
	Reason    string
}

AliasMapping maps an old anchor to a new anchor.

type AliasResult

type AliasResult struct {
	AutoAliases        []AliasMapping
	AmbiguousAliases   []AmbiguousMapping
	DisappearedAnchors []string
	AppearedAnchors    []string
}

AliasResult contains the result of auto-aliasing analysis.

func ComputeAutoAliases

func ComputeAutoAliases(oldManifest *Manifest, newScan *scanner.ScanResult, newFingerprints map[string]string) *AliasResult

ComputeAutoAliases determines which aliases can be automatically applied.

type AmbiguousMapping

type AmbiguousMapping struct {
	DisappearedAnchor string
	CandidateAnchors  []string
	Reason            string
}

AmbiguousMapping represents an ambiguous alias situation.

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator creates and updates manifests from scan results.

func NewGenerator

func NewGenerator(cfg GeneratorConfig) *Generator

NewGenerator creates a manifest generator.

func (*Generator) AutoAliasResult

func (g *Generator) AutoAliasResult() *AliasResult

AutoAliasResult returns the last auto-aliasing result.

func (*Generator) Generate

func (g *Generator) Generate(scanResult *scanner.ScanResult) (*Manifest, error)

Generate produces a manifest from scan results.

type GeneratorConfig

type GeneratorConfig struct {
	ExistingManifest *Manifest
	CodecCalculator  *codec.FingerprintCalculator
}

GeneratorConfig configures the generator.

type Manifest

type Manifest struct {
	ManifestVersion     string                     `json:"manifestVersion"`
	AnchorFormatVersion string                     `json:"anchorFormatVersion"`
	ToolVersion         string                     `json:"toolVersion"`
	BuildSchema         string                     `json:"buildSchema"`
	GeneratedAt         string                     `json:"generatedAt,omitempty"`
	Primitives          map[string]PrimitiveEntry  `json:"primitives"`
	SessionKeys         map[string]SessionKeyEntry `json:"sessionKeys"`
}

Manifest represents the vango_state_manifest.json structure.

func Load

func Load(path string) (*Manifest, error)

Load reads a manifest from a file.

func New

func New() *Manifest

New creates an empty manifest.

func (*Manifest) AddAlias

func (m *Manifest) AddAlias(oldAnchor, newAnchor string) error

AddAlias adds a manual alias mapping.

func (*Manifest) MarshalDeterministic

func (m *Manifest) MarshalDeterministic() ([]byte, error)

MarshalDeterministic produces deterministic JSON output.

func (*Manifest) PromoteAlias

func (m *Manifest) PromoteAlias(newPrimaryAnchor string) error

PromoteAlias promotes an alias to be the primary anchor key.

func (*Manifest) PruneAliases

func (m *Manifest) PruneAliases(keepAliases map[string]bool) (pruned []string)

PruneAliases removes aliases not in the keep set.

func (*Manifest) Save

func (m *Manifest) Save(path string) error

Save writes the manifest to a file with deterministic formatting.

func (*Manifest) Validate

func (m *Manifest) Validate() error

Validate checks manifest integrity invariants.

type PrimitiveEntry

type PrimitiveEntry struct {
	StableID         string    `json:"stableID"`
	Class            string    `json:"class"`
	Kind             string    `json:"kind"`
	CodecFingerprint string    `json:"codecFingerprint,omitempty"`
	Persisted        bool      `json:"persisted"`
	DebugName        string    `json:"debugName,omitempty"`
	Initializer      string    `json:"initializer,omitempty"`
	Source           SourceRef `json:"source"`
	Aliases          []string  `json:"aliases,omitempty"`
}

PrimitiveEntry represents a single primitive in the manifest.

type SessionKeyEntry

type SessionKeyEntry struct {
	StableID         string    `json:"stableID"`
	CodecFingerprint string    `json:"codecFingerprint"`
	HasDefault       bool      `json:"hasDefault"`
	Source           SourceRef `json:"source,omitempty"`
}

SessionKeyEntry represents a typed session key in the manifest.

type SourceRef

type SourceRef struct {
	File   string `json:"file"`
	Line   int    `json:"line"`
	Column int    `json:"col"`
}

SourceRef is a source location reference.

Jump to

Keyboard shortcuts

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