Skip to content

docs(sync): record the b24ui-only useTokenSearch divergence as a porting invariant - #366

Merged
IgorShevchik merged 3 commits into
mainfrom
claude/nuxt-spa-b24ui-conflict-xqvflw
Aug 11, 2026
Merged

docs(sync): record the b24ui-only useTokenSearch divergence as a porting invariant#366
IgorShevchik merged 3 commits into
mainfrom
claude/nuxt-spa-b24ui-conflict-xqvflw

Conversation

@IgorShevchik

@IgorShevchik IgorShevchik commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Linked issue

Refs #339, #347, #363.

Type of change

  • Documentation (updates to the documentation or readme)
  • Bug fix (a non-breaking change that fixes an issue)
  • Enhancement (improving an existing functionality)
  • New feature (a non-breaking change that adds functionality)
  • Chore (updates to the build process or auxiliary tools and libraries)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Revised after review. The first revision also carried a bullet marked PENDING, describing a truncation-units contract from an unmerged PR. It has been dropped: it stated a failure mode the loop cannot produce, its self-deletion instruction told the porter to edit a file outside src/ — which the same document forbids — and nothing enforced its expiry. Two factual claims have also been corrected; see the end of this description.

Documentation only. .sync/PORTING.md gains one §2 invariant plus a dated changelog line; .sync/nuxt-ui.json gets a one-line correction. No src/ change.

The divergence. highlight() takes a fifth parameter useTokenSearch and carries the token-search logic around it. c502157b added tokens / minTokenLength, 6743f793 added the parameter itself and gated the tokenizer behind it — both against the file's old name src/runtime/utils/fuse.ts, both shipped in v2.8.0. Immediately before c502157b the function took four parameters and computed no minTokenLength at all; that is what establishes it as locally authored.

Why it stayed invisible. The port 557a5178 renamed fuse.ts to search.ts and carried the divergence across. A pickaxe on the current path returns exactly one commit — 557a5178, which is a genuine upstream port with an Upstream: trailer — so the divergence is not merely hidden but actively misattributed. --follow is needed to see the two commits that introduced it.

Why it matters. Replaying upstream's four-parameter signature wholesale drops behaviour shipped in v2.8.0, and nothing goes red: useTokenSearch appears nowhere under test/. #363 tracks that gap.

Ledger correction. .sync/nuxt-ui.json's summary for 2a172ef asserted "highlight signature matches 1:1" without qualification. The .md log for the same port was already accurate — it scoped its claim to behaviour "without token search" — but the machine-readable half was not, and a porter consulting it would have got the wrong answer.

This follows the convention used by prior rule-adding PRs (#330, #331, #335, #338, #341, #343, #346, #351): a rule in the relevant section plus a dated line in "Changelog of rules". No processed entry — that map is keyed by 40-hex upstream SHA, and there is no upstream SHA here.

Corrections from review of the first revision:

  • "the one invariant in this section with no guard at all"false, removed. Locales, playground-manifest mirroring, jsDoc and Types are unguarded too. The text now says plainly that some §2 rules name a guarding spec and some do not, and points at test(search): highlight()'s b24ui-only useTokenSearch argument has no coverage #363.
  • "neither carries an Upstream: trailer" as evidence of local authorship — weak, reframed. Only 16 of ~3200 commits carry that trailer, and 559a5cdb — this very file's most recent upstream port — is not one of them. The claim now rests on the four-parameter signature preceding c502157b.
  • The quotation from .sync/log/2a172ef….md was truncated mid-parenthetical with a closing paren supplied that the source does not have. Now quoted in full.
  • The upstream assertion is hedged in the file itself, not only in the commit message: nuxt/ui has not been re-inspected, so "upstream has no such parameter" is an inference from b24ui's own history.
  • Attribution: the "byte-identical with upstream" premise originated here, in 595923b9 (PR fix(CommandPalette): stop the raw label and suffix reaching v-html #338), was repeated in bug(search): truncateHTMLFromStart splits astral characters, emitting lone surrogates #339, and was inherited in good faith by the external contributor whose PR prompted the check. The changelog line records that.

Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Note on scope: the branch name is left over from an unrelated task earlier in the session and does not describe this change.

…rting invariant

`highlight()` in `src/runtime/utils/search.ts` takes a fifth `useTokenSearch`
argument, and carries the token-search logic around it, that no port brought in.
`c502157b` added `tokens`/`minTokenLength` and `6743f793` the parameter itself,
both against the file's old name `src/runtime/utils/fuse.ts`; both shipped in
v2.8.0. Immediately before `c502157b` the function took four parameters and
computed no `minTokenLength` at all, which is what establishes the divergence as
locally authored.

The port `557a5178` then renamed `fuse.ts` to `search.ts` and carried the
divergence across, so a pickaxe on the current path returns only `557a5178` — a
genuine upstream port — and `--follow` is needed to see the two commits that
actually introduced it. That rename is what hid the divergence; `Upstream:`
trailers are too rare here to support an inference either way (16 of ~3200
commits carry one, and `559a5cdb`, this file's own most recent port, does not).

Replaying upstream's four-parameter signature wholesale would drop behaviour
shipped in v2.8.0 while nothing goes red — `useTokenSearch` appears nowhere
under `test/`. #363 tracks that gap.

Also corrects `.sync/nuxt-ui.json`'s summary for `2a172ef`, which asserted
"highlight signature matches 1:1" without qualification. The `.md` log for the
same port was already accurate, scoping its claim to behaviour "without token
search"; the machine-readable half was not, and a porter consulting it would
have got the wrong answer.

The invariant states plainly that upstream has not been re-inspected, so the
claim "upstream has no such parameter" reads as an inference from b24ui's own
history rather than a verified fact.

On provenance: the "byte-identical with upstream" premise originated here, in
`595923b9` (PR #338), was repeated in #339, and was inherited in good faith by
the external contributor whose PR prompted this check.

Refs #339, #347, #363

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LWWrBHgfqGSbeU3V6UuMF8
@IgorShevchik
IgorShevchik merged commit 7ce6238 into main Aug 11, 2026
1 check passed
@IgorShevchik
IgorShevchik deleted the claude/nuxt-spa-b24ui-conflict-xqvflw branch August 11, 2026 14:16
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.

2 participants