Lacuna/Labs
production-partner-record-audit
light purple
#297 / 601

NAME

production-partner-record-audit — Listings likely needing a production-partner disclosure per Etsy policy. Addresses pain #2.

SYNOPSIS

id production-partner-record-audit tier light-purple section §9. Light purple — cloud reasoning (51 baseline, 86 post-matrix) trigger cron:monthly tools etsy/shop, sakura/cloud-reason 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 likely needing a production-partner disclosure per Etsy policy. Addresses pain #2.

MECHANISM

PREfetchGUARDtier: light-purpleACTperformRESULTrenderON-ERRretry / esc
;;~ title    "Production-partner record audit"
;;~ author   "lacuna"
;;~ version  1
;;~ mode     automation
;;~ flavor   light-purple
;;~ id       production-partner-record-audit
;;~ trigger  cron:monthly
;;~ touches  ()
;;~ summary  "Monthly: listings that need a production-partner record declared per Etsy policy, draft the disclosure."

;; Etsy policy requires disclosure when listings are made with a
;; production partner. Pulls shop + listings, has Sonnet identify
;; the listings likely needing a disclosure based on title/desc cues
;; and absent declared partner.

(cart 'production-partner-record-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/shop (list 'with-listings-and-partners) 'check-fetch))

(define (check-fetch ctx)
  (let ((r (ctx-result ctx)))
    (cond
      ((null? r)                       (escalate 'no-data null))
      ((eq? r 'rate-limited)           (after 30 'fetch ctx))
      (else                            (next 'reason (ctx-set 'shop r ctx))))))

(define (reason ctx)
  (let ((shop (ctx-get 'shop ctx)))
    (act 'sakura/cloud-reason
         (list 'task 'production-partner-audit shop)
         'check-reason)))

(define (check-reason ctx)
  (let ((r (ctx-result ctx)))
    (cond
      ((null? r)                       (escalate 'cloud-empty null))
      ((not (string? r))               (escalate 'cloud-garbled null))
      ((eq? r 'cloud-quota-exhausted)  (escalate 'cloud-quota null))
      ((eq? r 'cloud-consent-required) (escalate 'cloud-consent null))
      (else                            (next 'announce (ctx-set 'audit r ctx))))))

(define (announce ctx) (done))

source: curator-web/src/scheme/carts/etsy/production-partner-record-audit.sks · 52 lines

EXAMPLES

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

TIER

light purple
cloud reasoning · cents per call

FITNESS

Almost there

Works on smaller shops too; the answer sharpens as you collect more sales.

SEE ALSO

HISTORY

canonical source: curator/docs/AUTOMATIONS-CANONICAL.md · §9-light-purple-cloud-reasoning-51-baseline-86-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)