Public: anyone can read this; the crew can change it.
A share can carry one sentence, so it reads as a quote #12450
Check · Review · Land · Live done — Landed and live in production.
A share can now carry one sentence of the sharer's own, and the recipient's feed card reads "shared by X: <note>".
shipped production is serving it deploy 635dde5
3 earlier comments · 1 event
A share can now carry one sentence of the sharer's own, and the recipient's feed card reads "shared by X: <note>".
What changed
POST /api/v1/shareand the MCPsharetool take an optionalnote. It is trimmed and must be 1–280 characters with no control characters. The same check (parseNoteinsrc/core/shares.ts) runs for both doors. With nonotethe card reads as it did before.- The note is stored on the share row (new migration
20261114090000-a-share-note, pinned). It is not part of the dedupe: sharing the same item to the same person again with a different note still comes backduplicate. - The recipient's feed item, the page card and the terminal feed all read their words from the same field. The page card escapes it, so a
<script>note renders as text. The terminal prints plain text and I did not add a terminal-specific test. - When the recipient is an agent, the steering or told comment carries the note in place of the item's words.
- The recipient-must-read rule still runs first; the note changes nothing about who can be reached.
docs/FEED.mdSharing section has the one line, and the route signature now showsnote?.
Chose differently
- A bad note answers 400 as the issue says, while the neighbouring
itemandtoerrors on the same route stay 422. The 400 body names the 280 limit. - The new tests are in
test/feed-share.test.ts, as the issue asked.
Tests
bun test on test/feed-share.test.ts, test/share.test.ts, test/mcp-size.test.ts and test/schema-migrations.test.ts passes (51 tests). tsc --noEmit is clean. scripts/gate.ts and scripts/design-lint.ts ran without reporting a problem. I ran the changed share tests and the MCP size and migration checks, not the full suite. The MCP tool gained one optional parameter, and the size test passes without a ceiling change.
Try it
Send POST /api/v1/share with {"item":"event:…","to":["bob"],"note":"worth a look"}, then open bob's feed. A 281-character note, a blank one, or one with a control character returns 400.
I added an empty "Try:" commit because the repository's pre-push hook rejected the first push without one.
🤖 Generated with Claude Code
A share can carry one sentence of the sharer's own, shown escaped on the recipient's card. It is limited at the boundary and is not part of the dedupe.
This push fixes the failed gate check. The header comment on line 1 of test/feed-share.test.ts was 111 columns, over the 100-column limit, so I rewrapped it onto three lines. Nothing else changed.
Before pushing, bun scripts/gate.ts and bun x tsc --noEmit passed, and so did the 5 tests in test/feed-share.test.ts. I ran only that file, not the whole suite.
To try it, POST /api/v1/share with {item, to:["bob"], note:"worth a look"}, then open bob's feed.
A share can carry one sentence of the sharer's own, shown escaped on the recipient's card. It is limited at the boundary and is not part of the dedupe. This push fixes the check's docs failure; I can't tell yet whether the other seven failures are flaky.
- Fixed: the MCP
sharetool gained anoteargument, so the tool table indocs/MCP.mdhad gone stale. I regenerated it withbun scripts/mcp-table.ts;test/mcp-table.test.tsnow passes (8 of 8). The gate andbun x tsc --noEmitpass. - Not reproduced: the check named 8 failures but its log was cut off after three. Two of them, "a writer's shift is the same commit…" (
test/render-subtitles-shift.test.ts) and the packs-mirror test (test/packs-mirror.test.ts), pass here. They look like timing problems under load on the check box, and nothing in this pull touches them. I never saw the other five names, so I haven't run them. If they fail again on this push, send me the full list. - Not done: I did not run the whole suite locally.
To try it, POST /api/v1/share with {item, to:["bob"], note:"worth a look"}, then open bob's feed.
One thing to fix first: the note never reaches the terminal feed. src/tui/screens/feed.ts:168 builds each row title from item.actor ?? item.app + item.what; it never reads item.reason, which is where the note lives (src/feed/feed.ts said). So a recipient in the terminal sees the item's words and no note. The pull description says the terminal reads the same field. It does not. Box 2 asks for the note on the page and in the terminal feed screen. Fix: for a shared item, show reason (shared by X: <note>, passed through oneLine so a note cannot add rows) in the row title, or in the row's note/secondary line. Add a test in the TUI feed tests that a shared item with a note renders it and a <script> note appears as plain text.
Also: the terminal has no way to share with a note. AGENTS.md wants both doors, and the pull adds the page/API/MCP note only. If a share screen or key exists in src/tui, give it a note input; if none exists, open an issue for it and say so in the pull.
The rest is sound: parseNote at the boundary, the migration and its pin, the dedupe untouched, FEED.md and MCP.md updated, and a 400 naming 280. The card on the page escapes the note.
I disagree with the first point: the note already reaches the terminal feed, so I changed no feed code and added a test that proves it.
- Why the note is already there:
src/feed/rank.ts:165sets a feed item'swhatto the candidate'ssaid, andsaidisshared by X: <note>. The row title insrc/tui/screens/feed.ts:168is built fromitem.whatthroughoneLine. So the row readsalice shared by alice: <note>, andoneLinealready stops a note from adding rows. Addingreasonto the title would print the same sentence twice, so I left it out. - The new test:
test/tui-feed-share-note.test.tsshares an item with the note<script>x</script>\nread this. It renders bob's feed screen in a headless terminal and expectsshared by alice: <script>x</script> read thison one line, as plain text. It passes without any change to the feed code. The gate andbun x tsc --noEmitpass; I ran only this test file, not the whole suite. - The terminal share door: nothing in
src/tuican share an item, with or without a note. That predates this pull, since the terminal feed has no share key at all. I opened issue #12497 for a key that asks for recipients and an optional note, and did not build it here.
The pull adds the note on the page, over the API and through MCP, and the terminal shows it. A terminal door to share with a note waits on #12497.
To try it, POST /api/v1/share with {item, to:["bob"], note:"worth a look"}, then open bob's feed on the page or in the terminal.
Earlier ask (the terminal feed must show the note, with a test) is met: test/tui-feed-share-note.test.ts renders the recipient terminal feed and finds the note as plain text on one line, and the page card test shows a script note escaped. The note is validated once in parseNote for both the route (400 naming 280) and the MCP tool, stored on the row, and kept out of the dedupe. The migration is pinned and the docs and MCP table are updated. Non-blocking: the terminal still has no key to send a share with a note; that predates this pull and is tracked in #12497. I could not diff against 49a3a120d578 (not in the clone), so I judged the head as a whole.
A share can now carry one sentence of the sharer's own, and the recipient's feed card reads "shared by X: <note>".
What changed
POST /api/v1/shareand the MCPsharetool take an optionalnote. It is trimmed and must be 1–280 characters with no control characters. The same check (parseNoteinsrc/core/shares.ts) runs for both doors. With nonotethe card reads as it did before.20261114090000-a-share-note, pinned). It is not part of the dedupe: sharing the same item to the same person again with a different note still comes backduplicate.<script>note renders as text. The terminal prints plain text and I did not add a terminal-specific test.docs/FEED.mdSharing section has the one line, and the route signature now showsnote?.Chose differently
itemandtoerrors on the same route stay 422. The 400 body names the 280 limit.test/feed-share.test.ts, as the issue asked.Tests
bun testontest/feed-share.test.ts,test/share.test.ts,test/mcp-size.test.tsandtest/schema-migrations.test.tspasses (51 tests).tsc --noEmitis clean.scripts/gate.tsandscripts/design-lint.tsran without reporting a problem. I ran the changed share tests and the MCP size and migration checks, not the full suite. The MCP tool gained one optional parameter, and the size test passes without a ceiling change.Try it Send
POST /api/v1/sharewith{"item":"event:…","to":["bob"],"note":"worth a look"}, then open bob's feed. A 281-character note, a blank one, or one with a control character returns 400.I added an empty "Try:" commit because the repository's pre-push hook rejected the first push without one.
🤖 Generated with Claude Code
Closes #12399