Answer
Every limit in Brew that stops money being spent, its value on production, its default in the code and why it exists; production sets most of them in one place, tools/prod-env.sh.
Today
Whole server, per day
| Cap | Production | Code default | What it stops | Source |
|---|---|---|---|---|
TREG_DAY_CAP_USD |
$40 | $25 | All outside data calls through treg in a day, across instances | brew/tools/prod-env.sh:9 brew/treg.js:45 brew/treg.js:82 |
DAILY_BUILD_CAP_USD |
$250 | $200 | All first builds of Plays in a day, across brands | brew/tools/prod-env.sh:9 brew/build.js:114 |
DAILY_TEXT_CAP |
1,500 units | 400 | AI writing calls in a day | brew/tools/prod-env.sh:9 brew/budget.js:13 |
DAILY_IMAGE_CAP |
1,500 | 60 | Pictures in a day; about $58 at worst on Flash | brew/tools/prod-env.sh:9 brew/budget.js:13 brew/deploy.sh:21 |
DAILY_VIDEO_CAP |
60 | 15 | Videos in a day | brew/tools/prod-env.sh:9 brew/budget.js:13 |
DAILY_VOICE_CAP |
not set, so 60 | 60 | Voice clips in a day | brew/budget.js:13 |
DAILY_CREDITS_CAP |
not set, so 300 | 300 | Sloosh credits for finals in a day | brew/budget.js:13 memory brew-sloosh-finals |
Per brand
| Cap | Production | Code default | What it stops | Source |
|---|---|---|---|---|
| Brand share of each daily cap | a third | a third, DAILY_BRAND_SHARE |
One brand using the whole day | brew/budget.js:14-15 |
BRAND_VIDEO_CAP |
20 a day | a third of the video cap | Videos for one brand | brew/tools/prod-env.sh:9 |
| Pictures kept for the team | 40 a day | BG_RESERVE_IMAGE 40, video 8, voice 10 |
Background drafts using the team's last pictures | brew/server.js:564-566 |
BUILD_CAP_USD |
$45 a build | $60 | One brand's first build of every Play | brew/tools/prod-env.sh:9 brew/build.js:113 |
| Pro brand build | $150 | the larger of $150 and 2.5 times the build cap | A brand marked Pro | brew/build.js:115 |
BRAND_WEEK_CAP_USD, the rewrite pot |
$40 a week on Pro Plays | $10 Flash, $40 Pro, $50 Claude | Weekly rewrites that keep Plays fresh | brew/rewrite-pot.js:20-21 brew/rewrite-pot.js:71 |
CONNECT_CAP_USD |
$40 a run | $40 | Rewrites after a first connected account | brew/build.js:1070 memory brew-connect-refresh |
LEARN_CAP_USD |
$30 an upload | $30 | Rewrites after a learnings drop | brew/build.js:1075 |
LIVE_CAP_USD |
$30 a run, weekly | $30 | Rewrites after connected numbers move 10% | brew/build.js:1076 memory brew-move-freshness |
REFRESH_CAP_USD, REFRESH_AUTO_CAP_USD |
$60 by hand, $10 automatic | same | A site check refresh | brew/build.js:1069 |
DRAFTS_DAY_CAP_USD |
$4 a day | $4 | Background first drafts | brew/drafts-bg.js:13 brew/drafts-bg.js:142 |
MOVES_WEEK_CAP_USD |
$3 a week | $3 | Weekly listening, automation and learn Plays | brew/moves-cadence.js:406 |
SOCIAL_DAY_CAP_USD |
$3 a day | $3 | Listening and the ideas stream | brew/social-feed.js:274 |
APIFY_BRAND_MONTH_CAP_USD |
$10 a month | $10 | Apify scrapers for one brand | brew/tools/prod-env.sh:9 brew/shelf.js:69 |
Per run
| Cap | Value | What it stops | Source |
|---|---|---|---|
LISTEN_RUN_CAP_USD |
$0.60, lite $0.15 | One listening run | brew/listen-watch.js:684 brew/social-feed.js:274 |
PULSE_CAP_USD |
$3 | One market pulse run | brew/market-pulse.js:318 |
| Brand Book enrichment | $0.50 | One enrichment run | brew/brand-enrich.js:9 |
Apify maxTotalChargeUsd |
per actor, such as $0.45 for Trustpilot | One scraper run | brew/apify.js:4 brew/apify.js:42 |
Paid makes
| Rule | Source |
|---|---|
| Every Studio make, redo, extend and final needs a confirmed price; a higher price than confirmed stops the make | brew/jam2/routes.js:238 brew/jam2/routes.js:310-317 |
| Sloosh's own daily agent limit, raised from 50 to 200 credits on 21 Oct; a brand's share of finals is 100 credits a day | memory brew-viral-remakes brew/budget.js:13-15 |
Tomorrow
| Item | Version | Tag |
|---|---|---|
| Every cap above | v1 | Stays |
| One monthly ceiling per brand across every source | v1 | New, proposed in cost per brand |
| Caps follow the brand's plan once pricing exists | v1, after pricing | Changes |
| Ad spend caps the owner sets per area and channel | v4 | New |
How we do it
- Change a production cap only in
tools/prod-env.sh, with a comment saying why, then promote. - Before moving Plays to a dearer model, raise the caps that follow it:
BUILD_CAP_USD,BRAND_WEEK_CAP_USDmemory brew-pro-switch-and-flush. - Any new paid call gets three things: a cap in env, a per brand share and a tag that books it to the brand.
- When a cap is hit, the product says so in plain words and carries the work to the next day; it never fails silently.
- Check the treg balance live before blaming treg for a stop memory treg-usage-rules.
Numbers
| Metric | Definition | Where measured | Status |
|---|---|---|---|
| Cap hits a week | Times any cap stopped work, by cap | Server logs and ops alerts | Proposed |
| Worst case daily spend | Sum of the daily dollar caps | This page | Proposed: about $348 from treg $40, builds $250 and pictures about $58, before per brand caps |
Open
- Is $250 a day of first builds right for production? Proposal: keep it; five partners at $45 a build fit, and a new brand waits a day past that.
- The build cap default in code is $60 but production runs $45. Proposal: set the code default to $45 so a missing env var never spends more.
- A monthly ceiling per brand. Proposal: $50 a brand a month across all sources during the partnership, raised only by Param.