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

A paused duty says who paused it and when, on /maintenance #14876

Merged opened this

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

Merged

A paused duty's row on /maintenance now ends with a muted line like "paused by alice 3 h ago". The new test, the existing pause test and maintenance-calm pass, tsc is clean and design-lint passes. I did not run the app and look at the page, so there are no before/after screenshots.

Notes

shipped production is serving it deploy d7a1be9

opened this

A paused duty's row on /maintenance now ends with a muted line like "paused by alice 3 h ago". The new test, the existing pause test and maintenance-calm pass, tsc is clean and design-lint passes. I did not run the app and look at the page, so there are no before/after screenshots.

  • What changed: pausedByLine and agoWords in src/web/pages/maintenance_pause.ts, rendered from src/web/pages/maintenance.ts only while the duty is paused. The wording is "just now", "N min ago", "N h ago" or "N d ago". A runner auto-pause reads "paused by the runner 2 h ago".
  • Resume and never-paused: a resume clears the line, and a duty that was never paused has none.
  • Audience: /maintenance is already admin-only, and the handle sits on that page, so it follows that rule. The test checks that a request with no session never sees the handle.
  • Tests: test/maintenance-pause-who.test.ts covers paused, resumed and never-paused, the time wording, and the no-session case.
  • Left out: the API, MCP and terminal output (DutyState) are unchanged, so the line appears on the web page only. The row's existing "paused since <UTC time>; paused by <handle>" text stays, so the page says it twice. I added the line next to it and did not rewrite that text.
  • Push hook: it asked for a commit message starting with "Try:", so I added an empty commit for it.
[
 {"go": "/maintenance (as an admin)", "look": "Duties fold, a duty that is on", "expect": "No 'paused by' line; the button reads Pause"},
 {"go": "Press Pause on a duty", "look": "That duty's row", "expect": "A muted 'paused by <you> just now' after the detail; the button reads Resume"},
 {"go": "Press Resume", "look": "Same row", "expect": "The 'paused by' line is gone"}
]

Closes #14864

5 earlier comments · 1 event
commented

A paused duty's row on /maintenance now ends with a muted line like "paused by alice 3 h ago". The new test, the existing pause test and maintenance-calm pass, tsc is clean and design-lint passes. I did not run the app and look at the page, so there are no before/after screenshots.

  • What changed: pausedByLine and agoWords in src/web/pages/maintenance_pause.ts, rendered from src/web/pages/maintenance.ts only while the duty is paused. The wording is "just now", "N min ago", "N h ago" or "N d ago". A runner auto-pause reads "paused by the runner 2 h ago".
  • Resume and never-paused: a resume clears the line, and a duty that was never paused has none.
  • Audience: /maintenance is already admin-only, and the handle sits on that page, so it follows that rule. The test checks that a request with no session never sees the handle.
  • Tests: test/maintenance-pause-who.test.ts covers paused, resumed and never-paused, the time wording, and the no-session case.
  • Left out: the API, MCP and terminal output (DutyState) are unchanged, so the line appears on the web page only. The row's existing "paused since <UTC time>; paused by <handle>" text stays, so the page says it twice. I added the line next to it and did not rewrite that text.
  • Push hook: it asked for a commit message starting with "Try:", so I added an empty commit for it.
[
 {"go": "/maintenance (as an admin)", "look": "Duties fold, a duty that is on", "expect": "No 'paused by' line; the button reads Pause"},
 {"go": "Press Pause on a duty", "look": "That duty's row", "expect": "A muted 'paused by <you> just now' after the detail; the button reads Resume"},
 {"go": "Press Resume", "look": "Same row", "expect": "The 'paused by' line is gone"}
]
commented

<!-- look-pages 3186c1fde037 --> Look pages for 3186c1f, from the gate:

  • look pages (inferred): this pull changes src/web/pages/maintenance.ts, src/web/pages/maintenance_pause.ts; the forge pictures /system (src/web/pages/maintenance.ts), /maintenance (src/web/pages/maintenance.ts), the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

A paused duty's row on /maintenance now ends with a muted line like "paused by alice 3 h ago", and the maintenance screen in the terminal shows the same words. bun x tsc --noEmit is clean. The new web and terminal tests, maintain-pause, maintenance-calm, tui-maintenance-quiet and the docs tests pass. The gate no longer reports a rule failure, and I pushed. I haven't seen the forge's check result on the new push.

  • Both doors: the check failed because the page changed with no terminal change or how-to. pausedByLine now lives in src/maintain/pause.ts, and the page and src/tui/screens/maintenance.ts both call it. The how-to is docs/features/duty-paused-by.md.
  • Duplicate wording: the gate flagged my own time-wording helper as a copy of ageWords in src/snapshot/bucket.ts. I deleted mine and reuse that one, so the wording is "just now", "N min ago", "N h ago" or "N d ago". One difference: ageWords shows hours up to 47 h before switching to days.
  • Resume and never-paused: resuming clears the line, and a duty that was never paused has none. A runner auto-pause reads "paused by the runner 2 h ago".
  • Audience: /maintenance is already admin-only, and the terminal line sits on the maintenance screen, so the handle follows the same rule. I did not test the terminal side for non-admins.
  • Left out: the API and MCP output (DutyState) are unchanged. The row's existing "paused since <UTC time>; paused by <handle>" text stays, so the page says it twice.
  • Commit-message lines: the gate's "pipeline first" rule wanted a Direction: line for the new how-to, so I added one in an empty commit citing #14864. The push hook also wanted a Try: line, in an earlier commit.
  • Tests: test/maintenance-pause-who.test.ts covers paused, resumed, never-paused and a request with no session. test/tui-maintenance-pause-who.test.ts covers the terminal. I did not run scripts/fast.ts in full: it reported the diff reaches 2259 files and would take about 191 minutes. I ran the covering tests by name instead.
[
 {"go": "/maintenance (as an admin)", "look": "Duties fold, a duty that is on", "expect": "No 'paused by' line; the button reads Pause"},
 {"go": "Press Pause on a duty", "look": "That duty's row", "expect": "A muted 'paused by <you> just now' after the detail; the button reads Resume"},
 {"go": "Press Resume", "look": "Same row", "expect": "The 'paused by' line is gone"},
 {"go": "Open the maintenance screen over ssh (as an admin), with a duty paused", "look": "The paused duty's line", "expect": "It ends with 'paused by <handle> N h ago'"}
]

🤖 Generated with Claude Code

commented

I merged main into this branch and pushed it. The only conflict was in src/tui/screens/maintenance.ts.

  • Resolution: I kept both sides. The terminal's paused-duty line still says who paused the duty, using pausedByLine. The ...stalled entries that main added are back at the front of the default view.
  • Checks:
    • bun x tsc --noEmit printed nothing.
    • 308 tests across the 54 maintenance and pause test files pass.
    • I did not run scripts/gate.ts or scripts/design-lint.ts, so the push has not been checked by either.
    • scripts/fast.ts found the diff too broad to name tests (2271 of 3897 files), so I picked those test files myself. The forge's full check runs on this push.
commented

<!-- look-pages 09448ee97994 --> Look pages for 09448ee, from the gate:

  • look pages (named): this pull changes src/web/pages/maintenance.ts; a commit names /maintenance
Changes requested — before the latest push

The feature works as asked, but the row now says the same thing twice, which breaks design principle 1. Fix first: stop duplicating the detail.

The existing detail for a paused duty is already 'paused since 2026-.. UTC; paused by alice' (dutyState in src/maintain/pause.ts). The new span appends 'paused by alice 3 h ago' right after it, on the web and in the terminal: 'paused since 10:00 UTC; paused by alice. paused by alice 3 h ago'. Change dutyState's paused detail to carry the new words in place of the old, e.g. paused by alice 3 h ago plus the failing/reason tail for runner pauses, and drop the separate span and the TUI concatenation. The same fix keeps the API, MCP and terminal text consistent. Update the existing maintain-pause tests that assert the old text.

Also: add a test for a runner auto-pause ('paused by the runner N h ago'), and a terminal test that a non-admin sees nothing (the issue/the review bar says the terminal gates exactly as the page).

Ticks/left: 1 is met in wording, but the row says it twice, so I leave it; 2 and 3 are met.

commented

A paused duty's row now says who paused it and how long ago exactly once, on the web, in the terminal, the API and the MCP. I merged main into the branch (the conflict was in src/web/pages/maintenance.ts, where I kept main's schedule text) and pushed.

Changes

  • One wording: dutyState in src/maintain/pause.ts now opens a paused detail with paused by alice 3 h ago instead of paused since <UTC>; paused by alice.
  • Runner pauses: the old runner reason and failing-since tail follow the opening, so they read paused by the runner 2 h ago; paused after 3 errors in a row; last error: …. A person's pause no longer repeats the handle in its reason.
  • Removed: pausedByLine, the web span, and the terminal concatenation.
  • Old tests: maintenance-level and maintenance-last-run now assert paused by instead of paused since. The comment in src/maintain/schedule.ts and the two feature docs were updated to match.
  • New tests:
    • Web: the handle appears exactly once and paused since is gone.
    • Runner pause: paused by the runner 2 h ago, with its reason.
    • Terminal: the line shows the handle once.
    • Non-admin and agent: the terminal screen is not offered to them, via entry.offered. That gate is the terminal's only one: the screen itself does not check admin status.

I ran bun x tsc --noEmit, bun scripts/gate.ts --fix, and the maintenance and pause tests I touched (34 pass), plus crew-pause and crew-run-timing (7 pass). I did not run scripts/design-lint.ts or the full suite. The forge runs the full check on this push. The gate named /maintenance for look pages because of the changed web page.

Review block

[{"go":"/maintenance as an admin, pause a duty","look":"the duty's row","expect":"'paused by <you> just now' once, no 'paused since', no second span"},
 {"go":"Resume it","look":"the row","expect":"'on' with no paused words"}]
Approved

All three earlier asks are met. (1) The web row now renders the single dutyState string, with no extra span. (2) The terminal no longer concatenates, so the handle appears once. (3) dutyState words the age through the shared ageWords, and a runner-pause test exists. The feature doc is in docs/features and README is untouched. The terminal screen is gated by entry.offered and has a test. Next, in order: (a) Non-blocking: ageWords shows hours up to 47 h before switching to days, so say so in duty-paused-by.md where it lists N d ago. (b) Non-blocking: add a test that a person pausing with a stored unparseable time falls back to paused by <handle> with no age.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs