CompactionRecord class final

Marks a compaction point: summary replaces everything before firstKeptEntryId when the context is rebuilt.

Ported from pi's CompactionEntry. Written by the compaction pipeline (a later phase); the record type is defined here so the tree and context projection already understand it.

Inheritance

Constructors

CompactionRecord({required String id, required String? parentId, required DateTime timestamp, required String summary, required String firstKeptEntryId, required int tokensBefore, Object? details, bool? fromHook})
Creates a CompactionRecord.
const

Properties

details → Object?
Optional structured details (e.g. file operations performed).
final
firstKeptEntryId → String
Id of the first record kept verbatim after the summary.
final
fromHook → bool?
Whether the compaction was triggered by a hook rather than the loop.
final
hashCode → int
The hash code for this object.
no setterinherited
id → String
Unique record id (short random id generated by the storage).
finalinherited
parentId → String?
Id of the parent record, or null for a tree root.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
summary → String
LLM-generated summary of the compacted history.
final
timestamp → DateTime
When the record was created.
finalinherited
tokensBefore → int
Token count of the context before compaction.
final
type → String
The type discriminator written to JSON (pi's type field).
no setteroverride

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
payloadJson() → Map<String, dynamic>
Type-specific fields merged into toJson by subclasses.
override
toJson() → Map<String, dynamic>
Serializes to a JSON map with the type discriminator (pi shape).
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited