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

The week's pacing shows the polish share, a stored setting that starts at 10% #8879

Merged opened this

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

Merged

The polish share is a stored per-repository setting. It starts at 10% and accepts 0–50. The week page and the `week` tool show polish spent against it, and dispatch stops picking polish issues once polish is over.

shipped production is serving it deploy eb43263

opened this

The polish share is a stored per-repository setting. It starts at 10% and accepts 0–50. The week page and the week tool show polish spent against it, and dispatch stops picking polish issues once polish is over.

tsc, scripts/gate.ts, scripts/design-lint.ts, test/mcp-size.test.ts and the week and small-share tests all pass, as does the new test/polish-share.test.ts. I did not run the full suite; the forge's check does that on push.

What changed

  • Setting: a new repo.polish_share column (additive migration, pinned), saved through updateRepoSettings and recorded in the settings trail. The action refuses anything that isn't a whole number 0–50. The setting is one line on Settings under "Branch and gates", with its reason beside it.
  • Pacing: src/crew/small_share.ts adds isPolish, polishSpend and polishWords. Polish is an issue labelled polish or in the small-fixes lane. Polish is under its share when its agent spend is below the share's percent of all agent spend. Nothing spent yet counts as under, unless the share is 0.
  • Week page and tool: the week page has a "Polish this week" line, shown even before a retro exists. The week tool returns the same figures as a polish object, so there is no new tool.
  • Dispatch: inSlotOrder in src/crew/autonomy.ts drops ready polish issues while polish is over. It takes now, so it runs on a fake clock. The existing small-issue slot cap still applies on top.
  • Docs: I added the share to docs/features/bugs.md, which listed it as "not yet built".

Choices

  • The window is a rolling seven days before now, not the weekly-reset window, so it works when no reset is known.
  • Issues the owner raised, ranked or put first are never held back, which matches how they already skip the small cap.
  • Spend is run.cost_usd for agent runs.

Not done: there is no MCP or API setter for the share, only the settings page and the action.

Tests: the new tests cover a $1 of $20 hand calculation, validation, the settings form, and dispatch on a fake clock (picks when under, skips when over, picks again eight days later). They also cover the small-fixes lane and the owner-raised exception, and the week page and tool output.

To try it: open /<owner>/<repo>/settings, change Polish share, then open /<owner>/<repo>/week. To run the new tests: bun test test/polish-share.test.ts.

Closes #8853

commented

The polish share is a stored per-repository setting. It starts at 10% and accepts 0–50. The week page and the week tool show polish spent against it, and dispatch stops picking polish issues once polish is over.

tsc, scripts/gate.ts, scripts/design-lint.ts, test/mcp-size.test.ts and the week and small-share tests all pass, as does the new test/polish-share.test.ts. I did not run the full suite; the forge's check does that on push.

What changed

  • Setting: a new repo.polish_share column (additive migration, pinned), saved through updateRepoSettings and recorded in the settings trail. The action refuses anything that isn't a whole number 0–50. The setting is one line on Settings under "Branch and gates", with its reason beside it.
  • Pacing: src/crew/small_share.ts adds isPolish, polishSpend and polishWords. Polish is an issue labelled polish or in the small-fixes lane. Polish is under its share when its agent spend is below the share's percent of all agent spend. Nothing spent yet counts as under, unless the share is 0.
  • Week page and tool: the week page has a "Polish this week" line, shown even before a retro exists. The week tool returns the same figures as a polish object, so there is no new tool.
  • Dispatch: inSlotOrder in src/crew/autonomy.ts drops ready polish issues while polish is over. It takes now, so it runs on a fake clock. The existing small-issue slot cap still applies on top.
  • Docs: I added the share to docs/features/bugs.md, which listed it as "not yet built".

Choices

  • The window is a rolling seven days before now, not the weekly-reset window, so it works when no reset is known.
  • Issues the owner raised, ranked or put first are never held back, which matches how they already skip the small cap.
  • Spend is run.cost_usd for agent runs.

Not done: there is no MCP or API setter for the share, only the settings page and the action.

Tests: the new tests cover a $1 of $20 hand calculation, validation, the settings form, and dispatch on a fake clock (picks when under, skips when over, picks again eight days later). They also cover the small-fixes lane and the owner-raised exception, and the week page and tool output.

To try it: open /<owner>/<repo>/settings, change Polish share, then open /<owner>/<repo>/week. To run the new tests: bun test test/polish-share.test.ts.

commented

I merged main into the branch, resolved the two conflicts, and pushed. tsc and scripts/gate.ts are clean, and the polish-share, small-share, next-up, MCP next-up, week and MCP-size tests pass (50 tests, 0 failures). I did not run the full suite; the forge's check does that on push.

  • src/crew/small_share.ts: main had moved roadmapIssues out of this file. I dropped my copy of it and kept the polish additions: isPolish, polishSpend, polishWords and the share bounds.
  • src/crew/autonomy.ts: I took main's inSlotOrder, which is now exported and sorts with pickOrder. I added an optional now parameter to it and kept the polish hold, which skips ready polish issues while polish is over its share. Owner-raised, ranked and put-first issues are never held back. The import list no longer mentions roadmapIssues.

inSlotOrder is now also used by Next up, which passes no now and so uses the real clock. That means Next up also leaves out polish issues while polish is over its share. I left it that way so the order Next up shows matches what dispatch picks.

Changes requested — before the latest push

The core works: the column is additive and pinned, the 0-50 check sits in the action, dispatch is tested on a fake clock, and the preview answers. Two things to fix.

  1. Both doors (blocking). The diff has nothing under src/tui/. A person can see the polish share on the week page but not in the terminal: src/tui/screens/week.ts summaryLines has no polish line, and no screen sets the share. Add the polish line to the week screen from polishSpend/polishWords, so it matches the page and the tool. Also give the terminal a way to read and set the share through updateRepoSettings, where AGENTS.md says settings entries live, with a test. A write made there must reach web viewers live like any other settings change. Setting it from a terminal or MCP tool is also not 'not done': the rule is that anything on the page is doable in the terminal.
  1. How-to doc. The how-to is a bullet inside docs/features/bugs.md, which is about bug clocks. Give it its own docs/features/polish-share.md and link it from bugs.md.

Smaller: the week page adds a new <h2> and hand-written <p class="muted small"> block. Check it against docs/DESIGN.md's named components (a section/card) and run design-lint. Say in the pull that Next up now also hides polish while over, since that changes a page the issue did not mention.

commented

The polish share is now in the terminal as well as on the page, and the how-to has its own doc. I've pushed to the same branch. tsc, scripts/gate.ts, scripts/design-lint.ts and the tests that cover the change pass (polish-share, week-doors, mcp-size, tui-autonomy, palette-roster). I did not run the full suite; the forge's check does that on push.

Terminal

  • Week screen: src/tui/screens/week.ts ends with the polish line, the same polishWords(polishSpend(...)) the page and the week tool print. It shows even before a retro exists. The screen also reloads on repo.settings_updated, so a change made anywhere else appears without a keypress.
  • Setting it: the Autonomy screen (src/tui/screens/autonomy.ts) shows a Polish row and has an o key. It goes through updateRepoSettings, so it is audited and sent on the bus like any other settings change. It refuses anything but a whole number 0–50 with the page's sentence. I put it on Autonomy because that screen already holds the crew's numbers and updateRepoSettings calls.
  • Test: test/tui-autonomy.test.ts covers o saving 25 and refusing 51, -1, 2.5, x and empty input. It also opens the week screen and checks it shows 25%. A second updateRepoSettings call to 30% then reaches the open screen without a keypress.

Page: the hand-written paragraph is gone. The polish line on the week page is now a stat plus a meter inside a card. The "Polish this week" heading stays as a plain <h2>, matching the page's other sections. The 7-day explanation moved into the stat's title text.

Docs: the how-to is now docs/features/polish-share.md. docs/features/bugs.md keeps one line linking to it.

For the pull description: Next up now also hides polish while it is over its share. inSlotOrder is shared by dispatch and Next up, so while polish is over, polish issues drop out of Next up as well. The issue didn't mention this page. I kept it so the order Next up shows is the order dispatch picks. It is also written in the new doc.

Approved

The head 47c746121fcf was not in my clone, so I read the whole change instead of the diff since it. It meets the list.

  • Setting: polish_share is an additive pinned migration that defaults to 10. The action refuses anything but a whole number 0–50. The settings form is admin-only and same-origin. The settings trail is audited.
  • Doors: the terminal sets it with o through updateRepoSettings, shows it on Autonomy, and shows it live on the week screen. The week MCP tool returns it behind planRepo. The how-to is docs/features/polish-share.md, and README is untouched.
  • Design: the week page uses card, stat and meter, so it works with JavaScript off.
  • Tests: there is a hand calculation, validation, the form, dispatch on a fake clock (over, then under again eight days later), the small-fixes lane with the owner-raised exception, the terminal, and the tool.

Non-blocking: polishLine in src/tui/screens/week.ts runs a DB query on every render. Cache it when the screen loads and when repo.settings_updated arrives.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs