Implement adapter-owned ingest finalization v1

Moves finalization from runner-owned post-processors into typed
SourceAdapter.finalize() contracts. Adds finalization report schema,
scope derivation, override replay context, and migrates historic-SQL
projection. Removes IngestBundlePostProcessorPort wiring and
HistoricSqlProjectionPostProcessor.
This commit is contained in:
Andrey Avtomonov 2026-05-18 15:55:07 +02:00
parent e8d461fcb8
commit 013998387e
25 changed files with 3176 additions and 295 deletions

View file

@ -1020,9 +1020,16 @@ describe('runKtxIngest', () => {
sourceKey: 'historic-sql',
body: {
workUnits: [],
postProcessor: {
finalization: {
sourceKey: 'historic-sql',
status: 'success',
commitSha: 'finalization-sha',
touchedPaths: ['semantic-layer/warehouse/_schema/public.yaml', 'wiki/global/historic-sql-orders.md'],
declaredTouchedSources: [{ connectionId: 'warehouse', sourceName: 'orders' }],
derivedTouchedSources: [{ connectionId: 'warehouse', sourceName: 'orders' }],
declaredChangedWikiPageKeys: ['historic-sql-orders'],
derivedChangedWikiPageKeys: ['historic-sql-orders'],
mismatches: [],
result: {
tableUsageMerged: 56,
staleTablesMarked: 1,
@ -1032,7 +1039,24 @@ describe('runKtxIngest', () => {
},
errors: [],
warnings: [],
touchedSources: [],
actions: [
...Array.from({ length: 57 }, (_, index) => ({
target: 'sl' as const,
type: 'updated' as const,
key: `orders-${index}`,
detail: 'Merged usage',
targetConnectionId: 'warehouse',
rawPaths: ['tables/public/orders.json'],
})),
...Array.from({ length: 35 }, (_, index) => ({
target: 'wiki' as const,
type: 'updated' as const,
key: `historic-sql-orders-${index}`,
detail: 'Projected pattern',
rawPaths: ['patterns/orders.json'],
})),
],
provenanceExclusions: [],
},
},
}),