Skip to content

fix(layout): codemod doc catch-up and regex quote forms (#862) - #1363

Merged
devsuitup merged 3 commits into
mainfrom
fix/862-codemod-doc
Nov 29, 2026
Merged

devsuitup merged 3 commits into
mainfrom
fix/862-codemod-doc

Conversation

@devsuitup

Copy link
Copy Markdown
Owner

Closes #862. This is a prerequisite of #1357, which finishes the ADR 0005 module moves.

Change

  • Quote forms in regex patterns. scripts/move-modules.js normalises them before it matches source text. Each of these now reaches the source-text warning, with one test per form:
    • ['"] and ["'] classes;
    • \x27 and \x22;
    • escaped punctuation.
  • Real-file check. A dry rewrite of test/db-search-query-bound.test.js with fts-match.js moved now warns at :46 and :60.
  • Docs. docs/module-moves.md now describes the current warnings, the same as the code. It adds the note that a test asserting a moved module's require of a module that stays put gets no warning.

Docs

  • User: docs/module-moves.md.
  • Agent: .ai/contexts/module-moves.md.

Changelog

no-changelog: tooling users do not see.

Tests

Check Result
test/move-modules.test.js 51/51; the 4 new cases fail on the base
test/module-layout.test.js 7/7
scripts/check-doc-refs.js 0 failures

Not covered: \u0027/\u0022 and quote classes with more members.

Regex source-text assertions written with a quote class (['"] or ["'])
or a \x27/\x22 escape now warn like plain quoted ones; the fts-match
assertions in test/db-search-query-bound.test.js were missed before.

docs/module-moves.md still described the first-round excerpt warnings.
It now matches the scanner: excerpts warn only when their source requires
a moved module or a stubbed key, extract* results that reach vm are full
loads, skipped path.join segments and regex/template text warn, and an
assertion on a moved module's require of a module that stays put does not.
@devsuitup devsuitup added the no-changelog The PR changes nothing a user sees; the CHANGELOG.md check is waived label Nov 29, 2026
Decoding the pattern text ignored character-class context: a class
such as [\x27.\/a\x27] or [^\x27.\/a\x27] matches one character but was
read as the literal './a' and warned. Mixed delimiters such as
['"]...\x22 were missed because the two quotes decoded differently and
the matcher pairs identical quotes.

Regex patterns are now tokenised: every quote form and every class made
only of quote forms becomes one canonical quote, escaped non-word
characters read as themselves, and any other class or escape is opaque.
…#862)

Uppercase \X is an identity escape, so \X27 is not a quote.
@devsuitup
devsuitup merged commit a7859eb into main Nov 29, 2026
14 checks passed
@devsuitup
devsuitup deleted the fix/862-codemod-doc branch November 29, 2026 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog The PR changes nothing a user sees; the CHANGELOG.md check is waived

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(layout): codemod doc catch-up and regex quote forms

1 participant