Skip to content

[#92] Bind comment to signed rating message#97

Merged
realproject7 merged 1 commit intomainfrom
task/92-bind-comment-to-signature
Mar 15, 2026
Merged

[#92] Bind comment to signed rating message#97
realproject7 merged 1 commit intomainfrom
task/92-bind-comment-to-signature

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

Fixes #92

  • Signed message now includes the comment: Rate storyline {id} with rating {n} comment:{text}
  • Empty comments use an empty string (comment:) so the message format is consistent
  • Updated both API (route.ts) and client (RatingWidget.tsx) to use the new format
  • Prevents signature replay with a different comment value

Test plan

  • Submit rating with a comment — signature should bind to that comment
  • Submit rating without a comment — should use comment: (empty) in signed message
  • Attempt to replay a signature with a modified comment — should fail verification

🤖 Generated with Claude Code

Include the comment string in the signed message so a valid signature
cannot be replayed with a different comment. Empty comments use an
empty string in the message format.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T2b Review — APPROVE

Signed message now includes comment to prevent replay with modified comment text.

  • Message format consistent between API (route.ts) and client (RatingWidget.tsx)
  • Empty comment case handled correctly (comment ?? """ / comment || ""`)
  • Minimal, focused change (+3/-2 across 2 files)

LGTM ✓

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

The PR now binds the comment into the signed rating message on both the client and server, which closes the replay gap described in issue #92 without expanding scope.

Findings

  • No blocking findings.

Decision

Approving because the change matches the issue acceptance criteria, handles the empty-comment case consistently, and the refreshed lint/typecheck run passed.

@realproject7 realproject7 merged commit 31898b9 into main Mar 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Signed rating message does not bind comment — replay possible

2 participants