Lacuna/Labs
recommend-price-change
light purple
#229 / 601

NAME

recommend-price-change — Suggest a price move with reasoning + comps. Addresses pain #14, #19, #23. Matrix mod 2026-06-01: + Engram (multi-device pricing context); premium variant moves to light-purple when Monte Carlo enabled.

SYNOPSIS

id recommend-price-change tier light-purple section §8. Green — cloud assist + web search + vision (46 baseline, 152 post-matrix) trigger analysis-pattern tools competitor-price-comp, cortex.aggregate source carry-forward

DESCRIPTION

Pulls your real margin from Cortex and (when green-tier) peer pricing from web search. Suggests a delta with reasoning. Operator decides; tool never auto-fires a destructive write.

Suggest a price move with reasoning + comps. Addresses pain #14, #19, #23. Matrix mod 2026-06-01: + Engram (multi-device pricing context); premium variant moves to light-purple when Monte Carlo enabled.

MECHANISM

PREfetchGUARDtier: light-purpleACTperformRESULTrenderON-ERRretry / esc
;;~ title    "Recommend a price change"
;;~ author   "lacuna"
;;~ version  1
;;~ mode     automation
;;~ flavor   light-purple
;;~ id       recommend-price-change
;;~ touches  ()
;;~ summary  "Suggest a price move with reasoning + comps."

;; Suggest a price move with reasoning + comps.
;;
;; Multi-step reasoning cart. precondition_fetch pulls the
;; needed shop facts, then escalates the reasoning step to
;; Sonnet via sakura/cloud-reason. Cloud is gated; we ask
;; consent before the relay if the operator hasn't pre-approved.

(cart 'recommend-price-change
  '((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)
  (act 'etsy/listing (let ((id (ctx-get 'listing-id ctx))) (list id)) '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 'facts r ctx))))))

(define (reason ctx)
  (let ((facts (ctx-get 'facts ctx)))
    (act 'sakura/cloud-reason
         (list 'task 'recommend-price-change facts)
         '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 'narrative r ctx))))))

(define (announce ctx) (done))

source: curator-web/src/scheme/carts/etsy/recommend-price-change.sks · 53 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 · §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)