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

The terminal lists the forge's capacity and guards live, and a forge admin changes a settable one after a plan, as MCP `capacity` does #7455

opened this

Merged 38d 10h ago, live in production

The terminal now has a Capacity screen. A forge admin who is a person finds it in the palette. bun x tsc --noEmit, test/tui-capacity.test.ts and test/mcp-size.test.ts pass here.

Notes

opened this

The terminal now has a Capacity screen. A forge admin who is a person finds it in the palette. bun x tsc --noEmit, test/tui-capacity.test.ts and test/mcp-size.test.ts pass here. I did not run the full suite; the forge's check does that on the push. I did not run bun scripts/design-lint.ts after the final push, and I did not boot the app.

  • List: each row shows the guard, its live value and where that value comes from (a setting or the default). The six settable guards also show their bounds, such as takes 1–16 or enforce | report, and the default once one has been changed. The other three (queue depth, queue batch, child forges) are marked read-only.
  • Change: e on a settable row asks for a value. An empty value restores the default. The confirm shows key: from → to, and changeCapacity runs only on y; the default is n. A value out of bounds is refused in the SETTING_WORDS.outOfRange words, and esc changes nothing.
  • Read-only rows: e on one says in one line that the environment sets it.
  • Who sees it: the palette door is offered only to a forge admin who is a person. A member or an agent gets no door. The actions already answer them not_found if they reach the screen another way.
  • Reuse: no new rule and no new MCP tool. The six settable keys are listed in the screen and match the capacity tool's enum.
  • Files: src/tui/screens/capacity.ts, the palette entry in src/tui/forge.ts, test/tui-capacity.test.ts, and a README paragraph.
  • Tests: the new tests cover the door's gate, the list, a change after a confirm (and cancelling it), an out-of-bounds refusal, and e on a read-only row.
  • First push: it carried a wrong test of mine. I had assumed left cancels the confirm, but n is the default. The second push fixed the test; the code did not change.
  • Left out: the capacity change log (listCapacity also returns it) is not shown in the terminal. Raising the three read-only guards from here is also left out.

To try it: sign in over the terminal as a forge admin, press ctrl+k, choose Capacity, move to "Crew runs at once", press e, type a number and press enter. Then press left and enter to apply it.

Closes #7275

3 earlier comments
commented

The terminal now has a Capacity screen. A forge admin who is a person finds it in the palette. bun x tsc --noEmit, test/tui-capacity.test.ts and test/mcp-size.test.ts pass here. I did not run the full suite; the forge's check does that on the push. I did not run bun scripts/design-lint.ts after the final push, and I did not boot the app.

  • List: each row shows the guard, its live value and where that value comes from (a setting or the default). The six settable guards also show their bounds, such as takes 1–16 or enforce | report, and the default once one has been changed. The other three (queue depth, queue batch, child forges) are marked read-only.
  • Change: e on a settable row asks for a value. An empty value restores the default. The confirm shows key: from → to, and changeCapacity runs only on y; the default is n. A value out of bounds is refused in the SETTING_WORDS.outOfRange words, and esc changes nothing.
  • Read-only rows: e on one says in one line that the environment sets it.
  • Who sees it: the palette door is offered only to a forge admin who is a person. A member or an agent gets no door. The actions already answer them not_found if they reach the screen another way.
  • Reuse: no new rule and no new MCP tool. The six settable keys are listed in the screen and match the capacity tool's enum.
  • Files: src/tui/screens/capacity.ts, the palette entry in src/tui/forge.ts, test/tui-capacity.test.ts, and a README paragraph.
  • Tests: the new tests cover the door's gate, the list, a change after a confirm (and cancelling it), an out-of-bounds refusal, and e on a read-only row.
  • First push: it carried a wrong test of mine. I had assumed left cancels the confirm, but n is the default. The second push fixed the test; the code did not change.
  • Left out: the capacity change log (listCapacity also returns it) is not shown in the terminal. Raising the three read-only guards from here is also left out.

To try it: sign in over the terminal as a forge admin, press ctrl+k, choose Capacity, move to "Crew runs at once", press e, type a number and press enter. Then press left and enter to apply it.

commented

I've pushed fixes for all three of juniper's points to the same branch. bun x tsc --noEmit, test/tui-capacity.test.ts, test/mcp-size.test.ts and test/mcp* pass; the full suite is left to the forge's check on this push. I still haven't booted the app, so the screen has only been exercised through the headless tests.

  • Refusals: each changeCapacity error now has its own words in src/tui/screens/capacity.ts. no_credential says to set a password or passkey first, because turning the edge off would lock the admin out. invalid_value keeps the SETTING_WORDS text, and not_found/no_such_setting say "no such capacity setting". A new test turns signin.edge off for an admin with no password and checks that the lockout message shows instead of "out of range".
  • Trim: onSubmit now trims once, and the validation, the plan and the call all use that value. A test types 3 and checks that the plan and the stored value are 3.
  • One list of settable keys: SETTABLE_CAPACITY is now exported from src/actions/capacity.ts. The MCP tool's enum and the terminal both use it, and the README paragraph no longer says "six".
  • More tests:
    • A change appends a capacity.changed event.
    • An empty value restores the default.
    • A cancelled confirm (n) changes nothing.
    • A member or an agent calling the screen directly sees no rows, and changeCapacity answers not_found.
  • Web viewers: I tested the event, not the web page. changeCapacity already appends capacity.changed and the web reads the same store, so I did not add a test that drives a web client.
  • Tool wording: src/http/mcp/tools/capacity.ts still answers every changeCapacity failure with the out-of-range text. I left that alone because the issue says to reuse the functions and add no rule. It does mean the MCP tool will tell an admin who is about to lock themselves out that the value is out of range.
commented

I've pushed the fix to the same branch. The terminal's Capacity screen now lets e edit every guard, as /settings/capacity does. bun x tsc --noEmit, bun scripts/design-lint.ts and test/tui-capacity.test.ts pass; I didn't run the full suite or boot the app.

  • Both doors: I dropped the settable gate from src/tui/screens/capacity.ts. Every row, including queue.depth, queue.batch and children.max, now shows its value, source and takes <bounds>, plus the default once overridden. SETTABLE_CAPACITY remains only as the MCP tool's enum.
  • README: the paragraph now says every guard can be changed with e and no row is read-only.
  • Tests:
    • The "read-only row" test is replaced by one that changes queue.depth to 4 after a confirm.
    • Tests reach rows with CAPACITY_KEYS.indexOf(key) instead of hand-counted j presses.
    • The signin.edge test restores carol's password_hash afterwards.
  • Not touched: MCP capacity still words no_credential as out of range. That deserves its own issue and stays out of this pull.
commented

I merged main into this branch, resolved both conflicts, and pushed (973e206f). The forge's check hasn't reported on the new push yet.

  • src/tui/forge.ts: the palette now has both the Capacity command and main's updated Resilience comment.
  • README.md: the Capacity paragraph is kept, and the clog-watch line is now main's version, which adds the detach text. I removed the older duplicate of that line.

bun x tsc --noEmit gave no errors. I ran the capacity tests plus the other tests whose names match palette, forge and resilience: 36 pass, 0 fail. I did not run the whole suite. scripts/fast.ts said the diff reaches 1019 of 1639 test files (about 89 minutes), so I picked those tests myself and left the full run to the forge's check.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs