Snapshots

The rules every change follows, each one earned by a past hurt

Settled
  • Truth: no invented numbers, and a check that did not run is never shown as none.
  • Every brand: a fix works for any brand, with a test and healed saved data.
  • Dummies carry a tag in three places, and none reaches production.
  • Never re-add a cut feature without a product decision.
  • Enforce in CI where possible, starting with the Dummy marker check.
15files carry DUMMY markers today
Your call

Should CI enforce these rules? Proposal: yes, start with the Dummy marker check.

Engineering · 5.18

Engineering rules

DraftLast checked Mon Oct 26Owner Param

Answer

These are the rules every change to Brew follows, from any person or session, and each one exists because breaking it hurt a brand or cost money before.

Today

Truth

  1. No invented numbers, quotes, founders, reviews or backstory. Every number traces to a ledger entry or a cited source; otherwise it says "to confirm". brew/SPEC.md
  2. Observed, inferred and implication stay separate; "not observed" never means "absent"; never state a rival's motive; benchmarks are labelled. brew/SPEC.md
  3. An error or a check that did not run is never shown as "none", "not found" or "0". Keep error on the item and say the check did not go through. brew/CLAUDE.md
  4. A Play is never evidence; proof is real data, real voice, real numbers. memory brew-proof-plain-make
  5. No disclaimers or AI labels on ad creative. brew/SPEC.md

Every brand

  1. A fix is done only when it works for any brand Brew could onboard, every card type, every widget and every view: platform, how it sells, market, name, how the site reads, background runs across deploys. Never a per-brand patch, hard-coded id or brand name. brew/CLAUDE.md memory feed-for-all-brands
  2. Fix as product: shared cause in code, a test or audit that would have caught it, healed saved data, then deploy. A hand patch to a pack is only a stopgap and is said so. memory fix-as-product
  3. Saved data heals itself: heal(), a stage or pack version bump, a load-time repair, wherever text is read. brew/CLAUDE.md memory brew-one-version
  4. Add a case to test/non-shopify.test.js for every new kind of brand that breaks; add a check to tools/audit-brand-book.mjs and a guard test for every new Brand Book problem class. brew/CLAUDE.md

Dummies and production

  1. Anything simulated is marked in three places: a Dummy tag in the UI, a DUMMY: comment in the code, a row in DUMMY.md. Simulated rows are never evidence. brew/DUMMY.md
  2. Nothing dummy, simulated or from testing ever reaches production; the clean gate refuses a promote on any finding. memory prod-clean-only brew/db/prod-clean.mjs:1-6
  3. Never re-add a cut feature without a product decision. brew/SCOPE.md

Partners and money

  1. Never disconnect, reconnect or re-select Arata's Meta or Shopify connection; PROTECTED_CONNECTIONS guards it in code. Test disconnects on Cozy. memory never-disconnect-arata-meta brew/connectors/protected.js
  2. Never wipe or reset the five design partners; risky tests run on Cozy or Zenant. memory brew-live-stores
  3. No paid generation while only building; ask before a paid probe; never full reads just to test. memory no-spend-while-building memory feed-for-all-brands
  4. Every treg call goes through treg.js; paid sources fall back to free ones; never repeat a call for data we hold. Load the brew-external-data skill before touching outside data. brew/CLAUDE.md memory treg-usage-rules
  5. Cost cuts never drop Plays; make each Play cheaper. memory keep-all-moves
  6. Every paid action shows its price and waits for a yes; nothing is paid twice (idempotency keys, make claims, saved job ids). brew/jam2/studio.js:1-5 brew/jobs.js:4-5
  7. Paid background work runs only on the lease holder. brew/roles.js:39

Product shape

  1. Read only in v1: Brew never writes to a brand's accounts or sends to its customers. brew/SCOPE.md
  2. One version, then Redo it; never several options to pick from. memory brew-one-version
  3. Say Plays to people; ids, routes and files may keep "move". memory brew-qa-round2-2026-10-24

Shipping

  1. Run AI_MOCK=1 node --test test/*.test.js, boot locally, then deploy with ./deploy.sh from a clean tree; deploy right after a change is tested so Param can test on staging. brew/CLAUDE.md memory always-deploy-to-test
  2. Commit only your own lines, push before deploying, deploy from a clean worktree of origin/main. memory brew-parallel-sessions-deploy
  3. Production only through tools/promote.sh. brew/.wt-prod/docs/production.md
  4. Phased work: a full QV round after each phase, three more before closing. memory brew-qv-process

Tomorrow

Item Version Tag
All rules above v1 Stays
Rule 20 (read only) v3 Changes: writes and sends arrive one at a time, each behind a person's yes
A CI check for rules that code can test (no undeclared constants, Dummy markers in step) v1 New

How we do it

  1. Before a change, read brew/CLAUDE.md, SCOPE.md and DUMMY.md on origin/main.
  2. Before shipping, walk this list and say in the commit which rules the change touched.
  3. When a rule is broken, add the incident to the rule's source note and a guard test.

Numbers

Metric Definition Where measured
Clean gate findings Findings per promote brew-prod-clean job logs
Dummy markers in step DUMMY: comments, UI tags and DUMMY.md rows that match Proposed: a test that compares them (15 files carry DUMMY: today) git grep "DUMMY:" origin/main
Per-brand patches Commits naming one brand slug in code Proposed: a grep in CI

Open

  1. Should these rules be enforced in CI where possible? Proposal: yes; start with the Dummy-marker check and a ban on brand slugs in code outside tests and data.
Sources
  • brew origin/main: CLAUDE.md (all sections), SPEC.md 'Hard rules', SCOPE.md, DUMMY.md (three markers, rules that keep a dummy from passing as real)
  • brew origin/main: connectors/protected.js; db/prod-clean.mjs:1-6; roles.js:39; jobs.js:4-5
  • memory feed-for-all-brands, fix-as-product, prod-clean-only, never-disconnect-arata-meta, brew-qv-process, always-deploy-to-test, no-spend-while-building, keep-all-moves, brew-one-version, brew-external-data-skill, brew-parallel-sessions-deploy, brew-live-stores, brew-name-and-scope, treg-usage-rules

Source file content/engineering/engineering-rules.md · For agents: Markdown · JSON