Skip to content

The library's public surface is not frozen, and that is what 1.0 means #296

Description

@sepehr-safari

The work here lands in zig-nostr/nostr, which is at 0.14.1 while its README still says APIs may change before 1.0. That was the right call while the API was moving. What it costs is that somebody building on the library cannot tell which parts have stopped moving, because nothing in the repo separates the settled half from the half still being written.

Freeze: BIP-340 keys and signatures, the NIP-01 event, filter and subscription model, NIP-19 entities (npub, nsec, note, nevent, naddr), and NIP-44 v2 payload encryption. All are checked against the official vectors and have not changed shape.

Leave outside it, and say so: keystore, signer and signer_ipc, which root.zig already marks "experimental, pre-1.0", plus store, relay and the outbox, which are still gaining behaviour. A 1.0 has to name what it does not cover as precisely as what it does.

The work:

  • Write the frozen set down in the repo, including what it means for a caller that a pre-1.0 module is exported from root.zig all the same.
  • Settle the error model on the frozen half. A public error set is part of a frozen signature, and check in store.zig folds every non-success LMDB code into error.Lmdb, so a caller cannot tell a full map from a duplicate id (Tell a full store apart from a duplicate id, and give it a retention window #124).
  • For every allocating function in the frozen half, state who owns what comes back in its doc comment rather than leaving it to the tests.
  • Tag v1.0.0, and say in the README what the promise covers and what it does not.

Already done and no longer part of this: pub const version agrees with the package (both 0.14.1) and CURRENT_STATE.md no longer repeats a number at all; the pre-1.0 modules are labelled at their exports; and the wire format is fuzzed, which src/fuzz.zig drives under zig build test and as a real loop under zig build test --fuzz.

Done

The README names the frozen surface and the promise attached to it, every allocating function in that surface says who owns its result, the error model on it is settled, and v1.0.0 is tagged.

Activity

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions