Skip to content

Let a team run have no money cap, said on purpose, everywhere a budget goes - #117

Merged
ntatschner merged 1 commit into
mainfrom
team-no-budget
Sep 24, 2026
Merged

ntatschner merged 1 commit into
mainfrom
team-no-budget

Conversation

@ntatschner

Copy link
Copy Markdown
Owner

A team run can now have no money cap, but only when somebody says so. none is accepted everywhere a budget goes, and there is a machine-wide default.

Why

A null budget meant "not set" everywhere, and not set falls back to something else. A run with neither a budget nor a round limit is refused. There was no way to say "no cap" on purpose. Writing usd: none in a team file made the whole file unreadable, because the figure is a decimal, and a lower layer's team of the same name ran in its place with only a finding to say so.

What it does

UsdCap holds three states: a figure above zero, none, or not set. A run takes the first of these that says anything:

  1. The run itself:
    • team run --usd (new);
    • team resume --usd;
    • team budget;
    • the dashboard's budget box, start form (new budget field) and pickup;
    • team schedule add --usd (new). The daemon passes this on when the schedule fires.
  2. The team file: budget: usd:. usd: none now reads as no cap.
  3. This machine's default: loadout config set team-budget <figure|none>, also in the dashboard's settings.

The runner's refusal still stands when nothing says anything and no --rounds was given. none from any of the three gets past it; a missing figure does not.

Also:

  • Bad figures: zero, a negative figure and anything that is not a figure or none are refused, never read as no cap. On team run and schedule add this happens before anything is looked up, and team show names such a figure in a team file as a mistake.
  • team show: it now says "no cap" only where the file says so, and "none set (give --usd or --rounds)" otherwise. It used to print "no cap" for a team that could not run.
  • Journal: a budget is recorded as its figure plus an uncapped flag. Fold now clears the figure when the cap is taken off. Before, a null figure kept the earlier one, so the page measured a run against a limit it no longer had.
  • Raise question: a watched run at its budget is offered "Take the cap off" beside the two raises.
  • Dashboard: the budget box is a text box, so it can take none, and the meter and the list say "no cap" instead of hiding the budget.

A consequence worth knowing

Every team that ships sets a figure, and the team file comes before the machine default. So team-budget none only reaches teams written without a budget. To take the cap off a shipped team, say none for the run. This is the order that was chosen ("both": none everywhere, plus a machine default that a team file or run can override with a figure).

Evidence

  • 47 new tests:
    • TeamBudgetFileTests;
    • runner tests for none from each of the three places, and for a team figure winning over the machine's none;
    • the override file and the journal in RunBudgetTests;
    • Settle with none;
    • one test per field for the start form, the start POST, the settings pane (through the real parser) and a fired schedule;
    • contract tests for team budget --usd none, a bad figure on team run, schedule add and team budget, and the config key.
  • Mutation-checked: each of nine rules fails a test when broken:
    • the refusal letting none through;
    • a team figure beating the machine default;
    • the journal clearing the cap;
    • the team file reading none;
    • zero not being a budget;
    • the page's budget reaching the command;
    • a schedule's budget reaching the command;
    • resume accepting none past the budget;
    • the raise offering to take the cap off.
  • Full suite: 3420 passed, 0 failed, 22 skipped.

Not verified

The dashboard has not been used by hand in a browser. Its scripts pass node --check, and the server and command side of every field is tested, but the new boxes and buttons have not been clicked.

…t goes

A null budget meant "not set" everywhere, and not set falls back: the
run's override to the team's figure, and a run with neither a budget nor
a round limit is refused. There was no way to say "no cap" on purpose.
usd: none in a team file made the whole file unreadable, because the
figure is a decimal, and a lower layer's team of the same name ran in
its place with only a finding to say so.

UsdCap is the three states: a figure above zero, none, or not set. What
a run is held to is the first that says anything of: the run's own
(team run --usd, team resume --usd, team budget, the dashboard's budget
box, start form and pickup, a schedule's --usd), the team file's
budget.usd, and this machine's team-budget. The runner's refusal still
stands for a run where nothing says anything and no --rounds was given;
none from any of them gets past it, a missing figure does not.

- Team files: TeamBudgetConverter reads usd: none; TeamCatalogue names
  a zero or negative figure as a mistake; team show says "no cap" only
  where the file said so, and "none set" otherwise, where it used to say
  "no cap" for a team that could not run.
- The run's override file takes "none"; anything unreadable is not set,
  never no cap.
- The journal records a budget as its figure and an uncapped flag, and
  Fold clears the figure when the cap is taken off: a null figure used
  to keep the earlier one, and the page measured a run against a limit it
  no longer had.
- A watched run at its budget is offered "Take the cap off" beside the
  two raises, and "none" typed there means the same.
- team run gains --usd; team schedule add gains --usd, which the daemon
  passes when the schedule fires; team budget and team resume take none.
  A bad figure is refused before anything is looked up.
- loadout config set team-budget <figure|none>, also in the dashboard's
  settings. It sits below the team file, so it reaches teams that set no
  budget; every team that ships sets one.
- The dashboard's budget box is text, so it can take none; the meter and
  the list say "no cap" rather than hiding.

Tests: TeamBudgetFileTests, runner tests for none from each of the three
places and for a team figure winning over the machine's none, the
override file and journal in RunBudgetTests, Settle with none, the start
form, the start POST, the settings pane and a fired schedule each field
by field, and contract tests for team budget --usd none, a bad figure on
team run, schedule add and team budget, and the config key. Mutation-
checked: nine rules, each failing a test when broken.
@ntatschner
ntatschner merged commit 6972a9f into main Sep 24, 2026
13 of 14 checks passed
@ntatschner
ntatschner deleted the team-no-budget branch September 24, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant