Day 4 fix #1: Rails product-slug rename (DB collision)#9
Merged
Conversation
Day-3a's lexical rename handled the domain entities (Shop->Clinic etc.)
but left the substrate's product-name references (Nativeapptemplateapi
module, NativeAppTemplate brand) intact. Generated projects reused
the substrate's actual dev/test databases because config/database.yml
still said `nativeapptemplateapi_development`. Tue-evening probe
accidentally dropped the user's substrate DBs on cleanup.
Fix:
- src/agents/workers/rails.ts: synthesize two product-rename pairs
from the slug and prepend them to the planner's domain plan.
{Nativeapptemplateapi -> <Slug>Api} scopes the Rails module, DB
names, render config. {NativeAppTemplate -> <Slug>} handles
brand/URL references in settings/openapi/envs.
- scripts/ruby/rename.rb: add flat-lowercase patterns for tokens
that don't re-appear in snake form (e.g. `nativeapptemplate.com`,
`com.yourdomain.nativeapptemplate`). Runs AFTER snake so single-
word rename pairs where flat == snake (e.g. `shop`) can't win
over snake's replacement.
Verified on both specs:
clinic-queue: module ClinicQueueApi, database
clinic_queue_api_development, zero leftover
NativeAppTemplate/nativeapptemplate/Nativeapptemplateapi tokens.
task-tracker: module TaskTrackerApi, database
task_tracker_api_development.
Full `bin/rails test` on generated clinic-queue project:
405 runs, 814 assertions, 0 failures, 0 errors, 0 skips.
Substrate databases NOT touched (confirmed post-run).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
dadachi
added a commit
that referenced
this pull request
Apr 21, 2026
) * Day 4 fix: iOS + Android product-slug rename (symmetric with Rails) Extends PR #9's Rails fix to the mobile workers. iOS generated project now ships with slug-scoped bundle ID + Xcode target + product name; Android generated project ships with slug-scoped applicationId, namespace, and Kotlin package path. - src/slug.ts: extract slugToPascal() — pure function, used by all three workers' buildProductRenamePairs. - src/agents/workers/rails.ts: import slugToPascal from ../../slug. - src/agents/workers/ios.ts: synthesize product pairs {NativeAppTemplateFree -> <Slug>Free, NativeAppTemplate -> <Slug>} and prepend to the domain plan. `NativeAppTemplateFree` runs first so `com.nativeapptemplate.nativeapptemplatefree`'s longer token gets replaced before the shorter prefix. - src/agents/workers/android.ts: same pair set (iOS and Android both have the `NativeAppTemplateFree` package suffix). Verified on clinic-queue spec: iOS: xcodeproj: ClinicQueue.xcodeproj bundle: com.clinicqueue.ClinicQueueFree.ios... product name: ClinicQueue zero NativeAppTemplate / nativeapptemplate leftovers Android: namespace + applicationId: com.clinicqueue.clinicqueuefree package dirs: app/src/main/kotlin/com/clinicqueue/clinicqueuefree/ zero leftovers Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Switch mobile product suffix Free -> App "Free" was a vestige of the substrate being the MIT free edition; the generated project has no paid counterpart so the suffix added no information. `App` matches the standard `com.org.app` Android package convention and reads naturally in iOS bundle IDs. Verified on clinic-queue: iOS bundle: com.clinicqueue.ClinicQueueApp.ios... Android: applicationId/namespace com.clinicqueue.clinicqueueapp package dir .../com/clinicqueue/clinicqueueapp/ Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Day-3a's rename handled the domain entities (
Shop → Clinic, etc.) but left product-name references (theNativeapptemplateapiRails module,NativeAppTemplatebrand, their flat/SCREAMING variants) untouched. Net effect: every generated project pointed at the substrate's actual dev/test databases, and my Tuesday-evening smoke probe accidentally dropped them on cleanup.Fix
src/agents/workers/rails.ts— synthesize two product-rename pairs from the slug and prepend them to the planner's domain plan:{ from: "Nativeapptemplateapi", to: "<Slug>Api" }— scopes the Rails module, DB names, render config{ from: "NativeAppTemplate", to: "<Slug>" }— handles brand/URL references insettings.yml,openapi.yaml, environment configsscripts/ruby/rename.rb— add flat-lowercase patterns (e.g.nativeapptemplate) that don't appear as a snake-case variant of their PascalCase source (NativeAppTemplate→ snakenative_app_template, flatnativeapptemplate). Flat patterns run after snake so single-word rename pairs where flat == snake (e.g.Shop/shop) can't clobber snake's replacement.Verified
clinic-queue (adapt, 4-pair plan)
config/application.rb→module ClinicQueueApiconfig/database.yml→clinic_queue_api_development,_test, etc.config/settings.yml→name: ClinicQueue,support@clinicqueue.com,com.yourdomain.clinicqueueNativeAppTemplate/Nativeapptemplateapi/nativeapptemplate/nativeapptemplateapitokens across.rb/.yml/.yamltask-tracker (replace, 5-pair plan)
module TaskTrackerApi,task_tracker_api_developmentFull boot + test suite
Against generated
out/clinic-queue/rails, afterbundle install+db:prepare:Substrate databases confirmed untouched this time.
Known gap (not in this PR)
NativeAppTemplatebundle, pbxproj app name) — symmetric Day-4 follow-upcom.nativeapptemplate.nativeapptemplatefreepackage) — sameTest plan
npm run ci— 5/5 green under stubmodule ClinicQueueApi,clinic_queue_api_development, zero product leftoversbin/rails teston generated project → 405/0/0