Developer Overview

Multi-Home Systems: LP Formulation

ndexr orchestrates apps and households using one optimizer: maximize savings & profit under real limits (time, childcare, infra, budget).

Core Principles
  • Primitives first: containers, rows, and cols before themes.
  • Separation of concerns: UI in modules, logic in services.
  • Actionable errors: stderr + failed command + next step.
  • Predictable diffs: small, reviewable, traceable.
Life + Compute LP (monthly)

We model households and cloud spend jointly. Variables choose work hours, childcare, category spends, savings, and where apps run (BYO vs Managed).

Entities
  • Adults i ∈ A (you, partner, …)
  • Households h ∈ H (multi-home)
  • Apps a ∈ Apps (rstudio, minecraft, …)
  • Categories k ∈ K (housing, food, utilities, transport, kids, debt, invest, disc)
Parameters
  • Income: fixed net ̄Y_i , optional hours H_i ≤ ̄H_i at wage w_i
  • School cover: C_school hours; childcare r_cc $/hr + f_cc
  • Needs minima: m_{h,k}
  • Compute: price/CU p_cu[a] , cost/CU c_cu[a] , capacity ̄C
Decision Variables
  • H_i ≥ 0 extra paid hours
  • H_cc ≥ 0 childcare hours
  • x_{h,k} ≥ 0 spend by category
  • S_h ≥ 0 savings per household
  • σ_h ≥ 0 shortfall slack (only if infeasible)
  • z_{i,a} ∈ {0,1} app placement (Managed vs BYO)
  • hM_{i,a}, hB_{i,a} ≥ 0 Managed/BYO compute CU
Objective
max  ΣhSh + Σi,a(pcu[a]-ccu[a])·hMi,a
 - MΣhσh - εΣiHi
Constraints (sketch)
  • Household budget: Σ fixedi∈h + Σ wiHi ≥ Σxh,k + Sh + (rccHcc+fcc) − σh.
  • Needs minima: xh,k ≥ mh,k.
  • Childcare coupling: Hcc ≥ (ΣHi) − Cschool.
  • App placement: hMi,a ≤ demandi,a·zi,a, hBi,a ≤ demandi,a·(1−zi,a).
  • Capacity/budget: Σ vcpu[a]·hM ≤ ̄C, Σ ccu[a]·hM ≤ infra_budget.
  • SLA (optional): Σa(hM+hB) ≥ sla_mini.
  • Binary policy: zi,a ≤ si (Managed requires subscription).
Implementation Notes
  • Rust orchestrates : fetch CUR/CloudWatch, solve MIP (highs/glpk/or-tools), emit JSON policy.
  • Shiny surfaces : inputs (mins, caps), results (hours, childcare, spend, savings), diff to last solve.
  • Stripe link : Managed CU → usage records; subscription gates z=1 placements.
  • AWS tags : enforce placement via start/stop by customer/workspace tags.

Show the failing command, stderr, and the next remedial command.

UI in modules, services for logic, Rust for orchestration. Keep layers thin.

  • Tax rate, wage/hour caps, school coverage, childcare rate/fee.
  • Needs minima (household + personal).
  • Compute: p_cu, c_cu, capacity, demand windows, GPU multipliers.
  • Risk penalties to steer BYO vs Managed.
  • Savings floors and envelope caps.