Documentation
¶
Overview ¶
Package runtimeguard centralizes runtime/buildtime dependency-boundary checks.
Keeping roots, forbidden prefixes, dependency graph collection, and violation formatting in one place prevents drift between CI command checks and test contract checks.
Index ¶
- func DefaultBuildtimeSentinelDependencyPrefixes() []string
- func DefaultBuildtimeSentinelRootPackagePath() string
- func DefaultForbiddenRuntimeDependencyPathPrefixes() []string
- func FindPresentDependencyPrefixMatches(rootPackagePath string, candidatePrefixes []string) ([]string, error)
- type DependencyViolation
- type EvaluationReport
- type RuntimeDependencyBoundaryCheck
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultBuildtimeSentinelDependencyPrefixes ¶
func DefaultBuildtimeSentinelDependencyPrefixes() []string
DefaultBuildtimeSentinelDependencyPrefixes returns default buildtime dependency prefixes expected to appear in a known buildtime root closure.
func DefaultBuildtimeSentinelRootPackagePath ¶
func DefaultBuildtimeSentinelRootPackagePath() string
DefaultBuildtimeSentinelRootPackagePath returns the default buildtime root used by sentinel-coverage checks.
func DefaultForbiddenRuntimeDependencyPathPrefixes ¶
func DefaultForbiddenRuntimeDependencyPathPrefixes() []string
DefaultForbiddenRuntimeDependencyPathPrefixes returns forbidden build/dev dependency prefixes for runtime roots.
Types ¶
type DependencyViolation ¶
type DependencyViolation struct {
RootPackagePath string
DependencyPath string
MatchedPrefix string
}
DependencyViolation records one runtime dependency-boundary failure.
type EvaluationReport ¶
type EvaluationReport struct {
CheckedRuntimeRoots []string
ForbiddenPrefixes []string
Violations []DependencyViolation
}
EvaluationReport captures one full dependency-boundary evaluation run.
func EvaluateDefaultRuntimeDependencyBoundaries ¶
func EvaluateDefaultRuntimeDependencyBoundaries() (*EvaluationReport, error)
EvaluateDefaultRuntimeDependencyBoundaries evaluates default runtime roots against default forbidden build/dev dependency prefixes.
func EvaluateRuntimeDependencyBoundaries ¶
func EvaluateRuntimeDependencyBoundaries( boundaryChecks []RuntimeDependencyBoundaryCheck, forbiddenDependencyPathPrefixes []string, ) (*EvaluationReport, error)
EvaluateRuntimeDependencyBoundaries evaluates runtime roots against forbidden dependency prefixes.
func (*EvaluationReport) FormatViolationReport ¶
func (report *EvaluationReport) FormatViolationReport() string
FormatViolationReport formats evaluation output for CI and human debugging.
func (*EvaluationReport) HasViolations ¶
func (report *EvaluationReport) HasViolations() bool
HasViolations reports whether any boundary violations were found.
type RuntimeDependencyBoundaryCheck ¶
type RuntimeDependencyBoundaryCheck struct {
RootPackagePath string
}
RuntimeDependencyBoundaryCheck defines one runtime package root whose transitive dependency closure must exclude build/dev-time packages.
func DefaultRuntimeBoundaryChecks ¶
func DefaultRuntimeBoundaryChecks() []RuntimeDependencyBoundaryCheck
DefaultRuntimeBoundaryChecks returns the default runtime roots checked by the guard.