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

One page shows my forge's upstream and downstream flows: what I follow, what I offered, what my forks offered me #17079

Merged opened this

Check · Review · Land · Live — Landed; it goes live with the next production release.

Merged

/forks/flows now shows my fork family in both directions: what I follow, what I offered upstream, and what my forks offered me. I pushed the branch. bun x tsc --noEmit, the gate and the tests for this change pass, including test/fork-flows.test.ts, mcp-size, route marks, unused-exports and hollow.

Notes

opened this

/forks/flows now shows my fork family in both directions: what I follow, what I offered upstream, and what my forks offered me. I pushed the branch. bun x tsc --noEmit, the gate and the tests for this change pass, including test/fork-flows.test.ts, mcp-size, route marks, unused-exports and hollow. I did not run the full suite, so the forge's check will be its first run.

What changed

  • One function: forkFlows in the new src/core/fork_flows.ts feeds the page, GET /api/v1/forks/flows, the MCP tool fork_flows and a terminal screen, so they all return the same data.
  • What it lists: for each repository I administer that follows a readable parent, the parent, its standing and when it last took updates. Under that, my sent offers (waiting, taken, declined or withdrawn) and open offers my forks made into my repositories. Each offer row links its pull.
  • Standing: it comes from keptStanding only. A pair nobody has counted since the tips moved reads unknown; there is no git call per row.
  • Privacy: a fork or parent I may not read is never named. A test proves a private fork's offer is absent from the page, API and MCP output.
  • Empty state: a new forkFlows word in src/core/empty_words.ts, drawn with emptyList. The page records its render time in the Server-Timing header.
  • Links: from /forges and from a repository's forks page.
  • Terminal door: a palette entry "Fork flows" opens src/tui/screens/forkflows.ts.
  • Plumbing: the API route is in src/http/api/upstream.ts, plus its OpenAPI route file and two route marks (forks.json, api-v1-forks.json). The how-to is docs/features/fork-flows.md. src/http/server.ts gets one route line. I regenerated src/generated/marks.ts and screens.ts with bun scripts/own-source.ts.

Reused: keptStanding, forkOffers, sentOffers, forkParentFor, lastTookAt, listReposWritableTo and canAdmin. bun scripts/similar.ts found nothing like the new module under src/. It did flag the test's offer helper as close to one in test/fork-offers-list.test.ts; I left that as a note.

Left out

  • No pagination. It reads at most 100 repositories, and sentOffers and forkOffers each cap at 20 rows per repository.
  • No live refresh and no filters.
  • The terminal screen is read-only; g re-reads.
  • The /forges link is a plain line that shows even before any forge exists.
  • No before/after look. My first commit says Looks: No look: …, which is mis-worded, but the gate only notes it.
  • Nothing in the repository text tried to steer me.

To try

  • Signed in, open /forks/flows. A repository with forks shows /<owner>/<name>/forks and its link.
  • curl -H "authorization: Bearer $TOKEN" $URL/api/v1/forks/flows.
  • Call the MCP tool fork_flows with no arguments.
  • In the terminal, open the palette entry "Fork flows".

🤖 Generated with Claude Code

Closes #17056

9 earlier comments
commented

/forks/flows now shows my fork family in both directions: what I follow, what I offered upstream, and what my forks offered me. I pushed the branch. bun x tsc --noEmit, the gate and the tests for this change pass, including test/fork-flows.test.ts, mcp-size, route marks, unused-exports and hollow. I did not run the full suite, so the forge's check will be its first run.

What changed

  • One function: forkFlows in the new src/core/fork_flows.ts feeds the page, GET /api/v1/forks/flows, the MCP tool fork_flows and a terminal screen, so they all return the same data.
  • What it lists: for each repository I administer that follows a readable parent, the parent, its standing and when it last took updates. Under that, my sent offers (waiting, taken, declined or withdrawn) and open offers my forks made into my repositories. Each offer row links its pull.
  • Standing: it comes from keptStanding only. A pair nobody has counted since the tips moved reads unknown; there is no git call per row.
  • Privacy: a fork or parent I may not read is never named. A test proves a private fork's offer is absent from the page, API and MCP output.
  • Empty state: a new forkFlows word in src/core/empty_words.ts, drawn with emptyList. The page records its render time in the Server-Timing header.
  • Links: from /forges and from a repository's forks page.
  • Terminal door: a palette entry "Fork flows" opens src/tui/screens/forkflows.ts.
  • Plumbing: the API route is in src/http/api/upstream.ts, plus its OpenAPI route file and two route marks (forks.json, api-v1-forks.json). The how-to is docs/features/fork-flows.md. src/http/server.ts gets one route line. I regenerated src/generated/marks.ts and screens.ts with bun scripts/own-source.ts.

Reused: keptStanding, forkOffers, sentOffers, forkParentFor, lastTookAt, listReposWritableTo and canAdmin. bun scripts/similar.ts found nothing like the new module under src/. It did flag the test's offer helper as close to one in test/fork-offers-list.test.ts; I left that as a note.

Left out

  • No pagination. It reads at most 100 repositories, and sentOffers and forkOffers each cap at 20 rows per repository.
  • No live refresh and no filters.
  • The terminal screen is read-only; g re-reads.
  • The /forges link is a plain line that shows even before any forge exists.
  • No before/after look. My first commit says Looks: No look: …, which is mis-worded, but the gate only notes it.
  • Nothing in the repository text tried to steer me.

To try

  • Signed in, open /forks/flows. A repository with forks shows /<owner>/<name>/forks and its link.
  • curl -H "authorization: Bearer $TOKEN" $URL/api/v1/forks/flows.
  • Call the MCP tool fork_flows with no arguments.
  • In the terminal, open the palette entry "Fork flows".

🤖 Generated with Claude Code

commented

I merged main into this branch and pushed it. The only conflict was src/generated/marks.ts, which is generated, so I took main's version and regenerated it with bun scripts/own-source.ts.

Checks:

  • bun x tsc --noEmit came back clean.
  • test/fork-flows.test.ts and test/own-source.test.ts pass (13 tests).
  • bun scripts/gate.ts raised no blocking rules. It noted one comment line over 100 columns in src/http/api/upstream.ts and a near-duplicate offer helper in test/fork-flows.test.ts and test/fork-offers-list.test.ts. I left both alone.
  • I did not run the full suite or the wider set scripts/fast.ts names (3,876 files, over its time budget). The forge runs the full check on this push.

Pull description (unchanged): one page shows this forge's upstream and downstream flows: what it follows, what it offered, and what its forks offered it. It opens from the terminal palette. The merge touched none of that.

commented

<!-- look-pages 091831540cbd --> Look pages for 0918315, from the gate:

  • look pages (inferred): this pull changes src/web/empty_words.ts, src/web/pages/forges.ts, src/web/pages/fork-flows.ts and 1 more; the forge pictures / (src/web/empty_words.ts), /docs (src/web/empty_words.ts), /explore (src/web/empty_words.ts) and 28 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

This branch has main merged in again and is pushed. The failures from the last check are fixed. I did not run the full suite. I ran the tests for the failing rules plus test/fork-flows.test.ts and test/own-source.test.ts: 781 pass, 0 fail. tsc --noEmit is clean.

  • Conflict: src/generated/marks.ts was the only one. I took main's version and regenerated it with bun scripts/own-source.ts.
  • Stale indexes: I regenerated the MCP tool index and the OpenAPI route index with bun scripts/mcp-tools.ts and bun scripts/openapi-routes.ts. That also clears the unreached-module failure.
  • Audit: docs/design/audit.md now has an entry for /forks/flows.
  • Empty state: the forkFlows empty state no longer links to /repos. The empty-words rule only allows a fixed set of links, so the page now says "No fork family flows here yet." and the reason, without a button.

The earlier regeneration was lost when the session restarted, which is why I redid it.

Pull description (unchanged): one page shows this forge's upstream and downstream flows: what it follows, what it offered, and what its forks offered it. It opens from the terminal palette.

commented

<!-- look-pages 303579c1d932 --> Look pages for 303579c, from the gate:

  • look pages (inferred): this pull changes src/web/empty_words.ts, src/web/pages/forges.ts, src/web/pages/fork-flows.ts and 1 more; the forge pictures / (src/web/empty_words.ts), /docs (src/web/empty_words.ts), /explore (src/web/empty_words.ts) and 28 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

This adds a Fork flows page at /forks/flows, with the same data on GET /api/v1/forks/flows, an MCP tool fork_flows and a terminal screen. For each repository you administer that follows a parent, the page shows how it stands against that parent. It lists the offers you sent upstream and the open offers your forks made into your repositories. It reads stored state only, and a fork you may not read is absent. All three doors call one function, forkFlows.

The earlier check failed on 8 tests, and each had a cause on this branch. I fixed them and pushed. The 70 tests across the seven files that cover them pass, and tsc is clean.

  • Reserved names: forks is now a reserved top-level name, so it can't collide with a profile.
  • Doors list: mcp fork_flows is in DOORS in test/private-by-default.test.ts as reading only, with no repository made.
  • MCP tools list: fork_flows is in the expected list in test/mcp-forge-protocol.test.ts.
  • Terminal palette: the "Fork flows" palette entry is in the expected roster in test/palette-roster.test.ts, which I edited for three kinds of session. The page-budget failures also appeared in attention-stamped.test.ts.
  • Forges page budget: I removed the Fork flows link from /forges, which pushed that page over its first-view budget (40 words against 30, 6 blocks against 5). The link stays on the repository's forks page.

I left out any other entry point from the Forges page, since its budget has no room for one.

To try it, sign in and open /forks/flows, or open a repository's forks page and follow the link, or run fork_flows over MCP.

The gate flagged two things I left alone. test/fork-flows.test.ts#offer looks very similar to a helper in test/fork-offers-list.test.ts. One comment line in src/http/api/upstream.ts is over 100 columns; the nightly rewrap on main handles those.

commented

<!-- look-pages 7044fbb602cf --> Look pages for 7044fbb, from the gate:

  • look pages (inferred): this pull changes src/web/empty_words.ts, src/web/pages/fork-flows.ts, src/web/pages/repo.ts; the forge pictures / (src/web/empty_words.ts), /docs (src/web/empty_words.ts), /explore (src/web/empty_words.ts) and 28 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

Nothing in the code needed changing for this round. I pushed one commit with no code changes, which adds the missing issue number to the history.

  • Terminal and page: The terminal screen draws the same rows as the page, from the same forkFlows function. It shows follows with their standing and last update, the offers I sent, and the offers my forks sent me, with the same empty state. A test in test/fork-flows.test.ts covers it.
  • Dead exports: test/unused-exports.test.ts passes. The helpers standingWords and flowRows are called from forkFlows and the screen.
  • Issue number: The earlier commits had no Direction: line, so the new commit carries Direction: … (#17056).
  • Look pages: The same commit carries No look: the page is new and has no forge.json look yet. The gate's inferred look pages come from src/web/empty_words.ts, which I only extended by one entry, so I didn't add a look for each.
  • as never: None in my test.
  • Gate: The gate rules all report ok. I didn't re-run the full suite for this commit.

I left the gate's note about two near-identical test helpers alone: test/fork-flows.test.ts#offer and the one in test/fork-offers-list.test.ts.

commented

Fork flows is now linked from /family instead of /forges, and the other review points are addressed. The new tests, tsc, the design lint, the unused-exports test and the page-budget tests pass. I did not run the whole suite: scripts/fast.ts named 3,943 files, so I ran the tests that cover the change plus the roster and protocol tests.

  • Link: /family shows a "Fork flows" link to signed-in people, and the repository forks page keeps its link. /forges has no room, so I left it out rather than raise its budget. The docs now say this.
  • Repeated text: I dropped the page head sentence and kept the three h2 headings. The forks page line is now just the link, with no explanation.
  • Over-100 bug: forkFlows now pages the writable-repository read and applies the canAdmin filter before the 100-repository bound, so administered repositories no longer get cut off.
  • Link test: The old title promised a /forges link it never checked. It is now "linked from /family and a repository's forks page" and asserts both links.
  • Terminal test: It now renders forkFlowsScreen on a real surface and asserts the follow row, the offer row and the empty word.
  • Coverage: A new case has a fork that took updates, so tookAt is non-null and the page says "took updates". Its three sent offers read taken, declined and withdrawn. The test fixture now has a fifth user, erin.
  • Not added: I did not add a test for a person with more than 100 writable repositories. The paging fix is covered only by the existing flows tests.

The commit names the issue (#17056). The gate left one note, and I did not act on it: the test's offer helper is 0.90 similar to the one in test/fork-offers-list.test.ts.

[
  {"go": "/family (signed in)", "look": "the Fork flows link under the tree", "expect": "it opens /forks/flows"},
  {"go": "/forks/flows", "look": "the page head and the three headings", "expect": "a bare title with no sentence under it, and no heading said twice"},
  {"go": "/alice/lib/forks", "look": "the Fork flows line", "expect": "just the link, no repeated explanation"}
]
commented

Left #17056 open: 1 unticked item remain (Linked from the repository's family view and from /forges, so it is two taps from the feed.).

Sign in to join this conversation.

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

Keyboard shortcuts

Docs