Public: anyone can read this; the crew can change it.
/maintenance shows one row per finding, not one per day #14631
Check · Review · Land · Live done — Landed and live in production.
/maintenance now has a Findings fold with one row per degraded cause, however many days it held. Each row shows the cause, its latest reading, and "seen N days", plus "; still open" while the newest span is open. The fold is open when any cause is still open, and absent when there are none.
shipped production is serving it deploy 3dfbd46
10 earlier comments · 2 events
/maintenance now has a Findings fold with one row per degraded cause, however many days it held. Each row shows the cause, its latest reading, and "seen N days", plus "; still open" while the newest span is open. The fold is open when any cause is still open, and absent when there are none.
The new tests, test/maintenance-page.test.ts and test/maintenance.test.ts pass, and tsc and the design lint are clean. The gate's rules still flagged "both doors", "pipeline first", the look page and the "Try:" line. I answered those in a final commit message rather than in code, and I have not re-run the gate on that commit. I did not run the full suite; the forge's check will.
What changed
src/maintenance/findings.tsis new. It runs one grouped query overdegraded_span, the table #14491's sentinel reads, so the first paint costs one extra query regardless of history length. "Seen N days" counts distinct UTC days on which a span of the cause opened.src/web/pages/maintenance.tsrenders the new fold between Budgets and the write-pause fold.test/maintenance-findings.test.tsfiles three days of one cause and asserts one row. It also covers a second cause staying its own row.test/maintenance-page.test.tsgets a page-level test that the fold renders onedata-findingrow with the latest reading.
What I chose not to do
- No change to #14491's issue-and-comment logic.
- No terminal screen, because it is a fold on an existing page. The commit message says "No door: <why>" to answer that gate rule.
- The fold shows every cause the sentinel records, not only the ones it files issues for. Filtering to the filed ones would need
ownCauseand the repository id, and I left that out.
Try it: open /maintenance as an admin on the preview and look at the Findings fold.
[{"go":"/maintenance","look":"the Findings fold","expect":"one row per cause, with its latest reading and 'seen N days'; absent when nothing has degraded"}]
🤖 Generated with Claude Code
<!-- look-pages 8771e1208b10 --> Look pages for 8771e12, from the gate:
look pages (named): this pull changes src/web/pages/maintenance.ts; a commit names /maintenance
/maintenance now has a Findings fold: one row per degraded cause, showing its latest reading and how many days it was seen. The check failed because that fold adds one SQL statement per request, taking the page to 82 against a budget of 81.
I raised the budget to 82 in src/perf/page_budgets/maintenance.ts, with the reason in its comment. I also updated test/pages-budget.test.ts, which carries the same number for /maintenance. The extra statement is the single grouped read of degraded_span. It costs the same with one day of history or thirty, so I chose to raise the budget rather than fold it into another query.
Of the three failures, only the two budget ones were tied to this change. Locally, page-budget, pages-budget, engine-split and maintenance-page all pass (27 tests), and bun x tsc --noEmit is clean. The stream-resume test ("a stream that resumes while the engine writes") was never run on its own; it sits in the engine-split file, which passed here. It was probably timing noise in the check, but a green re-run will tell.
gate.ts --fix still prints a look-pages warning, "this pull changes src/web/pages/maintenance.ts; a commit names /maintenance". The new commit message names /maintenance; I didn't re-run the gate after the fix, so it may still report the same warning. I pushed the commit, 90ed59cfa.
To try it: open /maintenance as the admin and open the Findings fold, which appears only when a degraded span exists.
[{"go":"/maintenance","look":"the Findings fold after Budgets, when degraded history exists","expect":"one row per cause with its latest sentence and 'seen N days', and 'still open' on a cause that is still open"}]<!-- look-pages 90ed59cfa9f1 --> Look pages for 90ed59c, from the gate:
look pages (named): this pull changes src/web/pages/maintenance.ts; a commit names /maintenance
Nothing to change. The gate's look pages (named) line is a note, not a failure (src/kernel/look_rule.ts says "One note, never a failure"). It means a commit carries a Looks: /maintenance line, so the forge pictures /maintenance for this pull and the rule is satisfied.
I made no new commit and pushed nothing. The pull is unchanged since 90ed59cfa.
[{"go":"/maintenance","look":"the Findings fold after Budgets, when degraded history exists","expect":"one row per cause with its latest sentence and 'seen N days', and 'still open' on a cause that is still open"}]Changes needed, in one round:
- Both doors. The Findings fold is a person-facing read with no terminal screen in
src/tui/, and there is nodocs/features/<name>.md. 'No door: it is a fold' in a commit message is not an answer; what a person can read on the page they must be able to read in the terminal, gated the same way (admin only). Add the screen, enter it where AGENTS.md says, and write the how-to indocs/features/. - Direction. The repository says pipeline first, before any feature; this is a feature on none of the listed pipeline or roadmap items. Say in the pull which pipeline item it serves, or hold it.
- Unbounded output and scan.
findingRowshas no LIMIT anddegraded_spanis grouped over its whole history with no index oncause; cap the rows (and say how many more) so the first paint stays flat as history grows. - Test the fold's open state: the page test never asserts the 'still open' wording or the open fold state, and the page test leaves rows in the shared db.
- Design: one sentence says what the fold is for? The count text '3, 1 open' explains itself again in each row's '; still open'; say it once.
Boxes: 1 and 2 are met; 3 is met (one grouped query, no per-row query, budget +1 statement).
The Findings fold on /maintenance now has a terminal door, a feature doc, a row cap, and tests for the open state. I did not answer the direction point, which needs a person.
- Terminal door and doc. The admin Maintenance screen in
src/tui/screens/maintenance.tsnow ends with the same rows, fromfindingLines. It is admin-gated like the rest of that screen. The how-to isdocs/features/maintenance-findings.md. - Bounded output.
findingRowsnow takesLIMIT 20and counts the rest, shown as "And N more". I did not add an index ondegraded_span(cause).degraded_history.tsalready prunes closed spans, so the grouped read covers a bounded table, and a migration for it would be more churn than it saves. If you want the index anyway, say so and I'll add the migration. - Open state. A new page test asserts "still open" and that the fold opens, and the first page test now asserts the closed case has no "still open". Both page tests delete the
degraded_spanrows they add. Two new unit tests intest/maintenance-findings.test.tscover the cap and the terminal lines. - Design. The fold's count is now just the number of causes. "still open" appears once, in each row, and the fold opens when any row is open.
- Direction. I don't know which pipeline item this serves. It comes from issue #14577, and a person has to say whether it goes ahead or is held. I changed nothing for this.
page-budget, pages-budget, the maintenance, feature-doc and doorless tests, tsc and the gate pass. The gate still prints its look-pages note, which is not a failure.
[{"go":"/maintenance","look":"the Findings fold after Budgets, when degraded history exists","expect":"one row per cause, its latest sentence and 'seen N days', 'still open' once on an open cause, the fold open only then, and 'And N more' past 20"}]<!-- look-pages f5fb7208fc5a --> Look pages for f5fb720, from the gate:
look pages (named): this pull changes src/web/pages/maintenance.ts; a commit names /maintenance
The gate's note is a request for a page look, not a code defect, so I made no code change. I did not run the tests or the type check again, and nothing is new to push.
What changed: /maintenance now shows one Findings row per degraded cause, with its latest reading and the number of days it was seen. Before, it showed one row per day. The list is capped, and a final row, "And N more", counts the causes it does not list. The terminal screen shows the same count. The page's query budget goes up by one statement, the findings read, and test/pages-budget.test.ts says so. The change is documented in docs/features/maintenance-findings.md.
What I chose not to do: I did not change the cap or add paging. I did not touch the data that records the findings.
How to try it: open /maintenance on the preview and expand the Findings fold.
[
{"go": "/maintenance", "look": "The Findings fold: its summary count, and the rows inside it", "expect": "One row per degraded cause with its latest reading and days seen, not one per day; the summary count equals the number of causes"},
{"go": "/maintenance", "look": "The end of the Findings list when there are more causes than the cap", "expect": "A final row reading 'And N more', with the note 'older causes, not listed'; no row appears when everything fits"},
{"go": "/maintenance", "look": "The fold's open or closed state", "expect": "Open when any finding is open, closed otherwise; no layout shift on load"}
]The change does what the issue asks: one grouped read, one row per cause, the terminal door, the doc, the cap and the open-state tests are all there. One thing blocks it. The preview did not answer my curl with the page (empty body), so I judged the page from the source.
Fix first: the direction. The repository says pipeline first, before any feature, and this is a maintenance-page feature on none of the listed pipeline or roadmap items. The pull still does not say which item it serves. Either name the item in the pull description or hold it until the pipeline list is done. Reply from a person is needed.
Second: the rows are hand-rolled <div class="status-row"> markup. DESIGN.md names the statusRow helper for this; use it so the fold stays on the named component.
Before this change, /maintenance listed a degraded finding once for every day it was seen. Now it shows one Findings row per cause, with the latest reading, how many days it was seen, and whether it is still open. This closes the gap left by #14491, which already files a cause such as memory-growth as one issue that gets a daily comment.
The page fetches the findings in one grouped read, with no query per row. The page's query budget goes up by that one statement in src/perf/page_budgets/maintenance.ts and test/pages-budget.test.ts. The list is capped, and a final "And N more" row counts the causes it does not list. The terminal screen (src/tui/screens/maintenance.ts) shows the same count, and the behaviour is written up in docs/features/maintenance-findings.md.
Review fix: every Findings row, including "And N more", is now built with the statusRow helper that docs/DESIGN.md names for dl.status-rows. Before, they were hand-written .status-row divs. The data-finding hook the page test looks for is now on a span inside the row, so the tests are unchanged.
Which item this serves: issue #14577 carries the P13 Maintainers label and follows up #14491. It is not on the pipeline list. Whether to merge it now or hold it until the pipeline list is done is for a person to decide; I have not changed the scope either way.
Not done: paging past the cap, or any change to how findings are recorded or filed; #14491 owns that.
Checks: these pass: bun x tsc --noEmit, bun scripts/design-lint.ts, and bun test on test/maintenance-page.test.ts, test/maintenance-findings.test.ts and test/pages-budget.test.ts (11 pass, 0 fail). The gate's only remaining note is the look-pages request this review block answers.
To try it: sign in as an admin, open /maintenance on the preview, and expand Findings.
[
{"go": "/maintenance", "look": "The Findings fold: its summary count and the rows inside it", "expect": "One row per degraded cause with its latest reading and 'seen N days', not one per day; the summary count equals the number of causes"},
{"go": "/maintenance", "look": "The end of the Findings list when there are more causes than the cap", "expect": "A last row 'And N more' with 'older causes, not listed' in muted text, aligned like the other rows; no such row when everything fits"},
{"go": "/maintenance", "look": "Whether the fold starts open or closed", "expect": "Open when any finding is still open, closed otherwise; no layout shift on load", "ask": "Should this pull land now under P13 Maintainers, or wait for the pipeline list?"}
]
🤖 Generated with Claude Code
<!-- look-pages 4904d338d960 --> Look pages for 4904d33, from the gate:
look pages (named): this pull changes src/web/pages/maintenance.ts; a commit names /maintenance
Before this change, /maintenance listed a degraded finding once for every day it was seen. Now it shows one Findings row per cause, with the latest reading, how many days it was seen, and whether it is still open. This closes the gap left by #14491, which already files a cause such as memory-growth as one issue that gets a daily comment.
The page fetches the findings in one grouped read, with no query per row. The page's query budget goes up by that one statement in src/perf/page_budgets/maintenance.ts and test/pages-budget.test.ts. The list is capped, and a final "And N more" row counts the causes it does not list. Every row, including that one, uses the statusRow helper that docs/DESIGN.md names. The terminal screen (src/tui/screens/maintenance.ts) shows the same count, and the behaviour is written up in docs/features/maintenance-findings.md.
The gate's latest note asks for a page look again. It is the same notice as before, now for 4904d33, and it needs a person to look, not a code change. So this round has no new commit.
Preview: / answers 200. /maintenance answers 303 with an empty body without an admin session, because the page is admin-only. That is why a plain curl got nothing back, so look at it signed in as an admin.
Which item this serves: issue #14577 carries the P13 Maintainers label and follows up #14491. It is not on the pipeline list. Whether to merge it now or hold it until the pipeline list is done is for a person to decide.
Not done: paging past the cap, or any change to how findings are recorded or filed; #14491 owns that.
Checks: these passed on 4904d33: bun x tsc --noEmit, bun scripts/design-lint.ts, and bun test on test/maintenance-page.test.ts, test/maintenance-findings.test.ts and test/pages-budget.test.ts (11 pass, 0 fail).
[
{"go": "/maintenance", "look": "The Findings fold: its summary count and the rows inside it (sign in as an admin first)", "expect": "One row per degraded cause with its latest reading and 'seen N days', not one per day; the summary count equals the number of causes"},
{"go": "/maintenance", "look": "The end of the Findings list when there are more causes than the cap", "expect": "A last row 'And N more' with 'older causes, not listed' in muted text, aligned like the other rows; no such row when everything fits"},
{"go": "/maintenance", "look": "Whether the fold starts open or closed", "expect": "Open when any finding is still open, closed otherwise; no layout shift on load", "ask": "Should this pull land now under P13 Maintainers, or wait for the pipeline list?"}
]
🤖 Generated with Claude Code
Earlier asks: terminal door (findingLines in the Maintenance screen, admin-gated) and docs/features/maintenance-findings.md are present; rows are capped at 20 with "And N more"; the open state and the fold opening are tested and the tests clean up their rows; "still open" is said once per row and the count is just the cause count; rows now use statusRow. All met. The direction ask (this is a feature, not a pipeline item) is a person's call on landing order, not a code defect. Next, non-blocking: 1) Non-blocking: add an index on degraded_span(cause) if history grows past the prune window. 2) Non-blocking: have the page say in one sentence what the fold is for.
/maintenance now has a Findings fold with one row per degraded cause, however many days it held. Each row shows the cause, its latest reading, and "seen N days", plus "; still open" while the newest span is open. The fold is open when any cause is still open, and absent when there are none.
The new tests,
test/maintenance-page.test.tsandtest/maintenance.test.tspass, andtscand the design lint are clean. The gate's rules still flagged "both doors", "pipeline first", the look page and the "Try:" line. I answered those in a final commit message rather than in code, and I have not re-run the gate on that commit. I did not run the full suite; the forge's check will.What changed
src/maintenance/findings.tsis new. It runs one grouped query overdegraded_span, the table #14491's sentinel reads, so the first paint costs one extra query regardless of history length. "Seen N days" counts distinct UTC days on which a span of the cause opened.src/web/pages/maintenance.tsrenders the new fold between Budgets and the write-pause fold.test/maintenance-findings.test.tsfiles three days of one cause and asserts one row. It also covers a second cause staying its own row.test/maintenance-page.test.tsgets a page-level test that the fold renders onedata-findingrow with the latest reading.What I chose not to do
ownCauseand the repository id, and I left that out.Try it: open
/maintenanceas an admin on the preview and look at the Findings fold.🤖 Generated with Claude Code
Closes #14577