Lacuna/Labs
shop-audit-narrative
deep purple
#309 / 601

NAME

shop-audit-narrative — Write the prose around an audit run — wins + gaps. Addresses pain #11. Matrix mod 2026-06-01: + Engram-hosted means deep reasoning reads full projection (was: digest only) + voice readout.

SYNOPSIS

id shop-audit-narrative tier deep-purple section §10. Deep purple ✨ — deep reasoning (34 baseline, 45 post-matrix) trigger operator-asked tools all white audit-* source carry-forward shape PLAYBOOK

DESCRIPTION

Multi-signal composite — pulls every relevant audit + ratio + trend into one number per listing. The signals are simple; the playbook around them is where deep reasoning earns its money.

Write the prose around an audit run — wins + gaps. Addresses pain #11. Matrix mod 2026-06-01: + Engram-hosted means deep reasoning reads full projection (was: digest only) + voice readout.

MECHANISM

DATAyour cortexFITmathPOSTERIORcredible bandFORECASTdecision
;;~ title    "Shop audit narrative"
;;~ author   "lacuna"
;;~ version  1
;;~ mode     automation
;;~ flavor   light-purple
;;~ id       shop-audit-narrative
;;~ touches  ()
;;~ summary  "Write the prose around an audit run — wins + gaps."

;; Write the prose around an audit run — wins + gaps.
;;
;; 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 'shop-audit-narrative
  '((author    . "lacuna")
    (version   . 1)
    (read-only . #t)))

(define (start ctx)
  (next 'fetch ctx))

(define (fetch ctx)
  (act 'etsy/listings (list 'active) '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 'shop-audit-narrative 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/shop-audit-narrative.sks · 50 lines

EXAMPLES

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

TIER

deep purple
deep reasoning · batched · dollars per run

FITNESS

Not yet

This method only gives a real answer above a sample threshold. Running it on a small shop produces a confidence band the size of the universe — useless. When the shop crosses the threshold, this lights up.

SEE ALSO

HISTORY

canonical source: curator/docs/AUTOMATIONS-CANONICAL.md · §10-deep-purple-deep-reasoning-34-baseline-45-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)