Skip to content

docs: add NIP parity audit for the rewrite - #872

Merged
chappie-daemon merged 2 commits into
mainfrom
factory/001-nip-audit
Oct 17, 2026
Merged

chappie-daemon merged 2 commits into
mainfrom
factory/001-nip-audit

Conversation

@chappie-daemon

Copy link
Copy Markdown
Collaborator

What this is

Phase 0 of the Rust rewrite: the protocol-currency audit for
cameri/nostream#861, parent
cameri/nostream#860.

docs/rewrite/nip-parity.md diffs the Nostr NIP registry as of 2026-10-15
(nostr-protocol/nips @ a79e21d9, the last commit before that date) against what
this relay implements at the capture commit 242a3001 plus the 24 commits absorbed
through 041fe34e (3.5.1), and records a rewrite disposition for every one of the
99 NIP documents in the registry at that revision.

What is in it

  • A 99-row disposition table — NIP | Status | Summary | Advertised | In nostream | Delta | Disposition — in registry order, with the registry's own status word and unrecommended flag, membership in supportedNips at 041fe34e (25 ids), what this relay does today, whether the registry text and the relay's behaviour differ, and one of must-have / opportunistic / out-of-scope.
  • Ten behavioural deltas, each citing the registry file and its section and the src/ code path affected: NIP-01 (prefix vs exact filter values), NIP-11 (six fields the registry does not define — two limitation keys it removed, max_filters and min_prefix, and four keys it has never defined — against the fourteen it does define, all of which this relay emits), NIP-15 and NIP-22 (the numbers were reassigned — this relay advertises the old meanings), NIP-42 and NIP-67 (the EOSE auth hint), NIP-43 (claims moved to NIP-86), NIP-44 (the raised plaintext cap), NIP-62 (soft delete where the NIP asks for deletion), NIP-78 (no AUTH guard on kinds 78/30078). NIP-77 is examined and found to have no relay-visible divergence in the registry text — its wire protocol and advertisement both landed after the capture commit.
  • Every other registry change in the window (registry files that changed on or after 2024-01-01, for a NIP this relay advertises or implements) accounted for with what changed and why it does not reach a relay.
  • The 24 post-capture commits sorted into the four that touch protocol code and the twenty that do not.
  • The advertisement mismatches: five advertised numbers with no NIP-specific code or with a reassigned meaning, nine live features that are not advertised, and README.md's NIP list disagreeing with supportedNips in both directions.
  • Open items for Phase 2 — eleven, in the order they affect the rewrite.

How it was checked

  • Two completeness oracles written for this job, both exiting 0: the disposition table's shape, per-row registry-status agreement, agreement between the Advertised column and git show 041fe34e:package.json, and a citation section for every claimed delta; plus an accounting check that every registry change in the window is named outside the table.
  • Six independent review lenses (security, UX, UI, code, architecture, performance) over five rounds. Round 1 returned changes from all six; rounds 2–4 closed every finding but kept finding new ones in the prose each round had just written — round 4's three lenses independently falsified one universal the previous round had introduced. This branch carries round 5's response to all six round-4 findings, and no lens has reviewed it: the job escalated with the review halted at round 5, and decision.md in the job folder records what was and was not reviewed.
  • changeset status --since origin/main exits 0 with an empty changeset, and the commit subject is conventional.

What it does not do

No source, test, schema or configuration change. No issue is filed — #861 says the dispositions become issues in Phase 2, and this document is what Phase 2 works from. No NIP is implemented and no part of the rewrite's architecture is decided.

One integration note for #860

The rewrite's integration branch, rewrite/main, is cut from the capture commit 242a3001. This document merges to main after that cut, so it will not be on rewrite/main unless the cut moves or the file is carried across. Its baseline is the capture commit plus the 24 commits through 041fe34e, so it is written for the branch as it will be when the cut is refreshed — and its test/ citations are pinned to 041fe34e, which is not what the cut carries today.

Adds docs/rewrite/nip-parity.md and .changeset/wise-berries-nail.md.
@changeset-bot

changeset-bot Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: dc5b32a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@greptile-apps

greptile-apps Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Low impact] Documentation audit of protocol compliance.

Safe to merge without changing runtime behavior, with three non-blocking corrections recommended before Phase 2 uses the audit.

Findings

  1. P2 Deletion support is overstated ▶
  2. P2 Channel metadata storage is misstated ▶
  3. P2 Existing tests are overlooked ▶

Summary

Adds a 99-row NIP audit for the Rust rewrite, with implementation notes, advertised capabilities, protocol differences, and Phase 2 decisions.

  • The audit maps 99 NIPs to Rust rewrite priorities.

Acknowledged by chappie-daemon: protocol fixes and missing parity tests are intentionally deferred to Phase 2; carrying the document onto rewrite/main is a known integration step. These are not reported as implementation defects in this PR.

Reviews (1) · Last reviewed commit: "docs: add NIP parity audit for the rewri..." · Reviewed by Greptile

Comment thread docs/rewrite/nip-parity.md Resolved
Comment thread docs/rewrite/nip-parity.md Resolved
Comment thread docs/rewrite/nip-parity.md Resolved
- NIP-09: DeleteEventStrategy collects only e tags; a-tag deletion is absent
  (row 09, new delta section, new Phase 2 item 12)
- NIP-28: kind 41 (channel metadata) is replaceable and routed to
  ReplaceableEventStrategy; 40 and 42-49 use DefaultEventStrategy
- NIP-11: max_filters, max_filter_values and search_supported do have tests;
  the untested set is min_prefix, supported_nip_extensions, supported_mips,
  max_event_tags

Addresses Greptile's three P2 threads on #872. Oracle passes.
@chappie-daemon
chappie-daemon merged commit 526054b into main Oct 17, 2026
12 checks passed
@chappie-daemon
chappie-daemon deleted the factory/001-nip-audit branch October 17, 2026 03:17
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.

1 participant