Lacuna/Labs
shipping-template-audit
green
#246 / 601

NAME

shipping-template-audit — Listings whose category or weight no longer matches their assigned shipping template.

SYNOPSIS

id shipping-template-audit tier green section §8. Green — cloud assist + web search + vision (46 baseline, 152 post-matrix) trigger cron:weekly tools etsy/listings source new

DESCRIPTION

Walk your data, check one predicate, surface the rows that fail. Pure SQL-shaped logic — no LLM, no API call. Runs on cron and shows up in the Analysis tab as a table.

Listings whose category or weight no longer matches their assigned shipping template.

MECHANISM

PREfetchGUARDtier: greenACTperformRESULTrenderON-ERRretry / esc
;;~ title    "Shipping template audit"
;;~ author   "lacuna"
;;~ version  1
;;~ mode     analysis
;;~ flavor   white
;;~ id       shipping-template-audit
;;~ trigger  cron:weekly
;;~ touches  ()
;;~ summary  "Weekly: listings whose category or weight no longer matches their assigned shipping template."

;; Pure-data audit. Pulls listings + their shipping templates, applies
;; a deterministic mismatch check (template region vs declared origin,
;; weight bracket vs actual weight), renders the gaps as a table.

(cart 'shipping-template-audit
  '((author    . "lacuna")
    (version   . 1)
    (read-only . #t)))

(define (start ctx)
  (let ((connected (ctx-get 'shop-connected ctx)))
    (cond
      ((not connected) (escalate 'shop-not-connected null))
      (else            (next 'fetch ctx)))))

(define (fetch ctx)
  (act 'etsy/listings (list 'active 'with-shipping) 'render))

(define (render ctx)
  (let ((rows (ctx-result ctx)))
    (cond
      ((null? rows)              (escalate 'no-data null))
      ((eq? rows 'rate-limited)  (after 30 'fetch ctx))
      (else                      (begin
                                   (table rows '(listing-id title template-id mismatch))
                                   (done))))))

source: curator-web/src/scheme/carts/etsy/shipping-template-audit.sks · 36 lines

EXAMPLES

Example forthcoming — docs/automations/examples.json entry editable in place.

TIER

green
cloud assist / web search / image understanding · sub-cent / call

FITNESS

Ready

Fits any shop today — this one has no sample-size floor.

SEE ALSO

HISTORY

canonical source: curator/docs/AUTOMATIONS-CANONICAL.md · §8-green-cloud-assist-web-search-vision-46-baseline-152-post-matrix
last regenerated: 2026-06-05 20:31 UTC (mechanical — edits land in the MD or sidecars, not here)

KNOWN BUGS

(none recorded — flag in AUTOMATIONS-CANONICAL.md or open an issue against the cart file)