Sync-one helper boundary¶
plugins/ccx-feeds-industrial/includes/pipeline/95-sync-one-helpers.php currently owns several distinct phases of one-feed synchronization.
The refactor is intentionally staged. The first step locks the historical surface before moving code.
Locked responsibilities¶
- Runtime context and run-id helpers.
- Stage reset, download and CSV parsing into stage buffers.
- Final offer upsert and canonical
offer_keycompletion. offers_norm_v2upsert and related metrics/review synchronization.- Stage-meta cleanup, final meta upsert, run pruning, integrity metrics and temporary-file cleanup.
Historical ordering¶
The contract preserves the effective phase sequence:
bootstrap -> reset stage -> download -> parse/flush -> offers upsert -> offers_norm -> meta/prune -> finalize.
Planned module boundary¶
The next mechanical extraction should target pipeline/sync-one/ with modules grouped by the responsibilities above, while keeping 95-sync-one-helpers.php as the compatibility facade.
No business rule, SQL condition, run-id source, pruning rule, diagnostic key or temporary-file policy should change during that extraction.