snapshot

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package snapshot canonicalizes, hashes, compares, saves, and loads snapshots

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Canonical

func Canonical(s *model.Snapshot) ([]byte, error)

Canonical returns JSON with tools, prompts, resources, templates, warnings, and map keys sorted. Ordering inside other slices remains significant, so this is deterministic only for the fields normalized by sortedCopy and encoding/json.

func CapabilityCoverage

func CapabilityCoverage(snap *model.Snapshot) model.Coverage

CapabilityCoverage converts snapshot truncation into coverage. Known missing counts balance as skips; unknown counts and scanner limits remain gaps. The caller supplies CapabilitiesAnalyzed. An unknown shortfall deliberately leaves the arithmetic unbalanced so a snapshot of uncertain completeness cannot support a clean verdict.

func FoldCapabilityCoverage

func FoldCapabilityCoverage(snap *model.Snapshot, cov model.Coverage) model.Coverage

FoldCapabilityCoverage merges what the snapshot knows about its own truncation into an analyzer's own coverage record, the way source.FoldWalkCoverage does for a file walk. It raises discovered and skipped counts without overwriting what the analyzer actually examined.

func Hash

func Hash(s *model.Snapshot) (string, error)

Hash returns the canonical snapshot's hex-encoded SHA-256 hash. Capability-list, warning, and JSON map-key ordering are normalized; ordering inside other slices remains significant.

func Write

func Write(w io.Writer, s *model.Snapshot) error

Write encodes s as indented JSON, escaping the same target-controlled characters report.Sanitize blocks in every other output the scanner produces

Types

This section is empty.

Jump to

Keyboard shortcuts

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