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

An admin sets the repository's description from the terminal's About card with `w`, as Settings does #8135

Parked opened this
Closed without merging

On the About card, w ("write description") now opens a one-line prompt prefilled with the current description. Enter saves it through updateRepoSettings, so the change is audited like Settings and MCP reposettings. Esc leaves it as it was.

Notes

stopped parked by the crew deploy 0f9d9da

opened this

On the About card, w ("write description") now opens a one-line prompt prefilled with the current description. Enter saves it through updateRepoSettings, so the change is audited like Settings and MCP repo_settings. Esc leaves it as it was.

The new tests, tsc, scripts/gate.ts and the About, golden and mcp-size tests pass. I did not run the full suite, and did not run scripts/design-lint.ts (I changed nothing under src/web/).

  • Who sees it: only a person who administers the repository is offered w, and only their press counts. I used the mayPerson() gate (admin and not an agent), not the plain may() that a uses. The issue asks that agents not be offered it, and may() alone would let an agent admin through.
  • Key: w doesn't collide with any existing About binding.
  • Save: the card redraws with the new description and a "description saved" toast. An empty description still shows "No description."
  • Validation:
    • Settings and updateRepoSettings don't validate the description at all, so there was no cap to reuse. MCP repo_settings caps it at 2000 characters in its schema.
    • I added a small descriptionRefusal in about.ts: trimmed, at most 2000 characters, no control characters.
    • A refusal is a toast and the card is unchanged. It is not applied to Settings or MCP, so those paths are unchanged.
    • Settings has no wording for a refusal, so the toasts are my own: "a description is one line of plain text" and "a description is at most 2000 characters".
  • Tests: test/tui-about-description.test.ts covers an admin's w + text + enter changing the row and the audit trail, esc changing nothing, a refused description, and a writer or agent admin having no w. tui-about-golden.test.ts is unchanged because the golden doesn't show the hint.

To try it, open a repository you administer, press I, then w.

Closes #8066

3 earlier comments · 1 event
Changes requested — before the latest push

The feature is shaped right (admin-and-person only, esc leaves it, refusals are a toast), but it needs one round:

  1. FIRST: test/tui-about-description.test.ts has its whole setup pasted twice: two beforeAll and two afterAll blocks, plus the helpers description, type, audited sit between them. The first app and data dir are created and then overwritten, so the first one leaks and is never closed. Delete the duplicate block and the stray double blank line. The tmpdir prefix is also copy-pasted (forge-tui-visibility); name it for this test.
  2. Validation is duplicated in the screen: DESCRIPTION_MAX and descriptionRefusal are a copy of what MCP repo_settings enforces, exported from a TUI screen module. Put the rule in the core/settings layer that updateRepoSettings uses (one place Settings, MCP and the terminal all share) and have the terminal show its refusal. Otherwise the three doors drift. If updateRepoSettings already rejects these, drop the local check and toast its error.
  3. Tests: the control-character refusal branch has no test (add one: a typed tab/escape path or a pasted newline must be refused and change nothing). Also add a test that the write reaches web viewers live (the event/audit or the live channel the page uses), since the terminal write must show up like any other.
  4. README: say how to use w on the About card (admin who is a person only). The task requires the README to name the door.
  5. The test header cites #8066; confirm it is the right issue number, or cite the issue this pull closes.
commented

I've addressed all five points and pushed. tsc, scripts/gate.ts, the description, golden and mcp-size tests, and 15 more settings/API/MCP test files pass (147 tests in total). scripts/fast.ts named 1345 test files, too many to run here, so the forge's full check covers the rest.

  1. Test setup: I deleted the duplicate beforeAll/afterAll block and the stray blank line. The tmpdir prefix is now forge-tui-description-.
  2. Validation in one place:
    • The rule now lives in src/core/repo_description.ts (trimmed, at most 2000 characters, no control characters) and updateRepoSettings applies it. A refused description returns the new error invalid_description.
    • The terminal toasts the shared words, DESCRIPTION_WORDS. Settings and MCP repo_settings now show them too (MCP answers invalid). The screen's own copy of the rule is gone.
    • The API's PATCH still answers the generic 422 for it. I did not give it its own message.
    • Settings and the API trim a description and refuse a newline or other control character in it. Before this they accepted both.
    • The migrate and fleet paths are unchanged. Migrate doesn't go through updateRepoSettings. Fleet does, so its description edits now get the same check.
  3. Tests:
    • A new test types a tab and then an escape sequence. Each is refused with the shared words, the description stays as it was, and no audit line is added.
    • The save test now checks the repo.settings_updated event on the bus with changed.description going from "" to "Our site". That event is what web viewers read, and the test would fail without it. I found no separate live channel for the page to check.
  4. README: it now describes w on the About card (admin who is a person only) and the shared rule.
  5. Issue number: #8066 is the issue this pull closes. The test header now says "issue #8066, pull #8135".
commented

An admin can now set the repository's description from the About card in the terminal. Press w, type the line and submit; it goes through updateRepoSettings, the same single description rule Settings and the MCP use. A refused description shows that rule's sentence as a toast and changes nothing.

The check had failed on two tests, and I fixed one of them:

  • Egress test: the new w hint in the About footer pushed e egress off the one-line footer, which broke "a site admin lists, grants and revokes through the actions". I moved the w binding after e and c and shortened its label from "write description" to "describe". test/tui-about-description.test.ts now expects "describe". tui-egress, the About description tests and the other About tests pass, and tsc --noEmit is clean.
  • MCP backups test: "a listing that fails is a short sentence with no key in it" timed out at 20 s in the check. This change doesn't touch the MCP backups code. test/mcp-backups.test.ts passes here, but I didn't re-run it in a loop to confirm it's flaky. If it fails again on this push, that's a separate problem.

I didn't run bun scripts/gate.ts or scripts/fast.ts, and I didn't run the full suite; the forge's check runs that on the push.

In the terminal, w is the last hint in the footer, so on a narrow terminal it may be cut off. The key still works.

🤖 Generated with Claude Code

commented

I made no changes this round. Both failing tests pass here and neither touches the description feature.

  • test/mcp-backups.test.ts: the whole file passed twice here, including "a listing that fails is a short sentence with no key in it". This is the second check it timed out in, at 20 s, on shard 54 and then shard 17. The test uses a deliberately invalid S3 endpoint and imports nothing I changed (app, tokens, users, the http server and the snapshot modules). That points at slow network or DNS handling of the bad endpoint in the check environment, not at this pull.
  • test/pull-files-speed.test.ts: "a 40-file pull's second Files request is a diff cache hit…" passed in both runs. It compares how much each request renders, so it is sensitive to machine load. The check log shows shards being killed for running long, so the machine was heavily loaded.

My diff only touches the About card's description key and rule, in src/tui/screens/about.ts, src/core/repo_description.ts, src/actions/repos.ts, src/http/mcp/tools/repo_settings.ts, src/web/pages/settings.ts and their tests.

A re-run of the check on the same commit (0f9d9dae) should clear the speed test. If the MCP backups test keeps timing out, the cause is in the check environment or that test's 20 s budget. A person should look at it.

🤖 Generated with Claude Code

commented

Parked by the crew: the check stayed red through 2 automatic tries: a 40-file pull's second Files request is a diff cache hit and renders far less than the first

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs