Skip to content

gitplaza: kind 1630/1631 (NIP-34 status events) — missing required e-tag marker and p-tags #80

Description

@alltheseas

Summary

gitplaza produces kind 1630 (NIP-34 "Open" status event) and kind 1631 (NIP-34 "Applied/Merged" status event) with minimal tag structure, missing required tags.

Note: Kind 1630/1631 are NIP-34 status events (not patches or issues). Patches are kind 1617, issues are kind 1621. Status events signal the lifecycle state of patches/issues (Open, Applied, Closed, Draft).

Evidence

Kind NIP-34 Meaning Events Description
1630 Open status 2 Only e-tag + client tag, missing "root" marker and p-tags
1631 Applied/Merged status 1 Only e-tag + client tag, missing "root" marker and p-tags

Sample tags (kind 1630)

[["e","9c7bfd49a5249a17a425327806b9cf90db300da83fe35e225c736cc536376fc3"],["client","gitplaza"]]

Expected structure (NIP-34 status events)

Kind 1630/1631 status events require:

  • e tag with "root" marker at position 3: ["e", event_id, relay, "root"] (minItems: 4)
  • p tags for the repository owner and root event author
  • Optional: a tag referencing the repository announcement, r tag with earliest commit ID

Source Code

Repository: https://codeberg.org/dluvian/gitplaza (Rust, Iced GUI, rust-nostr SDK)

Bug location: crates/core/src/nostr_util.rs:559-567

pub fn create_git_status(git_stuff: &Event, status_type: GitStatusType) -> EventBuilder {
    let maybe_repo_coord = repo_coord(git_stuff);

    EventBuilder::new(status_type.into(), "")
        .tag(Tag::event(git_stuff.id))          // ← BUG: creates ["e", event_id] (2 items)
        .tag(Tag::public_key(git_stuff.pubkey))
        .tag_maybe(maybe_repo_coord.map(|repo| Tag::public_key(repo.public_key)))
        .tag_maybe(maybe_repo_coord.map(|repo| Tag::coordinate(repo.to_owned(), None)))
}

Root cause: Tag::event(event_id) (docs) produces a bare ["e", "<event-id>"] (2 items). NIP-34 status events require the "root" marker at position 3: ["e", event_id, relay_or_empty, "root"] (minItems: 4). The rust-nostr API does not add relay or marker fields automatically — the developer must construct the full tag manually.

Dataset

655K events scanned across 52 event kinds from multiple relays. Validated against nostrability/schemata schemas.

Exact Failure Mode

Kind 1630 — Open status (2 events)

Error Path Keyword Message Count
/tags contains must contain at least 1 valid item(s) 2
/tags/0 minItems must NOT have fewer than 4 items 2
/tags/1 minItems must NOT have fewer than 4 items 2
/tags/1/0 const must be equal to constant 2
/tags/1/1 pattern must match pattern ^[a-f0-9]{64}$ 2

Kind 1631 — Applied/Merged status (1 event)

Error Path Keyword Message Count
/tags contains must contain at least 1 valid item(s) 1
/tags/0 minItems must NOT have fewer than 4 items 1
/tags/1 minItems must NOT have fewer than 4 items 1
/tags/1/0 const must be equal to constant 1
/tags/1/1 pattern must match pattern ^[a-f0-9]{64}$ 1

Root cause: gitplaza emits status events with only a bare ["e", event_id] tag (2 items) and a ["client","gitplaza"] tag. The schema requires e-tags with at least 4 items including the "root" marker: ["e", hex64, relay_or_empty, "root"]. The client tag fails because it doesn't match the expected e or p tag structure.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    app:gitplazaIssues affecting gitplazafailure-pinpointedExact AJV error paths, keywords, and sample values documentedverified-nipNIP specification verified against the actual NIP documentverified-schemaSchemata schema verified as correct for this kindverified-sourceBug verified in app source code with file/line references

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions