Documentation
¶
Overview ¶
Package project owns project selection and validation and exposes immutable project Sessions.
Index ¶
- Variables
- func AdvisoryNotes(state *Session, cfg *config.Config, output outputplan.Plan, ...) ([]string, error)
- func BuildCheckReport(state *Session, cfg *config.Config, repo *awfgit.Repo, ctx context.Context, ...) (repositorycheck.Report, error)
- func BuildListDocument(state *Session, cfg *config.Config, kindFilter string) (presentation.Document, error)
- func CatalogNames(cat *catalog.Catalog, singular string) ([]string, bool)
- func CheckVersionAuthority() error
- func IsFreeformDomainKind(singular string) bool
- func Kinds() []string
- func KnownTargets() []string
- func NeededVars() (map[string]bool, error)
- func PluralKind(singular string) (string, bool)
- func ScaffoldConfig(prefix string, vars map[string]string, scopes []string) ([]byte, error)
- func ValidateSchemaMinimumVersion(schema int, version string) error
- func VerifyCommitPolicyAt(ctx context.Context, root string, targets []string) (presentation.Document, commitpolicy.Outcome, error)
- type AuthoringTarget
- type CheckAdvisories
- type Layout
- type LoadConfigTree
- type Loader
- func (l *Loader) AcquireProjectLease(ctx context.Context, root string) (*filesystem.Lease, error)
- func (l *Loader) CoversProjectLease(ctx context.Context, root string, lease *filesystem.Lease) bool
- func (l *Loader) Load(ctx context.Context, root string) (*Session, error)
- func (l *Loader) LoadForMutation(ctx context.Context, root string, files *filesystem.Handle) (*Session, *filesystem.ExpectedIdentity, error)
- func (l *Loader) WithSelection(load LoadConfigTree, reader outputplan.TreeReader) *Loader
- type RegistryView
- type RenderedFile
- type ResolveResidentRoot
- type Session
- func (s *Session) Catalog() *catalog.Catalog
- func (s *Session) Config() *config.Config
- func (s *Session) Nested() bool
- func (s *Session) Reader() outputplan.TreeReader
- func (s *Session) Registry() RegistryView
- func (s *Session) Repository() *awfgit.Repo
- func (s *Session) Root() string
- func (s *Session) Roots() resident.Roots
- func (s *Session) Targets() []artifactregistry.Target
Constants ¶
This section is empty.
Variables ¶
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 ¶
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
IsFreeformDomainKind reports whether the kind has freeform cardinality.
func KnownTargets ¶ added in v0.4.0
func KnownTargets() []string
func NeededVars ¶ added in v0.13.0
NeededVars returns the var names referenced by the full rendered catalog.
func PluralKind ¶
PluralKind maps a singular CLI kind token to its descriptor plural.
func ScaffoldConfig ¶
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
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
AuthoringTarget is the semantic resolution of one authorable part.
func ResolveAuthoringTarget ¶ added in v0.44.0
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
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
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
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
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
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 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
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
Catalog returns the Session's defensive selected registry catalog.
func (*Session) Config ¶ added in v0.46.0
Config returns a defensive copy retaining this Session's selected tree binding.
func (*Session) Nested ¶ added in v0.46.0
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
Repository returns the one Git handle selected during loading, if any.
func (*Session) Targets ¶ added in v0.46.0
func (s *Session) Targets() []artifactregistry.Target
Targets returns defensive copies of the resolved target declarations.