Documentation
¶
Overview ¶
Package resident owns resident-root policy and path anchoring: the closed table of repository-wide roots awf owns at the primary control root, the predicate that recognises a path or a render kind as resident, the Roots value that resolves an output path against the right anchor, and the resident lifecycle operations. The sync core depends on this package; this package never depends on the core.
Index ¶
- func CollisionsAt(root string, planned []string) ([]string, error)
- func InspectRoots(root string) ([]string, error)
- func IsResidentKind(kind string) bool
- func IsResidentPath(path string) bool
- func PreserveRemoval(path string, preserved []string) bool
- func RootNames() []string
- type Backup
- type PartialUninstallError
- type Roots
- type UninstallReport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollisionsAt ¶
CollisionsAt filters planned project-relative paths to those that already exist under root and are not recorded in root's lock (not awf-managed). Split from InitCollisions so init's pre-prompt probe can plan outputs in a throwaway scaffold and test them against the real root; the ADR-0016 collision semantics are unchanged.
func InspectRoots ¶
InspectRoots examines direct children only. It never traverses a dynamic resident tree; a descendant other than the managed .gitignore keeps its root intact. Publisher's read-only inspection owns its existing host-path seam. InspectRoots is the read-only inspection entry point used by Publisher.
func IsResidentKind ¶
IsResidentKind reports whether a render kind is one of the resident roots' self-ignoring render units, so a caller never spells the names to decide it.
func IsResidentPath ¶
IsResidentPath reports whether a config-relative slash path names a resident root or something below one.
func PreserveRemoval ¶
PreserveRemoval reports whether a lock-relative path lies inside a resident root the inspection found to hold dynamic data, so removal must skip it.
Types ¶
type Backup ¶ added in v0.36.0
Backup records one local document preserved during uninstall. Both paths are lock-relative and Bak is the exact first-free sibling chosen by Backup.
type PartialUninstallError ¶ added in v0.41.0
type PartialUninstallError struct {
Report UninstallReport
Cause error
Recovery []string
}
PartialUninstallError retains the committed uninstall report when a later removal fails. It preserves the mechanism error for errors.Is/As and names the convergent recovery the resident operation owns.
func (*PartialUninstallError) Document ¶ added in v0.41.0
func (e *PartialUninstallError) Document() (presentation.Document, error)
func (*PartialUninstallError) Error ¶ added in v0.41.0
func (e *PartialUninstallError) Error() string
func (*PartialUninstallError) Unwrap ¶ added in v0.41.0
func (e *PartialUninstallError) Unwrap() error
type Roots ¶
Roots anchors output paths. Tracked is the invoking checkout that owns every tracked output; Resident is the primary control root that owns the dynamic resident trees. Both are construction inputs, fixed when a project opens.
func NewRoots ¶
NewRoots pairs the tracked and resident anchors into the value that owns output-path resolution.
func (Roots) ResolveOutput ¶
ResolveOutput resolves resident root artifacts at the primary control root while leaving every tracked output anchored at the invoking checkout.
type UninstallReport ¶
type UninstallReport struct {
Removed int
RemovedGenerated []string
PreservedRoots []string
Backups []Backup
RemovedEmptyDirs []string
LockRemoved bool
}
UninstallReport records every stable root-relative effect committed by an uninstall. Removed remains the compatibility summary; callers that need to recover or present the result use the exact effect lists.
func UninstallLeased ¶ added in v0.41.0
func UninstallLeased(ctx context.Context, root string, preserveTemplate func(string) bool, lease *filesystem.Lease) (UninstallReport, error)
UninstallLeased removes awf's generated footprint while preserving dynamic resident state. The caller supplies the live dual-root lease acquired before authority loading; this operation verifies it before reading the lock.
func (UninstallReport) Document ¶
func (r UninstallReport) Document() (presentation.Document, error)
Document maps an uninstall result into its complete ordinary presentation.
func (UninstallReport) PartialDocument ¶ added in v0.41.0
func (r UninstallReport) PartialDocument() (presentation.Document, error)
PartialDocument retains every completed uninstall fact when a later removal fails and gives the caller a convergent retry action.