Public: anyone can read this; the crew can change it.

The profit slider: one control per forge trading cost against responsiveness — placement, sleep windows, crew spend margin — with cost, revenue and the gap as board signal #513

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

Closes #392

shipped production is serving it deploy caaa084

opened this

Closes #392

This is the plan for the profit slider: a design page plus eight linked issues, each sized for one run. No app code changes. docs/PROFIT.md is the page the child issues share, following the spawn design (#428). The new issues are:

IssueWhat it isWaits for
#504One position from 0 to 100 per forge, a pure policyAt(position), a Settings → Economics page and its API—
#505A record of how long each app is awake and how much storage it uses, per app and environment—
#506Apps sleep on the slider's schedule, with no restart; an app can set always_on#504
#507What the forge costs: owned machine spread over the month, cloud by the hour, storage, crew spend#504, #505
#508A monthly statement per app (JSON, CSV, print): awake time, storage, and crew spend plus a margin#507
#509Where an app runs: owned machines first, cloud only above the slider's threshold#504, #505
#510The board's line: cost, revenue and the gap, with a 30-day chart drawn on the server#507, #508
#511An MCP economics read and the same data over the API#510

#391 (the long-running services app kind) now also waits for #509.

What to look at:

  • Position 50 is today's behaviour. Production sleeps after 24 h, previews after 30 min, and a quiet pull's preview stops after 3 days, so landing #504 changes nothing until someone moves the slider. Position 0 sleeps early and uses cloud only when owned machines are full. Position 100 keeps apps warm and uses cloud early. "Never sleeps" is treated as a 7-day cap when working out positions between the three settings.
  • The margin is its own number beside the slider. It sets price; the slider sets cost and responsiveness. The gap line shows whether the two together make a profit.
  • Money is in US dollars, rounded once at the end. The formulas are on the page with a worked example: $300 + 40 h × $0.05 + 12 GB-months × $0.02 + $57.10 = $359.34.

What I chose not to do:

  • No per-app sliders. always_on and a placement: metal|cloud preference are the only per-app settings.
  • The placement decision doesn't move anything. Actually running an app in the cloud waits for the spawn design's placement seam and its cloud-hosting spike (#339). Until a cloud host exists, every decision is "owned" and the board says bursts wait in a queue.
  • No payment processor. Billing is a statement anyone can check by hand.
  • The owned-machine label (plat.sh/site=vxrail) is a setting, not hard-coded. The sleep timers and the vxrail label from the issue live on the platform outside this repo, so the forge-side versions go in through #506 and #509.

Check: the forge.json check passed 597 of 598 tests. The one failure was in test/fork-flow.test.ts ("a mirror whose git is not ready yet is fetched again"). Run on its own it passes 15 of 15, so it looks like timing under load, and this pull only adds a doc. tsc first needed bun install in this clone.

To try it, read docs/PROFIT.md, then the map: #504 and #505 are ready now.

🤖 Generated with Claude Code

Closes #392

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs