Class FileSourceReconciler
A reconcile walks the source with the same code as a cold load, so caps,
selectors, ignore files, ordering and outcome checks are identical. The
prior manifest only replaces the per-file read: a file whose stat key is
unchanged is not read, and a file whose bytes and pipeline fingerprint are
unchanged is not extracted, chunked or enriched again. Reconciling against
FileManifest.empty() is a cold load. On a file system without an
inode change time, a change that keeps a file's size, modification time
and file key is not seen until its bytes are read again; see
FileManifest.
The reconciler holds no mutable state; callers keep the returned manifest and pass it to the next call.
- Since:
- 0.18.7
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classOutcome of one reconcile: the load result, the manifest for the next reconcile, and the diff against the prior manifest. -
Constructor Summary
ConstructorsConstructorDescriptionFileSourceReconciler(FileIngestionService ingestionService) Creates a reconciler that loads throughingestionServiceand keeps the extracted document of each ingested file in its manifests. -
Method Summary
Modifier and TypeMethodDescriptionreconcile(com.tnsai.rag.KnowledgeSourceConfig source, FileManifest prior, Consumer<FileIngestionService.IngestionProgress> observer) Loadssourcewithprioras the reuse oracle.Returns a reconciler on the same pipeline whose manifests keep each file's chunks but not the extracted document text, for callers that index chunks only.
-
Constructor Details
-
FileSourceReconciler
Creates a reconciler that loads throughingestionServiceand keeps the extracted document of each ingested file in its manifests.- Parameters:
ingestionService- the FILE pipeline and its admission caps
-
-
Method Details
-
withoutOriginals
Returns a reconciler on the same pipeline whose manifests keep each file's chunks but not the extracted document text, for callers that index chunks only.- Returns:
- a reconciler that keeps no extracted documents
-
reconcile
public FileSourceReconciler.Reconciled reconcile(com.tnsai.rag.KnowledgeSourceConfig source, FileManifest prior, Consumer<FileIngestionService.IngestionProgress> observer) Loadssourcewithprioras the reuse oracle.A file whose read fails keeps its prior entry and is reported in
FileSourceReconciler.Reconciled.failedPaths(), neither changed nor removed. A load that discards what it collected, such as a failed directory walk, isaborted: it returnspriorunchanged with an empty diff.- Parameters:
source- canonical FILE-source configurationprior- manifest of the previous load, orFileManifest.empty()observer- synchronous progress observer- Returns:
- the load result, the next manifest and the diff against
prior
-