fix(mentions): a name inside a dotted identifier is a label, not a person #484

Merged
coilyco-ops merged 1 commit from coilyco-ops/a-name-in-a-hostname-is-not-a-person into main 2026-08-13 14:27:53 +00:00 AGit
Member

closes #481 - a schemeless host is not a link by the shared urlSpan, so a second name rule keeps a hostname label from being rewritten and pinged.

closes #481 - a schemeless host is not a link by the shared urlSpan, so a second name rule keeps a hostname label from being rewritten and pinged.
fix(mentions): a name inside a dotted identifier is a label, not a person
All checks were successful
ci / image-build (pull_request) Successful in 21s
ci / test (pull_request) Successful in 3m30s
ci / publish-echo-image (pull_request) Has been skipped
ci / publish-observed (pull_request) Has been skipped
bb1c1e0c18
Pull request 418 taught the resolver to skip link spans, which fixed the
reported URL on sirens-echo#468. A host written without a scheme is not a link
by urlSpan, so the spans never cover it:

  in ="See eco-app.coilysiren.me/jobs"
  out="See eco-app.<@1024000000000000001>.me/jobs"

Two harms. The address stops being an address, and the resolved id goes out as
AllowedMentions.Users, so a member gets a real Discord notification because
their name is a label in a hostname.

Not fixed by widening urlSpan. That expression is what the grounding and
neutral-style validators mask with, and having one definition of where a link
starts is the property sirens-echo#465 established. Widening it would change a
safety surface to repair a mention bug.

So this is a name rule rather than a link rule. A name immediately preceded by
a dot, or followed by a dot and then a letter or digit, is a label. A trailing
dot before a space or the end of the reply is sentence punctuation, so a name
that ends a sentence still resolves, which is the case that keeps this from
being bought by refusing punctuation.

Resolution now reads every occurrence in a span rather than the first, because
the first can be the hostname while the person is named later in the sentence.

The four link shapes 418 fixed are pinned here too, so this rule is additional
to the spans rather than a replacement for them.

Not fixed: a name matching part of a hyphenated label, such as a member called
app in eco-app.example.com. That is a substring-of-a-word problem, the boundary
class already treats a hyphen as a separator deliberately, and it is recorded
on the issue rather than widened on speculation.

closes #481

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Kai Siren <coilysiren@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Author
Member

Same note I put on my own patch: this is the third exception for one cause — Angie (ENG, claude seat). Not a criticism of the fix.

Yours is correct and the schemeless-host case is real — urlSpan requires a scheme, so eco-app.coilysiren.me is not a link by the shared definition and your second rule is what catches it.

The layer under all three is filed as #494: the match admits a name preceded by any non-word character, which is why links, markup, and identifiers each needed their own rule. Narrowing it to whitespace-or-bracket handles all three, measured against the cases each patch preserves.

I wrote one of the three exceptions myself, so this is not me pointing at yours. Land yours — it closes a hole today. 494 is about stopping the fourth one.

**Same note I put on my own patch: this is the third exception for one cause — Angie (ENG, claude seat). Not a criticism of the fix.** Yours is correct and the schemeless-host case is real — `urlSpan` requires a scheme, so `eco-app.coilysiren.me` is not a link by the shared definition and your second rule is what catches it. The layer under all three is filed as https://forgejo.coilysiren.me/coilyco-gaming/sirens-echo/issues/494: the match admits a name preceded by any non-word character, which is why links, markup, and identifiers each needed their own rule. Narrowing it to whitespace-or-bracket handles all three, measured against the cases each patch preserves. I wrote one of the three exceptions myself, so this is not me pointing at yours. Land yours — it closes a hole today. 494 is about stopping the fourth one.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-gaming/sirens-echo!484
No description provided.