You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
id(note_links): check_note_link_op refusal messages state the opposite of the failed condition — empty surface 'is not empty', non-NFC surface 'is NFC' #4372
Two of the three field-error messages in check_note_link_op state the opposite of the condition that produced them. A peer (or operator) whose note.link event is refused is told the surface satisfies the very rule it broke.
Line 100: when surface.is_empty() is true, the error is "a link's authored surface is not empty" — the surface is empty; the message asserts it is not.
Line 111: when !is_nfc(surface) is true, the error is "a link's authored surface is NFC" — the surface is not NFC; the message asserts it is.
The third message in the same function (line 104-107, over-long surface: "is {} bytes, it may be at most {MAX_SURFACE_BYTES}") is factual, which makes the other two read as copy slips, not a style.
House style in the sibling validator states the fact: pkgs/id/src/tag_claims.rscheck_text returns "the {field} is not NFC" for the same condition, and pkgs/id/src/idset.rscheck_scope returns "the scope is not NFC".
These errors are not local-only: check_note_link_op is called on the chain receipt path (pkgs/id/src/chain.rs:307), so the inverted text is what a refused event's sender/operator sees in logs and error propagation.
Why it matters
Refusal reasons are the debugging surface for a signed-event protocol: a sender told their surface "is not empty" when it is empty (or "is NFC" when it is not) will fix the wrong thing or conclude the receiver is broken. The values are also pinned by no test — test_check_rejects_a_bad_surface_and_a_wrong_kind (note_links.rs tests) matches only Err(NoteLinkError::Field(_)), so the inversion survived review.
Acceptance criteria
The empty-surface error states the surface is empty (e.g. "a link's authored surface is empty" / "must not be empty" phrased as a fact about the input).
The non-NFC error states the surface is not NFC, matching the tag_claims/idset phrasing.
A test pins the message text (or at least the distinguishing wording) for both cases, not just the Field(_) variant.
No behavior change: the same inputs are accepted/refused as before.
Session / ID: new-issue-creator-code-b run 2026-11-02 07:20 CST
Found via: filed this run
Task: check_note_link_op's empty-surface and non-NFC refusal messages state the opposite of the failed condition; fix the text and pin it with a test
Expectation: effort/xs — error-text correction only, no accept/refuse behavior change; done when both messages state the fact and a test pins the wording
Links: pkgs/id/src/note_links.rs:97-115; receipt call site pkgs/id/src/chain.rs:307
agent-note:v1
event: picked_up
task: 6245 (repo-health-code-pilot, repo-worker-code, lane code-h)
state: claimed fix #4372; fresh revalidation: issue #4372 OPEN, no hard-stop labels, no existing PR or branch for this fix. Execution lane: direct.
next: laptop worktree on branch queue/6245-4372-note-links-messages; correct the two inverted refusal messages in pkgs/id/src/note_links.rs and add message-text tests.
agent-note:v1
event: done
task: 6245 (repo-health-code-pilot, repo-worker-code, lane code-h)
state: fixed_merged. PR #4500 MERGED at 2026-11-02T17:53:46Z, merge commit 87dddae; issue auto-closed by the merge. Messages corrected: empty surface now reads "a link's authored surface is empty", non-NFC now reads "a link's authored surface is not NFC"; new test test_check_names_the_surface_fault_in_its_message pins both texts. Codex review on the PR head: no findings.
tests: verbatim-slice probe crate on the laptop (check_note_link_op + its types extracted byte-for-byte from the edited file) — cargo test 2/2 pass, including behavior-unchanged cases. Full id lib remains blocked on main by issue #4454, unrelated to this module.
next: none for task 6245.
Activity
dezren39 commentedon Nov 2, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 2, 2026
🤖 Agent note · state: picked up
check_note_link_opinpkgs/id/src/note_links.rsreturns inverted refusal messages for the empty-surface and non-NFC branches, then routing a fix packet.2 remaining items
dezren39 commentedon Nov 2, 2026
agent-note:v1
event: picked_up
task: 6245 (repo-health-code-pilot, repo-worker-code, lane code-h)
state: claimed fix #4372; fresh revalidation: issue #4372 OPEN, no hard-stop labels, no existing PR or branch for this fix. Execution lane: direct.
next: laptop worktree on branch queue/6245-4372-note-links-messages; correct the two inverted refusal messages in pkgs/id/src/note_links.rs and add message-text tests.
Merge pull request #4500 from developing-today/queue/6245-4372-note-l…
dezren39 commentedon Nov 2, 2026
agent-note:v1
event: done
task: 6245 (repo-health-code-pilot, repo-worker-code, lane code-h)
state: fixed_merged. PR #4500 MERGED at 2026-11-02T17:53:46Z, merge commit 87dddae; issue auto-closed by the merge. Messages corrected: empty surface now reads "a link's authored surface is empty", non-NFC now reads "a link's authored surface is not NFC"; new test test_check_names_the_surface_fault_in_its_message pins both texts. Codex review on the PR head: no findings.
tests: verbatim-slice probe crate on the laptop (check_note_link_op + its types extracted byte-for-byte from the edited file) — cargo test 2/2 pass, including behavior-unchanged cases. Full id lib remains blocked on main by issue #4454, unrelated to this module.
next: none for task 6245.