docs: an example that ranks a nostr feed with Jev - #31
Merged
Merged
Conversation
examples/jev/rank-notes.sh fetches the newest notes from five relays into a local store, drops the app data some clients publish as kind:1, and asks Jev three typed questions about each note (topic, substance, spam). The thresholds that decide what is spam and when a topic is too uncertain are constants at the top of the script. Rate limits and server errors are retried with a growing pause; any other failure skips that note. --dry-run prints the requests without calling the API. The README records a real run over 1,000 notes and what it cost, and what to watch for: automated news posts near the spam line, replies judged without their parent, lower accuracy outside English. The skill and the README point at it, and CI now checks that example scripts parse and stay ASCII.
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.
Closes #30
examples/jev/rank-notes.sh: deed fetches the newest notes from five relays into a local store, the script drops empty notes and the JSON app data some clients publish as kind:1, and Jev answers three questions per note (topic as a Choice, substance as a Score, spam as a Noul). Thresholds for spam and for an uncertain topic are constants in the script. Requests run eight at a time; 429, 5xx and dropped connections are retried with backoff, anything else skips that note and says why.Verified:
--dry-runand a paid run under macOS's/bin/bash3.2, after making xargs start the same bash that runs the script (a bash 5 child cannot read functions exported by 3.2)Also: the skill gets a short section pointing at the example (and telling an agent to dry-run first and ask before a paid run), the README gets an Examples section, and CI's ASCII and parse checks now cover
examples/*/*.sh.