resident

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollisionsAt

func CollisionsAt(root string, planned []string) ([]string, error)

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

func InspectRoots(root string) ([]string, error)

InspectRoots examines direct children only. It never traverses a dynamic resident tree; a descendant other than the managed .gitignore keeps its root intact.

func IsResidentKind

func IsResidentKind(kind string) bool

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

func IsResidentPath(path string) bool

IsResidentPath reports whether a config-relative slash path names a resident root or something below one.

func PreserveRemoval

func PreserveRemoval(path string, preserved []string) bool

PreserveRemoval reports whether a lock-relative path lies inside a resident root the inspection found to hold dynamic data, so removal must skip it.

func RootNames

func RootNames() []string

RootNames returns the owned root names in table order. It hands back a copy so the single declaration above stays the only writable home of the set.

Types

type Roots

type Roots struct {
	Tracked  string
	Resident string
}

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

func NewRoots(tracked, resident string) Roots

NewRoots pairs the tracked and resident anchors into the value that owns output-path resolution.

func (Roots) ResolveOutput

func (r Roots) ResolveOutput(path string) string

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
	PreservedRoots []string
}

func Uninstall

func Uninstall(ctx context.Context, root string) (UninstallReport, error)

Uninstall removes awf's generated footprint while preserving dynamic resident state. It is a free function so a broken config does not block it. touches-state: rendering/sync-and-drift:uninstall-removes-lock-entries - lock-tracked file removal; proof in resident_test.go

func (UninstallReport) Document

func (r UninstallReport) Document() (presentation.Document, error)

Document maps an uninstall result into its complete ordinary presentation.

Jump to

Keyboard shortcuts

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