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
- Variables
- func AdvisoryNotes(state *ProjectState, cfg *config.Config, output outputplan.Plan, ...) ([]string, error)
- func BuildListDocument(state *ProjectState, cfg *config.Config, kindFilter string) (presentation.Document, error)
- func CatalogNames(cat *catalog.Catalog, singular string) ([]string, bool)
- func CheckStagedDriftResult(prep *ContextPreparation, plan outputplan.Plan) (checkresult.Result, error)
- func CheckVersionAuthority() error
- func IsFreeformDomainKind(singular string) bool
- func Kinds() []string
- func KnownTargets() []string
- func NeededVars() (map[string]bool, error)
- func NewADRLeased(root string, cfg *config.Config, repo *awfgit.Repo, ctx context.Context, ...) (string, error)
- func NewPitfall(root, title string) (presentation.Document, error)
- func NewPlanLeased(root, title string, lease *filesystem.Lease, files *filesystem.Handle) (string, error)
- func PitfallScaffoldDocument(sourcePath string) (presentation.Document, error)
- func PluralKind(singular string) (string, bool)
- func RequireCapability(profile catalog.Profile, command string, fullOnly bool) error
- func ScaffoldConfig(prefix string, vars map[string]string, scopes []string) ([]byte, error)
- func ScaffoldConfigForProfile(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 AgentDialect
- type Capability
- type CapabilityError
- type CheckAdvisories
- type CheckReport
- type ContextPreparation
- type CurrentStateReport
- 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) Open(ctx context.Context, root string) (*ProjectState, error)
- func (l *Loader) OpenForMutation(ctx context.Context, root string, files *filesystem.Handle) (*ProjectState, *config.Config, *filesystem.ExpectedIdentity, error)
- func (l *Loader) OpenForOperation(ctx context.Context, root string) (*ProjectState, *config.Config, error)
- type OperationSemantics
- type OutputPlan
- type OutputPolicy
- type PitfallScaffoldCleanupError
- type ProjectState
- type ProjectTreeReader
- type RenderedFile
- type ResolveResidentRoot
- type Target
- type TargetOutput
- type TargetOutputInput
- type TargetOutputProducer
Constants ¶
const ( // MarkdownAgentDialect preserves the Markdown target-dialect compatibility value. MarkdownAgentDialect = projectstate.MarkdownAgentDialect // PlainAgentDialect preserves the plain-text target-dialect compatibility value. PlainAgentDialect = projectstate.PlainAgentDialect )
const ( // CapabilitySubagentTools preserves the subagent-tools capability value. CapabilitySubagentTools = projectstate.CapabilitySubagentTools // CapabilitySessionHandoff preserves the session-handoff capability value. CapabilitySessionHandoff = projectstate.CapabilitySessionHandoff // CapabilityEffortSessions preserves the effort-sessions capability value. CapabilityEffortSessions = projectstate.CapabilityEffortSessions )
const TargetOutputTemplate = projectstate.TargetOutputTemplate
TargetOutputTemplate preserves the template-producer compatibility value.
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 *ProjectState, cfg *config.Config, output outputplan.Plan, semantics OperationSemantics) ([]string, error)
AdvisoryNotes reports non-blocking project checks from one prepared universe.
func BuildListDocument ¶ added in v0.40.0
func BuildListDocument(state *ProjectState, 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; ok is false for a kind with no catalog pool (domains).
func CheckStagedDriftResult ¶ added in v0.40.0
func CheckStagedDriftResult(prep *ContextPreparation, plan outputplan.Plan) (checkresult.Result, error)
CheckStagedDriftResult compares one Publisher plan entirely within its prepared index universe and retains generated-output classification from its owner.
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 singular CLI kind is the freeform domains kind (no catalog pool).
func KnownTargets ¶ added in v0.4.0
func KnownTargets() []string
KnownTargets returns the closed built-in target names.
func NeededVars ¶ added in v0.13.0
NeededVars returns the var names referenced by the full rendered catalog.
func NewADRLeased ¶ added in v0.41.0
func NewADRLeased(root string, cfg *config.Config, repo *awfgit.Repo, ctx context.Context, title string, lease *filesystem.Lease, files *filesystem.Handle) (string, error)
NewADRLeased scaffolds one branch-aware ADR through the caller-held selected-root capability. The caller retains its tracked lease through presentation.
func NewPitfall ¶ added in v0.40.0
func NewPitfall(root, title string) (presentation.Document, error)
NewPitfall scaffolds one authored pitfall beneath root.
func NewPlanLeased ¶ added in v0.41.0
func NewPlanLeased(root, title string, lease *filesystem.Lease, files *filesystem.Handle) (string, error)
NewPlanLeased scaffolds one plan through the caller-held selected-root capability. The caller retains its tracked lease through presentation.
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 ¶
PluralKind maps a singular CLI kind token to its descriptor plural.
func RequireCapability ¶ added in v0.38.0
RequireCapability refuses a declared Full-only command under Core.
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 ScaffoldConfigForProfile ¶ added in v0.38.0
func ScaffoldConfigForProfile(prefix string, vars map[string]string, scopes []string, profile catalog.Profile) ([]byte, error)
ScaffoldConfigForProfile generates fresh config for the selected governance footprint.
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 AgentDialect ¶ added in v0.18.0
type AgentDialect = projectstate.AgentDialect
AgentDialect preserves the project package's target-dialect compatibility name.
type Capability ¶ added in v0.18.0
type Capability = projectstate.Capability
Capability preserves the project package's target-capability compatibility name.
type CapabilityError ¶ added in v0.38.0
CapabilityError is a stable refusal produced before a Full-only handler runs.
func (*CapabilityError) Diagnostic ¶ added in v0.38.0
func (e *CapabilityError) Diagnostic() (presentation.Diagnostic, error)
func (*CapabilityError) Error ¶ added in v0.38.0
func (e *CapabilityError) Error() string
type CheckAdvisories ¶ added in v0.40.0
CheckAdvisories separates ranked warnings from unranked information without adding another finding rank.
type CheckReport ¶ added in v0.30.0
type CheckReport = repositorycheck.Report
CheckReport is the ordinary check operation's compatibility projection.
func BuildCheckReport ¶ added in v0.40.0
func BuildCheckReport(state *ProjectState, cfg *config.Config, repo *awfgit.Repo, ctx context.Context, output outputplan.Plan, semantics OperationSemantics) (CheckReport, error)
BuildCheckReport checks the selected project tree using one prepared universe.
type ContextPreparation ¶ added in v0.40.0
type ContextPreparation = currentstatecoord.ContextPreparation
ContextPreparation is the coordinator-selected staged universe used by the project-owned generated-output drift comparison. The project comparison does not select, parse, or cache another universe.
func PrepareStagedContextState ¶ added in v0.40.0
func PrepareStagedContextState(ctx context.Context, root string) (*ContextPreparation, error)
PrepareStagedContextState retains the project compatibility entry point for staged generated-output drift while delegating its authority preparation.
type CurrentStateReport ¶ added in v0.22.0
type CurrentStateReport = currentstatecoord.CurrentStateReport
CurrentStateReport is the direct compatibility projection consumed by repository-check command composition.
type Layout ¶
type Layout struct {
DocsDir string
ADRDir string
IndexMd string
PlansDir 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) Open ¶ added in v0.30.0
Open loads, validates, and derives one project's immutable facts.
func (*Loader) OpenForMutation ¶ added in v0.41.0
func (l *Loader) OpenForMutation(ctx context.Context, root string, files *filesystem.Handle) (*ProjectState, *config.Config, *filesystem.ExpectedIdentity, error)
OpenForMutation loads authority through the supplied confined handle and returns the identity of precisely the config bytes the Loader parsed. The byte comparison closes the otherwise invisible interval between confined observation and config-tree parsing; callers use identity for their expected replacement.
func (*Loader) OpenForOperation ¶ added in v0.40.0
func (l *Loader) OpenForOperation(ctx context.Context, root string) (*ProjectState, *config.Config, error)
OpenForOperation returns immutable state together with the one concrete configuration tree selected during loading. Commands pass that tree only to operations that read sidecars, parts, or source bytes.
type OperationSemantics ¶ added in v0.40.0
type OperationSemantics struct {
ADRs adr.Corpus
Pitfalls pitfall.Corpus
Topics topic.Corpus
EffectiveSkills map[string]bool
Plans []plan.Plan
PlansError error
GeneratedOutput generatedcheck.AdditionalInput
Vocabulary vocabularycheck.Input
}
OperationSemantics carries Publisher's direct semantic derivation to residual project consumers without coupling project to application coordination.
type OutputPlan ¶ added in v0.18.0
type OutputPlan = outputplan.Plan
type OutputPolicy ¶ added in v0.18.0
type OutputPolicy = outputplan.Policy
type PitfallScaffoldCleanupError ¶ added in v0.34.0
PitfallScaffoldCleanupError reports a committed authored source whose publication temporary still requires cleanup.
func (*PitfallScaffoldCleanupError) Diagnostic ¶ added in v0.34.0
func (e *PitfallScaffoldCleanupError) Diagnostic() (presentation.Diagnostic, error)
Diagnostic maps the committed scaffold outcome to actionable CLI output.
func (*PitfallScaffoldCleanupError) Error ¶ added in v0.34.0
func (e *PitfallScaffoldCleanupError) Error() string
func (*PitfallScaffoldCleanupError) Unwrap ¶ added in v0.34.0
func (e *PitfallScaffoldCleanupError) Unwrap() error
Unwrap preserves the committed-publication and cleanup failure identities.
type ProjectState ¶ added in v0.40.0
type ProjectState struct {
// contains filtered or unexported fields
}
ProjectState preserves the RF-002 compatibility name for the lower immutable state owner.
func Open ¶
Open is the transitional compatibility entry point for callers not yet migrated to outer composition. A supplied repository preserves one composed handle for an existing compatibility caller; new code composes a Loader.
func (*ProjectState) Config ¶ added in v0.40.0
func (s *ProjectState) Config() *config.Config
Config returns a defensive copy of the immutable loaded configuration facts.
func (*ProjectState) OutputState ¶ added in v0.40.0
func (s *ProjectState) OutputState() *projectstate.ProjectState
OutputState returns the immutable loaded facts consumed by Publisher. The lower value is projected defensively at this package boundary so Publisher cannot retain the compatibility facade's target slice.
func (*ProjectState) Root ¶ added in v0.40.0
func (s *ProjectState) Root() string
Root returns the invoking checkout root.
func (*ProjectState) Targets ¶ added in v0.40.0
func (s *ProjectState) Targets() []Target
Targets returns a defensive copy of the resolved targets.
type ProjectTreeReader ¶ added in v0.22.0
type ProjectTreeReader = outputplan.TreeReader
type RenderedFile ¶
type RenderedFile struct {
Path, Content, TemplateID, TemplateHash, ConfigHash string
RegenChecked bool
Policy outputplan.Policy
Declarer, DeclarerProjection string
Encoder 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 Target ¶
type Target = projectstate.Target
Target preserves the project package's resolved-target compatibility name.
type TargetOutput ¶ added in v0.18.0
type TargetOutput = projectstate.TargetOutput
TargetOutput preserves the project package's target-output compatibility name.
type TargetOutputInput ¶ added in v0.22.0
type TargetOutputInput = projectstate.TargetOutputInput
TargetOutputInput preserves the project package's target-input compatibility name.
type TargetOutputProducer ¶ added in v0.22.0
type TargetOutputProducer = projectstate.TargetOutputProducer
TargetOutputProducer preserves the project package's producer compatibility name.