Skip to content

Conversation

@alltheseas
Copy link

Summary

  • add kind 7 and kind 17 reaction schemas for NIP-25
  • add custom emoji, external content k/i tags and aliases
  • wire up aliases for reuse across schemas

Testing

  • pnpm build

@alltheseas alltheseas requested review from Copilot and dskvr September 26, 2025 23:06
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds JSON schema definitions for NIP-25 reaction events, supporting both reactions to nostr events (kind 7) and reactions to external content (kind 17). It also introduces support for custom emoji tags and external content tags from NIP-73.

  • Add kind 7 and kind 17 reaction event schemas with proper validation
  • Implement custom emoji tag schema for reactions with shortcode and URL validation
  • Add external content identifier (i) and type (k) tag schemas from NIP-73
  • Create reusable alias files for cross-schema tag references

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
nips/nip-78/kind-30078/schema.yaml Defines schema for arbitrary custom app data events
nips/nip-73/tag/k/schema.yaml Validates external content type identifier tags
nips/nip-73/tag/i/schema.yaml Validates external content identifier tags
nips/nip-25/tag/emoji/schema.yaml Validates custom emoji tags for reactions
nips/nip-25/kind-7/schema.yaml Validates reactions to nostr events with emoji support
nips/nip-25/kind-17/schema.yaml Validates reactions to external content
@/tag/*.yaml Creates reusable aliases for tag schemas

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +39 to +37
allOf:
- if:
contains:
type: array
minItems: 1
items:
- const: "emoji"
then:
contains:
$ref: "@/tag/emoji.yaml"
Copy link

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

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

This validation logic is redundant. The emoji tag validation is already handled in the items section (lines 17-25). This duplication could cause confusion and maintenance issues.

Suggested change
allOf:
- if:
contains:
type: array
minItems: 1
items:
- const: "emoji"
then:
contains:
$ref: "@/tag/emoji.yaml"

Copilot uses AI. Check for mistakes.
Comment on lines 26 to 38
contains:
type: array
minItems: 2
maxItems: 4
items:
- const: "e"
- type: string
pattern: '^[a-f0-9]{64}$'
- type: string
pattern: '^(ws://|wss://).+$'
- allOf:
- $ref: "@/secp256k1.yaml"
additionalItems: false
Copy link

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

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

[nitpick] This inline e-tag validation should be extracted to a separate schema file for reusability, following the pattern established for other tag types.

Copilot uses AI. Check for mistakes.
@alltheseas alltheseas requested a review from Copilot September 26, 2025 23:24
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@@ -0,0 +1,2 @@
allOf:
Copy link

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

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

Remove the trailing space after the colon on line 1.

Suggested change
allOf:
allOf:

Copilot uses AI. Check for mistakes.
@alltheseas alltheseas marked this pull request as ready for review October 9, 2025 20:43
@alltheseas alltheseas requested a review from Copilot October 9, 2025 20:50
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +29 to +34
errorMessage:
contains: "tags must include at least one k tag describing the external content type"
- contains:
$ref: "@/tag/external-content-i.yaml"
errorMessage:
contains: "tags must include at least one i tag referencing the external content"
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

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

The error messages are nested under individual 'contains' constraints, but this structure may not work as expected in JSON Schema. Consider moving the errorMessage to the top level of the allOf block for proper error handling.

Suggested change
errorMessage:
contains: "tags must include at least one k tag describing the external content type"
- contains:
$ref: "@/tag/external-content-i.yaml"
errorMessage:
contains: "tags must include at least one i tag referencing the external content"
- contains:
$ref: "@/tag/external-content-i.yaml"
errorMessage:
allOf:
- "tags must include at least one k tag describing the external content type"
- "tags must include at least one i tag referencing the external content"

Copilot uses AI. Check for mistakes.
@alltheseas alltheseas force-pushed the feat/nip-25-reactions branch from 7bbbc48 to 02e182e Compare October 9, 2025 21:00
@alltheseas alltheseas merged commit 239eb28 into master Oct 9, 2025
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.

2 participants