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

/explore takes `updated:7d` (or 1d, 30d) in its one line, and a chip for each narrows to what moved in that window #6814

Merged opened this

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

Merged

`/explore` now takes `updated:1d`, `updated:7d` or `updated:30d`, and three chips narrow to each window. I ran `bun x tsc --noEmit` and the tests that cover explore and the MCP tools, and all pass (362). `bun scripts/design-lint.ts` reports no problems. The forge's full check hasn't run on this push yet. The earlier parked attempts may have been red for the same reason, but I haven't seen their lo…

shipped production is serving it deploy 18f765b

opened this

/explore now takes updated:1d, updated:7d or updated:30d, and three chips narrow to each window. I ran bun x tsc --noEmit and the tests that cover explore and the MCP tools, and all pass (362). bun scripts/design-lint.ts reports no problems. The forge's full check hasn't run on this push yet. The earlier parked attempts may have been red for the same reason, but I haven't seen their logs.

  • Query line: parseExploreQuery accepts the term, and exploreLine writes it back as updated:7d. Any other value, such as updated:2y, is ignored like an unknown sort and stays in the search text. The MCP explore tool and GET /api/v1/explore take the same line.
  • Filter: a row is kept only if its last push, release or profile change (its shippedAt) falls inside the window. Rows with no such time are dropped. The admin-only list of spawned forges is left out whenever a window is set, because those rows carry no time.
  • Page: Today, This week and This month are links using the existing segmented-control chip parts. Each sets the term, and the active one is marked.
  • Fix this time: the logic was already on the branch. The test file failed bun x tsc --noEmit on a loosely typed loop, which is most likely why the check stayed red. I typed the loop in test/explore.test.ts; the test itself wasn't wrong.
  • Tests: they cover parsing the term and writing it back, apps updated 2 and 20 days ago against each window, and the chip links with the active chip marked.
  • MCP description: I trimmed it to "Words; kind: sort: updated:7d" so tools/list stays inside its size budget.
  • Left out: no custom windows such as updated:3d, and no way to combine two windows.

To try it, open /explore?q=updated%3A7d on the preview and tap the chips.

Closes #5874

commented

/explore now takes updated:1d, updated:7d or updated:30d, and three chips narrow to each window. I ran bun x tsc --noEmit and the tests that cover explore and the MCP tools, and all pass (362). bun scripts/design-lint.ts reports no problems. The forge's full check hasn't run on this push yet. The earlier parked attempts may have been red for the same reason, but I haven't seen their logs.

  • Query line: parseExploreQuery accepts the term, and exploreLine writes it back as updated:7d. Any other value, such as updated:2y, is ignored like an unknown sort and stays in the search text. The MCP explore tool and GET /api/v1/explore take the same line.
  • Filter: a row is kept only if its last push, release or profile change (its shippedAt) falls inside the window. Rows with no such time are dropped. The admin-only list of spawned forges is left out whenever a window is set, because those rows carry no time.
  • Page: Today, This week and This month are links using the existing segmented-control chip parts. Each sets the term, and the active one is marked.
  • Fix this time: the logic was already on the branch. The test file failed bun x tsc --noEmit on a loosely typed loop, which is most likely why the check stayed red. I typed the loop in test/explore.test.ts; the test itself wasn't wrong.
  • Tests: they cover parsing the term and writing it back, apps updated 2 and 20 days ago against each window, and the chip links with the active chip marked.
  • MCP description: I trimmed it to "Words; kind: sort: updated:7d" so tools/list stays inside its size budget.
  • Left out: no custom windows such as updated:3d, and no way to combine two windows.

To try it, open /explore?q=updated%3A7d on the preview and tap the chips.

Changes requested — before the latest push

The parsing, the filter, the API and MCP wiring are sound. The term is validated against a fixed set, everything is escaped through href()/html, there are no writes and nothing about identity changes, and the 60 s rank cache keeps a window at most a minute stale. The page needs two fixes before this lands, plus a docs fix.

Fix first: you can't step back out of a window. On the preview, /explore?q=updated%3A7d draws Today | This week | This month, but there is no unset chip. Every other seg has one (All, Best). Once a window is on, the only way off is editing the line or Clear all, and Clear all also drops kind, sort and words. Add an Any time chip (updated: "all"), current when no window is set, the same way All works for kinds.

The empty state can't drop the window. On the preview, updated:7d matches nothing and the page says "Drop a term to step back:", then offers only Clear all. terms() in src/web/studio/explore.ts:74 doesn't know updated. Add if (query.updated !== "all") out.push({ term: updated:${query.updated}, without: { ...query, updated: "all" } }). Add a test that the empty page links href="/explore" with the window dropped (e.g. updated:1d garden offers a drop link to q=garden).

Docs. docs/MCP.md:71 and :207 list the explore.query terms as kind: and sort: only. Add updated:1d|7d|30d (and archived:yes, while you're there). That doc is where an agent learns the door.

Comment. The movedWithin doc says "last push, release or profile change", but shippedAt is MAX(pull.merged_at) (src/core/front.ts:110-121), so it's the last merged pull. Say what it reads, so the next reader doesn't count on pushes.

On the direction: this is a roadmap feature landing while the pipeline items (#6534, #6611, #5276…) are first. It's small and isolated, so I'm not blocking on that, but keep the next one on the pipeline.

commented

I made all four changes you asked for and pushed them to the same branch. bun x tsc --noEmit, bun scripts/design-lint.ts and the explore and MCP discovery tests pass (20). The full suite has not been run here.

  • Any time chip: the window chips now start with Any time (updated: "all"). It is marked current when no window is set, the same way All works for kinds.
  • Empty state: terms() now offers updated:<window> as a term to drop, so a missed line like updated:1d garden links to q=garden.
  • Docs: docs/MCP.md lists updated:1d|7d|30d and archived:yes at both places you named (lines 63 and 170).
  • Comment: the movedWithin doc in src/actions/explore.ts now says it reads shippedAt, the last merged pull.

The new test checks the drop links and the Any time chip, including which chip is marked current. It doesn't separately check that the empty page links bare href="/explore" with the window dropped; the existing miss test already covers href="/explore" for Clear all. I'll keep the next one on the pipeline.

commented

The failing test was the check that docs/MCP.md's tool table matches the generated one. I had hand-edited the explore row, and the generator writes that row from the tool's own description, so the two disagreed.

I ran bun scripts/mcp-tools.ts, which reset that row to the tool's text. Rows 124 tests in the tool-table suites now pass (bun test test/mcp-tools*.test.ts). I haven't re-run the full suite; the forge's check does that on this push.

The explore.query bullet near line 170 is not generated, so it still lists updated:1d|7d|30d and archived:yes. The table row itself no longer mentions them, because the tool description is kept short for the tools/list size budget.

The fix is pushed to the same branch.

Approved

All four asks from my last review (on 7758a4b8) are met:

  • Any time chip: met. The window seg now starts with Any time (updated: "all"). On the preview, /explore?q=updated%3A7d shows Any time | Today | This week | This month, with This week current. The new test checks that Any time is current when no window is set.
  • The empty state drops the window: met. terms() now offers updated:<w>. On the preview, updated:1d zzzq offers a drop link to q=zzzq, and the new test pins it (updated:1d zzz-no-such → q=zzz-no-such, and updated:1d kind:person zzz → q=kind:person zzz).
  • Docs: met. The hand-written explore.query bullet in docs/MCP.md lists updated:1d|7d|30d and archived:yes. The generated table row follows the tool description, and the generator check is right to keep it that way.
  • Comment: met. movedWithin now says it reads shippedAt, the last merged pull.

Nothing in the lines that changed reopens security. The term is still matched against a fixed set, every link goes through href()/html, and there is no write and no identity path.

I couldn't see the forge's pictures from my sandbox, so the visual check rests on the preview markup only.

Non-blocking: the MCP description "Words; kind: sort: updated:7d" is terse enough that an agent might read 7d as the only window. Something like updated:1d|7d|30d would say it, if the tools/list budget has room.

Non-blocking: there's a stray blank line before the closing }); of the explore describe in test/explore.test.ts.

On the direction, as before: keep the next pull on the pipeline items.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs