← back to Designer Wallcoverings
auto-data-snapshot: 2026-09-15T18:00:40 (4 data files) — DW-Programming/ImportNewSkufromURL/database/create-batch-import-jobs.sql shopify/scripts/cadence/data/cadence-cursor.json shopify/scripts/cadence/data/cadence-plan-pm-2026-09-16.json shopify/scripts/cadence/data/upload-restore-2026-09-16.jsonl
1ec25883d23bed5ac5001f6c8db5409227f52d99 · 2026-09-15 18:03:07 -0700 · auto-commit-fleet
Files touched
M DW-Programming/ImportNewSkufromURL/database/create-batch-import-jobs.sqlM shopify/scripts/cadence/data/cadence-cursor.jsonA shopify/scripts/cadence/data/cadence-plan-pm-2026-09-16.jsonA shopify/scripts/cadence/data/upload-restore-2026-09-16.jsonl
Diff
commit 1ec25883d23bed5ac5001f6c8db5409227f52d99
Author: auto-commit-fleet <steve@designerwallcoverings.com>
Date: Tue Sep 15 18:03:07 2026 -0700
auto-data-snapshot: 2026-09-15T18:00:40 (4 data files) — DW-Programming/ImportNewSkufromURL/database/create-batch-import-jobs.sql shopify/scripts/cadence/data/cadence-cursor.json shopify/scripts/cadence/data/cadence-plan-pm-2026-09-16.json shopify/scripts/cadence/data/upload-restore-2026-09-16.jsonl
---
.../database/create-batch-import-jobs.sql | 53 ++++--
shopify/scripts/cadence/data/cadence-cursor.json | 4 +-
.../cadence/data/cadence-plan-pm-2026-09-16.json | 184 +++++++++++++++++++++
.../cadence/data/upload-restore-2026-09-16.jsonl | 17 ++
4 files changed, 239 insertions(+), 19 deletions(-)
diff --git a/DW-Programming/ImportNewSkufromURL/database/create-batch-import-jobs.sql b/DW-Programming/ImportNewSkufromURL/database/create-batch-import-jobs.sql
index 31cb24ac..a30b47d9 100644
--- a/DW-Programming/ImportNewSkufromURL/database/create-batch-import-jobs.sql
+++ b/DW-Programming/ImportNewSkufromURL/database/create-batch-import-jobs.sql
@@ -5,7 +5,18 @@
-- mid-job restart is handled by a boot-time orphan sweeper (reclaimOrphanedJobs in
-- lib/batch-import-jobs.ts, run once per process): jobs left 'pending'/'running' by a
-- dead process are marked 'failed' with a re-submit prompt (NOT auto-recreated — a
--- re-submit skips already-created SKUs as duplicates).
+-- re-submit skips already-created products as duplicates).
+--
+-- TK-11786 (review hardening) added:
+-- • batch_import_jobs.owner — the boot sweeper is scoped to owner = THIS instance
+-- (IMPORT_JOB_OWNER || hostname) so a dev boot can't mark prod's live jobs failed
+-- (dev + prod share dw_unified). (H3)
+-- • batch_import_job_items.create_started_at — the durable "a Shopify create was
+-- attempted" marker; the sweeper releases the dedup claim of an orphaned item whose
+-- create never started (safe re-import) and retains it for one caught mid-create
+-- (unknown Shopify state — never auto-mint a duplicate). (H2)
+-- • batch_import_created_skus now stores a dedup KEY (real SKU, or a composite
+-- vendor+title+collection key for SKU-less products) so SKU-less items dedup too. (H1)
-- Canonical DB: dw_unified. Idempotent — safe to run repeatedly.
CREATE TABLE IF NOT EXISTS batch_import_jobs (
@@ -14,37 +25,45 @@ CREATE TABLE IF NOT EXISTS batch_import_jobs (
total INTEGER NOT NULL DEFAULT 0,
vendor_id TEXT,
private_label BOOLEAN DEFAULT FALSE,
+ owner TEXT, -- TK-11786 H3: env/instance token that scopes the boot reclaim
error TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
+-- Idempotent upgrade for a table created before the owner column existed.
+ALTER TABLE batch_import_jobs ADD COLUMN IF NOT EXISTS owner TEXT;
CREATE TABLE IF NOT EXISTS batch_import_job_items (
- job_id UUID NOT NULL REFERENCES batch_import_jobs(job_id) ON DELETE CASCADE,
- idx INTEGER NOT NULL,
- title TEXT,
- sku TEXT,
+ job_id UUID NOT NULL REFERENCES batch_import_jobs(job_id) ON DELETE CASCADE,
+ idx INTEGER NOT NULL,
+ title TEXT,
+ sku TEXT,
-- pending | created | failed | blocked | skipped-duplicate
- status TEXT NOT NULL DEFAULT 'pending',
- product_id TEXT,
- error TEXT,
- updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
+ status TEXT NOT NULL DEFAULT 'pending',
+ product_id TEXT,
+ error TEXT,
+ create_started_at TIMESTAMPTZ, -- TK-11786 H2: set right before the Shopify create
+ updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
PRIMARY KEY (job_id, idx)
);
+-- Idempotent upgrade for a table created before the create_started_at column existed.
+ALTER TABLE batch_import_job_items ADD COLUMN IF NOT EXISTS create_started_at TIMESTAMPTZ;
CREATE INDEX IF NOT EXISTS idx_batch_import_job_items_job ON batch_import_job_items(job_id);
-- observability lookup: per-item progress by SKU.
CREATE INDEX IF NOT EXISTS idx_batch_import_job_items_sku ON batch_import_job_items(sku) WHERE sku IS NOT NULL AND sku <> '';
--- TK-11776 F2: atomic cross-job dedup ledger. A plain SELECT-then-create is a TOCTOU —
--- two concurrent/overlapping jobs (or a re-submit of a batch that looks stuck while the
--- first is still 'running') both read "not yet created" and both mint the SKU. PRIMARY
--- KEY(sku) is the concurrency arbiter: claimSku() INSERTs here ON CONFLICT DO NOTHING, so
--- exactly one racing caller wins the SKU and every other skips the Shopify create. A kept
--- row is the durable dedup record for a successfully-created SKU; a retryable failure
--- releases it, a hard crash leaves it (safely blocking a re-mint — never auto-mint a dup).
+-- TK-11776 F2 (+ TK-11786 H1): atomic cross-job dedup ledger. A plain SELECT-then-create is
+-- a TOCTOU — two concurrent/overlapping jobs (or a re-submit of a batch that looks stuck
+-- while the first is still 'running') both read "not yet created" and both mint the product.
+-- PRIMARY KEY(sku) is the concurrency arbiter: claimKey() INSERTs here ON CONFLICT DO
+-- NOTHING, so exactly one racing caller wins the key and every other skips the Shopify
+-- create. The `sku` column holds the dedup KEY — a real SKU, or a composite
+-- 'composite:vendor|title|collection' key for SKU-less products (H1). A kept row is the
+-- durable dedup record for a successfully-created product; a retryable failure releases it;
+-- on a crash the boot sweeper releases it ONLY for items whose create never started.
CREATE TABLE IF NOT EXISTS batch_import_created_skus (
- sku TEXT PRIMARY KEY,
+ sku TEXT PRIMARY KEY, -- dedup KEY: real SKU, or 'composite:vendor|title|collection'
job_id UUID,
idx INTEGER,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
diff --git a/shopify/scripts/cadence/data/cadence-cursor.json b/shopify/scripts/cadence/data/cadence-cursor.json
index da6e754d..5d5c75c5 100644
--- a/shopify/scripts/cadence/data/cadence-cursor.json
+++ b/shopify/scripts/cadence/data/cadence-cursor.json
@@ -1,5 +1,5 @@
{
- "idx": 2,
+ "idx": 8,
"lastSlot": "pm",
- "lastRun": "2026-09-15"
+ "lastRun": "2026-09-16"
}
\ No newline at end of file
diff --git a/shopify/scripts/cadence/data/cadence-plan-pm-2026-09-16.json b/shopify/scripts/cadence/data/cadence-plan-pm-2026-09-16.json
new file mode 100644
index 00000000..c9b38c0c
--- /dev/null
+++ b/shopify/scripts/cadence/data/cadence-plan-pm-2026-09-16.json
@@ -0,0 +1,184 @@
+[
+ {
+ "vendor": "Designtex",
+ "dw_sku": "DWDX-220516",
+ "cost": 58,
+ "retail": 104.98,
+ "sample": "4.25",
+ "sampleOnly": false,
+ "title": "Fragments, New York Wallcoverings | Designtex",
+ "willActivate": false,
+ "held": true,
+ "heldReason": "\"York Wallcoverings\" is a banned front-facing trade-parent name"
+ },
+ {
+ "vendor": "Designtex",
+ "dw_sku": "DWDX-220827",
+ "cost": 40,
+ "retail": 72.4,
+ "sample": "4.25",
+ "sampleOnly": false,
+ "title": "Corrugate, Oak Wallcoverings | Designtex",
+ "willActivate": false
+ },
+ {
+ "vendor": "Designtex",
+ "dw_sku": "DWDX-220828",
+ "cost": 40,
+ "retail": 72.4,
+ "sample": "4.25",
+ "sampleOnly": false,
+ "title": "Corrugate, Mist Wallcoverings | Designtex",
+ "willActivate": false
+ },
+ {
+ "vendor": "Newwall",
+ "dw_sku": "DWXW-1006395",
+ "cost": 104,
+ "retail": 188.24,
+ "sample": "4.25",
+ "sampleOnly": false,
+ "title": "Oeve Blue, Made to Measure Mural Type II Wallcoverings | Newwall",
+ "willActivate": false
+ },
+ {
+ "vendor": "Newwall",
+ "dw_sku": "DWXW-1006396",
+ "cost": 104,
+ "retail": 188.24,
+ "sample": "4.25",
+ "sampleOnly": false,
+ "title": "Oeve Green, Made to Measure Mural Type II Wallcoverings | Newwall",
+ "willActivate": false
+ },
+ {
+ "vendor": "Newwall",
+ "dw_sku": "DWXW-1006397",
+ "cost": 104,
+ "retail": 188.24,
+ "sample": "4.25",
+ "sampleOnly": false,
+ "title": "Sarabia Blue, Made to Measure Mural Type II Wallcoverings | Newwall",
+ "willActivate": false
+ },
+ {
+ "vendor": "Brewster & York",
+ "dw_sku": "DWBR-171345",
+ "cost": 105,
+ "retail": 190.05,
+ "sample": "4.25",
+ "sampleOnly": false,
+ "title": "Whimsy, Green Wallcoverings | Malibu Wallcovering",
+ "willActivate": false
+ },
+ {
+ "vendor": "Brewster & York",
+ "dw_sku": "DWBR-171346",
+ "cost": 105,
+ "retail": 190.05,
+ "sample": "4.25",
+ "sampleOnly": false,
+ "title": "Whimsy, Pink Wallcoverings | Malibu Wallcovering",
+ "willActivate": false
+ },
+ {
+ "vendor": "Brewster & York",
+ "dw_sku": "DWBR-171347",
+ "cost": 90,
+ "retail": 162.9,
+ "sample": "4.25",
+ "sampleOnly": false,
+ "title": "Jona, Multicolor Wallcoverings | Malibu Wallcovering",
+ "willActivate": false
+ },
+ {
+ "vendor": "Kravet",
+ "dw_sku": "DWKK-103482",
+ "cost": 202.4,
+ "retail": 303.6,
+ "sample": "4.25",
+ "sampleOnly": false,
+ "title": "Kravet Design, Off-White Wallcoverings | Kravet",
+ "willActivate": false
+ },
+ {
+ "vendor": "Kravet",
+ "dw_sku": "DWKK-103483",
+ "cost": 202.4,
+ "retail": 303.6,
+ "sample": "4.25",
+ "sampleOnly": false,
+ "title": "Kravet Design, Off-White Wallcoverings | Kravet",
+ "willActivate": false
+ },
+ {
+ "vendor": "Kravet",
+ "dw_sku": "DWKK-103484",
+ "cost": 202.4,
+ "retail": 303.6,
+ "sample": "4.25",
+ "sampleOnly": false,
+ "title": ", White Wallcoverings | Kravet",
+ "willActivate": false
+ },
+ {
+ "vendor": "Schumacher",
+ "dw_sku": "DWLK-812000",
+ "cost": 34,
+ "retail": 61.54,
+ "sample": "4.25",
+ "sampleOnly": false,
+ "title": "Bloomsbury, Deep Navy Wallcoverings | Schumacher",
+ "willActivate": false
+ },
+ {
+ "vendor": "Schumacher",
+ "dw_sku": "DWLK-812010",
+ "cost": 34,
+ "retail": 61.54,
+ "sample": "4.25",
+ "sampleOnly": false,
+ "title": "Bloomsbury, Cool Gray Wallcoverings | Schumacher",
+ "willActivate": false
+ },
+ {
+ "vendor": "Schumacher",
+ "dw_sku": "DWLK-812020",
+ "cost": 34,
+ "retail": 61.54,
+ "sample": "4.25",
+ "sampleOnly": false,
+ "title": "Bloomsbury, Carbon Wallcoverings | Schumacher",
+ "willActivate": false
+ },
+ {
+ "vendor": "Phillip Jeffries",
+ "dw_sku": "DWPJ-14661",
+ "cost": 0,
+ "retail": 0,
+ "sample": "4.25",
+ "sampleOnly": true,
+ "title": "Woven Wood, Carbon Crochet Wallcoverings | Phillip Jeffries",
+ "willActivate": false
+ },
+ {
+ "vendor": "Phillip Jeffries",
+ "dw_sku": "DWPJ-14662",
+ "cost": 0,
+ "retail": 0,
+ "sample": "4.25",
+ "sampleOnly": true,
+ "title": "Woven Wood, Navy Loom Wallcoverings | Phillip Jeffries",
+ "willActivate": false
+ },
+ {
+ "vendor": "Phillip Jeffries",
+ "dw_sku": "DWPJ-14663",
+ "cost": 0,
+ "retail": 0,
+ "sample": "4.25",
+ "sampleOnly": true,
+ "title": "Woven Wood, Lagoon Wallcoverings | Phillip Jeffries",
+ "willActivate": false
+ }
+]
\ No newline at end of file
diff --git a/shopify/scripts/cadence/data/upload-restore-2026-09-16.jsonl b/shopify/scripts/cadence/data/upload-restore-2026-09-16.jsonl
new file mode 100644
index 00000000..5860f2fb
--- /dev/null
+++ b/shopify/scripts/cadence/data/upload-restore-2026-09-16.jsonl
@@ -0,0 +1,17 @@
+{"table":"designtex_catalog","mfr_sku":"6674109","dw_sku":"DWDX-220827","shopify_product_id":"7966058610739","action":"created","activated":false,"published":false,"sampleOnly":false,"status":"DRAFT","batch_id":"upload-pm-2026-09-16T00-40-05-058Z","ts":"2026-09-16T00:40:12.967Z"}
+{"table":"designtex_catalog","mfr_sku":"6674401","dw_sku":"DWDX-220828","shopify_product_id":"7966058676275","action":"created","activated":false,"published":false,"sampleOnly":false,"status":"DRAFT","batch_id":"upload-pm-2026-09-16T00-40-05-058Z","ts":"2026-09-16T00:40:15.161Z"}
+{"table":"newwall_catalog","mfr_sku":"M3220-2","dw_sku":"DWXW-1006395","shopify_product_id":"7966058741811","action":"created","activated":false,"published":false,"sampleOnly":false,"status":"DRAFT","batch_id":"upload-pm-2026-09-16T00-40-05-058Z","ts":"2026-09-16T00:40:17.586Z"}
+{"table":"newwall_catalog","mfr_sku":"M3220-3","dw_sku":"DWXW-1006396","shopify_product_id":"7966058807347","action":"created","activated":false,"published":false,"sampleOnly":false,"status":"DRAFT","batch_id":"upload-pm-2026-09-16T00-40-05-058Z","ts":"2026-09-16T00:40:19.756Z"}
+{"table":"newwall_catalog","mfr_sku":"M3221-1","dw_sku":"DWXW-1006397","shopify_product_id":"7966058872883","action":"created","activated":false,"published":false,"sampleOnly":false,"status":"DRAFT","batch_id":"upload-pm-2026-09-16T00-40-05-058Z","ts":"2026-09-16T00:40:22.037Z"}
+{"table":"brewster_catalog","mfr_sku":"2821-12803","dw_sku":"DWBR-171345","shopify_product_id":"7966058905651","action":"created","activated":false,"published":false,"sampleOnly":false,"status":"DRAFT","batch_id":"upload-pm-2026-09-16T00-40-05-058Z","ts":"2026-09-16T00:40:24.775Z"}
+{"table":"brewster_catalog","mfr_sku":"2821-12802","dw_sku":"DWBR-171346","shopify_product_id":"7966058938419","action":"created","activated":false,"published":false,"sampleOnly":false,"status":"DRAFT","batch_id":"upload-pm-2026-09-16T00-40-05-058Z","ts":"2026-09-16T00:40:27.274Z"}
+{"table":"brewster_catalog","mfr_sku":"2821-25122","dw_sku":"DWBR-171347","shopify_product_id":"7966058971187","action":"created","activated":false,"published":false,"sampleOnly":false,"status":"DRAFT","batch_id":"upload-pm-2026-09-16T00-40-05-058Z","ts":"2026-09-16T00:40:29.647Z"}
+{"table":"kravet_catalog","mfr_sku":"4004.161.0","dw_sku":"DWKK-103482","shopify_product_id":"7966059003955","action":"created","activated":false,"published":false,"sampleOnly":false,"status":"DRAFT","batch_id":"upload-pm-2026-09-16T00-40-05-058Z","ts":"2026-09-16T00:40:32.151Z"}
+{"table":"kravet_catalog","mfr_sku":"4004.21.0","dw_sku":"DWKK-103483","shopify_product_id":"7966059069491","action":"created","activated":false,"published":false,"sampleOnly":false,"status":"DRAFT","batch_id":"upload-pm-2026-09-16T00-40-05-058Z","ts":"2026-09-16T00:40:34.709Z"}
+{"table":"kravet_catalog","mfr_sku":"4004.52.0","dw_sku":"DWKK-103484","shopify_product_id":"7966059135027","action":"created","activated":false,"published":false,"sampleOnly":false,"status":"DRAFT","batch_id":"upload-pm-2026-09-16T00-40-05-058Z","ts":"2026-09-16T00:40:37.317Z"}
+{"table":"schumacher_catalog","mfr_sku":"5013683","dw_sku":"DWLK-812000","shopify_product_id":"7966059200563","action":"created","activated":false,"published":false,"sampleOnly":false,"status":"DRAFT","batch_id":"upload-pm-2026-09-16T00-40-05-058Z","ts":"2026-09-16T00:40:39.749Z"}
+{"table":"schumacher_catalog","mfr_sku":"5013684","dw_sku":"DWLK-812010","shopify_product_id":"7966059266099","action":"created","activated":false,"published":false,"sampleOnly":false,"status":"DRAFT","batch_id":"upload-pm-2026-09-16T00-40-05-058Z","ts":"2026-09-16T00:40:41.962Z"}
+{"table":"schumacher_catalog","mfr_sku":"5013685","dw_sku":"DWLK-812020","shopify_product_id":"7966059331635","action":"created","activated":false,"published":false,"sampleOnly":false,"status":"DRAFT","batch_id":"upload-pm-2026-09-16T00-40-05-058Z","ts":"2026-09-16T00:40:44.264Z"}
+{"table":"pj_draft_catalog","mfr_sku":"4266","dw_sku":"DWPJ-14661","shopify_product_id":"7966059397171","action":"created","activated":false,"published":false,"sampleOnly":true,"status":"DRAFT","batch_id":"upload-pm-2026-09-16T00-40-05-058Z","ts":"2026-09-16T00:40:46.589Z"}
+{"table":"pj_draft_catalog","mfr_sku":"4267","dw_sku":"DWPJ-14662","shopify_product_id":"7966059429939","action":"created","activated":false,"published":false,"sampleOnly":true,"status":"DRAFT","batch_id":"upload-pm-2026-09-16T00-40-05-058Z","ts":"2026-09-16T00:40:48.744Z"}
+{"table":"pj_draft_catalog","mfr_sku":"4268","dw_sku":"DWPJ-14663","shopify_product_id":"7966059495475","action":"created","activated":false,"published":false,"sampleOnly":true,"status":"DRAFT","batch_id":"upload-pm-2026-09-16T00-40-05-058Z","ts":"2026-09-16T00:40:51.372Z"}
← 9a8dcc07 auto-data-snapshot: 2026-09-15T16:53:16 (3 data files) — sho
·
back to Designer Wallcoverings
·
auto-data-snapshot: 2026-09-15T18:34:22 (1 data files) — DW- 43c3a250 →