SessionRetentionConfig class final
The sessions.retention: block — the opt-in retention policy.
Defaults are the no-op policy: no cap (maxTotalBytes: 0), so nothing
is ever auto-deleted (AC1/AC2). Parsing is tolerant like
SpillsConfig: mistyped scalars fall back to the default with a note,
unknown keys are noted and ignored, and the parser never throws.
Constructors
-
SessionRetentionConfig({int maxTotalBytes = 0, int minAgeDays = defaultMinAgeDays, bool keepNamed = true, SessionRetentionSweepMode sweep = SessionRetentionSweepMode.boot, List<
String> notes = const []}) -
Creates a configuration; see each field for its default.
const
- SessionRetentionConfig.fromYaml(Object? node)
-
Parses the
retention:map (the value ofsessions.retention:). Tolerant: never throws; every deviation lands in notes.factory
Properties
- hasCap → bool
-
Whether a cap is configured — the master switch for every sweep.
no setter
- hasExplicitValues → bool
-
Whether any retention key differs from its default (a touched
section). Drives the yaml emitter (defaults are never written).
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- keepNamed → bool
-
Named sessions (
fa --session <name>) are always exempt.final - maxTotalBytes → int
-
The total-size cap over the sessions root, in bytes.
0(the default) means NO cap — nothing is ever auto-deleted.final - minAgeDays → int
-
A session last used more recently than this many days ago is never
swept, no matter how far over the cap the root is (AC3).
final
-
notes
→ List<
String> -
Tolerant-parse notes (unknown keys, mistyped scalars) surfaced at
boot; never fatal.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sweep → SessionRetentionSweepMode
-
When the sweep runs (default SessionRetentionSweepMode.boot).
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
toYaml(
{int indent = 2}) → String -
The
retention:block, only the non-default keys (the file stays minimal), indentedindentspaces for nesting undersessions:. Empty at the defaults.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- defaultMinAgeDays → const int
-
The default
minAgeDays(public for the yaml emitter's non-default check).