project

package
v0.46.0 Latest Latest
Warning

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

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

Documentation

Overview

Package project ties config, catalog, render, and manifest together to sync rendered files into a project and check them for drift.

Index

Constants

This section is empty.

Variables

View Source
var Version = strings.TrimSuffix(versionFile, "\n")

Version is the awf release version. Gate comparisons, the lock stamp, the bootstrap pin, and CLI output all read this value (ADR-0049).

Functions

func AdvisoryNotes added in v0.40.0

func AdvisoryNotes(state *Session, cfg *config.Config, output outputplan.Plan, glossary glossarycheck.Input) ([]string, error)

AdvisoryNotes reports non-blocking project checks from one prepared universe.

func BuildCheckReport added in v0.40.0

func BuildCheckReport(state *Session, cfg *config.Config, repo *awfgit.Repo, ctx context.Context, output outputplan.Plan, pitfalls pitfall.Corpus, effectiveSkills map[string]bool, generated generatedcheck.AdditionalInput, glossary glossarycheck.Input) (repositorycheck.Report, error)

BuildCheckReport checks the selected project tree using already-derived, narrow semantic values. Project deliberately has no publisher-operation bundle: orchestration remains at the application boundary.

func BuildListDocument added in v0.40.0

func BuildListDocument(state *Session, cfg *config.Config, kindFilter string) (presentation.Document, error)

BuildListDocument renders the requested project inventory.

func CatalogNames

func CatalogNames(cat *catalog.Catalog, singular string) ([]string, bool)

CatalogNames returns the catalog pool for a singular CLI kind.

func CheckVersionAuthority added in v0.39.1

func CheckVersionAuthority() error

CheckVersionAuthority validates the embedded version and its compatibility with the current config schema generation.

func IsFreeformDomainKind added in v0.30.0

func IsFreeformDomainKind(singular string) bool

IsFreeformDomainKind reports whether the kind has freeform cardinality.

func Kinds

func Kinds() []string

Kinds returns the singular CLI kind tokens in display order.

func KnownTargets added in v0.4.0

func KnownTargets() []string

func NeededVars added in v0.13.0

func NeededVars() (map[string]bool, error)

NeededVars returns the var names referenced by the full rendered catalog.

func NewPitfall added in v0.40.0

func NewPitfall(root, title string) (presentation.Document, error)

NewPitfall scaffolds one authored pitfall beneath root.

func PitfallScaffoldDocument added in v0.34.0

func PitfallScaffoldDocument(sourcePath string) (presentation.Document, error)

PitfallScaffoldDocument maps a created source path to the CLI presentation grammar.

func PluralKind

func PluralKind(singular string) (string, bool)

PluralKind maps a singular CLI kind token to its descriptor plural.

func ScaffoldConfig

func ScaffoldConfig(prefix string, vars map[string]string, scopes []string) ([]byte, error)

ScaffoldConfig generates a .awf/config.yaml with every catalog template's referenced vars, the self-pinning bootstrap, and the resolved commit scopes.

func ValidateSchemaMinimumVersion added in v0.30.0

func ValidateSchemaMinimumVersion(schema int, version string) error

ValidateSchemaMinimumVersion confirms that version is new enough to render a schema generation. The command gate calls it for the current generation, so registering a migration without its release mapping fails before rendering.

func VerifyCommitPolicyAt added in v0.30.0

func VerifyCommitPolicyAt(ctx context.Context, root string, targets []string) (presentation.Document, commitpolicy.Outcome, error)

VerifyCommitPolicyAt resolves the invoking worktree and returns its typed outcome together with its model-owned presentation.

Types

type AuthoringTarget added in v0.44.0

type AuthoringTarget struct {
	Kind, Name, Part string
	SourcePath       string
	Local            bool
}

AuthoringTarget is the semantic resolution of one authorable part.

func ResolveAuthoringTarget added in v0.44.0

func ResolveAuthoringTarget(s *Session, cfg *config.Config, kind, name, part string) (AuthoringTarget, error)

func ResolveSidecarTarget added in v0.44.0

func ResolveSidecarTarget(s *Session, cfg *config.Config, kind, name, field string) (AuthoringTarget, error)

ResolveSidecarTarget resolves a capability-valid leaf and its configuration-owned path.

type CheckAdvisories added in v0.40.0

type CheckAdvisories struct {
	Warnings    []string
	Information []string
}

CheckAdvisories separates ranked warnings from unranked information without adding another finding rank.

type Layout

type Layout struct {
	DocsDir    string
	Docs       map[string]string // catalog name -> output path (inv: layout-docs-full-catalog)
	Singletons map[string]string // template key -> output path
	DomainsDir string
}

Layout is the fixed, awf-given docs layout in typed form for Go consumers. These paths are not configurable through the project tree. templateMap projects it into the .layout template namespace (templates read a map, not unexported struct fields) and into the per-file ConfigHash. The mandatory-singleton paths are not struct fields: they derive from the catalog doc collection in templateMap (ADR-0061).

type LoadConfigTree added in v0.30.0

type LoadConfigTree func(string) (*config.Config, error)

LoadConfigTree loads one project's configuration tree.

type Loader added in v0.30.0

type Loader struct {
	// contains filtered or unexported fields
}

Loader owns project-opening policy over explicitly selected dependencies.

func NewLoader added in v0.30.0

func NewLoader(loadConfigTree LoadConfigTree, standard *catalog.Catalog, resolveResidentRoot ResolveResidentRoot, repo *awfgit.Repo) *Loader

NewLoader constructs project-opening policy with its required composed Git handle. A nil handle is always a composition error.

func NewLoaderWithoutRepository added in v0.30.0

func NewLoaderWithoutRepository(loadConfigTree LoadConfigTree, standard *catalog.Catalog, resolveResidentRoot ResolveResidentRoot) *Loader

NewLoaderWithoutRepository is the explicit fresh-adoption path for a tree known not to be a repository.

func (*Loader) AcquireProjectLease added in v0.41.0

func (l *Loader) AcquireProjectLease(ctx context.Context, root string) (*filesystem.Lease, error)

AcquireProjectLease obtains both the selected-checkout and shared-resident transaction capabilities in filesystem's deterministic canonical order.

func (*Loader) CoversProjectLease added in v0.41.0

func (l *Loader) CoversProjectLease(ctx context.Context, root string, lease *filesystem.Lease) bool

CoversProjectLease verifies that a supplied transaction covers this loader's selected checkout and its resolved shared-resident root.

func (*Loader) Load added in v0.46.0

func (l *Loader) Load(ctx context.Context, root string) (*Session, error)

Load constructs one Session from the Loader's exact selected inputs.

func (*Loader) LoadForMutation added in v0.46.0

func (l *Loader) LoadForMutation(ctx context.Context, root string, files *filesystem.Handle) (*Session, *filesystem.ExpectedIdentity, error)

LoadForMutation selects authority through the supplied confined handle and returns the identity of precisely the config bytes used by the Session.

func (*Loader) WithSelection added in v0.46.0

func (l *Loader) WithSelection(load LoadConfigTree, reader outputplan.TreeReader) *Loader

WithSelection returns the same loading authority with one bounded config and project-tree selection. Candidate and staged universes use this boundary so every Session is constructed through Load from matching inputs.

type PitfallScaffoldCleanupError added in v0.34.0

type PitfallScaffoldCleanupError struct {
	SourcePath  string
	ResiduePath string
	Cause       error
}

PitfallScaffoldCleanupError reports a committed authored source whose publication temporary still requires cleanup.

func (*PitfallScaffoldCleanupError) Diagnostic added in v0.34.0

Diagnostic maps the committed scaffold outcome to actionable CLI output.

func (*PitfallScaffoldCleanupError) Error added in v0.34.0

func (*PitfallScaffoldCleanupError) Unwrap added in v0.34.0

func (e *PitfallScaffoldCleanupError) Unwrap() error

Unwrap preserves the committed-publication and cleanup failure identities.

type RegistryView added in v0.46.0

type RegistryView struct {
	// contains filtered or unexported fields
}

RegistryView is the immutable project-selected projection of the canonical artifact registry. The declaration owner remains artifactregistry.

func (RegistryView) Catalog added in v0.46.0

func (v RegistryView) Catalog() *catalog.Catalog

Catalog returns a defensive copy of the selected catalog.

func (RegistryView) Targets added in v0.46.0

func (v RegistryView) Targets() []artifactregistry.Target

Targets returns defensive copies of the selected target declarations.

type RenderedFile

type RenderedFile struct {
	Path, Content, TemplateID, TemplateHash, ConfigHash string
	RegenChecked                                        bool
	Policy                                              outputplan.Policy
	Declarer, DeclarerProjection                        string
	Encoder                                             artifactregistry.AgentDialect
	Provenance                                          render.CommentStyle
	// contains filtered or unexported fields
}

RenderedFile is the residual checker projection of one neutral planned output. It is constructed only at the outputplan-to-check translation point.

type ResolveResidentRoot added in v0.30.0

type ResolveResidentRoot func(context.Context, string) string

ResolveResidentRoot maps an invoking checkout to the root that owns resident state. It takes the operation's context because the resolution reaches Git.

type Session added in v0.46.0

type Session struct {
	// contains filtered or unexported fields
}

Session is one authoritative in-memory project selection. It owns the bound configuration tree, immutable current facts, repository and root handles, selected project reader, and canonical registry projection.

func (*Session) Catalog added in v0.46.0

func (s *Session) Catalog() *catalog.Catalog

Catalog returns the Session's defensive selected registry catalog.

func (*Session) Config added in v0.46.0

func (s *Session) Config() *config.Config

Config returns a defensive copy retaining this Session's selected tree binding.

func (*Session) Nested added in v0.46.0

func (s *Session) Nested() bool

Nested reports whether the invoking checkout is nested below its repository root.

func (*Session) Reader added in v0.46.0

func (s *Session) Reader() outputplan.TreeReader

Reader returns the project-tree reader selected with the configuration.

func (*Session) Registry added in v0.46.0

func (s *Session) Registry() RegistryView

Registry returns the Session's immutable artifact-registry projection.

func (*Session) Repository added in v0.46.0

func (s *Session) Repository() *awfgit.Repo

Repository returns the one Git handle selected during loading, if any.

func (*Session) Root added in v0.46.0

func (s *Session) Root() string

Root returns the invoking checkout root.

func (*Session) Roots added in v0.46.0

func (s *Session) Roots() resident.Roots

Roots returns the selected tracked and resident roots.

func (*Session) Targets added in v0.46.0

func (s *Session) Targets() []artifactregistry.Target

Targets returns defensive copies of the resolved target declarations.

Jump to

Keyboard shortcuts

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