Spensara Spensara Knowledge Base & Documentation Repository

Repository Docs & Knowledge Base

Consolidated Spensara documentation repository (722 Markdown & architecture documents in ../repository)
Built Word Documents (.docx): Spensara Overview (.docx) Capability Assessment (.docx) Brink POS Ingestion Analysis (.docx) The Borg Ingestion Architecture (.docx)

Implementation Specs (157)

Detailed engineering and feature implementation specifications.
implementation-specs/specs/RedshiftSyntheticDataFeed/TASK3.1.md 2,107 bytes · Updated Oct 23, 2026 10:44 AM EDT
Raw File

TASK 3.1: Add CLI Command for Synthetic KDS Sync

Summary

Add an explicit CLI command that runs the synthetic KDS feed for local/dev validation.

The command should invoke the reusable feed service. It must not contain the full feed implementation inline.

Dependencies

  • TASK 2.2 (idempotency, checkpoint, and full-refresh behavior)

Files to Create

1. CLI command in backend/Kds.Ai.Cli

Create a command equivalent to:

text
sync-synthetic-kds --tenant-id <tenant_id> --store-guid <store_guid> [--full-refresh]

The exact command group/name may differ, but it must clearly indicate that this is synthetic/bootstrap infrastructure.

Files to Modify

2. CLI registration/wiring

Wire the command into the CLI command registration and dependency injection path.

Required Behavior

The command must:

  • accept tenant_id,
  • accept source store_guid,
  • accept full-refresh mode,
  • optionally support incremental mode by default,
  • invoke the reusable synthetic feed service,
  • print target tenant/database context,
  • print row counts for orders and order items,
  • print batch/checkpoint summary when available,
  • return a non-zero exit code or clear error on failure.

The command must not:

  • accept tenant_database as a normal replacement for tenant_id,
  • write directly to Redshift without the feed service,
  • trigger anomaly detector runtime behavior,
  • migrate monitor specs.

Acceptance Criteria

  • [x] CLI command exists for synthetic KDS sync
  • [x] Command accepts tenant_id
  • [x] Command accepts source store_guid
  • [x] Command supports full-refresh mode
  • [x] Command invokes the reusable feed service
  • [x] Command prints useful row counts and target context
  • [x] Command fails clearly for missing or inactive tenant mappings
  • [x] Command is clearly named/described as synthetic/bootstrap infrastructure
  • [x] Solution builds without errors

Notes

  • Keep command output concise but operationally useful.
  • Do not hide tenant routing errors behind generic failures.
  • This command is a dev/admin execution adapter, not the final ETL runtime.