fix(mentions): a person is named in prose, so narrow what may precede a name #498

Merged
coilyco-ops merged 2 commits from fix/a-person-is-named-in-prose into main 2026-08-13 15:01:23 +00:00
Member

closes #494

Three patches in three hours for one defect — #465 (links), #479 (markup), #481 (dotted identifiers). All correct. All one layer above the cause.

The cause

[^\w<@] admits any non-word character. A dot, slash, colon, hyphen. So a name matched inside anything that is not prose, and every structure containing name-shaped text needed its own exception.

The rule

A person is named in prose, and in prose a name follows whitespace, an opening bracket, or the start of the reply.

                                       before    after
coilysiren asked about it              match     match
ask coilysiren about it                match     match
(coilysiren) filed it                  match     match
"coilysiren" filed it                  match     match
https://eco-app.coilysiren.me/jobs     match     no match
see eco-app.coilysiren.me for jobs     match     no match
<:coilysiren:123>                      match     no match
a.coilysiren.b                         match     no match
/repos/coilysiren/sirens-echo          match     no match

Two tests assert this against the lead directly rather than through the resolver, so they show the narrowing is doing the work rather than the exceptions catching it afterwards.

The exceptions stay

They are tested, they carry corpora worth keeping, and they are now defence in depth rather than the defence. All three corpora pass unmodified — they are the regression suite for this change.

Disclosure

I wrote one of the three exceptions. I filed this rather than claiming it, then took it when it had sat uncommented while the class kept producing defects. The merge gate is the second opinion I wanted.

ward exec gate green: build, policy-check, vet, test, test-skips, pre-commit.

closes #494 Three patches in three hours for one defect — https://forgejo.coilysiren.me/coilyco-gaming/sirens-echo/issues/465 (links), https://forgejo.coilysiren.me/coilyco-gaming/sirens-echo/issues/479 (markup), https://forgejo.coilysiren.me/coilyco-gaming/sirens-echo/issues/481 (dotted identifiers). All correct. All one layer above the cause. ## The cause `[^\w<@]` admits **any** non-word character. A dot, slash, colon, hyphen. So a name matched inside anything that is not prose, and every structure containing name-shaped text needed its own exception. ## The rule A person is named **in prose**, and in prose a name follows whitespace, an opening bracket, or the start of the reply. ``` before after coilysiren asked about it match match ask coilysiren about it match match (coilysiren) filed it match match "coilysiren" filed it match match https://eco-app.coilysiren.me/jobs match no match see eco-app.coilysiren.me for jobs match no match <:coilysiren:123> match no match a.coilysiren.b match no match /repos/coilysiren/sirens-echo match no match ``` Two tests assert this **against the lead directly** rather than through the resolver, so they show the narrowing is doing the work rather than the exceptions catching it afterwards. ## The exceptions stay They are tested, they carry corpora worth keeping, and they are now **defence in depth rather than the defence**. All three corpora pass unmodified — they are the regression suite for this change. ## Disclosure I wrote one of the three exceptions. I filed this rather than claiming it, then took it when it had sat uncommented while the class kept producing defects. The merge gate is the second opinion I wanted. `ward exec gate` green: build, policy-check, vet, test, test-skips, pre-commit.
fix(mentions): a person is named in prose, so narrow what may precede a name
All checks were successful
ci / test (pull_request) Successful in 41s
ci / publish-echo-image (pull_request) Has been skipped
ci / publish-observed (pull_request) Has been skipped
ci / image-build (pull_request) Successful in 21s
36d46a169e
Three patches landed in three hours for one defect, each adding an exception:
links, then Discord markup, then dotted identifiers and schemeless hosts. They
are all correct and they are all one layer above the cause.

The match admitted a name preceded by any non-word character. A dot, a slash,
a colon, a hyphen. So a name matched inside anything that is not prose, and
every structure containing name-shaped text needed its own rule. Three found
and no reason to think three was the number.

A person is named in prose, and in prose a name follows whitespace, an opening
bracket, or the start of the reply. That one rule covers every case the three
patches were written for, and keeps every case they preserve, which two tests
assert directly against the lead rather than through the resolver.

The exceptions stay. They are tested, they carry corpora worth keeping, and
they are now defence in depth rather than the defence. Their corpora are the
regression suite for this change and all three pass unmodified.

closes #494

Co-authored-by: Kai Siren <coilysiren@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
coilyco-ops force-pushed fix/a-person-is-named-in-prose from 36d46a169e
All checks were successful
ci / test (pull_request) Successful in 41s
ci / publish-echo-image (pull_request) Has been skipped
ci / publish-observed (pull_request) Has been skipped
ci / image-build (pull_request) Successful in 21s
to 174319dc51
Some checks failed
ci / image-build (pull_request) Successful in 22s
ci / test (pull_request) Failing after 34s
ci / publish-echo-image (pull_request) Has been skipped
ci / publish-observed (pull_request) Has been skipped
2026-08-13 14:38:26 +00:00
Compare
fix(mentions): the lead now covers the fourth shape too, and the doc says why
All checks were successful
ci / image-build (pull_request) Successful in 21s
ci / test (pull_request) Successful in 34s
ci / publish-echo-image (pull_request) Has been skipped
ci / publish-observed (pull_request) Has been skipped
213f9380da
A code-span exception landed while this was in flight, which is the fourth
patch for one cause. It also caught a real regression in my rule: I had
admitted a backtick as an opening bracket, so a name inside a code span still
matched, and their test said so.

Dropping the backtick covers code spans. Adding the emphasis marks keeps a name
in bold or italic resolving, which their other test caught me breaking. Their
corpora are why both of those were found before merge rather than after.

Two characterization tests documented defects this fixes, and both said to
delete them once fixed. Deleted, and replaced with assertions of the fixed
behaviour over the same corpora.

The doc now states the rule instead of enumerating the exceptions, because the
enumeration was the thing that kept losing.

Co-authored-by: Kai Siren <coilysiren@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
coilyco-ops force-pushed fix/a-person-is-named-in-prose from 213f9380da
All checks were successful
ci / image-build (pull_request) Successful in 21s
ci / test (pull_request) Successful in 34s
ci / publish-echo-image (pull_request) Has been skipped
ci / publish-observed (pull_request) Has been skipped
to 7b8291d251
All checks were successful
ci / image-build (pull_request) Successful in 23s
ci / test (pull_request) Successful in 42s
ci / publish-echo-image (pull_request) Has been skipped
ci / publish-observed (pull_request) Has been skipped
2026-08-13 14:48:20 +00:00
Compare
coilyco-ops force-pushed fix/a-person-is-named-in-prose from 7b8291d251
All checks were successful
ci / image-build (pull_request) Successful in 23s
ci / test (pull_request) Successful in 42s
ci / publish-echo-image (pull_request) Has been skipped
ci / publish-observed (pull_request) Has been skipped
to f6cde4516a
All checks were successful
ci / image-build (pull_request) Successful in 22s
ci / test (pull_request) Successful in 37s
ci / publish-echo-image (pull_request) Has been skipped
ci / publish-observed (pull_request) Has been skipped
2026-08-13 14:56:16 +00:00
Compare
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!498
No description provided.