profileownership

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package profileownership conservatively routes goplint assurance profiles.

Index

Constants

View Source
const FormatVersion = 2

Variables

This section is empty.

Functions

This section is empty.

Types

type Class

type Class string

Class is one reviewed change class assigned to a governed path family.

const (
	// ClassDocumentation covers prose and bookkeeping that no gate executes or reads as input.
	ClassDocumentation Class = "documentation"
	// ClassConsumer covers root-module code that consumes goplint without owning analyzer behavior.
	ClassConsumer Class = "consumer"
	// ClassHarness covers gate orchestration that can lose evidence but cannot change analyzer verdicts.
	ClassHarness Class = "harness"
	// ClassAnalyzerSemantics covers everything that can influence any analyzer verdict or proof obligation.
	ClassAnalyzerSemantics Class = "analyzer-semantics"
)

type Context

type Context struct {
	Event              string
	ChangedPaths       []string
	MergeBaseAvailable bool
	ShallowRepository  bool
}

Context is the complete event and changed-path routing input.

type Decision

type Decision struct {
	Profile soundnessgate.ProfileID `json:"profile"`
	Class   Class                   `json:"class"`
	Reason  string                  `json:"reason"`
	Paths   []string                `json:"paths"`
}

Decision is a deterministic profile and visible conservative reason.

type Manifest

type Manifest struct {
	FormatVersion int    `json:"format_version"`
	Rules         []Rule `json:"rules"`
}

Manifest maps governed repository path families to their reviewed change class.

func Decode

func Decode(data []byte) (Manifest, error)

Decode strictly decodes and validates ownership manifest bytes. The json/v2 decoder rejects duplicate object members, invalid UTF-8, and unknown members. Field-name matching is case-sensitive; manifest tags are snake_case and produced by writers in this package, so casing is controlled.

func Load

func Load(path string) (Manifest, error)

Load strictly decodes and validates an ownership manifest file.

func (Manifest) ClassForPath

func (manifest Manifest) ClassForPath(path string) (Class, bool)

ClassForPath resolves the most specific governing rule: an exact pattern wins outright, then the longest matching recursive prefix.

func (Manifest) Route

func (manifest Manifest) Route(input Context) (Decision, error)

Route selects completion for exhaustive events, the least expensive tier that covers the highest change class present in a proven path set, and the semantic profile for every missing or ambiguous case.

func (Manifest) Validate

func (manifest Manifest) Validate() error

Validate checks canonical, non-ambiguous exact or recursive-prefix rules and rejects any documentation classification over executable gate inputs.

type Rule

type Rule struct {
	Pattern string `json:"pattern"`
	Class   Class  `json:"class"`
}

Rule owns one exact path or recursive prefix pattern.

Jump to

Keyboard shortcuts

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