components/flutterstart_core/flutterstart_core library
Core models, primitives, and utilities for FlutterStart.
Classes
- AppliedHistoryStore
- Persists redacted applied-plan history with bounded retention.
- AppliedPlanHistoryRecord
- Represents the persisted history record of an applied plan that survives staging release.
- ApprovalRecord
- Represents the approval record bound to a Change Plan.
- Blueprint
- A project blueprint containing deterministic creation details.
- Catalog
- The versioned collection of catalog entries (§60.3, FR-021).
- CatalogEntry
- The single declaration of one selectable option.
- ChangePlan
- Represents the Change Plan outlining the creation steps and verification constraints.
- CommandRecord
- A record of an executed command in staging.
- CompatibilityFinding
- A structured finding resulting from compatibility validation.
- CompatibilityResult
- Structured result of validating a Blueprint and toolchain against a RecipeLock.
- DenyList
- A versioned definition containing a set of redaction rules.
- DoctorProbe
- Probes the system environment to build a DoctorReport.
- DoctorReport
- The Doctor capability data container reporting on system environment.
- EnvVarRedactionRule
- A redaction rule that dynamically redacts values of environment variables whose names match documented secret-like patterns.
- ExitCodes
- Stable exit codes for the FlutterStart application.
- HashResult
- A sealed result representing the outcome of a hashing operation.
- InvalidUtf8Result
- Result returned when a file expected to be text contains invalid UTF-8.
- LogRecord
- A structured record of an executed command log.
- ManifestEntry
- A single entry in the staging manifest representing a generated file.
-
ObservedValue<
T> - Represents a value that may or may not have been observed during a probe.
- Operation
- Represents a single unit of work (an operation) in a ChangePlan.
- PathCollision
- Represents a case-insensitive logical path collision.
- PinnedDependency
- A pinned dependency coordinate the recipe lock resolves (FR-019, C-3).
- PlanLocationRecord
- Represents the machine-local locator sidecar state for a Change Plan.
- PlanPruneInput
- Input model representing a plan's log metadata for pruning evaluation.
- PlanStore
- Persists portable plans separately from their machine-local location data.
- ProcessRunner
- Process runner wrapping dart:io process execution.
- PruneResult
- The result of the log pruning execution.
- RecipeLock
- The recipe lock pinning the concrete versions of all components.
- RecoveryReport
- The report detailing recovery outcomes and remaining unresolved paths.
- RedactionRule
- Represents a rule used to redact sensitive content from logs and artifacts.
- RedactionSink
- A write-time sink wrapper that redacts secrets before writing them to disk.
- SessionLock
- Manages a user-scoped session lock for serializing FlutterStart operations against a canonical destination path.
- StagingManifest
- The deterministic record of everything generated in staging.
- StalenessAssessment
- StalenessInputs
- Recorded plan values and current read-only observations used for staleness.
- StaticRedactionRule
- A redaction rule using a regular expression to match and replace secrets.
- SuccessfulHash
- Successful hashing result containing raw and normalized hashes.
- ToolchainException
- Represents a toolchain exception indicating a file is host-path-dependent.
- ValidationReport
- The report of validation checks, commands run, and hashes pre/post execution.
Enums
- ApprovalMode
- The mode of approval for a Change Plan.
- ApprovalVerification
- CompatibilityFindingSeverity
- Severity level for compatibility findings.
- CompatibilityStatus
- The tri-state compatibility outcome (FR-030, INV-COMP1) — a pure derivation over CompatibilityResult's existing findings (R-203), not a new result type.
- OperationKind
- The kinds of operations supported by FlutterStart.
- OwnershipClass
- Represents the ownership classification of a file.
- PackageCacheClassification
- The classification of the local package cache relative to locked recipes.
- PlanState
- Represents the lifecycle states of a Change Plan as defined in FR-069a.
- RecoveryState
- The state of staging/target recovery after a plan execution failure.
- RollbackCapability
- The rollback capability of a Change Plan.
- SelectionType
- Whether a capability section accepts one option or an ordered, de-duplicated list (FR-007, FR-008).
- SetupMode
-
The starting-selections mode a
createsession begins from. - SupportLevel
- The support level a Capability Catalog option carries (FR-010, §40).
- ValidationProfile
- ValidationResult
- The result status of the plan validation phase.
- WorkingDirectoryClass
- Represents the classification of working directory.
Constants
- flutterStartEngineVersion → const String
-
The recipe engine version this build implements. The
doctorengine-compat gate confirms it still matches the locked recipe'sengineVersion; keep it in lockstep with the recipe lock, not with the product version above. - flutterStartProductVersion → const String
-
FlutterStart product/CLI version shown to users (the
doctorbanner). ponytail: single literal; bump alongside pubspecversionon release. - logBestEffortNotice → const String
- Best-effort log redaction notice constant.
Properties
- defaultDenyList → DenyList
-
The default named, versioned deny-list implementation.
final
Functions
-
bindApproval(
{required ChangePlan plan, required Map< String, dynamic> targetPreconditions, required ApprovalMode mode, required DateTime approvedAt}) → ApprovalRecord -
canonicalJsonValue(
Object? value) → Object? - Recursively processes an object to create a canonical JSON representation.
-
computeRawHash(
List< int> bytes) → String - Computes the raw SHA-256 hash of the exact bytes.
-
containsLegacyRelocatedSelections(
Map< String, String> selections) → bool - Whether a v3 selection map still uses a capability's retired v2 home.
-
deriveCompatibilityStatus(
CompatibilityResult result) → CompatibilityStatus - Derives the tri-state status: Blocked ⟺ any blocker finding; Passed with warnings ⟺ no blockers but at least one warning; Passed ⟺ no findings.
-
detectPathCollision(
Iterable< String> paths) → PathCollision? - Detects case-insensitive path collisions among a set of paths.
-
evaluateStaleness(
StalenessInputs inputs) → StalenessAssessment - Compares supplied observations without reading or writing external state.
-
getUserStateDir(
{Map< String, String> ? environment}) → String - Derives the user-scoped state directory for FlutterStart session locks.
-
hashBytes(
List< int> bytes, {bool? isBinary}) → HashResult - Computes hash values for the given bytes.
-
isBinaryContent(
List< int> bytes) → bool - Helper to detect if a byte array represents binary content.
-
normalizeLineEndings(
String text) → String - Folds CRLF (\r\n) and lone CR (\r) into LF (\n).
-
pruneLogs(
List< PlanPruneInput> plans, {DateTime? now}) → PruneResult - Bounded log retention pruning.
-
releaseStaging(
String stagingRoot) → void -
requireLogicalPath(
String pathStr) → String - Requires an already-canonical, non-empty project-relative logical path.
-
toCanonicalJson(
Map< String, dynamic> map) → String - Converts a map to a canonical JSON string with recursively sorted keys.
-
toLogicalPath(
String pathStr) → String - Converts a path string to a project-relative, '/'-separated logical path.
-
validateBlueprint(
{required Blueprint blueprint, required String flutterVersion, required String dartVersion, required RecipeLock lock}) → CompatibilityResult - Validates a Blueprint and observed toolchain versions against a RecipeLock.
-
validateBlueprintAgainstCatalog(
{required Blueprint blueprint, required Catalog catalog, required String flutterVersion, required String dartVersion, required RecipeLock lock}) → CompatibilityResult -
Validates a versioned Blueprint's catalog-driven selections
against
catalog, the observed toolchain, andlock(FR-028-FR-033). -
validateVersionAgainstRange(
{required String toolName, required String observedVersionStr, required String rangeConstraintStr, required String? provenVersionStr, required List< CompatibilityFinding> findings, required String belowCode, required String aboveCode, required String outOfRangeCode, required String driftCode, required String invalidVersionCode, required String invalidRangeCode}) → void -
Pure, stateless version-range check (mutates
findingsin place; no other side effects). Public socatalog_validator.dartcan genuinely reuse it for per-capability Flutter/Dart bounds (T040) rather than duplicating the range/drift logic. -
verifyApproval(
ChangePlan plan) → ApprovalVerification -
withSessionLock<
T> (String destinationPath, Future< T> action(), {String? baseDir, bool isPidAlive(int pid)?, int? currentPid}) → Future<T> -
Convenience helper executing
actionwithin a session lock.
Exceptions / Errors
- InvalidUtf8
- Exception thrown when invalid UTF-8 content is encountered.
- SessionLockHeldException
- Exception thrown when a session lock is already held by another live operation.