Documentation
¶
Overview ¶
Package currentstatecoord coordinates current-state transition operations over explicitly selected immutable repository universes.
Index ¶
- func NormalizeAuthorityPath(root, value string) (string, error)
- func QueryTopic(root string, repo *awfgit.Repo, ctx context.Context, selector string, ...) (topic.QueryResult, error)
- func ReadADR(root string, repo *awfgit.Repo, ctx context.Context, identity string) (presentation.Detail, error)
- func ReadPlan(root, name, selector string) ([]byte, error)
- func ResolveTopics(root string, repo *awfgit.Repo, ctx context.Context, paths []string) (presentation.Detail, error)
- func UncoveredPaths(root string, repo *awfgit.Repo, ctx context.Context) (presentation.Detail, error)
- type CommitAuthorizationResult
- type CurrentStateReport
- type NumberAssignment
- type NumberingEffect
- type NumberingReport
- type OutputPreparation
- type PartialNumberingError
- type PublicationOutcome
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeAuthorityPath ¶ added in v0.43.0
normalizeAuthorityPath makes a command argument repository-relative and lexical. Absolute paths outside root and upward traversal are refused.
func QueryTopic ¶
func QueryTopic(root string, repo *awfgit.Repo, ctx context.Context, selector string, opts topic.QueryOptions) (topic.QueryResult, error)
QueryTopic selects and validates one working authority universe before delegating topic query semantics to topic.
func ReadADR ¶ added in v0.43.0
func ReadADR(root string, repo *awfgit.Repo, ctx context.Context, identity string) (presentation.Detail, error)
ReadADR reports one parsed ADR's status, canonical operation progress, and plans that link it from the same working authority universe.
func ReadPlan ¶
ReadPlan selects one plan from the working filesystem and completes its plan-v2 authority projection. Parsing, selection, closure, and rendering remain owned by plan and plancheck.
func ResolveTopics ¶ added in v0.43.0
func ResolveTopics(root string, repo *awfgit.Repo, ctx context.Context, paths []string) (presentation.Detail, error)
ResolveTopics reports lexical path attribution from the working current-state universe. It intentionally does not require paths to exist.
func UncoveredPaths ¶ added in v0.43.0
func UncoveredPaths(root string, repo *awfgit.Repo, ctx context.Context) (presentation.Detail, error)
UncoveredPaths reports the whole-working-tree unowned census. It is an informational query, separate from enforcement coverage and its exclusions.
Types ¶
type CommitAuthorizationResult ¶
type CommitAuthorizationResult struct {
Category string
Condition string
ChangedIndex bool
ChangedMessage bool
ChangedMergeState bool
NextActions []string
}
CommitAuthorizationResult is the non-mutating outcome of definitive commit-message stale-merge authorization.
func CheckCommitAuthorization ¶
func CheckCommitAuthorization(root string, repo *awfgit.Repo, ctx context.Context, msg commitmsg.Message) (CommitAuthorizationResult, error)
CheckCommitAuthorization validates the index, first parent, every incoming MERGE_HEAD parent, and the cleaned final message without mutating any axis.
type CurrentStateReport ¶
type CurrentStateReport struct {
Static []currentstate.Finding
Provisional []currentstate.Introduction
Coverage []topic.CoverageFinding
PlanDrift []manifest.Drift
PlanNotes []string
// PlanResult retains PlanChecker classification while PlanDrift and
// PlanNotes remain compatibility projections.
PlanResult checkresult.Result
// CurrentResult and PlanArtifactResult retain disjoint typed partitions for
// command presentation. OwnerResult is their immutable aggregate. Legacy
// slices remain compatibility projections.
CurrentResult checkresult.Result
PlanArtifactResult checkresult.Result
OwnerResult checkresult.Result
}
CurrentStateReport is the routed outcome of a current-state check over one snapshot: the static ADR-to-claim handshake findings (all blocking), staged older-format introductions awaiting commit-message evidence, and the coverage/fan-out findings, which carry ranks fixed in code rather than configured - coverage at error, fan-out at warn (ADR-0183). Findings and Notes split the report into blocking lines and non-failing note lines so the command layer never re-derives the routing.
func CheckStaged ¶
CheckStaged loads the HEAD (before) and staged index (after) current-state universes and runs the snapshot-diff transition check between them plus the coverage/fan-out evaluator over the index (ADR-0135, ADR-0134). Both sides are committed or index universes, so a dirty working tree never affects the result. The before side is the empty universe on a repository with no commit yet, and the after config, policy, and eligible paths all come from the index tree so the staged check reads one universe. Coverage and fan-out always evaluate, whether or not the staged config declares a currentState policy (ADR-0192).
func CheckStagedRoot ¶
func CheckStagedRoot(ctx context.Context, root string) (CurrentStateReport, error)
CheckStagedRoot validates the staged current-state transition without opening working-tree project configuration. The staged command must remain operable when a valid adopted index deliberately deletes or lacks the working config.
func CheckWorking ¶
CheckWorking loads the working-tree current-state view and runs the static ADR-to-claim handshake and the coverage/fan-out evaluator over it (ADR-0135, ADR-0134). It reads exactly one working Tree, so the two checks never mix a working and an index universe. Coverage and fan-out always evaluate, whether or not the project configures a currentState policy (ADR-0192).
func (CurrentStateReport) Information ¶
func (r CurrentStateReport) Information() []string
Information returns unranked provisional introductions. They are not findings because the staged boundary lacks definitive merge-parent and message evidence; every independently derivable finding remains blocking.
func (CurrentStateReport) Result ¶
func (r CurrentStateReport) Result() checkresult.Result
Result returns the completed owner-classified result captured by the current-state coordinator. Compatibility slices cannot change it afterward.
type NumberAssignment ¶
NumberAssignment is one pending record's slug and the number numbering gave it.
type NumberingEffect ¶ added in v0.41.0
NumberingEffect is one exact root-relative path fact committed before a later numbering failure.
type NumberingReport ¶
type NumberingReport struct {
Assignments []NumberAssignment
}
NumberingReport is the mapping one numbering run assigned, in assignment order, so its caller can present it after a partial completion.
func NumberPendingADRsLeased ¶ added in v0.41.0
func NumberPendingADRsLeased(root string, slugs []string, publish func() (PublicationOutcome, error), lease *filesystem.Lease) (NumberingReport, error)
NumberPendingADRsLeased loads the pre-mutation authority universe through the selected-root handle, numbers its pending records, substitutes topic provenance, and then runs publish against the separately selected post-mutation universe. The caller retains the covering lease through presentation of the returned complete or partial outcome.
func (NumberingReport) Document ¶
func (r NumberingReport) Document() (presentation.Document, error)
Document maps numbering assignments to their semantic presentation.
type OutputPreparation ¶ added in v0.43.0
type OutputPreparation struct {
State *projectstate.ProjectState
Config *config.Config
Reader outputplan.TreeReader
// contains filtered or unexported fields
}
OutputPreparation selects the index universe used exclusively by staged generated-output drift. It carries output-plan inputs, not authority context.
func PrepareStagedOutput ¶ added in v0.43.0
func PrepareStagedOutput(ctx context.Context, root string) (*OutputPreparation, error)
PrepareStagedOutput selects only the index universe for staged output drift. It never consults working-tree configuration or locks.
func (*OutputPreparation) Lock ¶ added in v0.43.0
func (p *OutputPreparation) Lock() *manifest.Lock
func (*OutputPreparation) Tree ¶ added in v0.43.0
func (p *OutputPreparation) Tree() *snapshot.Tree
type PartialNumberingError ¶ added in v0.41.0
type PartialNumberingError struct {
Report NumberingReport
Effects []NumberingEffect
Publication PublicationOutcome
Cause error
Recovery []string
}
PartialNumberingError retains exact numbering, provenance, and Publisher effects after numbering has crossed its first mutation. It preserves the mechanism cause and supplies a residue-first recovery boundary.
func (*PartialNumberingError) Document ¶ added in v0.41.0
func (e *PartialNumberingError) Document() (presentation.Document, error)
func (*PartialNumberingError) Error ¶ added in v0.41.0
func (e *PartialNumberingError) Error() string
func (*PartialNumberingError) Unwrap ¶ added in v0.41.0
func (e *PartialNumberingError) Unwrap() error
type PublicationOutcome ¶ added in v0.41.0
type PublicationOutcome interface {
HasCommittedEffects() bool
PartialMutation() (presentation.Mutation, error)
}
PublicationOutcome is the owner-rendered Publisher result retained by ADR numbering when publication crosses its own mutation boundary.