Skip to content

fix(gate-46): a fragment copied from a real GitHub link did not match the alias it was copied from - #206

Merged
rubenvdlinde merged 1 commit into
mainfrom
fix/gate-46-raw-fragment-match
Aug 7, 2026
Merged

fix(gate-46): a fragment copied from a real GitHub link did not match the alias it was copied from#206
rubenvdlinde merged 1 commit into
mainfrom
fix/gate-46-raw-fragment-match

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

heading_aliases already emits both spellings of a heading — the kebab one and the one GitHub actually publishes. The fragment, though, was pushed through slugify() before comparison, and that rewrites _ to -:

heading ### Requirement: Trace-scoped call correlation via call_log.sessionId (REQ-011)
gh alias …-via-call_logsessionid-req-011 ← what GitHub links to
fragment …-via-call_logsessionid-req-011 ← what the author wrote
slugified …-via-call-logsessionid-req-011 ← what was compared

That matches neither alias: not the gh one (its underscore had been rewritten), and not the kebab one (call-log-sessionid, split at the underscore). So a tag whose link works fine on GitHub was reported @spec anchor not found.

Observed on openconnector SynchronizationService, while clearing gate-46 debt.

The fix compares the raw fragment alongside the slugified forms.

Tests

Four assertions, two of them controls: a near-miss fragment (call_logrequestid against a call_logsessionid heading) and an underscore fragment against a file with no such heading both still fail. Accepting the raw spelling must not become accepting any fragment that shares a prefix.

Suite: 37 passed. Full helper-suite run: 27 passed, 2 quarantined as documented, 0 failed.

… the alias it was copied from

`heading_aliases` already emits both spellings of a heading — the kebab one
and the one GitHub actually publishes. The FRAGMENT, though, was pushed
through `slugify()` before comparison, and that rewrites `_` to `-`:

  heading    ### Requirement: Trace-scoped call correlation via
                 call_log.sessionId (REQ-011)
  gh alias   …-via-call_logsessionid-req-011      ← what GitHub links to
  fragment   …-via-call_logsessionid-req-011      ← what the author wrote
  slugified  …-via-call-logsessionid-req-011      ← what was compared

which matches neither: not the gh alias (its underscore had been rewritten)
and not the kebab alias (`call-log-sessionid`, split at the underscore). So a
tag whose link works was reported "anchor not found". Observed on
openconnector SynchronizationService.

Compares the raw fragment alongside the slugified forms.

Four assertions, two of them controls: a near-miss fragment (`call_logrequestid`
against a `call_logsessionid` heading) and an underscore fragment against a
file that has no such heading both still fail. Accepting the raw spelling must
not become accepting any fragment that shares a prefix.
@rubenvdlinde
rubenvdlinde merged commit 1b9d916 into main Aug 7, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant