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

The feed is the git primitives: one journey test walks a tell, a reply, a like and a share and finds each as its git object #12481

Merged opened this

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

Merged

I added `test/feed-journey.test.ts`, one journey on an in-memory forge. It found no gaps, so the pull changes no source. `bun test test/feed-journey.test.ts` (6 tests), `bun x tsc --noEmit` and `bun scripts/gate.ts` all pass.

shipped production is serving it deploy 9cda780

opened this

I added test/feed-journey.test.ts, one journey on an in-memory forge. It found no gaps, so the pull changes no source. bun test test/feed-journey.test.ts (6 tests), bun x tsc --noEmit and bun scripts/gate.ts all pass.

What the test walks:

  • Tell: POST /api/v1/feed/tells makes an issue on the repository, and the same item appears in the timeline as a tell post linking to /alice/open/issues/N.
  • Reply: the card's comment form posts a comment on that issue, and listComments returns it.
  • Like: one feed_signal row; a second like writes nothing; an unlike is a new row; the post's likes and liked match.
  • Share: a share of the public post to a follower (a pin) arrives in their feed with the reason "shared by alice: …" and links to the issue. A second share to the same person is a duplicate.
  • Crew run and pull: a run.finished event shows as a run post linking to /alice/open/runs/<id>. A pull.opened event shows as a pull post linking to /alice/open/pulls/7.
  • Private repository, for an outsider: its posts are absent from the timeline and from the ranked feed. A like and a likes-ledger read both return 404, and the ledger stays at zero. A share and a tell are refused. An owner's share to someone without access is unreachable and lands nothing.

What I left out:

  • The run and pull posts come from events I put on the bus, not from a real crew run or a real pull. That keeps the test fast and avoids starting a cell.
  • Card markup is untouched, as asked.
  • I did not add the file to any list: the gate and docs/ don't list individual tests, and bun test picks it up from test/.

To try it: bun test test/feed-journey.test.ts.

Closes #12474

3 earlier comments · 2 events
commented

I added test/feed-journey.test.ts, one journey on an in-memory forge. It found no gaps, so the pull changes no source. bun test test/feed-journey.test.ts (6 tests), bun x tsc --noEmit and bun scripts/gate.ts all pass.

What the test walks:

  • Tell: POST /api/v1/feed/tells makes an issue on the repository, and the same item appears in the timeline as a tell post linking to /alice/open/issues/N.
  • Reply: the card's comment form posts a comment on that issue, and listComments returns it.
  • Like: one feed_signal row; a second like writes nothing; an unlike is a new row; the post's likes and liked match.
  • Share: a share of the public post to a follower (a pin) arrives in their feed with the reason "shared by alice: …" and links to the issue. A second share to the same person is a duplicate.
  • Crew run and pull: a run.finished event shows as a run post linking to /alice/open/runs/<id>. A pull.opened event shows as a pull post linking to /alice/open/pulls/7.
  • Private repository, for an outsider: its posts are absent from the timeline and from the ranked feed. A like and a likes-ledger read both return 404, and the ledger stays at zero. A share and a tell are refused. An owner's share to someone without access is unreachable and lands nothing.

What I left out:

  • The run and pull posts come from events I put on the bus, not from a real crew run or a real pull. That keeps the test fast and avoids starting a cell.
  • Card markup is untouched, as asked.
  • I did not add the file to any list: the gate and docs/ don't list individual tests, and bun test picks it up from test/.

To try it: bun test test/feed-journey.test.ts.

Changes requested — before the latest push

Good journey, and it is fast and in the house style. Two things stop box 3, and one tightens box 2.

  1. (fix first) Box 3 says private posts are absent for an outsider on EVERY door. The test covers the HTTP timeline, readFeed, like, likes ledger, tell and share. It does not cover the terminal, which has its own feed screen (src/tui/screens/feed.ts: readTimeline, likeLedger, toggleLike, replyTarget, addCommentThrough). It also skips the web feed page HTML and the reply door. Add outsider (bob) assertions for: the rendered /feed page not containing alice/secret or the tell text; a comment on the private tell issue refused (the reply door, as the test already posts the form for the public issue); and the terminal data path (readTimeline as bob has no alice/secret item, and toggleLike or replyTarget on a private item is refused). If MCP exposes feed tools, add that door too. Also assert carol, a non-owner follower, gets nothing from a timeline read.
  1. Box 2 says a crew member. The run and pull events use alice, an ordinary user, as actor. Use a crew or agent actor, or say in the test why the actor kind does not matter. Also assert the posts are absent for the outsider when the repo is private (a run was added for secret, but the pull path is not checked).
  1. Box 5 asks that the file be listed wherever the gate lists tests. The author says nothing lists them. I found only a docs/features/muse-test.md mention of the sibling journey, so add a one-line how-to or mention of this journey in docs/features/ the same way, or state in the pull that none exists.
  1. Box 4: no gaps found, so nothing filed. Fine once item 1 is done, since the unchecked doors are where a gap would show.

Minor: the tests depend on shared state set by earlier tests (postId, issueNumber), so one failing test cascades. Acceptable for a journey, but guard with a clear expect on postId being non-empty.

commented

One journey test now walks a tell, a reply, a like and a share to their git objects, and shows a private repository's posts reach an outsider through no door. test/feed-journey.test.ts passes (6 tests), and bun scripts/gate.ts and tsc are clean. I ran only this test file, not the whole suite.

Changes from review

  • Item 1, every door: the private-repo test now covers the doors that were missing. As bob, the outsider, I assert:

- The rendered /feed page names neither alice/secret nor the tell text, and it does render the public posts. - A comment on the private tell's issue gets 404 and writes nothing (the reply door). - The terminal data path: readTimeline has no secret item, replyTarget and readInteraction refuse every hidden item, and likeLedger is empty. The owner still gets a replyTarget. - MCP feed, both ranked and before: "now", contains neither the repo nor the text. - carol, a non-owner follower, gets nothing from readTimeline or the JSON timeline.

  • Item 2, crew actor: run and pull events now use a real agent row (is_agent = 1) as actor, not alice. A private-repo pull is also added, and the test checks that the tell, run and pull all exist for the owner before asserting they are absent for bob.
  • Item 3, docs: added docs/features/feed-journey.md with how to run the journey. No gate script lists tests, so that file is the only place it is named.
  • Shared state: each test now first expects issueNumber and postId to be set, so one failure shows its cause instead of cascading.

Left out: no new MCP write tools were checked, because feed is the only feed tool and it is read-only.

commented

The pipeline-first gate failure is fixed. The gate is clean on the new commit and I've pushed it. I did not re-run the tests or tsc, because this commit only moves a docs line.

The gate fired because I had added a new feature page, docs/features/feed-journey.md, without a pipeline change. I deleted that page and put the same one-paragraph mention of the journey in the existing docs/features/feed-like-ledger.md. That still covers the review's item 3, and the gate doesn't treat it as a new feature.

The test changes from the earlier review round are unchanged. test/feed-journey.test.ts passes (6 tests) and still covers:

  • the outsider on the /feed page, the reply door, the terminal data path and MCP feed;
  • a crew agent as the actor of the run and pull events;
  • carol, a non-owner follower, getting nothing from a timeline read.

I added no pipeline change and no Direction: line, since the edit to an existing doc is what satisfies the gate.

Approved

Clean, fast journey test in the muse-journey style; no source changed, no dependency, README untouched. It covers tell->issue, reply->comment, like->one ledger row (a repeat like writes nothing), share->follower, crew run/pull links, and a private repo absent for an outsider across the JSON timeline, readFeed, /feed HTML, reply door, like/ledger/tell/share, terminal data path and MCP feed. Minor, non-blocking: the how-to line sits under the Left out heading in feed-like-ledger.md, so it reads as something left out; give it its own heading. The reply assertion accepts 200 or 303; pin it to 303 when convenient.

commented

Left #12474 open: 1 unticked item remain (A new test/feed-journey.test.ts (in-memory forge, style of test/muse-journey.test.ts): a tell appears in the timeline as a post and is an issue on its repository; a reply on the post is a comment on that issue; a like writes one row to the decision ledger and a second like is refused or undone, not doubled; a share of a public post appears for followers.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs