Lacuna/Labs
review-themes-monthly
light purple
#294 / 601

NAME

review-themes-monthly — Cluster the month's reviews into themes with concrete examples. Addresses pain #4, #24.

SYNOPSIS

id review-themes-monthly tier light-purple section §9. Light purple — cloud reasoning (51 baseline, 86 post-matrix) trigger cron:monthly tools etsy/reviews, sakura/cloud-reason source new

DESCRIPTION

Cluster the reviews by what they're about. Surface the themes with real quotes attached — operator sees what buyers actually said, not a summary that lost the words.

Cluster the month's reviews into themes with concrete examples. Addresses pain #4, #24.

MECHANISM

PREfetchGUARDtier: light-purpleACTperformRESULTrenderON-ERRretry / esc
;;~ title    "Review themes · monthly"
;;~ author   "lacuna"
;;~ version  1
;;~ mode     automation
;;~ flavor   light-purple
;;~ id       review-themes-monthly
;;~ trigger  cron:monthly
;;~ touches  ()
;;~ summary  "Monthly: cluster the month's reviews into themes with concrete examples."

;; Monthly rollup. Fetch reviews for the past 30d, hand the bundle to
;; Sonnet for theme clustering + example quotations. Returns a
;; structured narrative the operator can read in two minutes.

(cart 'review-themes-monthly
  '((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/reviews (list '30d) '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 'reviews r ctx))))))

(define (reason ctx)
  (let ((reviews (ctx-get 'reviews ctx)))
    (act 'sakura/cloud-reason
         (list 'task 'review-themes-monthly reviews)
         '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 'themes r ctx))))))

(define (announce ctx) (done))

source: curator-web/src/scheme/carts/etsy/review-themes-monthly.sks · 51 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)