Lacuna/Labs
attribute-fill-suggest
pink
#205 / 601

NAME

attribute-fill-suggest — When a listing is edited, propose missing taxonomy attributes (material, color, occasion) from the title.

SYNOPSIS

id attribute-fill-suggest tier pink section §7. Pink — Sakura local (65 baseline, 131 post-matrix) trigger event:listing-edited tools etsy/listing, sakura/decide source new

DESCRIPTION

Reads Cortex for context, may peek at peer data via web search, then proposes one or two options. Operator approves before anything fires.

When a listing is edited, propose missing taxonomy attributes (material, color, occasion) from the title.

MECHANISM

PREfetchGUARDtier: pinkACTperformRESULTrenderON-ERRretry / esc
;;~ title    "Suggest missing attributes"
;;~ author   "lacuna"
;;~ version  1
;;~ mode     automation
;;~ flavor   pink
;;~ id       attribute-fill-suggest
;;~ trigger  event:listing-edited
;;~ touches  ()
;;~ summary  "When a listing is edited, propose the missing taxonomy attributes (material, color, occasion) from the title."

;; Reads the listing's current attrs + title, asks the local Sakura
;; to propose values for any missing attrs. Output is a list of
;; (attr-name, suggested-value) pairs; type-trapped before announce.

(cart 'attribute-fill-suggest
  '((author    . "lacuna")
    (version   . 1)
    (read-only . #t)))

(define (start ctx)
  (let ((id (ctx-get 'listing-id ctx)))
    (if (null? id)
        (escalate 'missing-listing-id null)
        (next 'fetch ctx))))

(define (fetch ctx)
  (let ((id (ctx-get 'listing-id ctx)))
    (act 'etsy/listing (list id 'with-taxonomy-attrs) 'invoke)))

(define (invoke ctx)
  (let ((listing (ctx-result ctx)))
    (cond
      ((null? listing)              (escalate 'no-data null))
      ((eq? listing 'rate-limited)  (after 30 'fetch ctx))
      (else (act 'sakura/decide
                 (list 'task 'attribute-fill-suggest listing)
                 'check-result)))))

(define (check-result ctx)
  (let ((r (ctx-result ctx)))
    (cond
      ((null? r)              (escalate 'sakura-empty null))
      ((not (list? r))        (escalate 'sakura-garbled null))
      (else                   (next 'announce (ctx-set 'suggestions r ctx))))))

(define (announce ctx) (done))

source: curator-web/src/scheme/carts/etsy/attribute-fill-suggest.sks · 46 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)