Skip to content

[Rewrite P2] NIP currency: implement audit-identified gaps in Rust #870

Closed

Description

@chappie-daemon

Parent: #860
Milestone: Phase 2: Protocol core
Host: chappie · Expected cost: $2.50

Implement the NIP gaps Phase 0's audit finds, in the Rust core/relay — protocol currency is judged at the capture date, and the audit (#861) produces the authoritative list.

Acceptance: supportedNips in the Rust relay matches #861's audited must-have list; every advertised NIP has implementation + vectors.

Estimate basis (2026-10-24): $2.50 - the NIP gaps list is unknown until #861's audit output is read in full; bracketed by job 008's per-module cost at one to three modules of work. Model and per-unit costs: .factory/estimates.md.

Activity

  1. added
    rewritenostream 4.0 Rust/LMDB rewrite
    rustRust implementation work
    factoryBuilt by the software factory
    on Oct 17, 2026
  2. chappie-daemon commented on Nov 9, 2026

    @chappie-daemon
    CollaboratorAuthor

    Shipped in the squash-merge-free merge 4adaa42392526d750f0cd7614d317ed192ffedb1 (PR #1094, merged into rewrite/main at 2026-11-09T16:41:37Z by Cameri; tree byte-identical to the reviewed head c2e3db8, git diff c2e3db8 4adaa42 empty).

    What landed

    • The advertised set is the Phase 0 audit's 33 must-have rows plus NIP-67 — 34 ids, ascending, pinned by a test that restates the list literally (an expectation read from the constant stays green under every wrong value).
    • Six NIP vectors (14, 22, 28, 50, 65, 89), NIP-44's 6-byte prefix and clause ceilings derived at compile time, NIP-09 a-tag deletion with a 100-distinct-address cap and resolve+delete sharing one transaction, and a nip-generic-events harness session (93 steps over 17 sessions, 1 declared tolerance; census untouched at 658).
    • NIP-67 hints ["EOSE", <subid>, [<hint>…]] per the registry — feat(nip67): support EOSE completeness hints #718's {"completeness": …} object is a different message and is rejected in the code comment.
    • Completeness is provable, not asserted. finish needs six conditions: clean stream end, no backend page cap, no spent page slot, the backend's matcher agreeing on refused rows, its predicate agreeing on search, and its tag index able to answer every criterion. The last two are declared capabilities beside page_bound() (search_rule, empty_tag_rule) rather than rules hardcoded in the relay.

    Ten review rounds. Six shipped d4bbe4a; Greptile then failed the merge gate on a P1 the series never looked for — LMDB collected a page in one read transaction and read its values in another, so a key removed between them vanished without a trace and a short page read as complete, sending a false finish. Rounds 7–10 closed that (StreamedEvent::Vanished behind find_by_filters, counted as a spent slot), the second door the static review then found ({"#d":[""]} selects nothing from either index while Filter::matches accepts it), and the text those fixes outran.

    Cost $6.635 against $2.50 scoped, 34 sessions, 14.93 h — the estimate was wrong in kind, and the regret line in the job's runs.jsonl says so.

    Filed rather than fixed: #1090 (uncapped e-id arm), #1093 (finish can be false under nip56.hideActionableReports, default off), #1096–#1101 (pre-existing defects the round-7 static review and the approver found in touched files). The two Postgres arms — delete_by_addresses, empty_tag_rule — are read, not measured; one tests/parity.rs case against CI's postgres:16-alpine closes both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    factoryBuilt by the software factoryrewritenostream 4.0 Rust/LMDB rewriterustRust implementation work

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions