fleettickets/docs
david kiania a4b90a33d8 fix(inc): ingest the incremental changes/ stream (baseline + deltas)
The S3 source switched from full hourly snapshots at
automations/inc/<ts>.csv to an incremental CDC stream at
automations/inc/changes/<ts>.csv (first file = full baseline, each later
file = only the rows that changed, keyed by ticket_id; no deletions).

The loader still pointed at the old root path and only ingested the single
newest file, so after the switch it found nothing (no new tickets ingested)
and, even with the path fixed, would silently drop intermediate deltas.

Changes:
- point ingestion at automations/inc/changes/ (_CHANGE_KEY_RE)
- ingest EVERY not-yet-processed file in ascending timestamp order
  (baseline first, then each delta), upserting each
- replace the single-ETag skip with a per-file timestamp watermark
  (import_meta.metadata->>'source_max_key'); rows + watermark commit in one
  txn per file, then archive to processed/ — so a mid-run failure leaves a
  consistent, resumable state
- docs: rename n8n-hourly-s3-full-data-exports.md -> n8n-s3-ticket-exports.md
  and rewrite it for the incremental stream; fix the reference in
  docs/phase-1-ingestion.md

Verified live against prod: re-seeded baseline + 5 deltas (26,529 rows),
files archived to processed/, watermark advanced, re-run is a no-op.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 14:37:17 +03:00
..
dashboard-api-contract.md docs: dashboard_api endpoint contract for fn_inc_dashboard (handoff) 2026-06-16 01:13:09 +03:00
implementation.md feat: history capture — closure_events + daily backlog snapshot (migration 10) 2026-06-16 01:19:23 +03:00
phase-1-ingestion.md fix(inc): ingest the incremental changes/ stream (baseline + deltas) 2026-06-23 14:37:17 +03:00
phase-2-dashboard.md docs: add docs/ — phase-1/phase-2 PRDs + implementation record 2026-06-16 01:05:18 +03:00