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

A branch's sentences live in one module, read by the branches page, MCP, the mirror and the terminal #5759

opened this

Merged 38d 2h ago, live in production

The four branch sentences now live in a new module, src/actions/branchwords.ts. No existing module held them, so I added one rather than putting them in an unrelated place. Every file the issue names reads them from it.

Notes

opened this

The four branch sentences now live in a new module, src/actions/branch_words.ts. No existing module held them, so I added one rather than putting them in an unrelated place. Every file the issue names reads them from it. Running grep -rn under src/ for any of the four sentences now finds only that module. Nothing a person or agent sees has changed: no wording moved, and only the lines the sentences sit on were touched.

  • BRANCH_NOT_CREATED and BRANCH_NOT_DELETED: the fallback messages for a refused create or delete. src/web/pages/branches.ts and src/http/mcp.ts import them. In mcp.ts the only changes are one import line and the two ?? fallbacks.
  • NAME_THE_BRANCH: the terminal's answer when a branch name is left empty. src/tui/screens/refs.ts and src/tui/screens/workspace.ts import it.
  • MUST_NOT_ALREADY_EXIST: this phrase only ever appeared in comments in src/actions/branches.ts and src/origins/git-mirror.ts, never in running code. Those comments now name the constant and where it lives instead of quoting the words. Neither file imports it, because the import would never be used; the module's doc comment explains what the phrase means for git's push lease.

test/branch-words.test.ts checks that the module says each sentence word for word. It also reads each of the six files as text and fails if any of them contains one of the sentences, or no longer names the constants it should.

Checks run:

  • bun x tsc --noEmit is clean.
  • bun scripts/design-lint.ts is clean.
  • The new test passes.
  • I ran the branches, MCP branches, branches timing, workspace terminal and mirror suites together: 84 passed and 1 failed. The failure was a 5 s hook timeout in test/push-through.test.ts. That suite passes 6/6 on its own, with this change and on main, so the timeout came from running the suites together.

Try it: run bun test test/branch-words.test.ts. Then put "That branch was not created." back into src/web/pages/branches.ts, run it again, and it fails.

🤖 Generated with Claude Code

Closes #5713

commented

The four branch sentences now live in a new module, src/actions/branch_words.ts. No existing module held them, so I added one rather than putting them in an unrelated place. Every file the issue names reads them from it. Running grep -rn under src/ for any of the four sentences now finds only that module. Nothing a person or agent sees has changed: no wording moved, and only the lines the sentences sit on were touched.

  • BRANCH_NOT_CREATED and BRANCH_NOT_DELETED: the fallback messages for a refused create or delete. src/web/pages/branches.ts and src/http/mcp.ts import them. In mcp.ts the only changes are one import line and the two ?? fallbacks.
  • NAME_THE_BRANCH: the terminal's answer when a branch name is left empty. src/tui/screens/refs.ts and src/tui/screens/workspace.ts import it.
  • MUST_NOT_ALREADY_EXIST: this phrase only ever appeared in comments in src/actions/branches.ts and src/origins/git-mirror.ts, never in running code. Those comments now name the constant and where it lives instead of quoting the words. Neither file imports it, because the import would never be used; the module's doc comment explains what the phrase means for git's push lease.

test/branch-words.test.ts checks that the module says each sentence word for word. It also reads each of the six files as text and fails if any of them contains one of the sentences, or no longer names the constants it should.

Checks run:

  • bun x tsc --noEmit is clean.
  • bun scripts/design-lint.ts is clean.
  • The new test passes.
  • I ran the branches, MCP branches, branches timing, workspace terminal and mirror suites together: 84 passed and 1 failed. The failure was a 5 s hook timeout in test/push-through.test.ts. That suite passes 6/6 on its own, with this change and on main, so the timeout came from running the suites together.

Try it: run bun test test/branch-words.test.ts. Then put "That branch was not created." back into src/web/pages/branches.ts, run it again, and it fails.

🤖 Generated with Claude Code

commented

The three sentences the forge actually says now live in a new module, src/actions/branch_words.ts. Making or deleting a branch reads the same from the branches page, the MCP and the terminal.

  • BRANCH_NOT_CREATED ("That branch was not created.") and BRANCH_NOT_DELETED ("That branch was not deleted.") are the fallback messages for a refused create or delete. src/web/pages/branches.ts and src/http/mcp.ts import them. In mcp.ts the only changes are one import line and the two ?? fallbacks.
  • NAME_THE_BRANCH ("give the branch a name") is the terminal's answer when a branch name is left empty. src/tui/screens/refs.ts and src/tui/screens/workspace.ts import it.

No wording changed, so pages, screens and answers are byte-for-byte the same. grep -rn under src/ finds each of the three sentences only in the new module.

I left out the issue's fourth item, "must not already exist", on purpose. It is not something the forge says. It quotes git's rule for an empty --force-with-lease expectation, and it only appears in comments in src/actions/branches.ts and src/origins/git-mirror.ts. Moving it would have left an exported constant that no code uses, and comments that point to another file instead of explaining git where they stand. Those comments are back word for word, and both files are out of the diff.

test/branch-words.test.ts checks that the module says each sentence word for word. It also reads each of the four files as text and fails if one contains a sentence or stops naming the constant it should.

bun x tsc --noEmit and bun scripts/design-lint.ts are clean, and the new test passes. On the first push I ran the branches, MCP branches, branches timing, terminal workspace and mirror suites together: 84 passed and 1 failed. The failure was a 5 s hook timeout in test/push-through.test.ts, which passes 6/6 on its own with this change and on main. After this change only the new test was rerun. That change only restored the two comment-only files and trimmed the new module and test.

To try it, run bun test test/branch-words.test.ts, then type "That branch was not created." back into src/web/pages/branches.ts and run it again; it fails.

🤖 Generated with Claude Code

Sign in to join this conversation.

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

Keyboard shortcuts

Docs