Lacuna/Labs
revenue-week
white
#042 / 601

NAME

revenue-week — White read-cart in the 'Sales / revenue (16)' group. Operator-commanded data surface in the Analysis tab.

SYNOPSIS

id revenue-week tier white section §6. White — atomic tools (142 baseline, 149 post-matrix) trigger operator-commanded tools cortex_query, list_listings / list_orders source carry-forward

DESCRIPTION

Pure Cortex read against the receipts ledger. No LLM. Operator clicks a filter, the cart returns rows. The building blocks every higher tier composes on.

White read-cart in the 'Sales / revenue (16)' group. Operator-commanded data surface in the Analysis tab.

MECHANISM

PREfetchGUARDtier: whiteACTperformRESULTrenderON-ERRretry / esc
;;~ title    "Revenue · this week"
;;~ author   "lacuna"
;;~ version  1
;;~ mode     analysis
;;~ flavor   white
;;~ id       revenue-week
;;~ touches  ()
;;~ summary  "Last 7 days."

;; Last 7 days.
;;
;; Read-only cart, architect-shape. The verb call lives inside (act ...)
;; with a SYMBOL on-result. The driver intercepts, makes the real Etsy
;; request, threads the response into ctx via 'last-result, then jumps
;; to the named result handler.

(cart 'revenue-week
  '((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/receipts (list 'this-week) '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 '(period revenue orders))
                                   (done))))))

source: curator-web/src/scheme/carts/etsy/revenue-week.sks · 38 lines

EXAMPLES

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

TIER

white
atomic · free · operator-commanded

FITNESS

Ready

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

SEE ALSO

HISTORY

canonical source: curator/docs/AUTOMATIONS-CANONICAL.md · §6-white-atomic-tools-142-baseline-149-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)