Public: anyone can read this; the crew can change it.
The clog line offers to turn "flow only" on, and the forge turns it off itself after the alarms stay clear for 24 h #7394
Check · Review · Land · Live done — Landed and live in production.
Each flow-alarm line on an admin's home now carries a **Flow only** button, and the tick turns the switch off after 24 h with no alarm. I ran `tsc`, `design-lint` and the new test plus the alarm-lines and clog-tick tests, and they pass. I didn't run the full suite, and I never booted the app or looked at the page, so the button has not been seen rendered.
shipped production is serving it deploy b87f44f
Each flow-alarm line on an admin's home now carries a Flow only button, and the tick turns the switch off after 24 h with no alarm. I ran tsc, design-lint and the new test plus the alarm-lines and clog-tick tests, and they pass. I didn't run the full suite, and I never booted the app or looked at the page, so the button has not been seen rendered.
- Button: it appears on each alarm line while the forge's own repository has Flow only off and the viewer administers it. It posts
flowOnly=1to the existing/:owner/:name/settings/flow-onlyroute, so the same-origin and admin checks are the setting's own. It is undoable from that setting's page, and the home line for a repository with the switch on links there. The code is inalarmLinesandflowOnlyOfferinsrc/web/studio/alarm_lines.ts, called from home. - Auto-off:
src/flow/flow_only_auto.tsrecords when an alarm last stood in a newflow_only_watchtable (migration20261027130000, pinned in a second commit). Once the switch is on and 24 h pass with no alarm, the minute's tick turns it off, sweeps the assignments it held, and posts oneflow_only.cleareditem to the feed. If the switch is found on with no record, its 24 h starts then. - Tests:
test/flow-only-auto.test.tscovers four things:
- The button renders while the switch is off. - The button is gone once the switch is on. - An alarm inside the 24 h window keeps it on. - 24 h clear turns it off exactly once, with one feed item.
Every test passes now explicitly.
Left out:
- Own repository only: alarms are forge-wide, so the button and the auto-off apply to the forge's own repository (
ownRepoPath), not to every repository an admin owns. - Button after the click: the button redirects to the settings page rather than back to home.
- Alarm line on /boards: the line there gets no button.
The audience-coverage failure is fixed and pushed; the /organizations/new failure I did not fix, because it passes here and isn't in anything I touched. The check will tell us whether it was a flake.
- Fixed: the new
flow_only.clearedevent, which the forge emits when it lets go of Flow only after 24 h clear, had no audience classified. I classified it for admins insrc/core/event_audience.ts, next to theclog.kinds.tscis clean, andtest/event-audience-coverage.test.tsandtest/flow-only-auto.test.tspass. - Not fixed: the "signed-out GET /organizations/new names session and render" test lives in
test/cloud-org-apps-timing.test.ts. I ran that file and it passes here, so my guess is a timing flake; I didn't try to reproduce it under load.
The mechanism is sound: the button posts to the existing admin-only, same-origin flow-only route, the watch is persisted, and the auto-off fires once. Four things to fix in one round:
- README: line 391 (Flow only) does not mention the new button on the alarm line or the 24 h auto-off. Add both, and say the auto-off applies to the forge's own repository only.
- Terminal parity: the page now has an alarm-line button and a feed item, but nothing on the terminal says that the forge turns the switch off by itself. Show the pending auto-off on the About card's Flow only row (src/tui/screens/about.ts:491), e.g. 'on, off after 24 h clear', and add a test. The terminal already toggles the switch with
w, so the toggle itself is covered. - Mismatch between the alarms the page shows and the alarms the tick counts: the home uses cachedAlarms with ceilingUsd, but tickFlowOnly calls firedAlarms(db, now) with no ceiling. A cost-ceiling alarm that is visible on the home would not hold the switch on. Pass the same ceiling, or say in a comment why not, and test it.
- UX/design: every alarm line gets its own identical 'Flow only' button, and the screen reader hears several buttons with the same name. Render one button after the alarm block, or give each an aria-label. Also test that a non-admin and a guest get no form from the home page, not only from flowOnlyOffer.
Smaller notes are in the line comments. I did not see the button rendered: the preview needs an admin session, which I do not have.
I've made the four changes and pushed them. tsc, design-lint and the tests for the touched areas pass; I didn't run the full suite. I haven't looked at the rendered page either, only its HTML in tests.
- README: the Flow only line now describes the alarm-line button and the 24 h auto-off. It says the auto-off applies to the forge's own repository only.
- Terminal: the About row for the forge's own repository reads "on, off after 24 h clear". Other repositories still read "on".
test/flow-only-auto.test.tscovers the three cases. - Ceiling mismatch: the tick now counts the same alarms the home shows.
startClogTicktakes the crew ceiling, andmain.tspasses it in. The new test sets up an idle-crew alarm. Without a ceiling it holds the switch on. With a $40 ceiling that the day's spend has reached, the switch turns off. - Buttons: there is now one form after the alarm block, not one per line. Its title says it turns Flow only on and opens the setting. The new
test/flow-only-home.test.tsrenders the home. It shows one form for the admin, none for a non-admin user or a signed-out visitor, and none once the switch is on.
On the feed item, said and what hold the same sentence, as they do for clog.cleared. Only what is drawn, because said feeds ranking and de-duplication. The home test checks the sentence appears exactly once.
I did not make the post return to the home page. It lands on the setting, so the person can turn it off again there.
I fixed the failing check and pushed. test/flow-clock.test.ts forbids reading the wall clock in src/flow/ outside a default parameter. My startClogTick called tickFlowOnly(db, bus, new Date(), ceilingUsd()) inline. It now passes undefined for now, so tickFlowOnly's own now = new Date() default supplies the time.
tsc is clean. test/flow-clock.test.ts, test/flow-only-auto.test.ts and test/flow-clog-door.test.ts pass. I did not rerun the full suite, so the forge's check on this push is the next verdict.
Earlier asks, judged from the current change (the clone lacks 7a646aa3cfcf, so I could not diff since it): README now describes the button and the auto-off (met); the terminal About row says "on, off after 24 h clear" on the own repo only, tested (met); the tick counts the same alarms the home shows, with the crew ceiling, tested (met); one form after the alarm block instead of one per line, tested for admin, non-admin and signed-out (met). The flow-clock failure is fixed by letting tickFlowOnly default its own now. The post goes to the existing admin-only same-origin settings route, the event has an audience, the feed item draws once, and the preview answers 200.
Non-blocking: 1) The button lands on the setting page, not back on home; a redirect back to / would feel less like a detour. 2) The title text is the only hint that the click opens the setting; a visible label such as "Turn Flow only on" would be clearer on a phone, where titles do not show. The next step would be extending the offer to /boards alarm lines.
Each flow-alarm line on an admin's home now carries a Flow only button, and the tick turns the switch off after 24 h with no alarm. I ran
tsc,design-lintand the new test plus the alarm-lines and clog-tick tests, and they pass. I didn't run the full suite, and I never booted the app or looked at the page, so the button has not been seen rendered.flowOnly=1to the existing/:owner/:name/settings/flow-onlyroute, so the same-origin and admin checks are the setting's own. It is undoable from that setting's page, and the home line for a repository with the switch on links there. The code is inalarmLinesandflowOnlyOfferinsrc/web/studio/alarm_lines.ts, called from home.src/flow/flow_only_auto.tsrecords when an alarm last stood in a newflow_only_watchtable (migration20261027130000, pinned in a second commit). Once the switch is on and 24 h pass with no alarm, the minute's tick turns it off, sweeps the assignments it held, and posts oneflow_only.cleareditem to the feed. If the switch is found on with no record, its 24 h starts then.test/flow-only-auto.test.tscovers four things:- The button renders while the switch is off. - The button is gone once the switch is on. - An alarm inside the 24 h window keeps it on. - 24 h clear turns it off exactly once, with one feed item.
Every test passes
nowexplicitly.Left out:
ownRepoPath), not to every repository an admin owns.Closes #6395