Skip to content

fix(rebrand): preserve brand casing across forks - #952

Merged
TortoiseWolfe merged 1 commit into
mainfrom
fix/933-case-preserving-rebrand
Aug 23, 2026
Merged

fix(rebrand): preserve brand casing across forks#952
TortoiseWolfe merged 1 commit into
mainfrom
fix/933-case-preserving-rebrand

Conversation

@TortoiseWolfe

Copy link
Copy Markdown
Owner

Closes #933

Summary

  • replace source-brand content case-insensitively while preserving display, slug, identifier, title-case, uppercase, and arbitrary mixed-case projections
  • rename complete tracked paths through an atomic collision-checked plan, with stale-index and symlink safety preflights
  • independently verify eligible content and paths have no unmarked old-brand survivors before committing the new identity state
  • add fork-stable unit, shell, mutation, retry, collision, and downstream rebrand regressions plus updated forking contracts

Verification

  • pnpm run test:scripts — 602/602
  • bash tests/rebrand/test-rebrand.sh — 63/63
  • clean destructive fork to geo LARP — rebrand succeeded; 602/602 script tests, ESLint, TypeScript, and fork smoke passed
  • enforced pre-push quick CI — secret scan, ESLint, TypeScript, breakpoints, production build, 111-chunk parse check, and first-load budget passed

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@TortoiseWolfe
TortoiseWolfe merged commit db624c1 into main Aug 23, 2026
33 of 34 checks passed
@TortoiseWolfe
TortoiseWolfe deleted the fix/933-case-preserving-rebrand branch August 23, 2026 16:59
TortoiseWolfe added a commit that referenced this pull request Aug 27, 2026
… measure (#967)

Two defects in what the rebrand tells you about itself. Both are in the same
1000-line harness, so they land together rather than fighting over it.

#956 — the summary over-reported. FILES_MODIFIED was a bare ++ accumulated by two
independent sweeps over the same file set, so a file carrying both the brand and
the owner token counted twice. Measured: 1002 reported against 926 paths git
could see. That number does not stay in the terminal — docs/POSITIONING.md quotes
it as a measurement — and it is the first thing a forker reads about what just
happened to their repository.

The union data was always there: consume_case_report() parses a per-path
UPDATED/RENAMED record for every file and threw it away in favour of a COUNT. It
now records paths and counts the unique ones. Also drops the literal `+ 17` for
icons, which was a guess reported as a measurement; the icons already have their
own summary line.

One subtlety that made the first attempt useless: the two sweeps spell the same
path differently — rebrand-case.mjs JSON-quotes its payload for the log, so it
says "docs/FORKING.md" where the sed sweep says docs/FORKING.md. Unnormalised
they never dedupe and the union is no better than the double count. With that
fixed the summary now reports 928 against exactly 928 git-visible paths.

#958 — the #952 regression guard could not fail on the input that caused the bug.
It asserts the case projections with CASE_TARGET_DISPLAY set to "CaseProbe" or
"GeoLarp", both SINGLE-TOKEN, where targetSlug and asciiLower(targetComponent)
are the same string. The branch it protects therefore produces identical output
either way. Mutation-tested: delete the `identifierAdjacent ?` branch from
rebrand-case.mjs and that suite reports zero failures.

A multi-token case is added rather than changing the shared variable, which feeds
six test functions. It asserts identifier VALIDITY rather than equality against a
computed string, because equality still passes when both sides are wrong the same
way — and this is a file whose whole job is to be syntactically valid. With the
branch deleted the new case reports two failures while the old one still reports
none. A third assertion pins that a STANDALONE slug stays hyphenated, so the fix
cannot be "never hyphenate", which would corrupt prose and hostnames.

Both guards were written to fail first and checked against origin/main:
#956's differential grows by 2 there and by 1 here; #958's mutation is red here
and invisible to the existing suite.

Closes #956
Closes #958

Co-authored-by: TurtleWolfe <TurtleWolfe@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

rebrand.sh misses case variants, so every fork's intro post is still titled 'Scripthammer - Opinionated Next.js PWA Template'

1 participant