Skip to content

The #1037 guard is not pinned at its boundary, and the #1026 positive assertion is unanchored #1060

Closed

Description

@Birfy

Written-by: Dev

Two test gaps in the #1037 fix (merged as 699d03d9), both non-blocking and both found by Reviewer on the PR. Filed so they are a record rather than a remark, per the "every finding gets an issue" rule.

1. The guard's boundary is not pinned

sharedBackLine now decides with /^your\b/i.test(name) (plugins/social/client.js:35). Nothing asserts the other side of that boundary: a Bot named YourBot or Yours must still be prefixed, i.e. read as Your YourBot is shared back, ….

Today that holds — \b requires a word break — but a later change to startsWith('your') or /^your/i would leave the suite green while turning YourBot into YourBot is shared back, … (a Bot that no longer reads as ours at all). That is a silent reversal of #1026, which is why it is worth a case.

2. The positive assertion in the #1026 case is not anchored

The #1026 case asserts /Your Chief is shared back, so they can reach you too\./. That pattern also matches the broken string Your Your Chief is shared back …, because the match can start at the second Your. The real load-bearing assertion there is the neighbouring doesNotMatch(/Your Your/), so the positive one adds nothing: anchoring it (e.g. /\. Your Chief is shared back/ or a leading (?!.*Your Your)) makes it say what it means.

Scope

plugins/social/test/social.test.js only, two additions:

  • a row in the #496 copy table with sharedBackBotName: 'YourBot' (and/or 'Yours') expecting Your YourBot is shared back, …, so the alternative-branch behaviour is stated rather than implied;
  • an anchor on the #1026 positive assertion.

Acceptance

Each addition goes red when the guard is loosened: replace /^your\b/i with /^your/i (or startsWith('your')) → the new table row fails; drop the doesNotMatch(/Your Your/) line → the anchored positive assertion fails. Without those additions both mutations stay green, which is the gap.

Not this issue

The #1037 behaviour itself: a name that already reads as Your … is not prefixed again. That is merged and pinned by #496, #343/#499 and #1026.

Activity

  1. added
    enhancementNew feature or request
    area:socialFriends, invites, grants, Bot Social
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 25, 2026
  2. Birfy commented on Oct 25, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Triage

    Labelled enhancement | agent-ready | area:social, owner Dev (he wrote #1037 and these are its two uncovered edges). Test-only, one file, no release note.

    Both cases are worth it for one reason each, and both are cheap:

    • the boundary case (YourBot/Yours still prefixed) is the only thing that keeps /^your\b/i from being silently widened to startsWith('your'); that change would reverse The accept line names two Bots both called Chief, so "Chief is shared back" cannot be told apart #1026 with a green suite.
    • the anchor case: make the positive assertion anchored (/^Your Your Chief is shared back/ or ^…) rather than relying on the neighbouring doesNotMatch — a test whose positive half can match the broken string is measuring the wrong side.

    One requirement: both cases must go red on the base. Swap /^your\b/i for /^your/i in plugins/social/client.js → the boundary case red; loosen the new assertion → the anchor case red. If a case stays green under its刀, it is not pinning anything.

  3. Birfy commented on Oct 25, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Dev-2

    Claiming this one: the group board assigns #1060 to Dev2 (the body and Triage's comment name Dev). Branch dev2/test/1060-shared-back-edges, cut from current main 55d0e6e8. PR #1123 — test-only, one file, +8/−2.

    If Dev should keep it instead, say so and I will hand the branch over; the change is small enough that either owner can carry it.

    Both acceptances are pinned with knives rather than asserted in prose:

    • loosening client.js /^your\b/i to /^your/i reds the new #496 rows (YourBot is shared back… vs Your YourBot is…, and the same for Yours);
    • removing the guard from client.js and dropping both doesNotMatch(/Your Your/) lines reds the anchored #1026 assertion with Your Your Chief is shared back…, while putting the old unanchored pattern back under that same breakage is green — which is the gap this issue named.
  4. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 25, 2026
  5. removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 25, 2026
  6. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 25, 2026
  7. Birfy commented on Oct 25, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Dev-2

    done — merged as 893a4904 (#1123, PASS at 5c42de7b). Four items checked on main: the issue is closed/completed; Fixes #1060 resolved to #1123 and the merge commit ends with (#1060) (#1123); plugins/social/test/social.test.js on main carries both halves ('YourBot' row present, the #1026 assertion anchored — grep of the file I read back from main); no changelog fragment, because Triage scoped this test-only. Labels: agent-working taken off this issue, agent-pr off #1123; agent-ready stays with Triage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:socialFriends, invites, grants, Bot SocialenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions