Repository navigation
feat(relay): implement the fourteen event strategies behind the capture's census - #976
Merged
Merged
Conversation
…and NIP-43 helpers
The relay refuses an oversized frame from its declared length, so it can close before the client finishes writing 614 600 bytes. The client's send then fails with Io(BrokenPipe) and the test aborted there, never comparing the close frame it exists to assert: 10 failures in 20 release runs on an idle box. Tolerate an IO error on that send and keep the 1009 comparison as the assertion. A non-IO send failure still fails. Measured after the fix: 0 failures in 30 runs, with the write losing the race in 11 of 20 during classification. Also correct four line citations in ADR 0006 that round 2's inserts moved.
The DuplicateEvent variant this branch added moved the storage crate's own doc on forwarding a driver's message to a caller; the citation still named the old span. The UnavailableWotGraph item ends at the impl's closing brace, not one line past it.
The rule against forwarding a driver's message is stated in the first two lines of the doc block, and the UnavailableWotGraph impl closes one line past the span cited at the previous commit.
🦋 Changeset detectedLatest commit: ba95e52 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
8 tasks
[High impact] The changes since the previous review appear safe to merge.
|
…s something `pubkey_hex()` returned `"3".repeat(64)`, so `to_uppercase()` was the identity and `uppercase_hex_names_the_same_target` asserted that parsing a string equals parsing the same string. Greptile P2 on #976. The fixture is now hex with letters in it, and the test guards itself with an assert_ne so an all-digit fixture fails loudly instead of passing vacuously. Mutation-checked: restoring `"3".repeat(64)` fails with the guard's message. Same for the event-id fixture, which had no uppercase test but the same shape.
This was referenced Oct 24, 2026
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.
Implements the fourteen
NotImplementedevent-strategy arms behind the existingselect/EventStrategyseam, plus the three core pieces they call. Every arm is ported from the capture at242a3001and pinned by a census that now covers all 36 strategy spec files.Closes #974.
Needs a human — access and identity
The factory's approver returned ESCALATE with all three approve conditions holding. The condition is
money-access-identity, and the reason is what this branch makes live rather than how it was built: these four arms no longer answerNotImplemented, they decide things.join_request— NIP-42 gate, thenclaim_code, thenadmit_userleave_request— revocationreport—mark_actionable_targetunderhide_actionable_reportsJob 007 escalated on the same condition for the storage half of this path.
Both features ship disabled (
nip43.enabled: false,nip56.enabled: false,nip56.hideActionableReports: falseinresources/default-settings.yaml), so the question is narrow and it is a judgement rather than a defect: is dormant-by-default enough forrewrite/main, or should those three arms be read by a person first?Evidence, for a reader who will not open
build.mdcensus: 658 cases, 612 mapped across 200 mapping rows to 182 test functions, 7 exempt groups holding 46 cases,4 passed; 0 failed.242a3001prints658 cases from 36 filesand diffs empty againstcrates/nostream-relay/tests/fixtures/ts-cases.json.git merge-tree --write-tree rewrite/main factory/011-relay-strategiesexits 0.Repository checks in both profiles:
cargo fmt --all --checkclean, both clippy passes clean with no warning line,cargo test --workspace --all-features56 test targets,0 failed, in debug and in release,cargo build --workspace --all-features --releaseclean.What lands
crates/nostream-relay/src/strategies/contact_list,delete,dvm_job_request,ephemeral,gift_wrap,group,invite_request,join_request,leave_request,parameterized_replaceable,replaceable,report,timestamp,vanishcrates/nostream-corenip03(OpenTimestamps validation for kind 1040),nip56(report target extraction),report_scoring(ReportWeight::weight)crates/nostream-relay/src/wot.rsWotGraphtrait andUnavailableWotGraph, carried onHandlerContextbesidelimits658 cases, 612 mapped, 36 spec filestests/strategies.rs(100 cases) and the extended parity oracleReview
Two rounds, four lenses each (ui and ux stood down in both, with reasons checked against the whole branch diff rather than the round's). Round 1 returned CHANGES from code and architecture — four findings, all closed and re-verified against the code in round 2. Security and performance passed in both rounds.
Verdict sequencing: the approver's decision was reached on
ae6f889. The tree now differs only in the two ADR citation lines committed at06463a5, which is why the verdict still stands; the approver checked that delta by hand.Notes for the reader
.husky/pre-commitdrives the legacy pnpm lint/build/test and its.husky/_/husky.shis absent in the worktree, so it aborts before any check. Commits usedHUSKY=0 git commit --no-verify. What ran instead is the list under Evidence, in full, at the head.wire_parity's oversized-frame step no longer requires a 614 600-byte write to succeed. The relay refuses on the frame's declared length and may close before the client finishes writing, which is what the capture's socket does too; the step tolerates an IO error on that write and keeps the 1009 close comparison as its assertion. Measured at24b679c: 10 failures in 20 release runs before; 0 in 30 after, with 11 of 20 writes losing the race during classification. Closes relay: the wire_parity release test fails intermittently with BrokenPipe #974.