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.
mason/forge:mason/12399-a-share-can-carry-one-sentence-so-it-rea → main 5 commits fork 1 thread · 1 unresolved
11 files
changed +261
−15
docs/FEED.md +2 −1
| @@ -124,7 +124,7 @@ The `choose` card comes from `src/feed/choose.ts`, a run card offers Stop | ||
| 124 | 124 | |
| 125 | 125 | ## Sharing (`src/feed/share.ts`, `core/shares.ts`) |
| 126 | 126 | |
| 127 | `POST /api/v1/share` `{ item, to? }` (`rw`, same-origin for sessions) and the | |
| 127 | `POST /api/v1/share` `{ item, to?, note? }` (`rw`, same-origin for sessions) and the | |
| 128 | 128 | MCP tool `share` are one verb. `to` is up to 10 usernames. The sender must |
| 129 | 129 | see the item (it is looked up in the sender's own feed sources); the answer |
| 130 | 130 | is `{ sent: [{ to, outcome }] }`, outcome one of `delivered queued steered |
| @@ -145,6 +145,7 @@ may not see the item are both `unreachable`. | ||
| 145 | 145 | - **Budget:** 5 delivered a day per person. More are queued, delivered |
| 146 | 146 | best-weighted first as room frees (checked on each feed read), and dropped |
| 147 | 147 | after 48 hours; a waiting share's worth falls linearly with its age. |
| 148 | - **A note:** `note` is one sentence of the sharer's own, 1–280 characters, no control characters (else 400 naming the limit); the card reads "shared by X: <note>", escaped, on the page and in the terminal. It is stored once on the row and is not part of the dedupe. | |
| 148 | 149 | - **Dedupe:** one share per item per recipient, ever. |
| 149 | 150 | - **Sender weight:** `2·(opens+1)/(shares+2)` over 90 days of delivered |
| 150 | 151 | shares to people, clamped 0.2–2; an open is the recipient's `opened` of the |
docs/MCP.md +1 −1
| @@ -199,7 +199,7 @@ bytes in `tools/list`. After changing a tool run `bun scripts/mcp-table.ts`; | ||
| 199 | 199 | | `secrets` | — | Admin: list\|set\|remove sealed secrets | 248 | |
| 200 | 200 | | `sessions` | `list`, `end`, `end_idle`, `signins`, `shells` | Where you are signed in: your tokens and browsers, never a secret; `username` for a person as owner; action end + id signs a browser out | 385 | |
| 201 | 201 | | `sever` | — | Unlink a spawned forge from its parent, or an app from the repository it came from | 225 | |
| 202 | | `share` | — | Share a feed item: no `to` tells the app's crew and owners, else followers; budgeted | 258 | | |
| 202 | | `share` | — | Share a feed item: no `to` tells the app's crew and owners, else followers; budgeted | 283 | | |
| 203 | 203 | | `signup` | — | Sign-ups: open (default); invite lets in only a person with an open invite link; closed refuses every new account | 324 | |
| 204 | 204 | | `sizes` | — | A child forge's sizes: small, medium and large, each with CPU, memory and disk | 196 | |
| 205 | 205 | | `snapshot_now` | — | Take a snapshot now, as Backups does (admin) | 133 | |
src/feed/feed.ts +1 −1
| @@ -270,7 +270,7 @@ function sharedCandidates( | ||
| 270 | 270 | link: s.link, |
| 271 | 271 | what: s.what, |
| 272 | 272 | urgency: SHARE_BOOST * senderWeight(db, sender.id, now), |
| 273 | said: `shared by ${sender.username}: ${s.what}`, | |
| 273 | said: `shared by ${sender.username}: ${s.note ?? s.what}`, | |
| 274 | 274 | }); |
| 275 | 275 | } |
| 276 | 276 | return out; |
src/http/feed.ts +4 −2
| @@ -22,7 +22,7 @@ import { | ||
| 22 | 22 | import { chipsOf, isKindChip, setChip } from "../core/feed_chips.ts"; |
| 23 | 23 | import { CURSOR_NOT_ISSUED, KIND_HAS_NO_CHIP } from "../actions/feed_words.ts"; |
| 24 | 24 | import { getUserByName, getUsersByIds } from "../core/users.ts"; |
| 25 | import { drainQueue } from "../core/shares.ts"; | |
| 25 | import { drainQueue, NOTE_WORDS, parseNote } from "../core/shares.ts"; | |
| 26 | 26 | import { feedTag, hasQueuedShares } from "../feed/feed_tag.ts"; |
| 27 | 27 | import { lastVisit } from "../core/home_visit.ts"; |
| 28 | 28 | import { feedDigest } from "../web/studio/since.ts"; |
| @@ -367,7 +367,9 @@ export function feedRoutes(router: Router<Handler>): void { | ||
| 367 | 367 | 422, |
| 368 | 368 | `to is up to ${RECIPIENTS_MAX} usernames`, |
| 369 | 369 | ); |
| 370 | const made = await share(ctx.app, ctx.auth.user!, itemId, to); | |
| 370 | const note = parseNote(input.note); | |
| 371 | if (note === undefined) return apiError("invalid_note", 400, NOTE_WORDS); | |
| 372 | const made = await share(ctx.app, ctx.auth.user!, itemId, to, Date.now(), note); | |
| 371 | 373 | if (!made.ok) return notFound(); |
| 372 | 374 | return json({ sent: made.value.sent }, 201); |
| 373 | 375 | }); |
new above
offline
This carries the note, but src/tui/screens/feed.ts:168 renders
item.whatand ignoresreason, so the terminal never shows it. Render the reason there and test it.