feat(cli): add sprout notes for NIP-23 long-form notes#718
Closed
tlongwell-block wants to merge 1 commit into
Closed
feat(cli): add sprout notes for NIP-23 long-form notes#718tlongwell-block wants to merge 1 commit into
sprout notes for NIP-23 long-form notes#718tlongwell-block wants to merge 1 commit into
Conversation
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>
Collaborator
Author
|
Superseded by #719 (combined CLI + relay a-tag fix per Tyler). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)
notes set --name <slug> [--title T] [--summary S] [--tag t]... [--clear-tags] --content -(kind:30023, me, d=slug). Read-before-write preservespublished_aton edits and carries title/summary/tags when omitted;""/--clear-tagsclears.--titlerequired on first publish. Prints durable refs (event id, naddr, coordinate, slug).notes get (--naddr <naddr> | --name <slug> [--author <ref>]) [--content-only]#dlookup by name. >1 hit → candidates + non-zero exit. Never guesses.notes ls [--author <ref>] [--tag t] [--limit N]--author allacross the team. Bounded (default 50, cap 200).notes rmis intentionally deferred: the relay's NIP-09 a-tag deletion is a no-op for 30023 today (#714, fix in #716).rmlands 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
--name+--authoris the human form. Memory pointers store both.d/title/summary/t/published_at); global, noh-tag.build_set_event) and tag parsing (NoteSnapshot::from_event) are fully unit-tested;e2e_long_formgains aset-twice-preserves-published_atround-trip.Testing
cargo test -p sprout-cli --lib98/98 ·clippy --all-targets -D warningsclean ·fmt --checkclean ·e2e_long_formcompiles (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.