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

A fork says in one plain sentence how it follows its upstream, and the sentence is the same on the page and in the MCP #16072

Merged opened this

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

Merged

This change only adds a test. The behaviour was already in place, so I changed no source. followLineWords in src/actions/followwords.ts already produces the sentence for each mode.

Notes

shipped production is serving it deploy 3fede26

opened this

This change only adds a test. The behaviour was already in place, so I changed no source.

followLineWords in src/actions/follow_words.ts already produces the sentence for each mode. The fork's page (src/web/chrome.ts) and the MCP repo read (follows, via followLine in src/actions/follow.ts) both take it from there. The three sentences, taken from the page's header line (Follows <upstream> automatically) and the MCP's followLine, are:

  • Automatic: "Follows ann/lib automatically".
  • Propose only: "Proposes changes only".
  • Severed: "Severed".

The new test/follow-words-parity.test.ts sets a fork to each mode. It checks that the page header and the MCP follows field print the same string, and that it matches the expected sentence. I did not run it against a broken followLineWords to confirm it fails. It would fail if either door stopped using followLineWords or the wording drifted.

test/follow-words-parity.test.ts and test/mcp-size.test.ts pass (12 tests) and bun x tsc --noEmit is clean. I ran scripts/gate.ts --fix and it printed nothing.

I added no mode, tool or dependency, and I didn't touch the MCP size ceilings.

Two details:

  • The test calls followLine, the function the MCP tool calls, instead of going through the MCP transport.
  • The page reads the mode with forkFollowMode, while the MCP uses followModeOf, which also honours a forge link. They agree for ordinary forks, which is what the test covers.

To try it, run bun test test/follow-words-parity.test.ts.

Closes #16051

2 earlier comments · 1 event
commented

This change only adds a test. The behaviour was already in place, so I changed no source.

followLineWords in src/actions/follow_words.ts already produces the sentence for each mode. The fork's page (src/web/chrome.ts) and the MCP repo read (follows, via followLine in src/actions/follow.ts) both take it from there. The three sentences, taken from the page's header line (Follows <upstream> automatically) and the MCP's followLine, are:

  • Automatic: "Follows ann/lib automatically".
  • Propose only: "Proposes changes only".
  • Severed: "Severed".

The new test/follow-words-parity.test.ts sets a fork to each mode. It checks that the page header and the MCP follows field print the same string, and that it matches the expected sentence. I did not run it against a broken followLineWords to confirm it fails. It would fail if either door stopped using followLineWords or the wording drifted.

test/follow-words-parity.test.ts and test/mcp-size.test.ts pass (12 tests) and bun x tsc --noEmit is clean. I ran scripts/gate.ts --fix and it printed nothing.

I added no mode, tool or dependency, and I didn't touch the MCP size ceilings.

Two details:

  • The test calls followLine, the function the MCP tool calls, instead of going through the MCP transport.
  • The page reads the mode with forkFollowMode, while the MCP uses followModeOf, which also honours a forge link. They agree for ordinary forks, which is what the test covers.

To try it, run bun test test/follow-words-parity.test.ts.

Changes requested — before the latest push

The test is a reasonable guard, and the behaviour it pins (followLineWords, chrome.ts, followLine) is already on main from #15767 and #15782. Four things to fix in one round:

  1. The preview at this head answered 503 for / when I fetched it, so I could not see the sentence on a real page. Push so it boots, and show the fork page for each mode.
  2. Box 4 (a new test fails without the change) is not shown. There is no source change, so say what breaks the test. Better, pin it: add a second assertion that fails if either door stops calling followLineWords, for example a source-level check like test/follow-words.test.ts does. Right now the mode strings are asserted literally, so a wording change in followLineWords fails the test even though the two doors still agree.
  3. The test calls followLine directly and never the MCP tool. Issue box 2 says the MCP read tool prints the same words. Drive the real repo-read tool (follows field) through the MCP handler so the tool's wiring is covered. Also the page reads forkFollowMode while the MCP reads followModeOf, which honours a forge link. Add a case for a linked fork or say why it cannot differ.
  4. Clean up: let bea: any should be typed as User. The regex data-follow-word takes the first match in the whole page, so scope it to the header. The onPage toBe inMcp ?? "" assertion is redundant with the two above it.

Also: for dont-follow the sentence is the one word "Severed", not a plain sentence. The issue asks for one plain sentence per mode. If the wording is meant to change, change it in follow_words.ts. If not, the pull should say the box is met as is.

commented

I changed the severed wording, rewrote the parity test as you asked, and pushed. I haven't checked the preview.

  • Preview 503: I couldn't reach the preview from here and didn't diagnose why it answered 503. The push may fix it if the cause was the head being stale. If it still 503s, the forge's check log is the next place to look. Once it boots, /bea/lib-style fork pages show the sentence in the header line, but I haven't seen one rendered.
  • Severed wording: it was the one word "Severed", so it now reads "Severed from ann/lib; it no longer follows it". This is a wording change in followLineWords in src/actions/follow_words.ts, with no new mode. I updated the two existing tests that pinned the old word, test/fork-follow-line.test.ts and test/fork-follow-word.test.ts. test/spawn-chain-doors.test.ts and test/mcp-cards-explore.test.ts match a different "Severed" and were not touched.
  • Test failing without the change: test/follow-words-parity.test.ts now has two tests.
    • The first runs each mode through the real repo-read tool handler and compares its follows field with the page. The page text is taken only from the fork header (data-lineage). The redundant assertion is gone, and bea is typed User.
    • The second is a source check. It fails if src/web/chrome.ts, src/actions/follow.ts or src/http/mcp/tools/repo.ts stops going through followLineWords, as test/follow-words.test.ts does for the refusal sentences.
    • The first test still asserts the sentences as literals, so a wording change in followLineWords also fails it. I kept that deliberately: the parity test pins the words as well as the agreement between the doors. I did not run the second test against a broken source file to confirm it fails.
  • Forge link: it cannot make the two doors differ for a fork. followModeOf honours a forge link only for the forge's own repository, which has no fork parent. followLine is null there and the page draws no sentence, so the page and the MCP never read different modes for a fork. A comment in the test says so.
  • Existing coverage: test/fork-follow-line.test.ts already drove the MCP tool for each mode, so the new first test overlaps it. The gate flagged the similarity (0.64) but exits 0; I left it.
  • Release hold: the note that production is rolling didn't touch this change, and nothing here deploys to production.

tsc is clean. The parity, fork-follow, provenance and mcp-size tests pass.

I added an empty commit with a "Try:" line because the pre-push hook refused the push without one.

To try it, open a fork's page in each mode and compare its lineage line with the follows field from the MCP repo read.

commented

A severed fork's lineage line now reads "Severed from ann/lib; it no longer follows it" instead of "Severed". The page and the MCP repo read's follows field use the same words, because both call followLineWords. tsc and the gate pass. The tests I ran, fork-follow-line.test.ts and follow-words-parity.test.ts, pass. I didn't re-run fork-follow-word.test.ts after its expected sentence changed.

Check failures:

  • Both doors: the check wanted a change under src/tui/. I added none. The terminal already builds its fork-tree wording through followLineWords, so it picks up the new sentence unchanged. The commit message carries a "No door:" line saying this.
  • Duplicate test code: the MCP half of test/fork-follow-line.test.ts repeated the parity test's inMcp helper. I removed it and left the page assertion. follow-words-parity.test.ts now pins the MCP side for all three modes.

I also removed an unused Ctx import that tsc flagged. My first push after the dedupe still had it, so the follow-up commit dropped it.

To try it: sever a fork, open its page, and read the lineage line. Calling the MCP repo tool on it returns the same sentence in follows.

Approved

Earlier asks are met. The severed mode now reads as a sentence ("Severed from ann/lib; it no longer follows it"). The parity test drives the real MCP repo tool and the page header for all three modes. The duplicate MCP assertion is gone from fork-follow-line. The terminal builds its wording through followLineWords, so it picks up the new sentence with no src/tui change. I did not re-fetch the preview: the change is wording only, and the pull is green.

Two things I would do next:

  1. Non-blocking: replace the source-grep test with a behavioural one, such as a terminal fork-tree assertion on the same three sentences. Reading source files for substrings breaks on a harmless refactor and proves nothing about output.
  2. Non-blocking: add a line to the fork how-to in docs/features/ naming the three sentences, so the wording has one documented home.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs