projectprofile

package
v0.8.1 Latest Latest
Warning

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

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

Documentation

Overview

Package projectprofile holds the downstream-project conventions the kernel used to hardcode: how a project is recognised, which ledgers it keeps, and which verification command each changed path implies. Kernel packages read this table; they never name a project.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Known

func Known(id string) bool

Known reports whether id names a profile in the table.

func Signals

func Signals() []string

Signals returns every path any profile is recognised by, in table order.

Types

type Command

type Command struct {
	Match  func(path string) bool
	Render func(path string) string
}

Command maps a changed path to the verification command a profile prescribes for it.

type Profile

type Profile struct {
	ID             string
	Signals        []string
	FeaturesPath   string
	ScenariosPath  string
	ADRPrefix      string
	Gate           string
	WebAliasPrefix string
	WebAliasRoot   string
	Commands       []Command
}

Profile describes one downstream project. Signals are the paths that must all be present for the profile to be recognised; FeaturesPath and ScenariosPath name its record ledgers; ADRPrefix is the directory its decision records live under; Gate is the command that closes a verification plan; Commands are its path-specific verification rules.

WebAliasPrefix and WebAliasRoot carry the one bundler convention a reverse-import resolution needs and cannot derive: the module-specifier prefix a project's build tooling rewrites, and the repository-relative directory it rewrites it to. `GPK-V0-027` requires that pair to be read from here and NOT hardcoded to any one repository's source root, so a profile that declares no alias resolves no aliased specifier at all rather than borrowing another project's root.

func ByID

func ByID(id string) Profile

ByID returns the named profile, or the fallback when the name is unknown.

func Detect

func Detect(present func(path string) bool) Profile

Detect returns the first profile all of whose signals are present.

func Fallback

func Fallback() Profile

Fallback is the profile used when no signalled profile is recognised.

func Prescribe

func Prescribe(path string) (string, Profile, bool)

Prescribe returns the verification command a profile prescribes for path, together with the profile that prescribes it.

Jump to

Keyboard shortcuts

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