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

A fork's page says in one sentence how far it is from its upstream and what following would do #14477

Merged opened this

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

Merged

A fork's standing line now reads as one sentence, for example "3 changes behind a/b; following will apply 3 changes." or "Up to date with a/b; following has nothing to apply." I ran the fork-standing and standing-live tests, bun test test/mcp-size.test.ts and four other fork and MCP suites, bun x tsc --noEmit, the desi…

Notes

shipped production is serving it deploy 4ec2c16

opened this

A fork's standing line now reads as one sentence, for example "3 changes behind a/b; following will apply 3 changes." or "Up to date with a/b; following has nothing to apply."

I ran the fork-standing and standing-live tests, bun test test/mcp-size.test.ts and four other fork and MCP suites, bun x tsc --noEmit, the design lint and the gate. All pass. I did not run the full suite; the forge's check does.

  • Sentence: driftWords in src/actions/follow_words.ts builds it from the ahead and behind counts and the follow mode. Each mode says something different when behind:
    • take-updates says it will apply or merge them.
    • tell-me says nothing is applied until you take them.
    • dont-follow says nothing will be applied.
  • Cached drift only: followWords in src/actions/follow.ts reads the existing drift cache (driftOfForks), so there is no new git walk on the page. When git can't give a count, or the viewer can't read the parent, the sentence says so rather than guessing, and the parent isn't named.
  • Page: the standing line in src/web/pages/fork-standing.ts shows the sentence in place of the old "Sends offers to X" line, still followed by "· last took …" when there is one.
  • Answers: MCP forks and GET /api/v1/repos/:owner/:name/forks each carry a top-level words, null when the repo is not a fork.
  • Mode names: the mode's lead words ("Takes updates from", "Sends offers to") no longer appear on the page. The MCP line and the terminal still say them.
  • Tests: test/fork-standing-line.test.ts covers up to date, behind, ahead, diverged, each follow mode and unknown drift. A second test checks that the page, MCP and API say the same sentence. I changed the expected text in test/fork-standing-line.test.ts and test/standing-live.test.ts for the new page wording. Both had asserted the old line.
  • Docs: docs/FOLLOWING.md has a short section on it.

What I chose not to do: the following MCP tool and API already return a words field with different content, the sync action's words. A test asserts on it, so I left it and put the new sentence on the forks answers instead.

To try it: open a fork's page, for example /bob/lib, and read the line under its head. Then call MCP forks or the forks API for the same repo and compare words.

I added an empty commit whose message starts with Try: because the pre-push hook asked for one.

Closes #14462

6 earlier comments · 1 event
commented

A fork's standing line now reads as one sentence, for example "3 changes behind a/b; following will apply 3 changes." or "Up to date with a/b; following has nothing to apply."

I ran the fork-standing and standing-live tests, bun test test/mcp-size.test.ts and four other fork and MCP suites, bun x tsc --noEmit, the design lint and the gate. All pass. I did not run the full suite; the forge's check does.

  • Sentence: driftWords in src/actions/follow_words.ts builds it from the ahead and behind counts and the follow mode. Each mode says something different when behind:
    • take-updates says it will apply or merge them.
    • tell-me says nothing is applied until you take them.
    • dont-follow says nothing will be applied.
  • Cached drift only: followWords in src/actions/follow.ts reads the existing drift cache (driftOfForks), so there is no new git walk on the page. When git can't give a count, or the viewer can't read the parent, the sentence says so rather than guessing, and the parent isn't named.
  • Page: the standing line in src/web/pages/fork-standing.ts shows the sentence in place of the old "Sends offers to X" line, still followed by "· last took …" when there is one.
  • Answers: MCP forks and GET /api/v1/repos/:owner/:name/forks each carry a top-level words, null when the repo is not a fork.
  • Mode names: the mode's lead words ("Takes updates from", "Sends offers to") no longer appear on the page. The MCP line and the terminal still say them.
  • Tests: test/fork-standing-line.test.ts covers up to date, behind, ahead, diverged, each follow mode and unknown drift. A second test checks that the page, MCP and API say the same sentence. I changed the expected text in test/fork-standing-line.test.ts and test/standing-live.test.ts for the new page wording. Both had asserted the old line.
  • Docs: docs/FOLLOWING.md has a short section on it.

What I chose not to do: the following MCP tool and API already return a words field with different content, the sync action's words. A test asserts on it, so I left it and put the new sentence on the forks answers instead.

To try it: open a fork's page, for example /bob/lib, and read the line under its head. Then call MCP forks or the forks API for the same repo and compare words.

I added an empty commit whose message starts with Try: because the pre-push hook asked for one.

commented

<!-- look-pages a4940f576694 --> Look pages for a4940f5, from the gate:

  • look pages (inferred): this pull changes src/web/pages/fork-standing.ts; the forge pictures /settings/crew (src/web/pages/fork-standing.ts), /settings/grants (src/web/pages/fork-standing.ts), /preview-admin/sample (src/web/pages/fork-standing.ts) and 3 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

The gate failure is fixed: the local gate now passes, and the tests I re-ran pass. I have not seen the forge's check run on the new push. The gate's "both doors" rule asked for the terminal to show what the page shows, and for a how-to under docs/features/, so I added both.

  • Terminal: the forks screen (src/tui/screens/forks.ts) now shows the same one-sentence standing as the page. That replaces its old "Takes updates from X · N behind" line, so the redundant "N behind" suffix is gone.
  • How-to: docs/features/fork-standing.md. That triggered a second gate rule, "pipeline first", so I added a Direction: line in an empty commit naming #14462.
  • Tests: test/fork-standing-line.test.ts now expects the new sentence in the terminal.
  • Checks: bun x tsc --noEmit is clean and test/fork-standing-line.test.ts passes. I did not re-run test/mcp-size.test.ts or the other forks suites after this change.

What changed overall (pull description): a fork's standing line says how far it is from its parent and what its follow mode will do, in one sentence, for example "3 changes behind a/b; following will apply 3 changes." or "Up to date with a/b; following has nothing to apply."

  • Where it's said: the same sentence appears on the fork's page (followed by "· last took …" when there is one) and on the terminal's forks screen. MCP forks and GET /api/v1/repos/:owner/:name/forks carry it as a top-level words field, null for a non-fork.
  • Built from cached drift: driftWords in src/actions/follow_words.ts builds it and followWords in src/actions/follow.ts reads the existing drift cache, so there is no new git walk. When the drift is unknown or the parent is unreadable, the sentence says so and doesn't name the parent.
  • Not touched: the following MCP tool and API already return a words field with different content, the sync action's words, and a test asserts on it. I left it alone.
  • Tests: test/fork-standing-line.test.ts covers up to date, behind, ahead, diverged, each follow mode and unknown drift, plus a check that the page, MCP and API say the same string. docs/FOLLOWING.md and the new docs/features/fork-standing.md describe it.
  • To try it: open a fork's page (e.g. /bob/lib), or press f in the terminal, or call MCP forks and compare words.
commented

<!-- look-pages 28b37887b018 --> Look pages for 28b3788, from the gate:

  • look pages (inferred): this pull changes src/web/pages/fork-standing.ts; the forge pictures /settings/crew (src/web/pages/fork-standing.ts), /settings/grants (src/web/pages/fork-standing.ts), /preview-admin/sample (src/web/pages/fork-standing.ts) and 3 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

A fork's page now says in one sentence how far it is from its parent and what its follow mode will do, for example "3 changes behind a/b; following will apply 3 changes." I fixed the three failures this push caused. The two flaky failures passed on re-run here, and I did not run the whole suite.

What changed since the red check

  • Feature note: docs/features/fork-standing.md named a topic, "Forks and following", that is not a heading of docs/features/README.md. It now sits under "Your apps". That cleared the three feature-note tests (test/feature-front-matter.test.ts and two in test/feature-orphans.test.ts).
  • Terminal forks screen: test/fork-follow-word.test.ts still expected the old "· 1 behind" line. The screen now shows the standing sentence, so I updated that assertion. The old expectation was out of date, not the code.
  • Forks API: GET /api/v1/repos/:owner/:name/forks now returns a words field, null when the viewer can read no fork. I added words: null to the expected body in test/fork-counts.test.ts.

Flaky failures

  • require-review refuses the merge until the head is approved and needsYouCard does not cost more as agent pulls span more distinct repos failed in shards. The forge's main-compare did not name them as red on main. test/surfaces-adversarial.test.ts and test/tui-workflows.test.ts pass here (21 pass, 0 fail), so I treated them as load flakes and left them alone.

Checks run

  • The four fixed test files pass, 24 tests.
  • tsc --noEmit is clean.
  • scripts/gate.ts --fix found only a long comment in src/http/api/upstream.ts, which it leaves to the nightly rewrap on main.

To try it: open a fork's page, such as /bob/lib, and read the line under its head.

🤖 Generated with Claude Code

commented

I changed no code for this feedback. I pushed one empty commit that carries a No look: line, which the gate lets override its inferred look pages.

I disagree with the inferred look pages. The gate listed /settings/crew, /settings/grants and /preview-admin/sample because their routes import src/web/pages/fork-standing.ts. That module only builds the one sentence under a fork's head, shown on a fork's own page (for example /bob/lib). I think none of the inferred pages draws that sentence, and I did not render them to check. The forge's seeded pictures contain no fork, so a look at any of them would not show the change. The commit message says this.

If you want a picture of the fork page, name a seeded fork path with a Looks: <path> line and I'll add it.

The feature is unchanged: a fork's page says how far it is from its parent and what its follow mode will do about it. The terminal's forks screen, MCP forks and GET /api/v1/repos/:owner/:name/forks carry the same sentence. To try it, open a fork's page, such as /bob/lib, and read the line under its head.

🤖 Generated with Claude Code

Changes requested — before the latest push

Sentence, words on MCP and API, and the docs are in the right shape, and no security finding: followWords reads only what the viewer may read and does not name an unreadable parent. Changes needed, all in one round:

  1. First: the page tests no longer prove the follow modes. Three modes now assert the same 'Up to date' string, and the cross-door test is a loose regex. Use real drift (ahead/behind) in the page and door tests so each mode and the diverged case would fail if wrong.
  2. The terminal lost 'last took' (the old line came from followStanding); the page keeps it. Put it in one place so both doors agree.
  3. The unknown-drift sentence still leads with 'Sends offers to', which is the mode jargon the pull removed elsewhere (principle 8).
  4. Terminal: the sentence is up to ~110 characters and truncate cuts the part that matters on an 80-column screen. Wrap it or shorten it.
  5. Duplicate dont-follow branches in driftWords.

The preview was not exercised beyond reading the diff; the forge's pictures show no fork page, so the change is not visible in them.

commented

All five points are addressed and pushed. The tests I ran pass and tsc is clean. I did not run the full suite. The forge runs it on the push.

  1. Tests on real drift. A new test commits to alice/lib, so bob/lib is 2 ahead and 1 behind. It asserts one exact string for each of the three modes on the page, in MCP forks and in the API words. The driftWords unit test now has distinct strings per mode and for the unknown-drift case. The loose regex is gone.
  2. Last took in one place. followWords in src/actions/follow.ts now appends "Last took 2 days ago." to the sentence. The page no longer builds it, and the terminal, MCP and API all say it. The wording moved from "· last took" to a trailing sentence, so I updated test/standing-live.test.ts and test/fork-standing-line.test.ts to match.
  3. Unknown drift. The "Sends offers to" lead is gone. It now reads "Not known how far this is from a/b; following will wait for you to take it." The other two modes have their own plain clauses.
  4. Terminal width. The mode word is dropped, since the sentence already says it. The sentence wraps over up to two rows, so the follow effect and last take are not cut. At 80 columns it asserts the full sentence is on screen.
  5. Duplicate branch. The two dont-follow returns in driftWords are folded into one. Along the way I shortened the other lines too:
    • "and the changes can be offered up" is now "following has nothing to apply."
    • "a conflict goes to the crew" is now "or open an issue on a conflict".

The look-pages note from earlier still stands: the fork page is not among the forge's seeded pictures, so the change is not visible there.

🤖 Generated with Claude Code

Approved

All five earlier asks are met. The duplicate dont-follow branch is folded. The jargon is gone. Last took is built once in followWords and used by the page, terminal, MCP and API. The terminal wraps onto two rows. Tests assert exact strings per mode on real drift. No new findings on the changed lines. Non-blocking: followWords re-reads drift that the API route already read; it is cached, so the cost is small.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs