Documentation
¶
Overview ¶
Package reconcile owns the bounded multi-source synchronization service.
The service composes validated application ports behind exact scope/source keyed nonblocking leases. Its stage engine is delivered incrementally by the reconciliation stage tasks; until composed, public entrypoints perform full input validation, leasing, and aggregation without mutating durable state.
Index ¶
- Variables
- type AllResult
- type Clock
- type Dependencies
- type Options
- type Result
- type RunIDGenerator
- type Service
- func (service *Service) Recover(ctx context.Context, scope knowl.ScopeRef, sources []knowl.Source) ([]Result, error)
- func (service *Service) SyncAll(ctx context.Context, scope knowl.ScopeRef, sources []knowl.Source) (AllResult, error)
- func (service *Service) SyncSource(ctx context.Context, scope knowl.ScopeRef, source knowl.Source) (Result, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrSyncInProgress reports an overlapping invocation for one exact scope/source. ErrSyncInProgress = errors.New("source sync already in progress") // ErrSyncPartial reports that SyncAll or Recover completed while at least one source failed. ErrSyncPartial = errors.New("source sync completed with source failures") // ErrRecoveryFailed reports readiness restoration or resumable-run inspection // failure without exposing storage internals. ErrRecoveryFailed = errors.New("workspace recovery failed") )
Stable, redacted service outcomes.
Functions ¶
This section is empty.
Types ¶
type AllResult ¶
type AllResult struct {
Results []Result
}
AllResult aggregates one deterministic result per attempted source.
type Dependencies ¶
type Dependencies struct {
Adapters map[knowl.SourceType]app.SourceAdapter
State app.SourceStateStore
Content app.ContentStore
SourceContent app.SourceContentStore
Search app.SearchIndex
Maintenance app.SourceMaintenanceQueue
}
Dependencies binds the validated application ports consumed by the service.
type Options ¶
type Options struct {
MaxSyncAllSources int
MaxScanPages int
MaxScanDocuments int
MaxMutations int
MaxRawBytes int
MaxRecoveryRuns int
Clock Clock
NewRunID RunIDGenerator
}
Options carries conservative validated service bounds and injected clocks.
type Result ¶
type Result struct {
SourceID knowl.SourceID
Run knowl.SyncRun
Changed bool
FailureClass string
Diagnostics []knowl.SourceDiagnostic
}
Result is the redacted observable outcome of one source synchronization attempt.
type RunIDGenerator ¶
RunIDGenerator supplies bounded opaque durable run identifiers.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service coordinates bounded idempotent source reconciliation.
func NewService ¶
func NewService(dependencies Dependencies, options Options) (*Service, error)
NewService validates dependencies and options and returns a composed service.
func (*Service) Recover ¶
func (service *Service) Recover(ctx context.Context, scope knowl.ScopeRef, sources []knowl.Source) ([]Result, error)
Recover restores workspace readiness, then resumes every bounded nonterminal run belonging to the configured sources.