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

Builder slots serve the roadmap first: tests-only and small-addition pulls get at most a set share of builder slots #7589

Parked opened this in answer to
Closed without merging

The picker now takes roadmap issues first and holds small issues to a share of the builder slots. The new test and the capacity, pipeline, MCP-size, autonomy and held-issue suites pass, and tsc is clean. I did not run the full suite.

Notes

stopped parked by the crew deploy 1ba1a23

opened this

The picker now takes roadmap issues first and holds small issues to a share of the builder slots. The new test and the capacity, pipeline, MCP-size, autonomy and held-issue suites pass, and tsc is clean. I did not run the full suite.

What changed

  • Pick order: driveRepo reorders the pickable issues so ones under an open epic or a P0/P1 pillar come first, with the existing rank kept inside each half. Both ways of being on the roadmap count:
    • An epic is an open issue titled Epic… or labelled epic, which waits for the issue.
    • A pillar is read from the existing servedBy.
  • Cap: small issues may hold at most slots.smallShare percent of the builder slots, rounded up, so 2 of 5 at the default 30. An issue is small if:
    • its title starts A test pins, Test: or Small, or contains tests-only; or
    • it is labelled tests-only, small or small-addition.
  • Setting: slots.smallShare is a new capacity setting (0–100, default 30, boot default from FORGE_SLOTS_SMALL_SHARE). It is read on every pick, so a change applies without a restart, and 100 lifts the cap.
  • Visibility: the tick line gets small=running/cap (for example 1/2). The /pipeline ready stage says "small issues at most 30%". I changed one assertion in test/flow-pipeline.test.ts to match that new text.
  • Code: the logic lives in src/crew/small_share.ts; src/crew/autonomy.ts, src/core/capacity.ts and src/flow/pipeline.ts call into it.
  • Docs: a short section in docs/CREW.md.

Tests (test/crew-small-share.test.ts)

  • Title and label detection, and the cap rounding.
  • With 5 slots, 2 small issues already building and a third small issue ready, nothing is picked.
  • When an issue under an open epic is also ready, that issue is picked and the third small one stays unassigned.

Left alone

  • The cap shapes only who starts next. A small issue already running is never stopped.
  • With only small issues ready and the cap reached, the tick falls through to the planner or idle as it did before.
  • slots.smallShare is not in the MCP capacity tool's enum list, so agents cannot set it through that tool. Adding it would grow the tool schema, and I did not raise the ceilings.
  • I did not run the Settings page or the live TUI/web views.

Closes #7571

5 earlier comments · 3 events
commented

The picker now takes roadmap issues first and holds small issues to a share of the builder slots. The new test and the capacity, pipeline, MCP-size, autonomy and held-issue suites pass, and tsc is clean. I did not run the full suite.

What changed

  • Pick order: driveRepo reorders the pickable issues so ones under an open epic or a P0/P1 pillar come first, with the existing rank kept inside each half. Both ways of being on the roadmap count:
    • An epic is an open issue titled Epic… or labelled epic, which waits for the issue.
    • A pillar is read from the existing servedBy.
  • Cap: small issues may hold at most slots.smallShare percent of the builder slots, rounded up, so 2 of 5 at the default 30. An issue is small if:
    • its title starts A test pins, Test: or Small, or contains tests-only; or
    • it is labelled tests-only, small or small-addition.
  • Setting: slots.smallShare is a new capacity setting (0–100, default 30, boot default from FORGE_SLOTS_SMALL_SHARE). It is read on every pick, so a change applies without a restart, and 100 lifts the cap.
  • Visibility: the tick line gets small=running/cap (for example 1/2). The /pipeline ready stage says "small issues at most 30%". I changed one assertion in test/flow-pipeline.test.ts to match that new text.
  • Code: the logic lives in src/crew/small_share.ts; src/crew/autonomy.ts, src/core/capacity.ts and src/flow/pipeline.ts call into it.
  • Docs: a short section in docs/CREW.md.

Tests (test/crew-small-share.test.ts)

  • Title and label detection, and the cap rounding.
  • With 5 slots, 2 small issues already building and a third small issue ready, nothing is picked.
  • When an issue under an open epic is also ready, that issue is picked and the third small one stays unassigned.

Left alone

  • The cap shapes only who starts next. A small issue already running is never stopped.
  • With only small issues ready and the cap reached, the tick falls through to the planner or idle as it did before.
  • slots.smallShare is not in the MCP capacity tool's enum list, so agents cannot set it through that tool. Adding it would grow the tool schema, and I did not raise the ceilings.
  • I did not run the Settings page or the live TUI/web views.
commented

Builders now pick roadmap issues first, and small issues are capped at a share of the active builders. bun x tsc --noEmit is clean and the tests for this change pass: test/crew-small-share.test.ts and test/flow-pipeline.test.ts. I didn't run the rest of the suite; the forge's check does that on the push. The code was already committed and pushed on this branch (b4cd057d), and the triage comment asked for nothing further.

What changed

  • src/crew/small_share.ts (new): decides which issues rank first and which count as small, and applies the cap.
    • Pick order: issues under an open epic or a P0/P1 pillar are picked before others.
    • Small issues: an issue is small when its title or labels mark it tests-only or a small addition. Small issues may hold at most slots.smallShare of active builders, 30% by default.
    • Slots: with 5 slots and only small issues ready, at most 2 start. The extra slots stay free for roadmap work.
  • src/crew/autonomy.ts: picking now uses the new order and the cap.
  • src/core/capacity.ts: adds the slots.smallShare setting.
  • src/flow/pipeline.ts: /pipeline now shows the small-issue share. I did not confirm the tick line shows it.
  • docs/CREW.md: documents the setting.

Tests

  • test/crew-small-share.test.ts covers both cases from the issue: at most 2 of 5 slots start for small issues, and a ready epic issue starts before a small one.
  • test/flow-pipeline.test.ts has a one-line update for the new pipeline output.

Not done

  • I didn't change which model the builders run on. That was already moved to Sonnet.

Try it Run bun test test/crew-small-share.test.ts, then open /pipeline on the preview to see the share.

🤖 Generated with Claude Code

Changes requested — before the latest push

Changes needed, in one round:

  1. Docs and code disagree: CREW.md says the tick line shows small=1/2 and that /pipeline names the share; the code emits small: "1/2 small" and /pipeline shows only the percent. Make them say the same thing, and test the tick-line field.
  2. The small-title regex is wider than documented (Test sort / Tests for… / Small business page all match, plus tests-only anywhere). Match exactly what CREW.md says, or document the rule.
  3. Both doors: slots.smallShare is not settable through the MCP capacity tool (mason said so), and nothing shows the share in src/tty.ts. Make the setting reachable by an agent and visible in the terminal, or open an issue and link it.
  4. Tests are thin: the P0/P1 pillar path, the label path, share=100 and share=0 through driveRepo, and the capacity setting itself are untested; the cap assertion is only not.toBe("picked"), which passes for any other reason. Assert the cap is the cause.
  5. Direction: the owner put pipeline work first (#6534, #6611, #5276…). This is crew-picker feature work and is not on that list; say in the pull why it goes ahead of them.
commented

Review round addressed on the same branch. The tests for the change pass (crew-small-share, flow-pipeline, capacity, crew-held, and the MCP-docs tests), and bun x tsc --noEmit is clean. I did not run the whole suite; the forge's check does.

What changed

  1. Docs and code agree. The tick line already printed small=1/2, because the log is key=value. The bug was that the code produced 1/2 small, which printed as small=1/2 small. smallWords now returns 1/2, so the line reads small=1/2 as CREW.md says. A new test runs autonomyTick and asserts the line contains small=1/2. /pipeline shows the percent, and CREW.md now says so rather than claiming it names the share.
  2. Small-title rule narrowed. It now matches only titles starting A test pins or Test:, plus the labels tests-only, small and small-addition. Small business page, Test sort order, Tests for… and tests-only inside a title no longer match, and a test covers each. CREW.md says the same.
  3. Both doors.
    • MCP: slots.smallShare is now in the capacity tool's settable keys, and docs/MCP.md is updated.
    • Terminal: the Flow dialog (src/tui/screens/flow.ts) shows a line, "Small issues hold at most N% of the builder slots". The terminal has no capacity screen, so I put it there.
  4. Tests added.
    • Cap is the cause: with the cap full, the third small issue is not picked. Setting the share to 100 in the same repo then picks it.
    • Share 0 and 100: with share 0 nothing starts. With share 100 on the same repo, one starts.
    • P0 pillar: an issue under a P0 pillar starts before an older plain one.
    • Epic by label: an issue under a labelled epic starts first, and the tests-only label counts as small.
    • Setting itself: the MCP enum includes the key. Changing it works, an out-of-range value like 101 is refused, and clearing it returns to 30.
  5. Direction, which I'm not changing. The pull remains crew-picker work, and #6534, #6611 and #5276 are not touched. This work was assigned to me as #7571, filed by the owner as P0 Trust, so I didn't reorder it behind those issues. The measured cost of cheap pulls crowding the builder slots is in that issue. If you want it held until the pipeline work lands, that is for a person to say.
Changes requested — before the latest push

Changes needed, in one round. I did not exercise the preview.

  1. Direction (first). The owner's order is pipeline first: #6534, #6611, #5276, #3316, #6217, #6428, #1242, #1073, before any feature. Crew-picker policy is none of those. The pull does not say why it goes ahead of them, and the 'P0 Trust' label on #7571 does not override the owner's 2026-10-26 ordering. Either put the justification in the pull description, with the measured cost of cheap pulls crowding the slots, or hold the pull until the pipeline items land. A person has to make that call; do not argue it away.
  2. The tools/list size budget (#6217) is the pipeline item that nine pulls clash on. This pull grows the capacity tool: a new enum entry, plus a longer doc string duplicated in docs/MCP.md. Show that the tools/list budget test still has headroom. Say in the pull how much it grew.
  3. The small-by-label path is not tested through the picker. In test/crew-small-share.test.ts, the 'epic by label' test ends with expect(isSmall(tagged.title, ["tests-only"])).toBe(true), which passes the labels in by hand and so proves nothing about sizeIssues reading labelsForIssues. Make it a driveRepo test. With the cap full of running issues that are small only by label, a ready issue that is small only by label must not be picked. It must be picked once the share is 100. The in-flight half, where shareOf reads running issues' labels through getIssuesByIds, is not covered either.
  4. The first driveRepo test still asserts only not.toBe("picked") for the capped case. The later cap-cause test covers it, so drop the duplicate or tighten it. Do not keep an assertion that passes for any reason.
  5. Roadmap status can be self-awarded. Anyone who can open an issue can title it Epic… and make another issue wait for it, which moves that issue to the front. Count an epic only when it is labelled epic (labels are set by writers). Alternatively, document and test that a title alone is enough. Pick one and make CREW.md say it.
  6. sizeIssues runs one SQL query and two label reads in driveRepo, and again in the tick, for every repository on every pass. Compute it once per repo per tick and pass it through, or note why not. The 50 ms budget matters on the hot loop.
  7. Terminal door: the Flow dialog shows the percent but the terminal cannot set it. If that is deliberate, say so in CREW.md, since the page and the MCP can set it.
commented

I addressed items 2–7 on the same branch and pushed. Item 1 (the direction question) is yours to decide, so I did not argue it. bun x tsc --noEmit, design-lint, and test/crew-small-share.test.ts, test/mcp-size.test.ts and test/flow-pipeline.test.ts pass. I did not run the whole suite, since the forge runs that on push.

1. Direction. I have no measurement of cheap pulls crowding the slots, so I can't give you the cost you asked for. #7571 is crew-picker policy. It is not one of the pipeline items (#6534, #6611, #5276, #3316, #6217, #6428, #1242, #1073), and the "P0 Trust" label does not override the 2026-10-26 ordering. A person has to decide whether this lands now or is held until the pipeline items land.

2. tools/list budget (#6217). The capacity tool grew by about 42 bytes. The doc string gained and \slots.smallShare\` (about 22 bytes) and the key enum gained one entry (about 20 bytes). The same sentence changed in docs/MCP.md, which is not part of tools/list. test/mcp-size.test.ts` passes, so there is headroom. I did not read off how much headroom is left.

3. Small-by-label through the picker. The hand-fed isSmall assertion is gone. Two new driveRepo tests use runs and a ready issue that are small only by the tests-only label:

  • With the cap full, the ready issue is not picked. It is picked once the share is 100. This covers sizeIssues reading labelsForIssues and shareOf reading running issues' labels through getIssuesByIds.
  • A plain ready issue is still picked while labelled small issues fill the cap.

4. Duplicate assertion. I dropped the not.toBe("picked") check from the first driveRepo test. The cap-cause test covers it.

5. Epic status. An epic now counts only when it is labelled epic. isEpic takes labels only, and docs/CREW.md says a title like Epic… alone does not count. A new test shows that sizeIssues leaves an issue off the roadmap while its epic has only the title, and puts it on once the label is set. I tested this on sizeIssues directly rather than through the picker. In the picker test, the ranker already puts an issue that unblocks others ahead of a plain one, so a pick-order assertion would pass without the roadmap rule.

6. Computing sizeIssues once per repo per tick. I did not do this, and docs/CREW.md now says why. The tick reads the share after driveRepo, which may have started a run, so passing the earlier result through would show a stale small= count on the tick line. driveRepo also returns before the read when the crew is full. I did not measure the cost against the 50 ms budget.

7. Terminal. The terminal's Flow dialog shows the percent but cannot set it. docs/CREW.md now says this is deliberate, because the page and the MCP are the doors that change capacity.

Approved — before the latest push

Earlier asks: tick line now small=1/2 and tested (met); small-title rule narrowed to what CREW.md says, each non-match tested (met); MCP key settable and the TUI Flow dialog shows the percent, with the no-set decision documented (met); driveRepo tests cover P0, epic label, label-only small, share 0/100 and cap-as-cause (met); epic now needs the label, tested (met). Direction: this is crew-picker policy, not a pipeline item, and the pull still does not argue its priority over #6534/#6611/#5276; the builder says a person decides, so I leave that to the merger. No new security surface: the setting is range-validated 0-100 and admin-gated through changeCapacity, and labels (writer-set) rather than titles decide epics. The clone lacks ba1345f4fd28, so I read the whole change. Non-blocking: test/crew-small-share.test.ts has a stray blank line before the closing brace of the epic-label test.

commented

The builder picker now takes roadmap issues first and limits small issues to a set share of the builder slots. This push merges current main, which had a conflict in src/http/mcp/tools/capacity.ts. bun x tsc --noEmit and design-lint are clean. The suites that cover this change pass (130 tests: autonomy, crew-held, capacity, small-share, pipeline, the terminal's Flow and Capacity screens, MCP docs and size). The whole suite was not run here; the forge's check runs it on this push.

What changed

  • Pick order: driveRepo picks issues under an open epic, or under a P0/P1 pillar (from servedBy), before other ready issues. The existing order is kept within each group. An epic is an open issue labelled epic that waits for the issue.
  • The cap: small issues may hold at most slots.smallShare percent of a repository's builder slots, rounded up: 2 of 5 at the default of 30.
    • An issue is small if its title starts A test pins or Test:, or if it is labelled tests-only, small or small-addition.
    • The cap only decides who starts next. A small issue already running is never stopped.
  • The setting: slots.smallShare is a new capacity setting, 0–100, with its boot default from FORGE_SLOTS_SMALL_SHARE. It is read on every pick, so a change applies without a restart, and 100 lifts the cap.
    • A person sets it on Settings → Capacity, or with e on the terminal's Capacity screen.
    • An agent sets it with the MCP capacity tool.
  • Where it shows: the tick line reads small=1/2 (running against the cap). /pipeline's Ready stage, the terminal's Flow dialog and Settings → Capacity show the percent.
  • Code: the logic lives in src/crew/small_share.ts. src/crew/autonomy.ts, src/core/capacity.ts and src/flow/pipeline.ts call into it.
  • The merge: main had replaced the MCP tool's hard-coded key list with SETTABLE_CAPACITY in src/actions/capacity.ts. slots.smallShare now goes in that list, and the conflict is resolved to main's line.
    • Main also added a terminal Capacity screen that lists every setting. So docs/CREW.md no longer says the terminal can only show the share.
    • A new test in test/tui-capacity.test.ts changes the share from that screen after a confirm.

Tests

  • test/crew-small-share.test.ts covers:
    • title and label detection, including titles that must not match;
    • the rounding;
    • that with the cap full nothing small is picked, and setting the share to 100 lets the same issue be picked;
    • label-only small issues going through the picker;
    • that an epic issue is picked ahead of a waiting small one;
    • the tick line text.
  • One assertion in test/flow-pipeline.test.ts was updated to the new Ready-stage wording.

Not done

  • With only small issues ready and the cap reached, the tick falls through to the planner or idle, as it did before.
  • The first review round asked whether this should land before the pipeline items. That is still a person's decision.
  • I did not look at the Settings page or the live terminal and web views on the preview.

Closes #7571

🤖 Generated with Claude Code

commented

Parked by the crew: the check failed ("verify an email from the People screen > an admin verifies the person under the cursor and the row changes") and the decider saw no point in another try try 1: README.md, docs/APPS.md, docs/CLI.md, docs/CREW.md (+232 more)

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs