Help us shape the future of Go! Take the 2026 Go Developer Survey

gate

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package gate is the diff gate (ADR-007): before ynf pushes anything, the changed paths must be inside the lane's allowed paths and outside every protected path. It catches what a runner's own tamper checks cannot: changes to the files that judge the change.

Index

Constants

This section is empty.

Variables

View Source
var Protected = []string{
	".github/workflows/**",
	".github/actions/**",
	"**/CODEOWNERS",
	".agents/**",
	".ynh/**",
	".ynm/**",
	".ynf/**",
}

Protected are refused in every lane: CI, ownership, and every folder that holds ynf, ynh or ynm configuration, including the lane policy itself.

Functions

func Check

func Check(changed, allowed, protected []string) error

Check returns an error naming every path the gate refuses. An empty allowed list allows all.

func CheckKinds added in v0.3.0

func CheckKinds(changed []string, kinds Kinds, allowed, protected, appendOnly []string) error

CheckKinds is Check with append-only paths: a path matching one may be added, never modified, deleted or renamed (a rename is a deletion and an addition). Protected paths and the allowed list are judged first, so an append-only path is not a way round either.

func Touches added in v0.3.0

func Touches(changed, globs []string) []string

Touches returns the changed paths that match any of the globs, in order.

Types

type Kinds added in v0.3.0

type Kinds struct {
	Added   []string
	Deleted []string
}

Kinds says how changed paths changed, beyond that they did. A path in neither list was modified (or changed type), so a record that predates change types reads every change as a modification.

Jump to

Keyboard shortcuts

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