pathpolicy

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EffectiveGitRoot

func EffectiveGitRoot(workspaceRoot, projectRoot string) string

func FileExists

func FileExists(path string) bool

func NormalizeScope

func NormalizeScope(scope string) string

func PreferredExistingPath

func PreferredExistingPath(candidates ...string) string

func ProjectRoot

func ProjectRoot(workspaceRoot, projectRoot string) string

func ProtectionForScope

func ProtectionForScope(scope string) domain.ProtectionClass

func RequireContainedChild

func RequireContainedChild(base, candidate string) error

RequireContainedChild rejects a destructive target unless it is a strict lexical child of base and no existing component at or below base is a symlink. Call it immediately before remove/replace operations.

func RequireExactPath

func RequireExactPath(expected, candidate string) error

RequireExactPath verifies that persisted metadata still points at the one deterministic managed path computed by the adapter.

func UserHome

func UserHome(explicit string) string

func ValidateLeafID

func ValidateLeafID(value string) error

ValidateLeafID validates an identifier before it is used as one physical filesystem path component. Product-specific schemas may impose stricter semantic rules in addition to this portable path-safety invariant.

func ValidatePortablePathSegment

func ValidatePortablePathSegment(value string) error

ValidatePortablePathSegment validates one package-tree path component while still allowing the Unicode names permitted by Agent Plugins packages.

func WorkspaceRootFromApply

func WorkspaceRootFromApply(in ports.ApplyInput) string

func WorkspaceRootFromInspect

func WorkspaceRootFromInspect(in ports.InspectInput) string

func WorkspaceRootFromRecord

func WorkspaceRootFromRecord(record domain.InstallationRecord) string

Types

type Policy

type Policy struct{}

Policy is the one implementation of the agentplugins PathPolicy port. It adds no logic of its own: every method forwards to the package function that already carries the containment rules.

func (Policy) RequireContainedChild

func (Policy) RequireContainedChild(base, candidate string) error

func (Policy) RequireExactPath

func (Policy) RequireExactPath(expected, candidate string) error

func (Policy) ValidateLeafID

func (Policy) ValidateLeafID(value string) error

Jump to

Keyboard shortcuts

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