Documentation
¶
Overview ¶
Package reconcile implements a React-style reconciliation pipeline for incremental graph updates driven by IPC events from Ancora and other sources.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChangeSet ¶
type ChangeSet struct {
Added []types.ObservationNode
Updated []types.ObservationNode
Deleted []int64 // Ancora IDs of deleted observations
}
ChangeSet describes the minimal set of mutations needed to bring the graph up to date with a batch of incoming events.
type Differ ¶
type Differ struct{}
Differ computes a ChangeSet from a batch of raw events. It is stateless — state tracking is the responsibility of the Reconciler / Patcher.
type Patcher ¶
type Patcher struct {
// contains filtered or unexported fields
}
Patcher applies a ChangeSet to the in-memory graph using minimal mutations. It maintains indexes so it can quickly locate existing nodes and edges without scanning the full graph on every event.
func NewPatcher ¶
NewPatcher creates a Patcher that operates on the given graph. llmQueueSize controls the buffer depth of the LLM extraction queue.
func (*Patcher) Apply ¶
Apply mutates the graph according to the ChangeSet. The graph is locked for the duration of the call so callers do not need external synchronization.
func (*Patcher) LLMQueue ¶
func (p *Patcher) LLMQueue() <-chan types.ObservationNode
LLMQueue returns the channel of nodes waiting for LLM reference extraction. The caller should drain this channel with a worker pool.
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue buffers incoming events with deduplication and optional debouncing. Multiple events for the same observation ID within the debounce window are collapsed so the reconciler only processes the most-recent state.
func (*Queue) Drain ¶
Drain removes up to maxBatch events from the queue and returns them in insertion order. The caller is responsible for processing them.