Categories
Implementation Specs (157)
- specs/AnomalyDetection/TASK1.1.md
- specs/AnomalyDetection/TASK1.2.md
- specs/AnomalyDetection/TASK1.3.md
- specs/AnomalyDetection/TASK1.4.md
- specs/AnomalyDetection/TASK2.1.md
- specs/AnomalyDetection/TASK2.2.md
- specs/AnomalyDetection/TASK3.1.md
- specs/AnomalyDetection/TASK3.2.md
- specs/AnomalyDetection/TASK3.3.md
- specs/AnomalyDetection/TASK4.1.md
- specs/AnomalyDetection/TASK4.2.md
- specs/AnomalyDetection/TASK4.3.md
- specs/AnomalyDetection/TASK4.4.md
- specs/AnomalyDetection/TASK5.1.md
- specs/AnomalyDetection/TASK5.2.md
- specs/AnomalyDetection/TASK5.3.md
- specs/AnomalyDetection/TASK6.1.md
- specs/AnomalyDetection/TASK6.2.md
- specs/AnomalyDetection/TASK6.3.md
- specs/AnomalyDetection/TASKS.md
- specs/ApiServicePostgresTestStability/TASK.md
- specs/BackendDatabaseConsolidation/TASK.md
- specs/BackendDatabaseConsolidation/TASK1.1.md
- specs/BackendDatabaseConsolidation/TASK1.2.md
- specs/BackendDatabaseConsolidation/TASK1.3.md
- specs/BackendDatabaseConsolidation/TASK2.1.md
- specs/BackendDatabaseConsolidation/TASK2.2.md
- specs/BackendDatabaseConsolidation/TASK2.3.md
- specs/BackendDatabaseConsolidation/TASK3.1.md
- specs/BackendDatabaseConsolidation/TASK3.2.md
- specs/BackendDatabaseConsolidation/TASK4.1.md
- specs/BackendDatabaseConsolidation/TASK4.2.md
- specs/BackendDatabaseConsolidation/TASK4.3.md
- specs/BackendDatabaseConsolidation/TASK5.1.md
- specs/BackendDatabaseConsolidation/TASK5.2.md
- specs/BrinkLaborGetShiftsStaging/TASK.md
- specs/BrinkPosOrdersFirstEtlJob/TASK.md
- specs/BrinkPosOrdersFirstEtlJob/TASK0.md
- specs/BrinkPosOrdersFirstEtlJob/TASK1.md
- specs/BrinkPosOrdersFirstEtlJob/TASK2.1.md
- specs/BrinkPosOrdersFirstEtlJob/TASK2.2.md
- specs/BrinkPosOrdersFirstEtlJob/TASK2.3.md
- specs/BrinkPosOrdersFirstEtlJob/TASK2.4.md
- specs/BrinkPosOrdersFirstEtlJob/TASK2.md
- specs/BrinkPosOrdersFirstEtlJob/TASK3.1.md
- specs/BrinkPosOrdersFirstEtlJob/TASK3.2.md
- specs/BrinkPosOrdersFirstEtlJob/TASK3.3.md
- specs/BrinkPosOrdersFirstEtlJob/TASK3.4.md
- specs/BrinkPosOrdersFirstEtlJob/TASK3.md
- specs/BrinkPosOrdersFirstEtlJob/TASK4.1.md
- specs/BrinkPosOrdersFirstEtlJob/TASK4.2.md
- specs/BrinkPosOrdersFirstEtlJob/TASK4.3.md
- specs/BrinkPosOrdersFirstEtlJob/TASK4.4.md
- specs/BrinkPosOrdersFirstEtlJob/TASK4.md
- specs/BrinkPosOrdersFirstEtlJob/TASK5.1.md
- specs/BrinkPosOrdersFirstEtlJob/TASK5.2.md
- specs/BrinkPosOrdersFirstEtlJob/TASK5.3.md
- specs/BrinkPosOrdersFirstEtlJob/TASK5.4.md
- specs/BrinkPosOrdersFirstEtlJob/TASK5.md
- specs/BrinkPosOrdersFirstEtlJob/TASK6.1.md
- specs/BrinkPosOrdersFirstEtlJob/TASK6.2.md
- specs/BrinkPosOrdersFirstEtlJob/TASK6.3.md
- specs/BrinkPosOrdersFirstEtlJob/TASK6.4.md
- specs/BrinkPosOrdersFirstEtlJob/TASK6.md
- specs/BrinkPosOrdersFirstEtlJob/TASK7.md
- specs/BrinkPosOrdersFirstEtlJob/TASK8.md
- specs/BrinkPosOrdersFirstEtlJob/TASK9.md
- specs/BrinkSettings2ToStaging/TASK.MD
- specs/CuratedToS3Stage/TASK.md
- specs/CuratedToS3Stage/TASK0.md
- specs/CuratedToS3Stage/TASK1.md
- specs/CuratedToS3Stage/TASK2.md
- specs/CuratedToS3Stage/TASK3.md
- specs/CuratedToS3Stage/TASK4.md
- specs/CustomerCredentialCustomHeaders/TASK.md
- specs/CustomerCredentialCustomHeaders/TASK1.1.md
- specs/CustomerCredentialCustomHeaders/TASK1.2.md
- specs/CustomerCredentialCustomHeaders/TASK2.1.md
- specs/CustomerCredentialCustomHeaders/TASK2.2.md
- specs/CustomerCredentialCustomHeaders/TASK3.1.md
- specs/CustomerCredentialTriggeredProvisioning/TASK.md
- specs/CustomerCredentialTriggeredProvisioning/TASK1.1.md
- specs/CustomerCredentialTriggeredProvisioning/TASK1.2.md
- specs/CustomerCredentialTriggeredProvisioning/TASK2.1.md
- specs/CustomerCredentialTriggeredProvisioning/TASK2.2.md
- specs/CustomerCredentialTriggeredProvisioning/TASK3.1.md
- specs/CustomerCredentialTriggeredProvisioning/TASK3.2.md
- specs/CustomerCredentialTriggeredProvisioning/TASK4.1.md
- specs/EtlSourceAdapterFramework/TASK.md
- specs/EtlSourceAdapterFramework/TASK0.md
- specs/EtlSourceAdapterFramework/TASK1.md
- specs/EtlSourceAdapterFramework/TASK2.md
- specs/EtlSourceAdapterFramework/TASK3.md
- specs/EtlSourceAdapterFramework/TASK4.md
- specs/EtlSourceAdapterFramework/TASK5.md
- specs/EtlSourceAdapterFramework/TASK6.md
- specs/KdsCdcDebeziumIntegration/TASK.md
- specs/KdsCdcDebeziumIntegration/TASK1.md
- specs/KdsCdcDebeziumIntegration/TASK2.md
- specs/KdsCdcDebeziumIntegration/TASK3.md
- specs/KdsCdcDebeziumIntegration/TASK4.md
- specs/KdsCdcDebeziumIntegration/TASK5.md
- specs/KdsCdcDurableRelationRouting/TASK.md
- specs/KdsCdcDurableRelationRouting/TASK1.md
- specs/KdsCdcDurableRelationRouting/TASK2.md
- specs/KdsCdcDurableRelationRouting/TASK3.md
- specs/KdsCdcDurableRelationRouting/TASK4.md
- specs/KdsCdcDurableRelationRouting/TASK5.md
- specs/KdsCdcIngestion/TASK.md
- specs/KdsCdcIngestion/TASK1.md
- specs/KdsCdcIngestion/TASK2.md
- specs/KdsCdcIngestion/TASK3.md
- specs/KdsCdcIngestion/TASK4.md
- specs/KdsCdcIngestion/TASK5.md
- specs/KdsCdcIngestion/TASK6.md
- specs/KdsCdcIngestion/TASK7.md
- specs/KdsCdcIngestion/TASK8.md
- specs/KdsCdcIngestion/TASK9.md
- specs/KdsCdcReplayExecution/TASK.md
- specs/KdsCdcReplayExecution/TASK1.md
- specs/KdsCdcReplayExecution/TASK2.md
- specs/KdsCdcReplayExecution/TASK3.md
- specs/KdsCdcReplayExecution/TASK4.md
- specs/KdsMonitorServingContractMigration/TASK.md
- specs/KdsMonitorServingContractMigration/TASK1.1.md
- specs/KdsMonitorServingContractMigration/TASK1.2.md
- specs/KdsMonitorServingContractMigration/TASK2.1.md
- specs/KdsMonitorServingContractMigration/TASK2.2.md
- specs/KdsMonitorServingContractMigration/TASK3.1.md
- specs/KdsMonitorServingContractMigration/TASK3.2.md
- specs/RedshiftFoundation/TASK.md
- specs/RedshiftFoundation/TASK1.1.md
- specs/RedshiftFoundation/TASK1.2.md
- specs/RedshiftFoundation/TASK1.3.md
- specs/RedshiftFoundation/TASK1.4.md
- specs/RedshiftFoundation/TASK2.1.md
- specs/RedshiftFoundation/TASK2.2.md
- specs/RedshiftFoundation/TASK3.1.md
- specs/RedshiftFoundation/TASK3.2.md
- specs/RedshiftFoundation/TASK3.3.md
- specs/RedshiftSyntheticDataFeed/TASK.md
- specs/RedshiftSyntheticDataFeed/TASK1.1.md
- specs/RedshiftSyntheticDataFeed/TASK1.2.md
- specs/RedshiftSyntheticDataFeed/TASK1.3.md
- specs/RedshiftSyntheticDataFeed/TASK2.1.md
- specs/RedshiftSyntheticDataFeed/TASK2.2.md
- specs/RedshiftSyntheticDataFeed/TASK3.1.md
- specs/RedshiftSyntheticDataFeed/TASK3.2.md
- specs/SingleStoreRedshiftRuntimeReadPath/TASK.md
- specs/SingleStoreRedshiftRuntimeReadPath/TASK1.1.md
- specs/SingleStoreRedshiftRuntimeReadPath/TASK1.2.md
- specs/SingleStoreRedshiftRuntimeReadPath/TASK2.1.md
- specs/SingleStoreRedshiftRuntimeReadPath/TASK2.2.md
- specs/SingleStoreRedshiftRuntimeReadPath/TASK2.3.md
- specs/SingleStoreRedshiftRuntimeReadPath/TASK3.1.md
- specs/SingleStoreRedshiftRuntimeReadPath/TASK3.2.md
- specs/SingleStoreRedshiftRuntimeReadPath/TASK4.1.md
KDS CDC Debezium Integration - Implementation Tasks
Overview
Implementation of the KDS CDC Debezium Integration slice.
This task plan is derived from:
../../docs/features/ETL/kds-cdc/index.md../../docs/features/ETL/kds-cdc/implementation-breakdown.md../../docs/features/ETL/kds-cdc/debezium-payload-compatibility-notes.md../../docs/features/ETL/kds-cdc/performance-and-scaling-notes.md- sample payloads under
../../docs/features/ETL/kds-cdc/payloads/
Repository analysis for this spec also reviewed the current KDS CDC implementation in:
backend/Kds.Ai.Integrations/KdsCdc/KdsCdcEnvelopeParser.csbackend/Kds.Ai.Integrations/KdsCdc/Messages/KdsCdcEnvelope.csbackend/Kds.Ai.Integrations/KdsCdc/KdsCdcTenantResolver.csbackend/Kds.Ai.Integrations/KdsCdc/KdsCdcOrderingToken.csbackend/Kds.Ai.Integrations/KdsCdc/KdsCdcMessageOrderingValidator.csbackend/Kds.Ai.Integrations/KdsCdc/KdsCdcDuplicateDetector.csbackend/Kds.Ai.Integrations/KdsCdc/KdsCdcBatchBuilder.csbackend/Kds.Ai.Integrations/KdsCdc/KdsCdcNormalizeLoadJobs.csbackend/Kds.Ai.Integrations/KdsCdc/KdsCdcExtractJobs.csbackend/Kds.Ai.Integrations/KdsCdc/KdsCdcIntakeSupport.csbackend/Kds.Ai.Integrations/KdsCdc/KdsCdcSqsQueueClient.csbackend/Kds.Ai.ApiService/Jobs/KdsCdc/KdsCdcWorkerService.csbackend/Kds.Ai.Data/Entities/KdsCdcSourceTenantMapping.csbackend/Kds.Ai.Data/Repositories/EfKdsCdcSourceTenantMappingRepository.csbackend/tests/Kds.Ai.Integrations.Tests/KdsCdc/
The current branch already has a working KDS CDC ETL spine, but it is still shaped around a simulator/mock contract, transport-group assumptions, and direct SQS-to-tenant batching that do not match the final Debezium-first architecture now documented in docs/features/ETL/kds-cdc/debezium-payload-compatibility-notes.md.
This slice aligns the integration to current reality:
- Debezium payload becomes the only supported intake contract,
- SQS processing does not depend on
MessageGroupId, store_guidis treated as canonical tenant identity,- valid messages are durably captured into landing RAW before tenant promotion,
- tenant RAW becomes downstream ETL boundary,
- ETL state owns relation indexes, retries, and curated consistency,
- simulator-specific code is removed,
- downstream normalization and staging are updated to operate on real Debezium row images,
- native
item_bumpsare supported directly.
Source Documents
../../docs/features/ETL/kds-cdc/index.md../../docs/features/ETL/kds-cdc/implementation-breakdown.md../../docs/features/ETL/kds-cdc/debezium-payload-compatibility-notes.md../../docs/features/ETL/kds-cdc/performance-and-scaling-notes.md../../docs/features/ETL/kds-cdc/payloads/customer_update.json../../docs/features/ETL/kds-cdc/payloads/item_create.json../../docs/features/ETL/kds-cdc/payloads/item_update.json../../docs/features/ETL/kds-cdc/payloads/item_bump_create.json../../docs/features/ETL/kds-cdc/payloads/order_create.json../../docs/features/ETL/kds-cdc/payloads/order_update.json../../docs/features/ETL/kds-cdc/payloads/order_delete.json
Spec Name
This implementation spec should be referred to as KDS CDC Debezium Integration.
Fixed Decisions
- Real Debezium payload is the target contract. Simulator/mock payload is no longer a long-term supported path.
store_guid == tenant_idfor KDS CDC and is treated as globally unique and stable.- KDS CDC tenant resolution must no longer depend on
source_account_id. - Queue is FIFO-class, but processing correctness, tenant routing, and ETL batching must not depend on
MessageGroupId. SequenceNumbermay be preserved when present, but correctness must not depend on it.- Debezium
before/afterrow images are the source of truth for normalization. - Orders and customers can resolve tenant directly from payload
store_guid. - Items currently do not carry
store_guidin sample payloads; tenant resolution for items must use relation-based enrichment, most likely throughorder_guid -> store_guidcorrelation. - Native
item_bumpspayloads exist and must be supported directly. - SQS ack happens after landing RAW durability, not after full downstream ETL completion.
- Landing RAW is first durable boundary and replay source for unresolved routing.
- Tenant RAW is second durable boundary and input to ETL stages.
- Curated correctness comes from rebuilding affected targets from tenant staging state.
- Existing simulator/mock module, mock parser branch, mock producer, and mock-only tests can be removed once Debezium coverage replaces them.
- Existing downstream ETL stages (
extract_raw,normalize_load,load_to_staging,staging_to_curated,curated_to_s3) remain the target runtime model. - Existing curated export narrowing fix must be preserved.
Scope
This task plan includes:
- replacing simulator-shaped intake models with Debezium-native contract models,
- removing processing dependence on
MessageGroupId, - simplifying tenant identity to
store_guid == tenant_id, - adding landing RAW capture and tenant RAW promotion boundaries,
- adding entity-aware tenant resolution for payloads that do not include
store_guiddirectly, - redesigning production ordering and duplicate semantics around Debezium metadata and durable ETL state,
- updating normalization to read Debezium row images,
- supporting native
item_bumps, - rebuilding curated targets from tenant staging state,
- removing simulator code and converting tests/docs to Debezium-first coverage.
In short, this slice ends when the KDS CDC integration is intentionally built for real Debezium payloads and no longer depends on simulator-specific contracts.
Out of Scope
The following items are explicitly excluded from this task plan:
- redesigning the whole ETL framework,
- changing the narrowed curated export behavior already delivered,
- large-scale performance redesign beyond changes required for Debezium correctness,
- production infrastructure rollout of FIFO queue settings,
- creating a brand-new external admin UI,
- inventing synthetic source data generators to replace removed simulator code.
Task Checklist
Phase 1: Debezium Contract And Transport Compatibility
- [ ] TASK 1 - Replace simulator contract assumptions with Debezium-native intake models
Sources:
../../docs/features/ETL/kds-cdc/debezium-payload-compatibility-notes.md../../docs/features/ETL/kds-cdc/payloads/*.json../../docs/features/ETL/kds-cdc/index.md#stage-1-debezium-to-sqs-fifo
Phase 2: Tenant Identity And Entity Correlation
- [ ] TASK 2 - Simplify tenant identity to
store_guidand define durable routing resolution for child entities
Sources:
../../docs/features/ETL/kds-cdc/debezium-payload-compatibility-notes.md../../docs/features/ETL/kds-cdc/index.md#stage-3-tenant-resolution../../docs/features/ETL/kds-cdc/performance-and-scaling-notes.md
Phase 3: Landing RAW, Promotion, Deduplication, And Intake Durability
- [ ] TASK 3 - Rework intake durability, landing RAW, promotion flow, ordering metadata, and raw persistence for Debezium semantics
Sources:
../../docs/features/ETL/kds-cdc/index.md#stage-2-worker-pull-and-micro-batch-creation../../docs/features/ETL/kds-cdc/index.md#stage-4-store-to-s3-raw-extract_raw../../docs/features/ETL/kds-cdc/debezium-payload-compatibility-notes.md
Phase 4: Debezium Normalization And ETL-State-Based Curated Rebuild
- [ ] TASK 4 - Update normalization/load path for Debezium row images, native
item_bumps, and curated rebuild from staging state
Sources:
../../docs/features/ETL/kds-cdc/payloads/*.json../../docs/features/ETL/kds-cdc/index.md#stage-6-normalize-to-s3-load-normalize_load../../docs/features/ETL/warehouse-data/logic-control-kds-staging-model/kds_item_bumps.md
Phase 5: Simulator Removal, Tests, And Documentation Alignment
- [ ] TASK 5 - Remove simulator path and replace it with Debezium-first tests and docs
Sources:
../../docs/features/ETL/kds-cdc/debezium-payload-compatibility-notes.md../../docs/features/ETL/kds-cdc/index.md../../docs/features/ETL/kds-cdc/performance-and-scaling-notes.md
Dependency Graph
Phase 1
+-- TASK 1 freezes Debezium models, parser direction, and transport-independent intake shape
Phase 2
+-- TASK 2 tenant identity and child-entity routing correlation <-- depends on TASK 1
Phase 3
+-- TASK 3 landing RAW, promotion, ordering metadata, and raw durability <-- depends on TASK 1, TASK 2
Phase 4
+-- TASK 4 normalization, native item_bumps, and curated rebuild <-- depends on TASK 1, TASK 2, TASK 3
Phase 5
+-- TASK 5 simulator removal, coverage, docs <-- depends on TASK 1 through TASK 4Recommended Session Order
| Session | Tasks | Description |
|---|---|---|
| 1 | 1 | Freeze Debezium models, parser seam, and transport-indifferent intake behavior |
| 2 | 2 | Simplify tenant identity and add durable child-entity routing rules |
| 3 | 3 | Introduce landing RAW, promotion flow, and Debezium-native raw durability semantics |
| 4 | 4 | Convert normalization/load path, support native item_bumps, and rebuild curated from staging state |
| 5 | 5 | Remove simulator code, rewrite tests, and finish doc alignment |
Key Design Decisions
Debezium-Only Contract
Current parser and models are shaped around a custom/mock envelope with fields like source_account_id, top-level store_guid, primary_key, and custom sequence metadata. Real payloads do not match that shape. This spec treats that mismatch as a migration, not a coexistence problem.
Transport Metadata Must Not Be Intake Contract
Current parser rejects messages without MessageGroupId or SequenceNumber. Final design does not allow transport metadata to control tenant routing, correctness, or ETL progression. The code should preserve transport metadata when present, but landing RAW capture and downstream ETL must still work without it.
store_guid Is Canonical Tenant Identity, But Child Entities Still Need Correlation
Orders and customers include store_guid directly. Items and some item-bump flows may not. So removing source_account_id solves one problem, but not all tenant-routing problems. The plan therefore includes explicit durable relation-based resolution for child traffic.
Landing RAW And Tenant RAW Are Required Boundaries
Current worker couples intake too tightly to immediate tenant batching. Final design requires two durable boundaries: landing RAW for fast append-only capture, then tenant RAW for ETL consumption after tenant routing is safe.
Curated Correctness Comes From Staging-State Rebuild
Current curated SQL is sensitive to parent-before-child timing. Final design fixes this by rebuilding affected curated targets from tenant staging state rather than treating one arrival window as final semantic truth.
Remove Simulator Instead Of Carrying Two Contracts
The user explicitly wants simulator-related code removed. This spec therefore favors direct replacement over dual-mode compatibility.
Preserve Existing ETL Spine
The integration should keep current stage structure, pipeline launcher, and downstream batch lineage rather than inventing a new ETL runtime.