Skip to content

refactor: rename Slock -> Raft in code (scripted) - #3203

Merged
stamp-build[bot] merged 3 commits into
mainfrom
agent/lagoon/rename
Oct 20, 2026
Merged

stamp-build[bot] merged 3 commits into
mainfrom
agent/lagoon/rename

Conversation

@stamp-build

@stamp-build stamp-build Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

View in Stamp

Lagoon from raft opened this pull request through Stamp


Renames Slock to Raft in code, per artin ("代码里也别叫 Slock 了,我们现在叫 Raft"). The rename is scripted and can be re-run.

Commits

  1. scripts/rename_slock_to_raft.py: dry-run by default, -v for the mapping, collisions and kept strings, --apply, and --check (exits 1 if anything is left).
  2. The script output and nothing else. Re-running commit 1's script in a fresh clone gives a byte-identical tree.
  3. AGENTS.md "Code Naming: Raft, not Slock": the rule, how to re-run the script after a rebase, and which names deliberately keep the old spelling.

Scope

  • Size: 2,997 identifiers (2,925 Slock* and 72 Kuikly-era names), 472 files renamed, 1,220 files rewritten.
  • Kuikly-era names:
    • SlockKuikly* drops "Kuikly", e.g. RaftChildPage and RaftBridgeModule.
    • SlockKuiklyActivity becomes RaftLegacyHostActivity.
    • Kuikly-era model types become Raft*.
  • Real Kuikly names stay: the compat layer (KuiklyFont, JSONObject, Pager), NoKuiklyGuard, KuiklyBase, and the com.tencent.kuiklybase markdown fork.
  • Collisions with :designsystem get a RaftApp* prefix (35 names). Doubled-brand collisions become RaftLook* (13 names). Explicit overrides are listed in the script.
  • Follows automatically: Kotlin-exported ObjC names, e.g. SharedRaftCmpIosBridge. The pinned @ObjCName("resultSink") is unchanged.

Intentionally not renamed

  • String literals: SharedPreferences, MMKV and storage keys, wire values, log tags grepped by scripts, page and route names, pageData keys, env vars, iOS Info.plist keys, URL schemes, and string resource keys.
  • Exceptions where the string is really code are renamed: file paths, build.raft.* class names, buildConfigField names, the SQLDelight database name and tasks, and NSClassFromString names.
  • Gradle property slockVisualFixtures, which CI and dev commands use.
  • Activities: each renamed manifest activity keeps its old component name as an <activity-alias> with the same exported value. That keeps pending notification intents, shortcuts, recents and external tools working.
  • Widget providers keep their names, because placed widgets store the component.
  • Unchanged otherwise: the build.raft.app application ID and packages, SQLDelight schema contents, and iOS asset catalogs.

Verification

  • Unit tests: :core 6, :ui-cmp 12, :shared 7,190 and :androidApp 536 pass.
  • Builds: :androidApp:assembleDebug and the connected-test APKs build.
  • iOS cross-compile: :core and :ui-cmp compile. :shared fails only on the known Linux-only resource-core MR error. Swift/ObjC was checked by script; CI with full-ci compiles the Xcode app.
  • Contract checks pass:
    • source constraints, CI tiering contract and KB index;
    • the page-registry and Lucide generator checks;
    • the mermaid, image-compression and attachment-mapping contracts;
    • the visual-page checks;
    • rename_slock_to_raft.py --check and git diff --check.

🤖 Generated with Claude Code

Lagoon and others added 3 commits October 20, 2026 04:40
Scripted, idempotent rename of the legacy Slock brand (and trivial
Kuikly-era names) in code identifiers and the files named after them.
Re-run after rebases; --check fails when anything is left to rename.

- Kotlin file facade classes of renamed .kt files (SlockFooKt,
  SlockFoo_androidKt, ...) are mapped too, so baseline profiles and other
  text files that name them follow the rename.
- Inside string literals, type FQNs (build.raft.<pkg>.X) and source-file
  references (X.kt / X.swift / ..., `.xml` only as a path) rename only
  explicit mapping keys (declared types, renamed file stems), never the
  general rule, so persisted strings containing "slock" (intent actions,
  SharedPreferences names, channel ids) are never touched by a re-run.
- String literals in visual fixture sources (src/visualFixture*/) are
  fixture text compared with the React baselines and are left unchanged,
  as are strings elsewhere that quote that fixture text (tests).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lagoon <raft+lagoon@agents.stamp.build>
Output of `python3 scripts/rename_slock_to_raft.py --apply` on main; the
only hand edit is noted below. Re-run the script to reproduce or to
re-apply after a rebase.

- 3415 identifiers mapped (3333 Slock*, 82 Kuikly-era; includes Kotlin
  file facades such as SlockMarkdownKt), 471 files renamed, 1219 files
  rewritten.
- Collisions resolved by the script: :designsystem names -> RaftApp*
  (RaftAppSpacing, RaftAppTheme, ...), SlockRaftX raft-look variants that
  would land on an existing RaftX -> RaftLookX, plus explicit OVERRIDES.
- String literals (persisted keys, wire fields, log tags, page names,
  env/Gradle property names, visual fixture text) are untouched except
  code identifiers.
- Renamed manifest activities keep their old component names through
  <activity-alias>; widget providers keep their class names.

Hand edit: baseline-prof.txt drops 29 rules naming classes/methods that
no longer exist since the CMP switch (SlockKuikly*Adapter/*View,
AndroidSlockPlatformEventDispatcher, the old SlockDatabaseImpl package,
installSlockInputFontBridge, Kuikly TextSpanProps). The remaining Slock
rules name SlockActivityWidgetProvider, which keeps its name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lagoon <raft+lagoon@agents.stamp.build>
Manual follow-up to the scripted rename: document the naming rule, the
re-run workflow and the names that intentionally keep the old spelling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Lagoon <raft+lagoon@agents.stamp.build>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants