Skip to content

feat(cli): add sprout notes for NIP-23 long-form notes#718

Closed
tlongwell-block wants to merge 1 commit into
mainfrom
feat/notes-cli
Closed

feat(cli): add sprout notes for NIP-23 long-form notes#718
tlongwell-block wants to merge 1 commit into
mainfrom
feat/notes-cli

Conversation

@tlongwell-block
Copy link
Copy Markdown
Collaborator

What

Adds sprout notes — a command group for editable NIP-23 long-form notes (kind:30023). This is our team knowledge base: write a skill once as an editable note, reference it by name from agent memory instead of re-deriving it.

Surface (v1)

verb behavior
notes set --name <slug> [--title T] [--summary S] [--tag t]... [--clear-tags] --content - Idempotent upsert keyed by (kind:30023, me, d=slug). Read-before-write preserves published_at on edits and carries title/summary/tags when omitted; ""/--clear-tags clears. --title required on first publish. Prints durable refs (event id, naddr, coordinate, slug).
notes get (--naddr <naddr> | --name <slug> [--author <ref>]) [--content-only] Exact by coordinate; cross-author #d lookup by name. >1 hit → candidates + non-zero exit. Never guesses.
notes ls [--author <ref>] [--tag t] [--limit N] Own notes by default; --author all across the team. Bounded (default 50, cap 200).

notes rm is intentionally deferred: the relay's NIP-09 a-tag deletion is a no-op for 30023 today (#714, fix in #716). rm lands once that's authoritative, so set/get/rm all operate on the same coordinate identity rather than shipping an event-id-based delete next to coordinate-based set.

Design

  • naddr is the canonical reference; --name + --author is the human form. Memory pointers store both.
  • Standard NIP-23 tags only (d/title/summary/t/published_at); global, no h-tag.
  • Pure, relay-free units: carry-forward logic (build_set_event) and tag parsing (NoteSnapshot::from_event) are fully unit-tested; e2e_long_form gains a set-twice-preserves-published_at round-trip.

Testing

cargo test -p sprout-cli --lib 98/98 · clippy --all-targets -D warnings clean · fmt --check clean · e2e_long_form compiles (relay-gated like its siblings).

Co-authored by Dawn (scaffold + helpers), Max (get/ls), Quinn (set). Closes the CLI half of the long-form notes effort; #716 is the independent relay-side companion.

Adds a `notes` command group for editable long-form notes (kind:30023) —
a team knowledge base with version-in-place editing, referenced by name
from agent memory.

Surface (v1):
- `notes set --name <slug> [--title T] [--summary S] [--tag t]... [--clear-tags] --content -`
  Idempotent upsert keyed by (kind:30023, me, d=slug). Read-before-write
  preserves `published_at` across edits and carries title/summary/tags when
  omitted; explicit `""`/`--clear-tags` clears. `--title` required on first
  publish (NIP-23). Prints durable refs: event id, naddr, coordinate, slug.
- `notes get (--naddr <naddr> | --name <slug> [--author <ref>]) [--content-only]`
  Exact by coordinate; cross-author `#d` lookup by name. >1 hit prints
  candidates and exits non-zero — never guesses.
- `notes ls [--author <ref>] [--tag t] [--limit N]`
  Own notes by default; `--author all` across the team. Bounded (default 50,
  cap 200).

`notes rm` is intentionally deferred: the relay's NIP-09 a-tag deletion path
is a no-op for 30023 today (#714, fix in flight). `rm` lands once that's
authoritative so set/get/rm all operate on the same coordinate identity.

Standard NIP-23 tags only (d/title/summary/t/published_at); global, no h-tag.
Pure carry-forward logic (`build_set_event`) and tag parsing
(`NoteSnapshot::from_event`) are unit-tested; `e2e_long_form` gains a
set-twice-preserves-published_at round-trip.

Signed-off-by: tlongwell-block <109685178+tlongwell-block@users.noreply.github.com>
Co-authored-by: Dawn (sprout agent) <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: Max (sprout agent) <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: Quinn (sprout agent) <96f056ad5f2305c8ddf637dc65d048aa4c12d7daeb8867690e34fca46b0ef64c@sprout-oss.stage.blox.sqprod.co>
@tlongwell-block
Copy link
Copy Markdown
Collaborator Author

Superseded by #719 (combined CLI + relay a-tag fix per Tyler).

@tlongwell-block tlongwell-block deleted the feat/notes-cli branch May 22, 2026 19:06
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