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

Review refusals live in one module, and the pull page, the review action and MCP read them from there #5569

Merged opened this

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

Merged

The three review refusals now live in one module, `src/actions/review_words.ts`. It exports `reviewWords` with the keys `selfReview`, `tooLong` and `forbidden`, and the pull page, the studio review action and MCP's `review` tool all read the sentences from there. `grep -rn` for each sentence now finds only that module.

shipped production is serving it deploy dc8790b

opened this

The three review refusals now live in one module, src/actions/review_words.ts. It exports reviewWords with the keys selfReview, tooLong and forbidden, and the pull page, the studio review action and MCP's review tool all read the sentences from there. grep -rn for each sentence now finds only that module.

  • src/http/mcp.ts: one import line, plus each of the three message lines changed in place (other MCP work edits this file too).
  • src/web/studio/review_act.ts: one import, and the forbidden and tooLong messages.
  • src/web/pages/pull.ts: one import, and five places:

- the review flash for self-review, forbidden and too-long; - the approve-to-run flash for self-review; - the two warnings shown beside the review form.

This door's forbidden message stays "A verdict that gates a merge needs write access. You can still leave a comment.", now written as ` ${reviewWords.forbidden} You can still leave a comment. `.

One output change to look at: the review form's write-access warning used to break across two lines in the template (needs write⏎ access.). It now renders as a single line, so the HTML whitespace differs while the page reads the same. Every flash and MCP answer is byte-for-byte unchanged, and no existing test was edited.

test/review-words.test.ts (new) has a reader send a verdict through each door — the pull page's review-state POST, /review/act with verb=changes, and MCP tools/call review. Each answer is checked against reviewWords.forbidden. A fourth case scans every .ts file under src/ and fails if any file other than the module types out one of the sentences, so retyping the words at a door is caught even when they match.

Run before pushing, all passing: bun x tsc --noEmit, bun scripts/design-lint.ts, and bun test on review-words, mcp-review, review-act, web-workflows, reviews-states, fork-pull-approval, pulls, pull-merge-box, diff-review-comment and crew-review. I didn't run the whole suite; the forge's check does that.

Not done: the other refusal sentences next to these (for example "That review could not be recorded.") are still typed out at each door. The issue named only these three.

To try it: bun test test/review-words.test.ts.

🤖 Generated with Claude Code

Closes #5565

commented

The three review refusals now live in one module, src/actions/review_words.ts. It exports reviewWords with the keys selfReview, tooLong and forbidden, and the pull page, the studio review action and MCP's review tool all read the sentences from there. grep -rn for each sentence now finds only that module.

  • src/http/mcp.ts: one import line, plus each of the three message lines changed in place (other MCP work edits this file too).
  • src/web/studio/review_act.ts: one import, and the forbidden and tooLong messages.
  • src/web/pages/pull.ts: one import, and five places:

- the review flash for self-review, forbidden and too-long; - the approve-to-run flash for self-review; - the two warnings shown beside the review form.

This door's forbidden message stays "A verdict that gates a merge needs write access. You can still leave a comment.", now written as ` ${reviewWords.forbidden} You can still leave a comment. `.

One output change to look at: the review form's write-access warning used to break across two lines in the template (needs write⏎ access.). It now renders as a single line, so the HTML whitespace differs while the page reads the same. Every flash and MCP answer is byte-for-byte unchanged, and no existing test was edited.

test/review-words.test.ts (new) has a reader send a verdict through each door — the pull page's review-state POST, /review/act with verb=changes, and MCP tools/call review. Each answer is checked against reviewWords.forbidden. A fourth case scans every .ts file under src/ and fails if any file other than the module types out one of the sentences, so retyping the words at a door is caught even when they match.

Run before pushing, all passing: bun x tsc --noEmit, bun scripts/design-lint.ts, and bun test on review-words, mcp-review, review-act, web-workflows, reviews-states, fork-pull-approval, pulls, pull-merge-box, diff-review-comment and crew-review. I didn't run the whole suite; the forge's check does that.

Not done: the other refusal sentences next to these (for example "That review could not be recorded.") are still typed out at each door. The issue named only these three.

To try it: bun test test/review-words.test.ts.

🤖 Generated with Claude Code

Approved

Clean, and it does what #5565 asks. The three sentences now live in src/actions/review_words.ts as plain constants. Each door reads them from there: pull.ts (the review flash, the approve-to-run flash and both card warnings), review_act.ts, and MCP review. The edits stay on the literals' own lines, as the issue asked. At this head, git grep finds each sentence only in the module. The lowercase strings left in src/http/api.ts and the other "too long" sentences are different words and outside this issue.

Security: nothing changes. These are constants interpolated through html (escaped), and auth, origin checks and caps are untouched. Design: the one markup change makes the card warning a single line in the template. It keeps the same muted small span and icon, so DESIGN.md is unaffected. The terminal does not use these sentences, so neither door changes. Tests: the new suite sends a reader's verdict through all three doors, asserts each answer is the module's sentence, and the MCP case also checks that no review was recorded. The src/ scan fails if any door retypes the words, so the test catches the drift it exists to prevent. No existing test was edited. The preview boots and / answers.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs