UNFAIR
Download
Glossary · Stack Architecture

Custom Stack Builder

Last updatedApr 21, 2026

The custom stack builder is the assembly surface in Unfair where a user chooses a goal, selects ingredients, and sets timing and duration, with safety checks running at every step before the stack can activate. It is deliberately not a free-form note field; every ingredient added is resolved against the library's canonical metadata, every dose is summed against the user's other active stacks, and every profile-level contraindication is evaluated before the activation button unlocks. The output is a stack that review cycles can read against its stack goal, not a shopping list.

Assembly flow

The builder walks the user through six steps in a fixed order. The order matters — the safety gates in later steps read the choices made in earlier steps, so skipping ahead is not supported.

StepWhat the user doesWhat the builder checks
1. GoalPick one primary goal and confirm the primary and secondary proxiesGoal has a defined proxy pair and a review window
2. RosterAdd 3–7 ingredients from the library, each resolved to a canonical compound idCanonical ids present, no unknown proprietary formulas without standardized actives
3. DoseSet a dose per ingredient within the library's suggested rangeDose within tolerable upper intake and per-compound ceiling
4. WindowPlace each ingredient into a morning, midday, pre-training, or bedtime windowWake-promoting compounds not placed in the bedtime window, sedating compounds not placed before noon
5. DurationPick a cycle length and review cadenceCycle length at least the review window of the chosen goal
6. Safety passReview the flagged items and resolve each oneEvery flag resolved — reduced, removed, or acknowledged with the required note

Step 6 is the gate. The activation button stays disabled until every flag from every previous step is either cleared or explicitly acknowledged with the note the flag requires.

Safety gates the builder enforces

Three gates run automatically and cannot be bypassed by a user checkbox alone.

  • Overlap gate. The canonical compound sum across this stack plus every other active stack is computed and compared against the per-compound ceiling. Exceeding a ceiling blocks activation until a product is removed or a dose is reduced; see duplicate ingredient risk for the four hidden-duplicate patterns the gate catches.
  • Dose ceiling gate. Each ingredient's dose is compared against the tolerable upper intake in its metadata. A dose above the UL blocks activation; a dose between RDA and UL surfaces an acknowledgement.
  • Stimulant cap gate. Total daily stimulant load in caffeine equivalents — coffee, tea, yerba, pre-workouts, theacrine, synephrine — is summed and compared against a 400 mg/day default cap and a 200 mg single-window cap. A stack that pushes the user past 400 mg/day is blocked until a source is removed or substituted for a stim-free variant.

Two additional gates surface warnings rather than blocks. The interaction risk gate flags pharmacodynamic overlap pairs at mild, moderate, or severe tier. The profile gate re-reads the user's current medications, pregnancy status, and recent labs and excludes any compound with a matched absolute contraindication.

A numeric example

A user builds a focus stack for the morning window. Step 1 sets the goal to focus with deep-work block quality as the primary proxy. Step 2 adds caffeine 200 mg, L-theanine 200 mg, tyrosine 500 mg, and a pre-workout containing 150 mg additional caffeine. Step 3 passes the per-ingredient dose check. Step 4 places all four in the 8 a.m. window. Step 5 sets a 28-day cycle. Step 6 runs the gates and the stimulant cap gate fires — total morning-window caffeine is 350 mg, above the 200 mg single-window cap, and day-total is 350 mg sitting under the 400 mg day cap but leaving no room for an afternoon coffee. The builder suggests either dropping the pre-workout or swapping to the stim-free variant. After swapping, the morning window caffeine drops to 200 mg and the stack activates. The matched framing lives in supplement stack mistakes to avoid under the risk checks section, with one stimulant at a time as the default rule.

Handoff to the review cycle

Activation is not the end of the builder's job. At activation, the stack is written to the user's log with three payloads — the roster with canonical ids, the dose schedule per window, and the chosen primary/secondary proxies — so the daily check-in begins collecting the right data from day one. Reminders fire on the windows chosen in step 4. The review cycle opens at the end of the duration chosen in step 5, compares the proxy trend against the baseline, and either promotes the stack to maintenance, extends the cycle with a single-variable change, or retires the stack. If the user adds a prescription to their profile mid-cycle, the profile gate re-runs and can pause the stack before the review cycle completes. The build your own stack pillar covers the same flow from a new-user perspective and is linked from the empty-state of the builder.

What the builder does not do

Three things are deliberately outside the builder's scope, and surfacing them here matters because users sometimes expect them.

  • The builder does not purchase products. It names the compounds and the doses; sourcing is handled outside the app.
  • The builder does not diagnose. A compound that might help with low mood is never phrased as a treatment, and goals that imply diagnosis (depression, ADHD, anxiety disorder) are replaced with proxy-level goals (mood score, focus score, subjective anxiety) so the stack stays on the self-tracking side of the line.
  • The builder does not override a clinician. Any compound a prescriber has instructed the user to stop is blocked at the profile gate regardless of any other logic, and a prescriber note on file takes priority over library defaults.

When to use the builder vs a template

A template is the right starting point when the goal is common and the roster is well-evidenced — a sleep stack with magnesium, glycine, and apigenin, or a foundational morning stack with vitamin D, omega-3, and creatine. The custom builder is the right starting point when the user has constraints a template cannot express — a prescription that excludes a common template ingredient, a training schedule that needs a non-standard window, or a second active stack whose overlap needs to be accounted for. Templates write through the same gates before activation, so switching from a template to a custom roster does not skip any safety step.

How this appears in Unfair

The builder is the default path from the home screen to any new stack. Each step is its own screen with the safety gates surfaced inline so the user sees the reason for every flag. The activation button shows the count of unresolved flags while disabled; tapping it in that state opens the flag list rather than attempting to activate. After activation, the stack appears on the home screen with its roster, next window, and review-cycle countdown, and the review screen is pre-populated when the cycle closes so the user is not re-entering data.

Clinical safety note

The builder's gates are based on the library's ingredient metadata and the user's entered profile; they do not see conditions or medications the user has not entered, and they are not a substitute for prescriber review. A new prescription, a new diagnosis, pregnancy, planned surgery, or any symptom cluster matching the escalation triggers in the interaction risk entry is a reason to pause the stack and involve a clinician before resuming, regardless of whether the builder has flagged anything.