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

A maintenance finding shows who last touched it #17015

Merged opened this

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

Merged

Each finding row on /maintenance, in the terminal's Maintenance screen and in /maintenance.json now says who last acted on it, or that nobody has. The maintenance tests, the own-source and dead-code tests and tsc pass. The gate passes after a No door: line.

Notes

opened this

Each finding row on /maintenance, in the terminal's Maintenance screen and in /maintenance.json now says who last acted on it, or that nobody has. The maintenance tests, the own-source and dead-code tests and tsc pass. The gate passes after a No door: line. Its look-alike note for reopenFinding is left as a note, not changed. I did not try the page on a preview.

  • Where it shows: rows end with "last touched by ada 2 h ago", or "untouched". Both the board and the terminal build that text with rowWords, so they cannot differ. /maintenance.json adds touchedBy and touchedAt (an ISO time), both null when untouched.
  • What counts as a touch: reopening an auto-closed finding records the signed-in person. The tick's own 14-day close records "maintenance tick". There is no dismiss action in the code, so those two are the only actions that exist.
  • Migration: adds touched_by and touched_at to degraded_span, with its pin. The last actor is read across all spans of a cause, so a reopen shows even when it touched an older span.
  • API change: reopenFinding now takes the actor's name, and the web and terminal callers pass it.
  • Tests: the new test in test/maintenance-finding-age.test.ts covers the board, terminal and JSON for both a touched and an untouched finding, and fails without the change. Existing tests had their degraded_span schemas and expected row words updated.
  • Docs: docs/features/maintenance-findings.md is updated.
  • Not done: no dismiss action, which would be new behaviour, and no history of past actors, only the latest one.
  • Gate line: the gate's both-doors rule wanted a new screen or how-to for the migration, so a commit carries No door:. The terminal text and the how-to are already in this change.

Try: open /maintenance.json on the preview as admin. Each finding carries touchedBy and touchedAt, and /maintenance rows end "untouched".

[{"go":"/maintenance","look":"Findings fold rows","expect":"each row ends with '; untouched' until someone reopens it, then 'last touched by <name> <age> ago'"},{"go":"/maintenance.json","look":"findings array","expect":"touchedBy and touchedAt present, null when untouched"}]

Closes #16187

12 earlier comments
commented

Each finding row on /maintenance, in the terminal's Maintenance screen and in /maintenance.json now says who last acted on it, or that nobody has. The maintenance tests, the own-source and dead-code tests and tsc pass. The gate passes after a No door: line. Its look-alike note for reopenFinding is left as a note, not changed. I did not try the page on a preview.

  • Where it shows: rows end with "last touched by ada 2 h ago", or "untouched". Both the board and the terminal build that text with rowWords, so they cannot differ. /maintenance.json adds touchedBy and touchedAt (an ISO time), both null when untouched.
  • What counts as a touch: reopening an auto-closed finding records the signed-in person. The tick's own 14-day close records "maintenance tick". There is no dismiss action in the code, so those two are the only actions that exist.
  • Migration: adds touched_by and touched_at to degraded_span, with its pin. The last actor is read across all spans of a cause, so a reopen shows even when it touched an older span.
  • API change: reopenFinding now takes the actor's name, and the web and terminal callers pass it.
  • Tests: the new test in test/maintenance-finding-age.test.ts covers the board, terminal and JSON for both a touched and an untouched finding, and fails without the change. Existing tests had their degraded_span schemas and expected row words updated.
  • Docs: docs/features/maintenance-findings.md is updated.
  • Not done: no dismiss action, which would be new behaviour, and no history of past actors, only the latest one.
  • Gate line: the gate's both-doors rule wanted a new screen or how-to for the migration, so a commit carries No door:. The terminal text and the how-to are already in this change.

Try: open /maintenance.json on the preview as admin. Each finding carries touchedBy and touchedAt, and /maintenance rows end "untouched".

[{"go":"/maintenance","look":"Findings fold rows","expect":"each row ends with '; untouched' until someone reopens it, then 'last touched by <name> <age> ago'"},{"go":"/maintenance.json","look":"findings array","expect":"touchedBy and touchedAt present, null when untouched"}]
commented

I merged main into the branch and pushed it. The only conflict was src/generated/migrations.ts.

main had added 20261201090000-app-vital-member, which shifted the numbering of the migrations after it. I took main's version of the file and regenerated it with bun scripts/own-source.ts, rather than editing the conflict markers. The result lists both migrations, and 20261201130000-finding-touched still sorts last. The merge changed nothing else.

I ran bun x tsc --noEmit, test/own-source.test.ts and the six finding test files (28 tests). All pass. I did not run the full suite; the forge's check runs it on push.

bun scripts/gate.ts --fix reported one comment line over 100 columns in src/tui/screens/maintenance.ts, which it left alone. It also flagged reopenFinding in src/maintenance/findings.ts as 0.64 similar to closedSince in src/rules/flake_trend.ts. I did not follow up on either note.

commented

<!-- look-pages 41ba8091df13 --> Look pages for 41ba809, 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
commented

The failing test was a new column that the account purge had no row for. degraded_span.touched_by, added by this pull's migration, holds a user id. I added it to COVERED in src/core/account_purge.ts as FORMER: the finding keeps its history, and the person shows as the former account once their account is purged.

test/account-purge.test.ts now passes (12 of 12) and bun x tsc --noEmit is clean. I did not run the full suite; the forge's check runs it on this push.

commented

<!-- look-pages 2a4be90edc60 --> Look pages for 2a4be90, 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
commented

The duplicate m444 came from main moving again. It added another migration, and my earlier merge of the generated file no longer matched.

I merged main again. The only conflict was src/generated/migrations.ts, so I took main's version and regenerated it with bun scripts/own-source.ts. bun x tsc --noEmit is clean. test/own-source.test.ts and test/account-purge.test.ts pass (15 tests). The push went through. I did not run the full suite; the forge's check runs it.

The drift warning in the log (one more one-off class than the baseline of 10) is in src/web/ files this pull doesn't touch.

commented

No code change this round, so I pushed nothing. The feedback was the gate's automated look-pages note plus a list of checks the crew's pulls often fail. I checked the pull against each one and none applies.

  • Dead-code test: test/unused-exports.test.ts passes.
  • during jobs test: test/job-slices.test.ts passes. The pull adds no during jobs.
  • Issue number: the three feature commits and the purge commit each carry (#16187). The two merge commits don't. They are the forge's merge commits from bringing main in.
  • as never: none in the pull's diff.
  • Look pages: the gate infers /maintenance from the src/web/pages/maintenance.ts change. That is correct, so no Looks: or No look: override is needed.

gate.ts still raises two notes I left alone: a comment line over 100 columns in src/tui/screens/maintenance.ts, which the nightly rewrap handles on main, and reopenFinding at 0.64 similarity to closedSince in src/rules/flake_trend.ts. The two functions do different jobs: reopenFinding reopens a finding and records who did it, while closedSince answers a flake-trend question.

commented

<!-- look-pages 47efed0f6bbd --> Look pages for 47efed0, 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
commented

This is the same automated look-pages note as last round, now for commit 47efed0. I changed no code and pushed nothing.

I checked the four listed refusals against this pull last round, and the branch hasn't changed since:

  • Dead-code test: test/unused-exports.test.ts passes.
  • during jobs test: test/job-slices.test.ts passes. The pull adds no during jobs.
  • Issue number: the three feature commits and the account-purge commit each end (#16187). The two merge commits don't. They are the forge's merge commits from bringing main in.
  • as never: none in the pull's diff.
  • Look pages: the gate infers /maintenance from the src/web/pages/maintenance.ts change. That is the page this pull touches, so no Looks: or No look: line is needed.
commented

All three requested fixes and the smaller notes are in and pushed. The tests I touched pass and bun x tsc --noEmit is clean; I didn't run the full suite, which the forge's check does.

  • Untested behaviour: test/maintenance-autoclose.test.ts now checks that autoClose writes TICK_ACTOR and touched_at. It also checks that POST /maintenance/findings/reopen records the signed-in username (boss). I did not run them against the old code to watch them fail.
  • Empty actor: reopenFinding returns false for an empty or blank actor, and a test shows the finding stays closed. The terminal's doReopen now says "Sign in to reopen a finding." when there is no user. I did not test that terminal branch separately: the o key is already gated to admins, so it is unreachable in practice.
  • Purge mismatch: the column holds a username, so FORMER was wrong. I marked it none in COVERED with the reason, and purgeAccount now rewrites a purged person's name on a finding to "a former member". The tick's name is left alone, and so is a similar name like danae. test/account-purge.test.ts covers all three.
  • Double wording: rowWords leaves off "last touched by …" when the toucher is the tick, so an auto-closed row only says "closed …". A test checks this.
  • Ordering: the COVERED entry now sits after the crew_device rows, before repo_review.

The commit carries No door: … because it tightens rowWords and reopenFinding, which the page and terminal already share. I did not fetch the preview. The gate's two standing notes are unchanged: the 100-column comment line in src/tui/screens/maintenance.ts and reopenFinding against closedSince.

commented

<!-- look-pages 409265c3690f --> Look pages for 409265c, 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
commented

Nothing changed on this push: the checks you listed are already green on 409265c, so I committed no code. I made no new commit, and I did not push.

  • Gate: every rule passes. It prints two notes. The first is the inferred look page, /maintenance, which the forge pictures on its own. The second is a comment line over 100 columns in src/tui/screens/maintenance.ts. gate --fix left that file alone, since the nightly rewrap handles it on main.
  • Named checks: "dead code: every export under src/ has a caller" and "every job src/ runs under during is timed" both pass. So do the other tests in unused-exports, job-slices and brief-lessons.
  • Test inputs and issue number: the pull's own test files contain no as never, and "name the issue" passes.
  • Tests and types: the five test files this pull changes pass, 31 tests in all. bun x tsc --noEmit is clean.

I did not run the whole suite. A name-filtered run over test/ also loads test/fixtures/shard-errors.test.ts, which throws on load by design, so it showed one error that has nothing to do with this change.

Summary of the pull: a maintenance finding now shows who last touched it. The actor must be non-empty, a purged account's name is scrubbed, and the tick's touch is stated once. Account purge also covers degraded_span.touched_by.

What I left out: no new dependencies and no schema change beyond that purge coverage.

To try it, open /maintenance on the preview and read the "last touched by" line on a finding.

🤖 Generated with Claude Code

commented

Each maintenance finding row now ends with who last touched it and how long ago ("last touched by ada 2 d ago"), or "untouched". This is the same on the board, the terminal and /maintenance.json. Each touch is recorded on the span: the tick's sweep records maintenance tick, and a reopen records the signed-in username. A reopen with an empty actor is refused. Account purge also scrubs degraded_span.touched_by.

This push answers the review:

  • Tick touch on an older span: rowWords used to drop the touch whenever the tick was the last toucher. It now drops it only when the tick closed this row, whose "closed <date>" clause already says so. If the tick swept an older span and a newer span of the same cause is open, the row now reads "still open; last touched by maintenance tick 3 d ago". A new test covers that case and failed under the old condition.
  • Age wording: touchedWords and openedWords both call one private agoWords(at, now) now, instead of stripping "opened " off openedWords' output. A test checks the touch reads "just now", "m", "h" and "d".
  • Terminal "Sign in to reopen a finding." branch: I removed it rather than testing it, because it cannot be reached. The o key only gets to doReopen once mayAct() has confirmed a signed-in admin. The call now passes f.user?.username ?? "" like the quiet and bring-back handlers beside it. reopenFinding already refuses an empty name, and an existing test covers that.

The gate's duplicate scan likens agoWords to ageWords in src/snapshot/bucket.ts. That is a note, not a refusal. I kept them separate because the bucket helper prints "min" and keeps hours up to 48 h, so sharing it would change what /maintenance prints.

The type check, design lint and gate pass, and so do 138 tests across the maintenance, findings, terminal, status, unused-export and job-timing files. I did not run the full suite; the forge runs it on push.

No look: only the words on a row change, and the layout of /maintenance does not.

To try it: on the preview, open /maintenance as an admin and read the end of each finding. Reopen an auto-closed finding, and its row reads "last touched by <you> just now". In the terminal, o reopens a finding by its number.

[{"go":"/maintenance","look":"the end of each finding row","expect":"its age, then 'still open' or the closed date, then 'last touched by <name> <age>' or 'untouched'; a row the tick closed does not repeat the tick's touch"},
 {"go":"/maintenance","look":"press Reopen on a finding under 'closed for want of action'","expect":"the row now ends 'last touched by <your username> just now'"}]

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs