genesis

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Profile        = "genesis-inventory/0.1-experimental"
	SummaryProfile = "genesis-inventory-summary/0.1-experimental"
)

Variables

This section is empty.

Functions

func BoundaryOrder

func BoundaryOrder() []string

BoundaryOrder returns the canonical boundary vocabulary in wire order.

func Classifications

func Classifications() []string

Classifications returns the canonical classification vocabulary in wire order.

func CompileRepositoryInventory

func CompileRepositoryInventory(ctx context.Context, root, activation string, authorityID *string, revision string, excludedPrefixes []string) map[string]any

CompileRepositoryInventory compiles the frozen read-only Genesis receipt.

func SourceClassOrder

func SourceClassOrder() []string

SourceClassOrder returns the canonical source-class vocabulary in wire order.

func SummarizeInventoryReceipt

func SummarizeInventoryReceipt(receipt map[string]any, maxEntriesPerClass int) (map[string]any, error)

SummarizeInventoryReceipt returns the sealed bounded default CLI view.

func VerifyInventoryReceipt

func VerifyInventoryReceipt(receipt map[string]any) bool

Types

type Entry

type Entry struct {
	Mode       string
	ObjectType string
	OID        string
	Path       *string
	PathSHA256 string
	Size       *int64
}

Entry is already-read Git tree metadata consumed by ClassifyEntry.

type GuidanceSnapshot

type GuidanceSnapshot struct {
	Revision string
	Tree     string
	Records  []Record
	Blobs    map[string][]byte
	Omitted  int
	// contains filtered or unexported fields
}

GuidanceSnapshot exposes the bounded immutable inventory to advisory composers. Mutable observations are limited to admission and the final consistency check.

func OpenGuidance

func OpenGuidance(ctx context.Context, root string) (*GuidanceSnapshot, error)

func (*GuidanceSnapshot) Check

func (s *GuidanceSnapshot) Check(ctx context.Context) error

func (*GuidanceSnapshot) CurrentRef

func (s *GuidanceSnapshot) CurrentRef(ctx context.Context) (string, error)

func (*GuidanceSnapshot) Materialize

func (s *GuidanceSnapshot) Materialize() (string, error)

Materialize writes only admitted regular immutable blobs in private scratch. The caller owns removal; no repository file, symlink or command is executed.

func (*GuidanceSnapshot) MergeBase

func (s *GuidanceSnapshot) MergeBase(ctx context.Context, a, b string) (string, error)

func (*GuidanceSnapshot) Paths

func (s *GuidanceSnapshot) Paths(ctx context.Context, a, b string) ([]string, error)

func (*GuidanceSnapshot) RefTips

func (s *GuidanceSnapshot) RefTips(ctx context.Context) (string, error)

type Limits

type Limits struct {
	MaxEntries        int
	MaxTreeBytes      int
	MaxBlobBytes      int64
	MaxTotalBlobBytes int64
	MaxPathBytes      int
	MaxReceiptBytes   int
	GitTimeout        time.Duration
	TotalTimeout      time.Duration
}

Limits contains the validated Genesis limits used by the classifier.

type Record

type Record struct {
	Boundaries     []string `json:"boundaries"`
	Classification string   `json:"classification"`
	Classes        []string `json:"classes"`
	Mode           string   `json:"mode"`
	ObjectType     string   `json:"objectType"`
	OID            string   `json:"oid"`
	Path           *string  `json:"path"`
	PathSHA256     string   `json:"pathSha256"`
	Reason         string   `json:"reason"`
	Roles          []string `json:"roles"`
	Size           *int64   `json:"size"`
}

Record is the exact per-entry Genesis inventory record.

func ClassifyEntry

func ClassifyEntry(
	entry Entry,
	blobs map[string][]byte,
	exhaustedOIDs map[string]struct{},
	exclusions []string,
	limits Limits,
) Record

ClassifyEntry deterministically classifies one already-read Git tree entry.

Jump to

Keyboard shortcuts

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