Lacuna/Labs
shop-policy-freshness-audit
pink
#207 / 601

NAME

shop-policy-freshness-audit — Returns + shipping + payment policy timestamps; flag anything over a year stale.

SYNOPSIS

id shop-policy-freshness-audit tier pink section §7. Pink — Sakura local (65 baseline, 131 post-matrix) trigger cron:weekly tools etsy/shop 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.

Returns + shipping + payment policy timestamps; flag anything over a year stale.

MECHANISM

PREfetchGUARDtier: pinkACTperformRESULTrenderON-ERRretry / esc
;;~ title    "Shop policy freshness audit"
;;~ author   "lacuna"
;;~ version  1
;;~ mode     automation
;;~ flavor   pink
;;~ id       shop-policy-freshness-audit
;;~ trigger  cron:weekly
;;~ touches  ()
;;~ summary  "Weekly: when were returns, shipping, payment policies last updated? Flag anything over a year stale."

;; Reads shop policy timestamps. Anything not updated in 365 days
;; surfaces with a calm nudge — policy text dating from a year+ ago
;; usually drifts from how the operator actually handles things.

(cart 'shop-policy-freshness-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-policy-timestamps) '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 '(policy last-updated days-since-update stale))
                                   (done))))))

source: curator-web/src/scheme/carts/etsy/shop-policy-freshness-audit.sks · 36 lines

EXAMPLES

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

TIER

pink
Sakura local 8B · free · on-device

FITNESS

Ready

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

SEE ALSO

HISTORY

canonical source: curator/docs/AUTOMATIONS-CANONICAL.md · §7-pink-sakura-local-65-baseline-131-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)