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

Bugs get fixed or declined on a clock, and a share of each week goes to polish #8714

Merged opened this in answer to

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

Merged

This covers the first two boxes of #8709 and leaves the other three undone. `tsc`, `bun scripts/gate.ts`, `design-lint` and 14 test files (including the cross files) pass. I did not run the full suite; the forge's check does that on push.

shipped production is serving it deploy d5155e2

opened this

This covers the first two boxes of #8709 and leaves the other three undone. tsc, bun scripts/gate.ts, design-lint and 14 test files (including the cross files) pass. I did not run the full suite; the forge's check does that on push.

What changed

  • Pickup order: src/flow/bugs.ts is new. In pump (src/crew/dispatch.ts), queued runs about an open issue labelled bug now start ahead of other work. Each side keeps its existing order, and the team dials still apply within it.
  • The clock: a bug is high if it also has a high, priority: high or priority:high label. High bugs have 4 hours and all others 48.
  • Alarm: one new flow alarm, bug_clock, is added in firedAlarms, so home, the notifier and the MCP flow tool pick it up. It names the bug that has waited longest ("and N more" if others are late) and links to it. It is one alarm for all late bugs, not one per bug. The notifier tells the owner again only when the longest-waiting bug changes.
  • Home: the KPI row has an "Open bugs" tile with the open count and how many are past their clock. It turns to the attention tone when any are. The count is read in the cached KPI answer and named in KPI_PARTS as kpis.bugs, so Server-Timing shows it. Kpis.bugs is optional, so existing literals still type-check, and the tile is absent when it is missing. The tile links to /boards, because search has no label filter to link to.
  • Tests: new test/flow-bugs.test.ts covers the clock, the single alarm, the pickup order and the tile. I widened the hand-built issue tables in test/home-kpi-row.test.ts and added bugTables to test/helpers/reach-tables.ts. The test-double schemas were wrong; the tests themselves were not.

What I left out

  • "Fixed or closed as won't fix with a reason" is not enforced. The alarm asks for it, but closing an issue doesn't require a reason.
  • polish as a capped, small issue kind, the stored 10% weekly share, and its place in the pacing view (#8695) are not built.
  • Showing every shortcut beside its action, and C creating an issue everywhere, are not built.
  • Hunter findings are not filed as bug or polish issues. src/hunt still files them as before.

To try it, label an open issue bug and age it past 48 hours, or past 4 hours with high as well. Home then shows the alarm and the tile.

Closes #8709

commented

This covers the first two boxes of #8709 and leaves the other three undone. tsc, bun scripts/gate.ts, design-lint and 14 test files (including the cross files) pass. I did not run the full suite; the forge's check does that on push.

What changed

  • Pickup order: src/flow/bugs.ts is new. In pump (src/crew/dispatch.ts), queued runs about an open issue labelled bug now start ahead of other work. Each side keeps its existing order, and the team dials still apply within it.
  • The clock: a bug is high if it also has a high, priority: high or priority:high label. High bugs have 4 hours and all others 48.
  • Alarm: one new flow alarm, bug_clock, is added in firedAlarms, so home, the notifier and the MCP flow tool pick it up. It names the bug that has waited longest ("and N more" if others are late) and links to it. It is one alarm for all late bugs, not one per bug. The notifier tells the owner again only when the longest-waiting bug changes.
  • Home: the KPI row has an "Open bugs" tile with the open count and how many are past their clock. It turns to the attention tone when any are. The count is read in the cached KPI answer and named in KPI_PARTS as kpis.bugs, so Server-Timing shows it. Kpis.bugs is optional, so existing literals still type-check, and the tile is absent when it is missing. The tile links to /boards, because search has no label filter to link to.
  • Tests: new test/flow-bugs.test.ts covers the clock, the single alarm, the pickup order and the tile. I widened the hand-built issue tables in test/home-kpi-row.test.ts and added bugTables to test/helpers/reach-tables.ts. The test-double schemas were wrong; the tests themselves were not.

What I left out

  • "Fixed or closed as won't fix with a reason" is not enforced. The alarm asks for it, but closing an issue doesn't require a reason.
  • polish as a capped, small issue kind, the stored 10% weekly share, and its place in the pacing view (#8695) are not built.
  • Showing every shortcut beside its action, and C creating an issue everywhere, are not built.
  • Hunter findings are not filed as bug or polish issues. src/hunt still files them as before.

To try it, label an open issue bug and age it past 48 hours, or past 4 hours with high as well. Home then shows the alarm and the tile.

commented

I fixed one of the three failures and pushed. The other two I could not reproduce, so I have not fixed them.

  • Fixed: "home renders the nine tiles" asserted nine .stat tiles. The new Open bugs tile makes it ten, so I updated the test (test/home-kpi-page.test.ts) to count ten and renamed it. The count was the only thing wrong, so this change touches the test and nothing in the app.
  • Not reproduced: the two ETag tests ("a signed-out page showing a flash carries no ETag…" and "a signed-out 404 carries no ETag") pass here, alone and in random order. In the check log they failed in 0.4–0.5 ms, which points to a setup error in that shard rather than a wrong assertion. I found nothing in my change that touches signed-out pages, so I believe it was a flake.

test/home-kpi-page.test.ts, test/kpi-wrap.test.ts, test/etag.test.ts and tsc pass locally. If the ETag tests fail again on this push, the shard's setup error should be in the log.

Changes requested — before the latest push

The clock, alarm and tile are sound and the alarm respects publicOnly. Four things block it:

  1. No terminal door (first to fix). The Open bugs figure and the bug_clock alarm are reachable on the page, but there is no src/tui/ screen or entry showing them. AGENTS.md says where the entry goes. The terminal must show the same count and alarm, and gate them exactly as the page does: the tile is admin-only, and the alarm uses publicOnly for a guest.
  2. No docs/features/bugs.md. The how-to is missing: which labels count (bug, and high, priority: high, priority:high), the 4 h / 48 h clocks, the pickup order, the alarm and the tile. Do not put it in README.
  3. Dispatch wiring is untested. test/flow-bugs.test.ts calls bugsFirst directly, so removing it from pump in src/crew/dispatch.ts would break no test. Add a test through pump or the dispatch path showing a queued bug run starting before a feature run. bugsFirst also puts every bug ahead of the team dials in byDials, which is a policy choice the pull should say out loud.
  4. "Closed as won't fix with a reason" is not enforced. The alarm only asks for it. Either enforce it where an issue closes, or open a follow-up issue for it and say so.

Smaller: the open-bug SQL (label join and high EXISTS) is copied in openBugs and countBugs, so share one query. Test doubles now need bugTables, which is a sign of that coupling.

Boxes 3 to 5 of #8709 (polish share, shortcuts and C, hunters' findings) are not built. They stay open, and the pull should not close the issue.

commented

This pull covers only box 1 of #8709 (bugs on a clock) and should not close the issue. The polish share, shortcuts and hunters' findings are not built. Tsc, the gate, design-lint and the palette, flow-bugs, KPI and team-share tests pass locally. The forge's check runs the full suite.

What changed

  • Terminal door. A new Bugs palette entry (src/tui/screens/bugs.ts, one line in ENTRIES) shows what the page shows, gated the same way. A person who is a site admin sees the Open bugs count and the bug_clock alarm over all repositories. Anyone else, an agent or a guest included, sees only the alarm cut to public repositories. I added the entry to the palette roster test.
  • Docs. docs/features/bugs.md covers which labels count, the 4 h and 48 h clocks, the pickup order, the alarm, the tile and the terminal entry.
  • Dispatch test. pump now takes its order from an exported startOrder(app). A test queues a feature run first and a bug run second and checks that the bug run is ahead of the feature run. It fails if the bug ordering is removed from startOrder.
  • One query. readBugRows serves both openBugs and countBugs. The count variant skips the repo and user joins, so the bugTables test doubles are unchanged.
  • Won't fix with a reason. Not enforced; I opened #8782 for it and docs/features/bugs.md points to it. The alarm still only asks.

Policy to decide: bugs now start ahead of the team dials. byDials orders the queue, then bugsFirst moves every bug run to the front, so a bug run starts ahead of the team-dial shares. I chose this because the clock is a deadline and the dials share out whatever is left. The policy is stated in the startOrder comment and in the docs.

To try: open the palette and choose Bugs. On the page, the Open bugs tile is on home (admins only).

Approved — before the latest push

Approved for what it covers: the bug clock (4 h high, 48 h otherwise), one bug_clock alarm that respects publicOnly, bugs picked ahead of other runs through startOrder (tested through dispatch), the Open bugs tile, a Bugs terminal entry gated like the page, and docs/features/bugs.md (README untouched). One query serves both the list and the count. The ten-tile row still uses the named stat tile, works without JavaScript, and links as an <a>. Next, in order: (1) enforce a reason when a bug is closed as won't fix (#8782), so box 1 can close; (2) link the tile to a bug-filtered list rather than /boards once search has a label filter, and check the ten-tile row at 360px. The pull does not close #8709: boxes 3 to 5 are unbuilt.

commented

I merged main into the branch and pushed it. The only conflict was in src/crew/dispatch.ts.

Both sides changed the line in pump that builds the start order. main added the valve gating (gateQueue, with its "valve is shut" log line for held runs). This branch added bugs-first ordering. I kept both. startOrder(app) now applies the team dials first, then bugs ahead of everything, then the valves. It returns what gateQueue returns, so pump still logs the held runs. The pump-ordering test now reads startOrder(app).order.

tsc, scripts/gate.ts and these test files pass: flow-bugs, palette-roster, team-share and capacity. I did not rerun the full suite; the forge's check does that on this push.

As before, this pull covers only box 1 of #8709, so it should not close the issue.

commented

I merged main into the branch and pushed it. The two conflicts, in src/tui/screens/entries.ts and test/palette-roster.test.ts, were the same thing: main added a Pinned panels (home-pins) palette entry on the same lines where this branch adds the Bugs entry. I kept both, with Bugs first and Pinned panels after it, in the ENTRIES list and in the expected roster.

tsc, scripts/gate.ts and these test files pass: palette-roster, palette-entries and flow-bugs. I did not rerun the full suite; the forge's check does that on this push.

This pull still covers only box 1 of #8709, so it should not close the issue.

commented

I merged main into the branch and pushed it. The one conflict was in src/flow/kpis.ts.

main added a backup?: BackupVerdict | null field to Kpis, and this branch added bugs?: BugCount. I kept both fields, and readKpis returns both bugs and backup.

tsc and these test files pass: flow-bugs, home-kpi-row and palette-roster. scripts/gate.ts printed nothing; its last line was empty, so I'm reading that as no failures. I did not rerun the full suite; the forge's check does that on this push.

This pull still covers only box 1 of #8709, so it should not close the issue.

commented

I merged main into the branch and pushed it. The one conflict was in src/flow/alarms.ts.

Both sides had edited the FiredAlarm.key union. main added "silent" and "repeat", and this branch added "bug_clock". The merged union keeps all three, and the bug_clock push in firedAlarms is untouched.

tsc and 97 tests across 12 files pass; they cover the alarm tests plus flow-bugs, home-kpi-row and palette-roster. scripts/gate.ts printed nothing, which I'm reading as no failures. I did not rerun the full suite; the forge's check does that on this push.

This pull still covers only box 1 of #8709, so it should not close the issue.

commented

I merged main into the branch and pushed it. The one conflict was docs/features/bugs.md, which both sides had added as a new file.

main's version describes enforcing a reason when a bug is closed, so I kept it as docs/features/bug-close.md and kept mine as docs/features/bugs.md. In bugs.md I replaced the "Not yet: won't fix with a reason is not enforced (#8782)" line with a pointer to bug-close.md. The polish share, shortcuts and hunters' findings of #8709 are still listed there as not built.

main has now done what #8782 asked, so a person may want to close that issue; I did not touch it.

tsc and the 17 tests in flow-bugs, bug-close-doors and palette-roster pass. scripts/gate.ts printed nothing, which I'm reading as no failures. I did not rerun the full suite; the forge's check does that on this push.

This pull still covers only box 1 of #8709, so it should not close the issue.

Approved

All earlier asks are met: (1) terminal door: src/tui/screens/bugs.ts, registered in ENTRIES, gated like the page (count for a person-admin, alarm cut to public otherwise), tested. (2) docs/features/bugs.md exists, not in README. (3) dispatch wiring: pump uses startOrder, and a test fails without bugsFirst there; the bugs-before-dials policy is stated in the comment and docs. (4) The reason on close is enforced on main and bug-close.md covers it. (5) One shared readBugRows query. The preview answers 200 and the Open bugs tile is additive, linked, and in the attention tone only when late.

Non-blocking: the Bugs palette entry shows in every roster, including signed out. That is fine because the content is cut, but a one-line note on that in the docs would help. Next: box 3 (polish share on #8695 pacing) and box 4 (shortcuts and C).

commented

Left #8709 open: 3 unticked items remain (A polish issue is capped small. A set share of the week, a stored value that starts at 10%, goes to them, shown on the week's pacing (#8695).; Every action with a shortcut shows it beside the action, and C makes an issue everywhere (https://linear.app/now/invisible-details).; Hunters' findings go in as these, so the owner never triages them.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs