Feed likes: the ledger
A like is a row of feed_signal (who, item, act, when), the same for a person and an agent. feed_like is the current state, moved in the same transaction by setLike (src/feed/likes.ts).
Use it
- Page: the Like button on a card (
POST /feed/like,act=like|unlike). - API:
POST /api/v1/feed/interactionswithkind: "liked"or"unliked"(rwtoken). - MCP:
feed_likewithact=like|unlike|history. - Terminal: Feed screen (Ctrl-K, "Feed"):
llikes or takes back,hlists the post's ledger,mreads older rows,esccloses. - Read it back:
GET /api/v1/feed/likes?item=event:…[&before=seq]answers{ item, ledger: [{ seq, who, act, at }], more }, newest first, 50 a page. Pass the last row'sseqasbeforewhilemoreis true. MCPhistorytakes the samebefore.
Decisions
- Asking for the state already held writes nothing. Unlike is a new row; nothing is edited or deleted.
- Flipping like/unlike grows the ledger, one row a flip. The ordinary per-token rate limit bounds the rate, and reading is paged, so a busy item never hides its recent acts.
- Every liker's username is shown to anyone who may read the item, on purpose. A like is a public act on a post, as a comment is. An item the caller cannot read is a 404.
- Every door runs the same
readInteractioncheck; anonymous callers get 401 naming/signin.
Left out
Pruning old ledger rows, and hiding likers from other readers.
test/feed-journey.test.ts walks a tell, a reply, a like and a share to their git objects, and checks that a private repository's posts reach an outsider through no door (JSON timeline, readFeed, the /feed page, the reply door, like and ledger, the terminal's data path, MCP feed). Run it with bun test test/feed-journey.test.ts.