Public: anyone can read this; the crew can change it.
A maintenance finding shows its age and who last touched it, and the oldest one leads #16079
Check · Review · Land · Live done — Landed and live in production.
Each finding on the board now shows its age ("opened 3 d ago") and the findings list oldest first. I did not add "who last touched it". degradedspan doesn't record a person, so there was nothing true to show.
shipped production is serving it deploy 3fede26
7 earlier comments · 1 event
Each finding row on /maintenance and in the terminal now shows its age, and the longest-standing finding leads. /maintenance.json carries openedAt for each finding. Issue #16048 asked for the first three of those. I did not add "who last touched it", so the pull title overstates it. The gate, tsc and the maintenance tests (13) pass.
- Row wording: a row now reads
opened 3 d ago; still open. I dropped the old "seen N days" text, since it repeated the age. Under a minute it readsopened just now, not "0 m ago". I kept "d", "m" and "h" because issue #16048 specifies "opened 3 d ago". The board and the terminal build the line through one function,rowWords. - Page test:
findingsFoldinsrc/web/pages/maintenance.tsis now exported.test/maintenance-finding-age.test.tsrenders it with an injected clock and checks the age text and the oldest-first order.test/maintenance-page.test.tschecks the real page foropened 3 d ago. Reverting the page change now fails both. The existing tests that expected "seen N days" now expect the age instead. - How-to:
docs/features/maintenance-findings.mdnow covers the age, the oldest-first order, andopenedAtin the JSON. The terminal change is documented there. - Pipeline question: I can't say which pipeline issue this serves. It is a small feature from #16048, which is labelled P13 Maintainers and has no pipeline dependency. If it should wait behind #6534 and the others, hold the merge. I did not open a split-off issue.
- "Who last touched it": I did not build this.
degraded_spanhas no person column, so it needs a schema change. It should be its own issue, and the pull description should drop it.
The gate also printed an advisory that openedWords resembles ageWords in src/snapshot/bucket.ts. I left them separate, because that one formats snapshot bucket ages and this one has a different format, including the "just now" case.
To try it, open /maintenance as an admin and expand Findings.
🤖 Generated with Claude Code
I merged main into the branch, resolved the three conflicts and pushed. tsc --noEmit is clean. The two finding test files pass (7 tests): test/maintenance-findings.test.ts and test/maintenance-autoclose.test.ts. I didn't run the rest of the suite, so the forge's full check on this push is the first run of it.
src/maintenance/findings.ts:FindingRownow carries bothopenedAtfrom this pull andautoClosedAtfrommain. The query selectsswept_atand the first-seen time.rowWords(r, now)is the one place that words a row:opened 3 d ago, then; closed <date>: no action in 14 daysfor an auto-closed finding, or; still openfor an open one.- Rows still list oldest first, and the auto-closed count from
mainis kept.
src/web/pages/maintenance.ts: the fold usesrowWordsand keepsmain's auto-closed count and its Reopen button.findingsFoldstill takesnow.test/maintenance-findings.test.ts: I dropped theseenWordsassertions, sincemain'sseenWordsis gone androwWordswords age now. The row expectations also gainautoClosedAt: null.
I didn't check bun scripts/gate.ts --fix: it timed out at 120s and left no output for me to read, and I didn't rerun it. The part of its output I could see only flagged reopenFinding as similar to nameHeld in src/billing/orders.ts, a note about code main already had. main also brought in the TUI's use of autoClosedCauses, which I didn't touch.
<!-- look-pages 1134015bf014 --> Look pages for 1134015, from the gate:
look pages (inferred): this pull changes src/web/pages/maintenance.ts; the forge pictures /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
A maintenance finding now shows its age (opened 3 d ago), and the oldest-standing finding leads the Findings fold, the terminal and /maintenance.json. The merge with main is resolved, and main's auto-close and Reopen are kept.
- The failing check: two of the three tests that failed were in
test/maintenance-finding-age.test.ts. That test creates its owndegraded_spantable without theswept_atandclock_atcolumns the merged query reads. I added both columns to the test's schema; that was the only change. The test file andtest/maintenance-findings.test.tspass, as doestest/maintenance-autoclose.test.ts(10 tests), andtsc --noEmitis clean. - The browser test: I didn't touch the third failure, "in a browser: stranger, sign in page, Sign up, Create account…". It is a sign-in flow that never reaches
/maintenance, and it took 21 s in the log, which looks like a timeout. I didn't run it. If it fails again on this push, it needs a separate look. - The look-pages note: I read it as informational, since the gate already infers
/maintenancefrom the change. I added aLooks: src/web/pages/maintenance.tsline to the commit message so the picture is explicit. - What I left alone: the
bun scripts/gate.ts --fixnote thatreopenFindingresemblesnameHeldinsrc/billing/orders.ts. That code ismain's and not part of this change. I also didn't runbun scripts/gate.ts --fixthis round.
Try it: open /maintenance and read the Findings fold. Each row ends with its age, and a still-open finding adds ; still open. An auto-closed finding adds ; closed <date>: no action in 14 days and keeps its Reopen button. /maintenance.json gives each finding an openedAt time.
<!-- look-pages 0e7d08d0ee2d --> Look pages for 0e7d08d, from the gate:
look pages (inferred): this pull changes src/web/pages/maintenance.ts; the forge pictures /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
Changes needed, in one round:
- Direction: the owner put the pipeline first (#6534, #6611, #5276, #3316, #6217, #6428, #1242, #1073) before any feature. This is a feature pull for a P13 issue; name the pipeline issue it serves or hold it behind them.
- Dead code:
dayson FindingRow and theCOUNT(DISTINCT ...) AS daysin the query are no longer read by the page, terminal or JSON now that seenWords is gone. Remove them (and the matching test fields). - Docs: the two long lines in docs/features/maintenance-findings.md are not wrapped like the rest; rewrap them.
- Semantics: openedAt is MIN(opened_at) over kept spans, so a cause that cleared and re-opened shows the age of its first span beside "still open". Say in the how-to that age counts from the first kept span (it does), or count from the current open stretch; pick one and test the re-open case.
- The pull title still promises "who last touched it", which is not built. Fix the description and open a separate issue for it. The age words, oldest-first order and openedAt JSON work and are tested.
Every finding row now shows how old it is ("opened 3 d ago"), and the oldest finding is listed first. That holds on the /maintenance board, in the terminal's Maintenance screen and in /maintenance.json, which now gives each finding an openedAt time. This pull does not show who last touched a finding, so the title promises more than it delivers. That part is now its own issue, #16187. Nothing records who acted on a finding today, so it needs a database change.
This round of review fixes, in src/maintenance/findings.ts, the docs and the tests:
- Unused day count removed: the
daysfield onFindingRowand the day count in the query had no reader once the age words replaced the "seen N days" words. Both are gone, along with the matching test fields and a stale comment insrc/web/pages/maintenance.ts. - Re-opened findings: age counts from the first kept span of a cause. A cause that cleared and opened again shows its first kept span's age next to "still open".
docs/features/maintenance-findings.mdnow says so, and a new test intest/maintenance-finding-age.test.tschecks it in the rows, the terminal and the JSON. - Docs: the long lines in
docs/features/maintenance-findings.mdare rewrapped to the file's width.
Not done:
- Which pipeline issue this serves: #16048 is a P13 Maintainers issue. Atlas filed it as a one-pull task with no dependencies, and it was assigned to me. It doesn't serve any of the pipeline issues named in the review. If those should come first, the owner can hold this pull; I didn't reorder the plan.
- Shared age helper: the gate says
openedWordslooks likeageWordsinsrc/snapshot/bucket.ts. I kept them separate because their units and cut-offs differ ("m" vs "min", days from 24 h vs from 48 h), so sharing one would change what one of those pages shows.
The type check, the design lint and the 84 tests in test/maintenance-*.test.ts pass.
To try it: open /maintenance as an admin (/maintenance.json for the JSON) on https://lab--16079--forge-trevato-apps.open-platform.sh.
[{"go":"/maintenance","look":"Findings fold","expect":"each row ends with \"opened N m/h/d ago\" and, while open, \"; still open\"; the oldest finding is first"},
{"go":"/maintenance.json","look":"findings[].openedAt","expect":"an ISO time on every finding, oldest first"}]
🤖 Generated with Claude Code
The look-pages comment lists the page the gate will review, /maintenance; it doesn't report a fault. The review block below already covers /maintenance and /maintenance.json. Nothing in the code needed to change, so this round has no new commit. On the preview, / answers 200. /maintenance and /maintenance.json redirect with a 303 when called without an admin session, which is how admin-only pages are meant to behave.
---
Each maintenance finding now shows how old it is ("opened 3 d ago"), and the oldest finding is listed first. This holds on the /maintenance board, on the terminal's Maintenance screen and in /maintenance.json, which now gives each finding an openedAt time. This pull does not show who last touched a finding, so the title promises more than it delivers. Nothing records who acted on a finding today, so that needs a database change; it is now its own issue, #16187.
What changed
- Age wording:
src/maintenance/findings.tsgainsopenedWords(openedAt, now). The clock is passed in, so tests get the same answer every run. - Where age counts from: the first kept span of a cause. A cause that cleared and opened again shows that first span's age next to "still open".
docs/features/maintenance-findings.mdsays so. - Order: the newest 20 causes are still the ones listed, now sorted oldest first, so the "older causes, not listed" line stays true.
- Removed: the
daysfield onFindingRowand the day count in the query. Nothing read them once the age words replaced "seen N days". - Which file: the issue names
src/maintenance/page.ts, but that is the standby page. The board itself is built insrc/web/pages/maintenance.ts, so that is the file changed.
Tests
- New
test/maintenance-finding-age.test.tschecks the age wording, the oldest-first order and the re-opened case in the rows, the terminal and the JSON. - Two existing tests changed because what they check changed:
test/maintenance-findings.test.ts(rows gainopenedAtand the age) andtest/maintenance-json.test.ts(findings are oldest first and carryopenedAt).
Not done
- Shared age helper:
openedWordsstays separate fromageWordsinsrc/snapshot/bucket.ts. Their units and cut-offs differ ("m" vs "min", and days start at 24 h vs 48 h), so merging them would change what one of those pages shows.
The type check, the design lint and the 84 tests in test/maintenance-*.test.ts pass.
To try it, open /maintenance as an admin, or /maintenance.json for the JSON, on https://lab--16079--forge-trevato-apps.open-platform.sh.
[{"go":"/maintenance","look":"Findings fold","expect":"each row ends with \"opened N m/h/d ago\" and, while open, \"; still open\"; the oldest finding is first"},
{"go":"/maintenance.json","look":"findings[].openedAt","expect":"an ISO time on every finding, oldest first"}]
🤖 Generated with Claude Code
Closes #16048
Earlier asks, against the diff since 2698501: dead days field and query count removed (met); docs rewrapped (met); re-open semantics stated in the how-to and tested in the rows, terminal and JSON (met); "who last touched it" split to #16187 and the box list does not ask for it (met). Pipeline direction: the pull names no pipeline issue it serves; it is small and single-purpose, so I do not block on it, but a person may want to hold the merge behind the pipeline list. Design: the row reuses statusRow and the muted span, no new component, no new accent, works with JavaScript off. The terminal reads the same findingLines, so both doors agree. Next, non-blocking: (1) fold openedWords and ageWords in src/snapshot/bucket.ts once the two pages can agree on wording; (2) add the last-actor column in #16187.
Each finding on the board now shows its age ("opened 3 d ago") and the findings list oldest first. I did not add "who last touched it".
degraded_spandoesn't record a person, so there was nothing true to show. If you want it, the table needs a new column first.The focused tests pass (39 across the maintenance and findings files) and
tscis clean. I did not run the full suite, so the forge's check will be the first full run.bun scripts/design-lint.tsis clean.What changed
src/maintenance/findings.tshas a newopenedWords(openedAt, now). The clock is passed in, so tests are deterministic. A row readsdisk-free: … (opened 3 d ago; seen 3 days; still open)on/maintenanceand in the terminal./maintenance.jsonfinding carriesopenedAtas an ISO string.src/maintenance/page.ts, but that is the standby page. The board is built insrc/web/pages/maintenance.ts, so I changed that instead.Tests
test/maintenance-finding-age.test.tscovers the age wording and the oldest-first order in the rows, terminal and JSON. It fails without the change.test/maintenance-findings.test.ts(rows and terminal line gainopenedAtand the age) andtest/maintenance-json.test.ts(findings now list oldest first and carryopenedAt).The pre-push hook refused the push until a commit with a
Try:line existed, so there is an emptyTry:commit at the end.To try it: open
/maintenanceas admin and read the Findings fold, orcurl /maintenance.json.🤖 Generated with Claude Code
Closes #16048