Loop OPS-3 · Operations & construction · reports to Ifham & Mithun

Hotels reorder protectors every year — when we remember to call.

Reads hotel customers' purchase history for mattress protectors and flags who bought 10–14 months ago and hasn't reordered — the annually recurring revenue we currently leave to memory.

Built & tested — pilotWave 2🕐 Monthly⚙️ Hermes bizops (planned)
Part 1 — the plain-english view

Recurring revenue shouldn't depend on remembering.

What it watches
  • Hotel customers' protector purchases, by product family
  • Who's in the 10–14 month reorder window — and who's overdue beyond it
  • Grouped by sales team, so Hospitality and Branded Retail each see their own customers
When & how it speaks

Monthly to Ifham & Mithun: “these hotels bought 10–14 months ago and haven't reordered — worth a call”, with amounts, unit counts, and how overdue each is.

Why it exists

First live run found 34 customers in the due window — including a major development customer 15 months overdue (893 units) and a landmark hotel 28 months overdue. Every one of those is a phone call we should already have made.

34
customers in or past the reorder window on the first run
15 months
the most overdue large account found — nearly two full reorder cycles missed
10–14 mo
the window: long enough since purchase to need more, recent enough to remember us

Monthly

Start of month

👀

Reads sales history

Protector-family orders per hotel customer

📋

Window math

10–14 months since last order → due; beyond → overdue

💬

Call list by team

Amounts, units, months overdue

People call

Relationships stay human

What it will never doNever contacts a hotel.
Where it stands today · July 2026Built and live-tested. Per Nish's review it now groups by sales team (brand-family → team inference, with the caveat noted that a real customer→BU field belongs in the data layer eventually). Verified: the protector product families and exclusions are correctly detected.
Part 2 — under the hood

How it's wired: systems, models, and the path a number takes.

For implementers and the technically curious. The full build sheet — verified queries, thresholds, and build notes — lives on the specs page.

ReadsNetSuite warehouse
Sales orders for protector families, per customer
Stepops3_protector.py
Reorder-window math, team grouping
DeliversMonthly call list
To Ifham & Mithun, per team
Human gateSales calls
The loop finds; people sell
System we read Automated step State / memory Human decision
SystemRole in this loop
NetSuite warehousePostgres on our serverOur nightly read-only copy of NetSuite (ERP) data — items, stock, transactions — refreshed by the ETL sync every morning. The loop queries this copy, never NetSuite itself.
Metabasebi.huxapps.comThe BI layer over the warehouse. The loop runs its SQL through Metabase's API, and every number in the digest links to a live, clickable Metabase list so you can drill into the exact records.
Hermesagent runtime on our serverThe scheduler that wakes the loop up. Each loop is a cron job under a Hermes profile; the planned bizops profile will host the business digests (IT loops run under vpsops).
Healthcheckshealthchecks.huxapps.comThe dead-man's switch. The loop pings it only after a clean run — if the loop dies or errors, the ping stops and Healthchecks raises the alarm independently. This is how 'never silent' is enforced by machinery, not promises.
Email renderer + gwsrender_email.pyAll digests pass through one shared renderer: Huxberry-branded HTML, tables for repeated rows, a coral 'needs your response' box when the loop has questions, and an arrow link on every record. Sent from the loops mailbox via the Google Workspace CLI.
Loop chassisloop_common.pyShared plumbing every loop reuses instead of reinventing: state files, run-over-run diffing, Metabase drill-down link building, quiet-on-green notify logic.
Model / brainWhat it does here
None at run timedeterministic scriptA normal cycle is a plain Python script — no AI tokens are spent unless a diagnosis or judgment step is actually needed. AI wrote the script; the script does the rounds.
GPT-5.5 via Codexthe bulk-work modelWrote and maintains the mechanical parts — SQL, diffing, digest assembly. Effectively free on our existing subscription, so routine cycles cost almost nothing.
State & memory

Last month's due list — so the digest can show “new this month” vs “still uncalled”.

Delivery

Monthly email call list, per team, every customer linking to its records.

Safety rails

Read-only. A minimum-history filter (open threshold question) keeps one-off buyers from polluting the list.

Before it can run for real
  • Nish/Ifham's answer on the minimum-history filter (open question e from the Wave-2 email)
Full build sheet →