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

The home says in one line how much is flowing up and down, and opens /forks/flows #17146

Merged opened this

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

Merged

The home now shows one line of the fork flows when the viewer has a fork family: "N offers waiting upstream · M offered to you · K forks behind". The line links /forks/flows. The new tests, test/page-budget.test.ts and test/home-no-shift.test.ts pass unchanged, and tsc and the gate are clean.

Notes

opened this

The home now shows one line of the fork flows when the viewer has a fork family: "N offers waiting upstream · M offered to you · K forks behind". The line links /forks/flows. The new tests, test/page-budget.test.ts and test/home-no-shift.test.ts pass unchanged, and tsc and the gate are clean. I did not run the full suite, only the files above.

  • Where it draws: the line sits in the home header under the "need" line, in src/web/pages/home_forks.ts, wired into src/web/pages/home_flow.ts. It is server-rendered, adds no script, and reads forkFlows (stored state only).
  • How the counts are read:
    • N counts the viewer's offers still in the waiting state.
    • M counts offers their forks made into their repositories.
    • K counts the repositories they follow whose kept standing is "behind".
  • No family, no line: with no followed parent and no offers either way, nothing is drawn, so nothing shifts.
  • Reused: forkFlows and the kept standing words. No new dependency, no module-level state, no new CSS.

Tests in test/home-fork-flows.test.ts cover four cases:

  • A fork with an offer sent shows "1 offer waiting upstream · 0 offered to you · 0 forks behind".
  • The parent's owner sees "0 offers waiting upstream · 1 offered to you".
  • A user with no family gets no line.
  • The count helper returns null when all three are empty and counts "behind N" standings.

What I left out:

  • Screenshots: the before/after light and dark screenshots are not on the pull. The sandbox can't take them, so please capture them from the preview.
  • Forks with no offers: the line also appears when the viewer has only a followed parent or only offers. A viewer whose forks have made no offers and who follows nothing gets no line. forkFlows doesn't list bare forks.
  • Door rule: the commit carries No door:. The line only links the existing terminal screen and how-to for fork flows, so I added no new TUI screen or doc.

To try it, sign in on the preview as a user who forked a repository and opened a pull upstream, then open /. The line appears under the header and links to /forks/flows. A user with no forks or offers sees no line.

[
  {"go": "/", "look": "signed in as a fork owner who opened a pull upstream: the muted line under the header", "expect": "1 offer waiting upstream · 0 offered to you · 0 forks behind, linking /forks/flows"},
  {"go": "/", "look": "signed in as the parent's owner", "expect": "0 offers waiting upstream · 1 offered to you · 0 forks behind"},
  {"go": "/", "look": "signed in as a user with no forks or offers", "expect": "no line, and the header does not shift"}
]

🤖 Generated with Claude Code

Closes #17057

11 earlier comments
commented

The home now shows one line of the fork flows when the viewer has a fork family: "N offers waiting upstream · M offered to you · K forks behind". The line links /forks/flows. The new tests, test/page-budget.test.ts and test/home-no-shift.test.ts pass unchanged, and tsc and the gate are clean. I did not run the full suite, only the files above.

  • Where it draws: the line sits in the home header under the "need" line, in src/web/pages/home_forks.ts, wired into src/web/pages/home_flow.ts. It is server-rendered, adds no script, and reads forkFlows (stored state only).
  • How the counts are read:
    • N counts the viewer's offers still in the waiting state.
    • M counts offers their forks made into their repositories.
    • K counts the repositories they follow whose kept standing is "behind".
  • No family, no line: with no followed parent and no offers either way, nothing is drawn, so nothing shifts.
  • Reused: forkFlows and the kept standing words. No new dependency, no module-level state, no new CSS.

Tests in test/home-fork-flows.test.ts cover four cases:

  • A fork with an offer sent shows "1 offer waiting upstream · 0 offered to you · 0 forks behind".
  • The parent's owner sees "0 offers waiting upstream · 1 offered to you".
  • A user with no family gets no line.
  • The count helper returns null when all three are empty and counts "behind N" standings.

What I left out:

  • Screenshots: the before/after light and dark screenshots are not on the pull. The sandbox can't take them, so please capture them from the preview.
  • Forks with no offers: the line also appears when the viewer has only a followed parent or only offers. A viewer whose forks have made no offers and who follows nothing gets no line. forkFlows doesn't list bare forks.
  • Door rule: the commit carries No door:. The line only links the existing terminal screen and how-to for fork flows, so I added no new TUI screen or doc.

To try it, sign in on the preview as a user who forked a repository and opened a pull upstream, then open /. The line appears under the header and links to /forks/flows. A user with no forks or offers sees no line.

[
  {"go": "/", "look": "signed in as a fork owner who opened a pull upstream: the muted line under the header", "expect": "1 offer waiting upstream · 0 offered to you · 0 forks behind, linking /forks/flows"},
  {"go": "/", "look": "signed in as the parent's owner", "expect": "0 offers waiting upstream · 1 offered to you · 0 forks behind"},
  {"go": "/", "look": "signed in as a user with no forks or offers", "expect": "no line, and the header does not shift"}
]

🤖 Generated with Claude Code

commented

<!-- look-pages 36d35ada9ea6 --> Look pages for 36d35ad, from the gate:

  • look pages (named): this pull changes src/web/pages/home_flow.ts, src/web/pages/home_forks.ts; a commit names /
commented

The home now shows one line of the fork flows when the viewer has a fork family: "N offers waiting upstream · M offered to you · K forks behind", linking /forks/flows. This push fixes the failing "both doors" check. I ran bun x tsc --noEmit, the gate, and test/home-fork-flows.test.ts with test/doorless.test.ts, and all pass. I did not re-run the key-binding test (test/keymap-terminal.test.ts), which the check log says is red on main too.

  • What changed: the line's helper had been in src/web/pages/, which the "both doors" rule scans for pages that need a terminal screen. It is a helper, not a page, so I moved it to src/web/studio/fork_line.ts and updated the import in home_flow.ts and the test. I did not add it to scripts/doorless-allow.json, since that list is only meant to shrink.
  • The line: it sits in the home header under the "need" line and is server-rendered with no script. It reads the counts from forkFlows (stored state only). It draws only when the viewer follows a parent or has offers either way, so with no family nothing is drawn and nothing shifts. "Forks behind" counts followed repositories whose kept standing is "behind".
  • Tests: test/home-fork-flows.test.ts covers a fork with an offer sent, the parent's owner seeing the offer received, a user with no family seeing no line, and the count helper. test/page-budget.test.ts and test/home-no-shift.test.ts passed unchanged on the earlier push. I did not re-run them after the move.
  • Left out:
    • Screenshots: the light and dark before/after screenshots are not on the pull, because the sandbox can't take them; please capture them from the preview.
    • Forks with no offers: a viewer whose forks have made no offers and who follows nothing gets no line, because forkFlows doesn't list bare forks.
    • Terminal screen and how-to: I added no new terminal screen or how-to, since the line only links to the fork flows page, which already has both.

To try it, sign in on the preview as a user who forked a repository and opened a pull upstream, then open /. The line appears under the header and links to /forks/flows.

[
  {"go": "/", "look": "signed in as a fork owner who opened a pull upstream: the muted line under the header", "expect": "1 offer waiting upstream · 0 offered to you · 0 forks behind, linking /forks/flows"},
  {"go": "/", "look": "signed in as the parent's owner", "expect": "0 offers waiting upstream · 1 offered to you · 0 forks behind"},
  {"go": "/", "look": "signed in as a user with no forks or offers", "expect": "no line, and the header does not shift"}
]

🤖 Generated with Claude Code

commented

<!-- look-pages 979e6b21d842 --> Look pages for 979e6b2, from the gate:

  • look pages (named): this pull changes src/web/pages/home_flow.ts, src/web/studio/fork_line.ts; a commit names /
commented

This pull's checks are green, and the feedback needed no code changes. The "look pages" note is satisfied: the commit says Looks: /, and bun scripts/gate.ts --explain passes all 32 rules. bun x tsc --noEmit is clean. test/home-fork-flows.test.ts, test/unused-exports.test.ts and test/hollow.test.ts all pass. I did not push, because there was nothing new to push.

The home page now shows one line about the fork flows (how much is flowing up and down). It links to /forks/flows and is drawn only when the viewer has a fork family.

  • Where it lives: the line is built in src/web/studio/fork_line.ts, a helper rather than a page, and src/web/pages/home_flow.ts calls it.
  • Terminal and how-to: no new door was needed, because the line only links to /forks/flows. That page already has its terminal screen (forkflows) and its how-to (docs/features/fork-flows.md).
  • Test inputs: the test builds real records. It has no as never.
  • Dead code: every export in fork_line.ts has a caller. The unused-exports test names two unrelated exports in src/spawn/ that are no longer dead, and it still passes.
  • Issue number: both commits cite #17057.

I left out any change to the terminal side or the docs, for the reason above.

To try it, open / signed in as a fork that offered upstream. The line links to /forks/flows.

[{"go":"/","look":"the fork flows line, signed in as a fork that offered upstream","expect":"one line of up and down counts, linking to /forks/flows; no line for a viewer with no fork family"}]

🤖 Generated with Claude Code

commented

The home now counts "forks behind" from structured state, and a page-level test proves it. I couldn't attach before/after screenshots.

  • Behind count: FollowRow has a new behindBy number, taken from the kept standing in src/core/fork_flows.ts. src/web/studio/fork_line.ts counts rows with behindBy > 0, so it no longer depends on the wording in standingWords. A diverged fork that is also behind now counts, which the old startsWith("behind") check missed. This is the same count the /forks/flows page uses.
  • Page test: in test/home-fork-flows.test.ts, a fork diverges from its parent, and the home renders "1 fork behind" for its owner. It would fail without the change.
  • Re-run after the file move: tsc, the home-fork-flows, fork-flow, page-budget and home-no-shift tests all pass. The home's first page measures about 1.3 ms warm.
  • Bare fork: that same test fork has no offers and no other repos, and the line still shows. So the line appears for any fork with a followed parent, offers or not. Only a viewer with no fork family gets no line, and that case is tested.
  • Screenshots: the sandbox can't take them, so none are attached. The look pictures for / come from the forge's own looks, which the commit names (Looks: /). The preview is at https://lab--17146--forge-trevato-apps.open-platform.sh.

To try it, open / signed in as a fork whose parent has moved on. The line should read "1 fork behind" and link to /forks/flows.

[{"go":"/","look":"the fork flows line, signed in as a fork whose parent moved on","expect":"'… · 1 fork behind' linking /forks/flows, with no layout shift; no line for a viewer with no fork family"}]

🤖 Generated with Claude Code

commented

<!-- look-pages 8841245b7700 --> Look pages for 8841245, from the gate:

  • look pages (named): this pull changes src/web/pages/home_flow.ts, src/web/studio/fork_line.ts; a commit names /
commented

The home's fork line no longer costs the page extra queries for people without forks. That cost was behind two of the four failures, and both tests now pass here. I couldn't reproduce the other two, so I didn't change anything for them.

  • Cause: every home render called forkFlows, which scans the viewer's repositories and does per-repo work. That pushed the home's statement count from 38 to 88 in the N+1 test, and above its limit of 70 (148) in test/home-200.test.ts.
  • Fix: a new hasForkFamily in src/core/repos.ts is one query: does the viewer write any repo that is a fork or has one? src/web/studio/fork_line.ts runs it first and returns no line when the answer is no. Only viewers with a fork family pay for the full read. These passed:
    • home-200
    • surfaces-adversarial
    • home-fork-flows
    • fork-flows
    • tsc --noEmit
  • MCP test: "the MCP tool answers the same data" passes for me, and this change doesn't touch the MCP tool. I suspect a timing race: forks are followed in the background, so a fork's standing can change between the two reads the test compares. I haven't confirmed that, and I haven't fixed it.
  • Page-bytes test: "the page's own bytes are held" lives in test/talk-page.test.ts. The check log says that file is red on main too, so I left it alone.
  • Gate: it flagged hasForkFamily as 0.66 similar to closedByReview. I left it, because the two do different things and the gate only asked "one implementation?".

To try it, open / as someone with no forks. The line is absent and the page runs no extra statements. As a fork whose parent moved on, the line still reads "1 fork behind".

[{"go":"/","look":"signed in with no forks, then as a fork behind its parent","expect":"no fork line for the first; '1 fork behind' linking /forks/flows for the second"}]

🤖 Generated with Claude Code

commented

Nothing changed on this round, and I pushed nothing. The look-pages note is the same gate message as before, now for the older commit 8841245. It is a note, not a failure, and the pull's later commits satisfy it with Looks: /.

The four recurring refusals are met on the current head, d70577f:

  • Both doors: the line only links /forks/flows, which already has its terminal screen (forkflows) and its how-to (docs/features/fork-flows.md). The commits say No door: … with that reason. The gate's both-doors rule passes.
  • Real test input: test/home-fork-flows.test.ts has no as never. It builds the records with full fields, including behindBy, and tsc --noEmit is clean.
  • Dead code: forkCounts, forkFlowsLine and hasForkFamily each have a caller. test/unused-exports.test.ts passes, apart from two unrelated src/spawn/ exports it says are no longer dead.
  • Issue named: every commit cites #17057.

Still open from the last check:

  • MCP flake: "the MCP tool answers the same data" passed on my runs, but failed in the forge's check. I suspect a timing race with background fork-following, and I haven't fixed it.
  • Talk page: the page-bytes test in test/talk-page.test.ts is red on main too, so it isn't this pull's.
  • Screenshots: none are attached. The sandbox can't take them.
commented

<!-- look-pages d70577f24f5e --> Look pages for d70577f, from the gate:

  • look pages (named): this pull changes src/web/pages/home_flow.ts, src/web/studio/fork_line.ts; a commit names /
commented

I changed nothing and pushed nothing. I found no failure in this pull that I can reproduce.

  • Failures that are red on main too: the check log itself says these also fail on main at cec8b4d and doesn't count them against this pull. They cover talk-phone, talk-pane-bar, talk-page, phone-targets, guest-pull, mcp-flow-drift-update and runner-adopt. My four commits don't touch any of those areas. The pull only adds the home fork line, hasForkFamily in src/core/repos.ts, and a behindBy field in src/core/fork_flows.ts, with test/home-fork-flows.test.ts.
  • The one failure the check did count: test/contribute-no-forge.test.ts, which the log says is green on main in 3 runs. It passes here in all three runs I did: 11 of 11 each time. It also passes in the same process as test/guest-pull.test.ts and test/home-fork-flows.test.ts. The guest-pull tests fail locally in that run, as they do on main.
  • Likely cause: I think the contribute-no-forge failure was load flakiness on shard 43. That shard also holds the guest-pull tests, which are red on main, and the contribute-no-forge failures were all quick ones (about 35 ms). That is a guess. I couldn't see the failure message from the log.

If the check red-flags this test again, I'd need the assertion text from the log to go further.

commented

Left #17057 open: 1 unticked item remain (Before/after screenshots in light and dark on the pull.).

Sign in to join this conversation.

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

Keyboard shortcuts

Docs