Documentation
¶
Overview ¶
Package capability owns FlowBaton's executable support classifications and graph-wide fail-closed analysis.
Index ¶
Constants ¶
const RegistryVersionV0 = "flowbaton.support/v0"
RegistryVersionV0 identifies the first frozen support registry contract.
Variables ¶
var ErrFlowDirectory = errors.New("flow link is a directory")
ErrFlowDirectory identifies a path that resolves to a directory rather than a file resource.
var ErrFlowNonRegular = errors.New("flow link is not a regular file")
ErrFlowNonRegular identifies a path that resolves to a FIFO, socket, device, or another non-regular resource that must never be opened during preflight.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
Kind FeatureKind `json:"kind"`
Name string `json:"name"`
ParseStatus ParseStatus `json:"parseStatus"`
RuntimeStatus RuntimeStatus `json:"runtimeStatus"`
Platforms []string `json:"platforms,omitempty"`
Reason string `json:"reason"`
}
Entry is the stable generic support-registry schema.
type ExecutionPlatform ¶
type ExecutionPlatform string
ExecutionPlatform is the driver surface selected before capability preparation. It is deliberately narrower than the registry's host and physical-device platform vocabulary.
const ( ExecutionPlatformAndroid ExecutionPlatform = "android" ExecutionPlatformIOSSimulator ExecutionPlatform = "ios-simulator" ExecutionPlatformWeb ExecutionPlatform = "web" )
type FeatureKind ¶
type FeatureKind string
FeatureKind identifies the catalog containing an entry.
const ( FeatureCommand FeatureKind = "command" FeatureSelector FeatureKind = "selector-feature" FeatureConfigExtension FeatureKind = "config-extension" FeatureCLISubcommand FeatureKind = "cli-subcommand" FeatureCLIFlag FeatureKind = "cli-flag" FeatureHostTarget FeatureKind = "host-target" FeatureDevicePlatform FeatureKind = "device-platform" )
type FileLoader ¶
type FileLoader struct{}
FileLoader is the default read-only filesystem/parser adapter.
type FlowLoader ¶
type FlowLoader interface {
Canonical(context.Context, string) (string, error)
Load(context.Context, string) (model.Flow, error)
}
FlowLoader separates canonical identity from parsing so the checker can cache each canonical flow while retaining every call-site edge.
type GraphEdge ¶
type GraphEdge struct {
From string `json:"from"`
To string `json:"to"`
Kind model.FileLinkKind `json:"kind"`
Source model.SourceInfo `json:"-"`
}
GraphEdge retains every flow, script, and media call site. Source carries local diagnostics and is excluded from contract snapshots.
type GraphNode ¶
type GraphNode struct {
Path string `json:"path"`
}
GraphNode is one canonical flow loaded and analyzed exactly once.
type Option ¶
type Option func(*checkConfig)
Option configures Check without introducing device, asset, JS, or session dependencies.
func WithLoader ¶
func WithLoader(loader FlowLoader) Option
WithLoader supplies a pure flow/resource loader, primarily for deterministic tests and alternate read-only filesystems.
func WithPlatform ¶
func WithPlatform(platform ExecutionPlatform) Option
WithPlatform limits preflight to the selected execution platform. An empty platform preserves platform-neutral syntax checking; executable callers should pass one of android, ios-simulator, or web before opening a driver.
func WithRegistry ¶
WithRegistry supplies the frozen registry used by capability analysis.
type ParseStatus ¶
type ParseStatus string
ParseStatus records whether the syntax is recognized by the v0 contract.
const ( ParseStatusParseable ParseStatus = "parseable" ParseStatusOmitted ParseStatus = "omitted" )
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is an immutable-by-convention versioned entry set.
func DefaultRegistry ¶
func DefaultRegistry() Registry
DefaultRegistry returns the exhaustive v0 support registry.
func NewRegistry ¶
NewRegistry constructs a registry from defensively copied entries.
func (Registry) Lookup ¶
func (r Registry) Lookup(kind FeatureKind, name string) (Entry, bool)
Lookup returns one exact catalog entry.
type Report ¶
type Report struct {
Roots []string `json:"roots"`
Nodes []GraphNode `json:"nodes"`
Edges []GraphEdge `json:"edges"`
}
Report is the deterministic selected-root graph proven by preflight.
type RuntimeStatus ¶
type RuntimeStatus string
RuntimeStatus records the declared v1 execution posture.
const ( RuntimeStatusPlannedV1 RuntimeStatus = "planned-v1" RuntimeStatusPlatformLimited RuntimeStatus = "platform-limited" RuntimeStatusDeferred RuntimeStatus = "deferred" RuntimeStatusExcluded RuntimeStatus = "excluded" )
type Violation ¶
type Violation struct {
Code string `json:"code"`
Message string `json:"message"`
FeatureKind FeatureKind `json:"featureKind,omitempty"`
FeatureName string `json:"featureName,omitempty"`
Source model.SourceInfo `json:"-"`
Chain []GraphEdge `json:"chain,omitempty"`
Cause error `json:"-"`
}
Violation is a fail-closed, location-aware preflight error.