Skip to content

fix(capacity): a shut-down device holds no RAM budget - #979

Merged
V3RON merged 5 commits into
mainfrom
bug/779
Oct 24, 2026
Merged

V3RON merged 5 commits into
mainfrom
bug/779

Conversation

@V3RON

@V3RON V3RON commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Closes #779

Status

Implement: done (1/1 green) Review: round 2 clean, 4 fixed Hardware: n/a Gate: running
Next: gate

Done when

  • A shut-down device consumes no RAM budget; it keeps its device-limit charge (strategies/resource/index.ts #usedBytes; shutdown-ram.test.ts).
  • Booting a shut-down device is charged its whole full size; running rewarms keep the mode delta (canBoot; resource index.test.ts).
  • A boot reservation counts as RAM-active at full size until released (coordinator.ts #withReservations; coordinator.test.ts).
  • src/core/capacity/AGENTS.md, docs/CONFIGURATION.md and the website capacity page describe the new budget (review r2 claims lens checked them).

Assumptions

  • Assumption: how a reserved boot becomes RAM-active — the coordinator shows the booting shut-down device to the strategy as state booting, at full size.
  • Assumption: create-leasing.test.ts over-limit scenario — slim size raised to 3 GiB (was 2) so two running devices still exceed the limit now shut-down ones are free; its end state is 3 GiB used.

Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 4 blocking, 4 fixed, 0 notes. Claims review: 1 blocking, 1 fixed, 1 notes.
Rounds: 2. Tokens: 11.7M.
Runs: 10. Cost USD: 3.4155. Agent seconds: 1649.
Assessment: complete

Written by an agent.

@V3RON

V3RON commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: 1b5726b
Round 2: 4c1ffee

Runs: 10. Cost USD: 3.4155. Agent seconds: 1649.
Tokens input 312, output 73077, cache read 6649169, cache write 506644.
- build implementer: claude-sonnet-5-5 421 s $0.4542
- audit implementer: claude-sonnet-5-5 184 s $0.2634
- fix implementer: claude-sonnet-5-5 75 s $0.1087
- review 1 reviewer: claude-sonnet-5-5 391 s $0.3438
- review 1 reviewer spec: claude-sonnet-5-5 23 s $0.1132
- review 1 reviewer both: claude-opus-5-5 305 s $1.5052
- review 1 reviewer claims: claude-sonnet-5-5 43 s $0.1637
- fix 1 implementer: claude-sonnet-5-5 94 s $0.1988
- review 2 reviewer: claude-sonnet-5-5 74 s $0.114
- review 2 claims claims: claude-sonnet-5-5 39 s $0.1505
Finding outcomes: {"fixed":4}. Classes: {"comment false after change: shutdown frees RAM":1,"docs: waits until a device is deleted":1,"test comments with stale RAM figures":1,"testing 1":1}.
{
 "findings": [
  {
   "id": "R1",
   "role": "code,claims",
   "class": "comment false after change: shutdown frees RAM",
   "outcome": "fixed",
   "path": "src/leasing/acquisition-planner.ts",
   "round": "1",
   "fix": "4c1ffee118e2557c114e709a64281a552e478730"
  },
  {
   "id": "R2",
   "role": "code",
   "class": "docs: waits until a device is deleted",
   "outcome": "fixed",
   "path": "website/src/content/docs/docs/worker/capacity.mdx",
   "round": "1",
   "fix": "4c1ffee118e2557c114e709a64281a552e478730"
  },
  {
   "id": "R3",
   "role": "code",
   "class": "testing 1",
   "outcome": "fixed",
   "path": "src/leasing/create-leasing.test.ts",
   "round": "1",
   "fix": "4c1ffee118e2557c114e709a64281a552e478730"
  },
  {
   "id": "R4",
   "role": "code",
   "class": "test comments with stale RAM figures",
   "outcome": "fixed",
   "path": "src/core/capacity/strategies/resource/index.test.ts",
   "round": "1",
   "fix": "4c1ffee118e2557c114e709a64281a552e478730"
  }
 ]
}

Written by an agent.

@V3RON

V3RON commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Review notes

Not blocking, not verified. Each is one reviewer's claim.

  • claims: website/src/content/docs/docs/worker/capacity.mdx:53 the stated reason ("a shut-down device holds no RAM") did not explain why nothing is shut down for RAM: the planner evicts only for running-limit refusals (src/leasing/acquisition-planner.ts:243). Folded into the R1 and R2 fixes.

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review October 24, 2026 20:15
@V3RON
V3RON merged commit 5b434e2 into main Oct 24, 2026
52 checks passed
@V3RON
V3RON deleted the bug/779 branch October 24, 2026 20: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.

A shut-down device still counts against the RAM budget

1 participant