Skip to content

Combo Log CRUD + CSV Import

Maintain a durable ledger of tested combos as combo reports (ontology: Creative Act Reports) stored in macrodata_artifact rows with kind=combo_report. Each combo report documents a completed creative test that realizes a combo template (ontology: Plan Specification). The combo template identifier convention TYPE-PRODUCT-COUNT-AUDIENCE-SEQ (e.g., SP-IPH-2-WOMEN-001) provides human-readable, sortable structured identifiers.

Goal: CRUD for combo reports and bulk CSV import/export for operational workflows.

Both the low-level macrodata CRUD API and the higher-level creative-ops workflow API expose combo report operations:

MethodPathSpecDescription
GET/creative-ops/combo-testscreative-ops.yamlList combo reports with filters
POST/creative-ops/combo-testscreative-ops.yamlCreate a new combo report
GET/creative-ops/combo-tests/{test_id}creative-ops.yamlGet combo report detail
POST/creative-ops/combo-tests/{test_id}/finalizecreative-ops.yamlMark combo report as complete
GET/macrodata-catalogs/{catalog_id}/artifacts?kind=combo_reportmacrodata.yamlList combo reports in a catalog
POST/macrodata-artifactsmacrodata.yamlCreate artifact (kind: combo_report)
PUT/macrodata-artifacts/{artifact_id}macrodata.yamlUpdate combo report artifact
DELETE/macrodata-artifacts/{artifact_id}macrodata.yamlArchive combo report artifact
POST/macrodata-artifacts/uploadmacrodata.yamlUpload CSV for bulk import
GET/creative-ops/exportscreative-ops.yamlList/download export jobs (CSV export)

All endpoints use CF Access auth and target p99 < 200ms.

TableRole
macrodata_catalogCatalog/namespace that groups combo report artifacts
macrodata_artifactStores combo reports (kind=combo_report), templates, suggestions
link_product_macrodata_artifactLinks products to combo report artifacts
productProduct reference data for fuzzy matching during CSV import
ResourcePurpose
Internal Worker (CF Worker)Serves CRUD and import/export endpoints behind CF Access
Ingest Worker (CF Worker)Processes queued CSV import jobs
CF QueueCOMBO_REPORT_IMPORT job queue for async import
PlanetScale (Postgres via Hyperdrive)Primary data store for all artifacts
R2 (measurement.performance)Performance data used for product fuzzy matching
{type}-{productCode}-{productCount}-{audience}-{sequenceNum}
SegmentValuesExample
typeSP (Split), CT (Carousel), NT (Narrow), UGC, STSP
productCodeDerived from products (ontology: Material Artifacts): IPH, SAM, AIR, MIXIPH
productCountNumber of products in combo2
audienceTarget audienceWOMEN
sequenceNumAuto-incremented, zero-padded001
  1. POST /macrodata-artifacts/upload with CSV payload
  2. API enqueues COMBO_REPORT_IMPORT for background processing (ontology: ProcedureExecution)
  3. Ingest Worker parses rows, applies fuzzy matching against measurement.performance on R2 for product resolution
  4. Worker upserts into macrodata_artifact (kind=combo_report) in chunks
  5. Returns summary: N valid rows imported, M errors

Fuzzy matching: The current system uses Levenshtein distance + substring heuristics to match product titles from CSV to known products. This carries forward.

{
"job_type": "COMBO_REPORT_IMPORT",
"job_id": "uuid",
"source": { "type": "upload", "bearer_entity_key": "imports/..." }
}

GET /creative-ops/exports?type=combo_reports triggers an async export job that generates a CSV of all combo reports matching current filters.

  • PASS: Create/update/delete reflect in list; CSV import workflow adds N valid rows and reports M invalid rows deterministically
  • FAIL: Non-idempotent import creates duplicates; corrupted JSON in cases_included