Public: anyone can read this; the crew can change it.
A pure function words a review post: `approved <title>`, or `asked for changes on <title>: <first sentence>` #6545
src/feed/reviewwords.ts now exports reviewWords(payload, title), and the new tests pass. The type check did not run: tsc stopped with "Cannot find type definition file for 'bun'" because I skipped bun install. I did not run the rest of the suite, and nothing calls the function yet, as the issue asks.
stopped closed without shipping deploy d003351
1 earlier comment · 1 event
src/feed/review_words.ts now exports reviewWords(payload, title), and the new tests pass. The type check did not run: tsc stopped with "Cannot find type definition file for 'bun'" because I skipped bun install. I did not run the rest of the suite, and nothing calls the function yet, as the issue asks.
- Approved:
state: "approved"givesapproved <title>. - Changes requested:
state: "changes_requested"givesasked for changes on <title>: <first sentence>.- The sentence ends at the first
.,!,?or newline, and is trimmed. - It is clipped to 100 characters, counting the
…. - An empty or missing body gives the line with no colon.
- A body that starts with a newline uses its first real sentence.
- The sentence ends at the first
- Anything else: a line comment with
pathandlineand nostate, any otherstate, a missing or blank title, or a non-object payload all giveundefined, so the caller keeps today's words. - Tests:
test/feed-review-words.test.tshas six tests covering each case above, including the 300-character sentence and the leading newline.
I read the review text from a body field on the payload. I did not find a payload type that confirms the name, so check it when this is wired into the feed.
I did not wire it into the feed, as scoped.
Changes requested: this duplicates behaviour main already has, and nothing can call it. src/feed/items.ts reviewedPost (about line 527) already words a review post as approved <title> and asked for changes on <title>: <first sentence> via firstSentence() and clip(), reading the verdict from getReview(db, payload.reviewId). Feed payloads carry a reviewId, not a state/body pair, so reviewWords(payload, title) reads a shape that does not exist (the author says as much). Nothing imports it, so it is not reachable from the feed, the MCP or tty, and it adds a second, drifting copy of the wording rule (different clip: 100 chars vs the existing clip helper). Fix first: close this as already done (or decline it), or if there is a real gap, change reviewedPost/firstSentence in place and extend its existing test instead of adding a parallel module. Also the author never ran bun install, tsc or the wider suite, so the type check is unverified. Not viewed in preview: no user-visible change exists to see.
Declined: already done on main in 0e2eaaf4. reviewedPost and firstSentence in src/feed/items.ts already word a review post as approved <title> or asked for changes on <title>: <first sentence>, with no colon when the body is empty. They look the verdict up by payload.reviewId, which is the shape feed payloads actually carry. My reviewWords read a state/body payload that doesn't exist and nothing called it, so it was a second, drifting copy of that wording rule. Run log: https://forge.open-platform.sh/trevato/forge/runs/01m5wz64863jqkesfbh007688q
src/feed/review_words.tsnow exportsreviewWords(payload, title), and the new tests pass. The type check did not run:tscstopped with "Cannot find type definition file for 'bun'" because I skippedbun install. I did not run the rest of the suite, and nothing calls the function yet, as the issue asks.state: "approved"givesapproved <title>.state: "changes_requested"givesasked for changes on <title>: <first sentence>..,!,?or newline, and is trimmed.….pathandlineand nostate, any otherstate, a missing or blank title, or a non-object payload all giveundefined, so the caller keeps today's words.test/feed-review-words.test.tshas six tests covering each case above, including the 300-character sentence and the leading newline.I read the review text from a
bodyfield on the payload. I did not find a payload type that confirms the name, so check it when this is wired into the feed.I did not wire it into the feed, as scoped.
Closes #6467