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

/:owner/:name/waves lists a repository's waves newest first, and /waves/<version> renders one as a note #1801

opened this

Closed 50d 22h ago

/:owner/:name/waves and /:owner/:name/waves/:version are built on this branch. I merged current main into it and pushed so the check runs against today's tree. The earlier park came from a failure in an unrelated test, "the asks page > when nothing asks, it says All fine…" in test/asks.test.ts.

Notes

opened this

/:owner/:name/waves and /:owner/:name/waves/:version are built on this branch. I merged current main into it and pushed so the check runs against today's tree.

The earlier park came from a failure in an unrelated test, "the asks page > when nothing asks, it says All fine…" in test/asks.test.ts. I did not change that test or any asks code. I ran test/asks.test.ts on the pre-merge tree, where it passed 3 times in a row. After the merge I ran it with test/waves-page.test.ts, and both pass. I think the failure was a flake or a stale main rather than a bug in this change, but I could not reproduce it, so I can't say what caused it. Type check is clean.

  • List: /:owner/:name/waves reads waves/*.md from the default branch and lists them newest first. A file that doesn't parse is listed with its reason and doesn't break the page. Everything is server-rendered and escaped.
  • One wave: /:owner/:name/waves/<version> shows the headline, each highlight with its why, and the merged pulls as links. An unknown version is a 404.
  • Visibility: both pages follow the repository, so an outsider gets the same answer as for any other page of a private repository.
  • Code: the page is src/web/pages/waves.ts, the routes are in src/http/server.ts, and test/waves-page.test.ts is in GATE in scripts/gate.ts. The README has a short note on the pages.
  • Tests: they cover list order, a headline with markup coming out inert, a private repository refused to an outsider, and an unparsable file shown with its reason.
  • Left out: there is no MCP tool, as the issue says, and no new dependency.

To try it, open /<owner>/<name>/waves on the preview of a repository that has waves/*.md on its default branch.

🤖 Generated with Claude Code

Closes #1507

4 earlier comments
commented

This update makes the waves pages reachable from the repository page and stops the list being re-parsed on every request. The type check is clean, and test/waves-page.test.ts plus the web-ui and repository tests pass.

  • Link: the repository's code page now shows a muted "Waves" link, but only when the viewed ref is the default branch and waves/ exists at its root. It reuses the root tree listing the page already reads, so it costs no extra git call. A new test checks that the page carries href="/alice/pub/waves" when waves exist and has no waves link otherwise. The "no waves" case uses the none repository, which has no commits, so it shows that nothing is linked but not the case of a repository that has commits and no waves/ directory.
  • Cache: the waves list now keeps its parsed result per oid of the waves/ tree, up to 64 entries in memory. Repeat requests cost one cheap root listing instead of reading and parsing up to 500 files. A changed waves/ directory has a new oid, so the cache is never stale. I did not add a test for the cache.
  • Terminal: I opened #1819 for the terminal view, and the README now points to it.

I did not lower the 500-file cap.

🤖 Generated with Claude Code

commented

The full gate on land was red and named no test; the pull is open again.

commented

I merged main into the branch and pushed it. The only conflict was in scripts/gate.ts, and the forge's check will now run on the push.

  • Conflict: both sides had added an entry to the test list at the same spot. I kept both: this branch's test/waves-page.test.ts and main's test/cut-wave.test.ts. README.md and src/http/server.ts merged without conflicts.
  • Tests: test/waves-page.test.ts and test/cut-wave.test.ts pass together, 13 tests. I did not run the full suite here. The forge's check does that.
  • Flaky first run: the first run of those two files reported 1 failure and 1 error. I had started it alongside the type check, which hit the 120-second timeout. A rerun on its own passed cleanly, so I put the first result down to that load, but I didn't confirm the cause.
  • Type check: I started bun x tsc --noEmit but never saw its output, because the command timed out.
commented

I merged the new main into the branch and pushed it. This time it merged cleanly, with no conflicts, and scripts/gate.ts has no conflict markers left.

  • Tests: test/waves-page.test.ts and test/cut-wave.test.ts pass together (13 tests) when run with --timeout 30000.
  • Flaky setup: on the default 5-second hook timeout, the waves-page suite's setup timed out here, and the server connection was reset while it created the test repository. The same thing happened after the last merge, so I'm treating it as a slow sandbox rather than a code problem. I didn't confirm the cause.
  • Not run: I didn't run the full suite or bun x tsc --noEmit this time. The forge's check will run both on the push.
commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

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

Keyboard shortcuts

Docs