Loop HUX-L3 · Marketing — Huxberry.com · reports to Sherif

Every dirham in the ad accounts, watched daily.

Daily: spend pacing, disapprovals, and threshold breaches. Weekly: the full audit ritual a $300K/month agency runs — zero-conversion search terms, creative fatigue, audience saturation, quality scores, and a written “what moved and what I'd do”.

Built — awaiting credentialsWave 3🕐 Daily + weekly ritual⚙️ Script, creds pending
Part 1 — the plain-english view

No spend without results — ever again.

What it watches
  • Daily: pacing over/under, disapproved ads, and the coral rule: any ad set over AED 500 spend with zero sales in 7 days
  • Weekly ritual: zero-conversion search terms · creative fatigue (CTR drops) · audience saturation (frequency creep) · quality-score audit · week-over-week narrative
When & how it speaks

Daily one-liner when something breaches; the full weekly audit every Monday with a written narrative — what moved, and what a competent media buyer would do about it.

Why it exists

The AED 720K ran for 14 months without any of these checks existing. The weekly ritual is adopted verbatim from a proven playbook run at $300K/month of managed spend — we didn't invent the checklist, we adopted a battle-tested one.

AED 500
the daily coral rule: that much spend with zero sales in 7 days = flagged
5 checks
in the weekly ritual — the same routine a $300K/month operation runs
14 months
the AED 720K ran unwatched — the precedent this loop retires

Daily + Monday

Two cadences, one loop

👀

Pulls account data

Read-only: spend, results, terms, frequencies

📋

Thresholds + ritual

Daily breaches; Monday's five-check audit

💬

Digest to Sherif

Breaches same-day; narrative weekly

🔗

Feeds L5 & L6

Fatigue flags → creative refresh; junk terms → the janitor

What it will never doNever edits campaigns or budgets — read-only by construction. Its findings feed two other loops, both of which are also human-gated.
Where it stands today · July 2026Built and fixture-proven: every threshold (including deliberate below-threshold negatives) tested against synthetic account data; the hand-off files to L5 and L6 verified. Goes live when the read-only credentials land — the Google developer-token request is the slow part and should start first.
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.

ReadsGoogle + Meta ads
Read-only pulls via the shared adapter layer
Stephux_l3_watchdog.py
Daily thresholds; weekly 5-check ritual
StateAccount history
Pacing baselines, CTR trends, frequency history
DeliversDigest to Sherif
Daily breaches + Monday narrative
StepHand-off files
Fatigue → HUX-L5 · zero-conversion terms → HUX-L6
System we read Automated step State / memory Human decision
SystemRole in this loop
Ads adapter layerads_common.pyOne shared, environment-gated adapter for Google and Meta data, used by all four ads loops. It has a fixture mode, so every threshold was provable with synthetic data before any credential existed.
Agent Vaultcredential storeWhere API keys live. Loops get read-only credentials from the vault; nothing is hardcoded in scripts.
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.
Credential-expiry watchdogexisting loopThe Meta long-lived token dies ~2 months in, silently — it's wired into the expiry check from day one or this loop dies quietly at week 8.
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.
Claude Opusthe judgment modelReviews alert wording, thresholds, and anything a human will read and act on. Post-Fable, Opus owns everything that ships.
State & memory

Account history per campaign/ad set — pacing, CTR and frequency baselines that make “fatigue” and “saturation” computable.

Delivery

Daily breach one-liners; Monday's full audit with the written narrative. Every finding carries its numbers.

Safety rails

Read-only credentials from the vault. Only meaningful after the tracking foundation — before that, “results” would be a lie, so it waits.

Before it can run for real
  • HUX-L0 (so “results” = verified sales)
  • Read-only ad credentials: Google developer token (slow — request first) + OAuth; Meta long-lived token wired into expiry-watch
Full build sheet →