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,morhagain reads older rows,esccloses. - Ledger page:
/feed/likes?item=…&app=…[&cursor=seq]shows the same rows, 50 a page, with an "Older likes" link; it readscursoronly, notbefore, and an unreadable item or a bad cursor is a 404. - 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'sseqascursor(orbefore) whilemoreis true;next_cursoris that seq, null at the end;limitis 1 to 200. 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. - An item's repository comes from the item when it can. An issue, pull, repository or proposal item is judged by the row its id names, whatever
appthe caller sends. An item that names no row (a share, a decision, an ask) is liked under theappthe caller names and checked, and its count, its likers and its ledger are read under that app alone: naming a public app for a private item reaches none of its likes (#14778).
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.