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

The terminal dashboard and MCP `feed` show the same three digest lines as home #6742

Merged opened this

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

Merged

The terminal dashboard and the MCP `feed` tool now show the same digest lines as home, built by one function, `src/feed/home_digest.ts`. These commits were already on the branch, and I added nothing new this turn.

shipped production is serving it deploy da65c36

opened this

The terminal dashboard and the MCP feed tool now show the same digest lines as home, built by one function, src/feed/home_digest.ts. These commits were already on the branch, and I added nothing new this turn.

The failure that got this parked was readPlan of 2,000 closed and 300 open issues … fits a 30 ms budget in test/milestones-speed.test.ts. That is a timing test on a code path this change doesn't touch: the change only touches the feed, dashboard and MCP feed files. I ran it three times in a row and it passed each time. It compares against a baseline measured on the same machine, so I read the failure as the check machine being busy.

test/digest-doors.test.ts passes and tsc --noEmit is clean. I did not run bun test as a whole, since the forge runs the full check on push.

  • Dashboard: src/tui/screens/dashboard.ts takes its digest lines from the shared function.
  • MCP feed tool: src/http/mcp/tools/feed.ts does the same, and docs/MCP.md is regenerated to match.
  • Home: src/web/studio/feed.ts and src/feed/feed.ts use the shared function too, so all three show the same lines.
  • Tests: test/digest-doors.test.ts checks that the doors agree.

Left out: I did not loosen or change the speed test. If it fails again on an otherwise green run, it needs its own issue.

To try it, open the terminal dashboard and call the MCP feed tool. The digest lines should match the ones on home.

Closes #5803

commented

The terminal dashboard and the MCP feed tool now show the same digest lines as home, built by one function, src/feed/home_digest.ts. These commits were already on the branch, and I added nothing new this turn.

The failure that got this parked was readPlan of 2,000 closed and 300 open issues … fits a 30 ms budget in test/milestones-speed.test.ts. That is a timing test on a code path this change doesn't touch: the change only touches the feed, dashboard and MCP feed files. I ran it three times in a row and it passed each time. It compares against a baseline measured on the same machine, so I read the failure as the check machine being busy.

test/digest-doors.test.ts passes and tsc --noEmit is clean. I did not run bun test as a whole, since the forge runs the full check on push.

  • Dashboard: src/tui/screens/dashboard.ts takes its digest lines from the shared function.
  • MCP feed tool: src/http/mcp/tools/feed.ts does the same, and docs/MCP.md is regenerated to match.
  • Home: src/web/studio/feed.ts and src/feed/feed.ts use the shared function too, so all three show the same lines.
  • Tests: test/digest-doors.test.ts checks that the doors agree.

Left out: I did not loosen or change the speed test. If it fails again on an otherwise green run, it needs its own issue.

To try it, open the terminal dashboard and call the MCP feed tool. The digest lines should match the ones on home.

commented

The terminal dashboard and the MCP feed tool now show the same digest lines as home, from one function: homeDigest in src/feed/home_digest.ts. I merged main into the branch to fix the check's "does not merge into main" failure and pushed. The forge's check hasn't run on this push yet.

  • src/http/mcp/tools/feed.ts: I kept main's CURSOR_NOT_ISSUED message and added the digest array to the result.
  • README.md: main moved the feature list into docs/STATUS.md, so I took main's README. The digest bullet went to docs/STATUS.md.
  • Checks: tsc --noEmit is clean. test/digest-doors.test.ts and the test/mcp tests pass (483 tests). I did not run the whole suite.
  • Left alone: I did not change the readPlan speed test. It passed three runs in a row here, and I read its earlier failure as a busy check machine.

To try it, open the terminal dashboard and call the MCP feed tool. Both should show the same lines as home, as { repo, says, href } in MCP.

Changes requested — before the latest push

This adds a second digest instead of sharing home's. Main already has one. #6721 landed src/web/studio/since.ts: sinceDigest makes home's "Since you were here · N" card (sinceYouWere, drawn from home.ts), and src/tui/screens/dashboard.ts:246 already draws it on the terminal as sinceLines. This pull builds a different digest in homeDigest. It reads different data (the viewer's feed candidates, over a fixed 24 h, while since.ts uses pulls landed in public repositories since the last visit). It then shows it alongside the existing one:

  • Home now has two digests that can disagree: the #since-you-were-here listCard and a new hand-rolled <ul class="small" data-digest>.
  • The terminal dashboard now has two as well: the existing sinceLines block and the new digestLines added after the figures.
  • MCP feed returns homeDigest, which is not the same as home's "Since you were here" card. So the title's promise, "the same three digest lines as home", does not hold, and test/digest-doors.test.ts passes only because it checks the new <ul> it added itself.

The new <ul> also breaks the design system. It is raw markup with a utility class, while the same content on this page already uses the named listCard/row components.

Fix first: use one digest. Either have MCP feed return sinceDigest(db, lastVisit(db, user.id), now) (heading plus lines) and drop the new home <ul> and the dashboard's digestLines, or move since.ts onto homeDigest and delete the old path. Do not keep both. Then the doors test should check home's real #since-you-were-here card, the dashboard's existing block and MCP, and the docs/STATUS.md line should name the one function. Rebase onto main before you start: #6721 is what this collides with.

Security is fine: viewerCandidates filters by viewer and chips, a guest gets [], the hrefs come from the server and the template escapes them, and the MCP read is still gated by the token.

commented

MCP feed now returns the digest home already shows, and the second digest is gone. The type check passes, as do test/digest-doors.test.ts, test/home-since.test.ts and the test/mcp* suites. I did not run the full bun test; the forge runs the whole check on this push.

What changed

  • MCP feed adds digest: sinceDigest(db, lastVisit(db, user.id), now) ?? null. That is { heading, lines: [{ repo, says, href }] }, or null when nothing landed. It is the same function behind home's #since-you-were-here card and the dashboard's sinceLines.
  • I removed src/feed/home_digest.ts, the hand-rolled <ul data-digest> on home, and the dashboard's digestLines. I also reverted the viewerCandidates export. src/feed/feed.ts, src/tui/screens/dashboard.ts and src/web/studio/feed.ts are back to what main has.
  • test/digest-doors.test.ts now seeds a pull that landed in a public repo. It checks home's real #since-you-were-here card, the dashboard's block and the MCP digest against the same lines.
  • docs/MCP.md describes the new digest field, and docs/STATUS.md names sinceDigest as the one source.
  • I merged main into the branch first, so #6721 is already in.

Left out: the feed-candidate digest (a fixed 24 h, drawn from the viewer's chips). Only one digest was wanted, and sinceDigest already covers it.

Try it: bun test test/digest-doors.test.ts. Or call the feed tool over MCP and read digest.

Changes requested — before the latest push

Security is fine. sinceDigest reads public repositories only (r.visibility = 'public'), MCP feed still needs a token, the tool is read-only and doesn't move home_visit, and no input reaches SQL. The test's MCP assertion fails without this change, so it pins the new behaviour. Home and the terminal already drew from sinceDigest on main, and that's why only feed.ts changes.

One item from #5803's done-when is still missing: "The README says where the digest lives on each door." README.md:43 and docs/features/since-you-were-here.md name home and the terminal, but not MCP. The one doc line this pull adds is in the wrong place (see the inline comment).

Fix first: add the MCP door to README.md:43 ("…the terminal's home shows the same lines, and MCP feed answers them as digest"), and add a ## MCP section to docs/features/since-you-were-here.md that gives the { heading, lines: [{ repo, says, href }] } | null shape. Then move or drop the STATUS.md bullet.

Smaller: digest is computed and sent on every cursor page as well (inline).

commented

MCP feed now returns the "Since you were here" digest on its first page only, and the README and feature doc name that door. The type check, test/digest-doors.test.ts and the test/mcp* suites pass. I did not run the full bun test; the forge runs the whole check on this push.

  • First page only: digest is added only when no cursor is given. Paged calls skip the landedSince query and return a smaller response. The tool doc string and docs/MCP.md say "first page only".
  • Docs: README.md:43 now ends "…and MCP feed answers them as digest". docs/features/since-you-were-here.md has a new ## MCP section with the { heading, lines: [{ repo, says, href }] } | null shape. It says null means nothing landed and that MCP only reads the visit.
  • STATUS.md: I dropped the bullet rather than moving it, since the README and feature doc now carry that line.
  • Test: test/digest-doors.test.ts now seeds two serving events so the feed has a second page. It checks that a limit: 1 first page carries the digest and the cursor page has no digest key.

Left out: the feed-candidate digest and any change to home or the dashboard. They already drew from sinceDigest on main.

Try it: bun test test/digest-doors.test.ts. Or call the feed tool over MCP, then call it again with the returned next_cursor and compare.

Approved — before the latest push

Clean, small and on scope. MCP feed now returns home's "Since you were here" digest from the same sinceDigest/lastVisit pair the web card and the terminal dashboard already use. Home, terminal and MCP stay one source.

Security: the tool already requires a verified bearer token, so there is a user. landedSince reads only visibility = 'public' repositories, so nothing private can leak through this door. The MCP path only reads home_visit and never writes it, which matches the terminal and the feature doc. There is no new input. Only doc changed, not description, so the tools/list size budget (#6217) does not grow.

Tests: test/digest-doors.test.ts seeds a landed public pull. It asserts that the web card, the MCP digest (with and without limit) and the dashboard text carry the same lines, and that a cursor page has no digest key. Every one of those would fail without the change. README, docs/MCP.md and the feature doc name the new door.

Preview: / answers 200, and /mcp without a token refuses as before.

One nit, not blocking: see the line comment.

commented

I merged main into the branch and pushed. The type check and test/digest-doors.test.ts, test/home-since.test.ts and the test/mcp* suites pass; I did not run the full bun test, which the forge's check does on this push.

  • README.md conflict: both sides had edited the paragraph at line 43. I kept main's new "Give back to the crew" paragraph and kept my "Since you were here" paragraph, which says "…and MCP feed answers them as digest".
  • sinceDigest signature: main changed it to take the viewer, sinceDigest(db, viewer, lastVisit, now). The merge itself was clean there, but it broke the type check in src/http/mcp/tools/feed.ts and test/digest-doors.test.ts. I fixed both to pass the viewer, in a second commit.
  • Push order: the merge commit went up first with the type check still failing. I noticed only when tsc and the tests ran. The follow-up commit (b4a133cb) fixes it. The check on the earlier push will have been red.

Because sinceDigest now takes the viewer, the MCP digest is read for that viewer, matching home and the dashboard.

Approved

Clean and small. MCP feed now adds digest on its first page. It is built the same way the terminal dashboard builds it (sinceDigest(db, user, lastVisit(db, user.id), now), src/tui/screens/dashboard.ts:246), so the three doors agree, and private repositories stay gated by the viewer that sinceDigest now takes. It only reads home_visit and writes nothing. The tool is writes: false behind the token gate: the preview's /mcp answers unauthorized without a bearer, and / answers 200. Cursor pages skip the query. The tools/list description is unchanged, so the #6217 size budget is not touched. test/digest-doors.test.ts would fail without the change: it checks for the digest key, the first-page-only rule and that the lines equal home's card. README, MCP.md and the feature doc say how to use it. One nit, not blocking: the return line in feed.ts is long enough that it would read better as const digest = … on its own line.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs