Generator: handle domain name collision with hand-impl module (e.g. services domain) #68

Closed
opened 2026-05-19 15:30:37 +00:00 by timur · 1 comment
Owner

Context

Discovered by the #261 agent while bootstrapping hero_service. They chose services as the domain name (toy-domain = managing Hero services) and hit a collision because the generator emits a services module alongside the scaffolder's hand-impl src/services/mod.rs placeholder.

The collision forced the agent to work around the naming. Future contributors picking the obvious domain name will hit the same wall.

What to do

Pick one:

  • Rename the placeholder from src/services/ to something less generic (e.g. src/_handlers/ or src/business/).
  • Detect the collision in the scaffolder and either error out with a clear message ("domain name services collides with the placeholder; rename the domain or the placeholder") or auto-rename the placeholder.
  • Move the placeholder to a name that's a known reserved word the generator never emits as a domain.

Needs a small spec comment first deciding which approach + naming.

Acceptance

  • Scaffolding a service with domain name services (or any other plausible name) produces a clean workspace without manual renames.
  • Add a test that scaffolds with the conflicting name and verifies the result.
## Context Discovered by the [#261 agent](https://forge.ourworld.tf/lhumina_code/hero_skills/issues/261#issuecomment-34264) while bootstrapping `hero_service`. They chose `services` as the domain name (toy-domain = managing Hero services) and hit a collision because the generator emits a `services` module alongside the scaffolder's hand-impl `src/services/mod.rs` placeholder. The collision forced the agent to work around the naming. Future contributors picking the obvious domain name will hit the same wall. ## What to do Pick one: - **Rename the placeholder** from `src/services/` to something less generic (e.g. `src/_handlers/` or `src/business/`). - **Detect the collision** in the scaffolder and either error out with a clear message ("domain name `services` collides with the placeholder; rename the domain or the placeholder") or auto-rename the placeholder. - **Move the placeholder** to a name that's a known reserved word the generator never emits as a domain. Needs a small spec comment first deciding which approach + naming. ## Acceptance - Scaffolding a service with domain name `services` (or any other plausible name) produces a clean workspace without manual renames. - Add a test that scaffolds with the conflicting name and verifies the result. ## Related - [hero_skills#261](https://forge.ourworld.tf/lhumina_code/hero_skills/issues/261). - Parent META: [hero_skills#262](https://forge.ourworld.tf/lhumina_code/hero_skills/issues/262).
Author
Owner

Resolved by #75 / branch issue-75-remove-services-placeholder-v2 (1c2993df4b) — the empty src/services/ placeholder that was colliding with a services-named domain has been removed entirely from both the scaffolder and the build.rs codegen.

Verified by scaffolding a workspace with domain literally named services (hero_svctest) and building it clean — no manual fix-up required. The only pub mod services; in the resulting lib.rs is the feature-gated one for the domain itself; the src/services/ directory is populated entirely by codegen, with no placeholder.

Closing as resolved-by-this.

Resolved by #75 / branch `issue-75-remove-services-placeholder-v2` (1c2993df4b8f88a87fae3aa43aa5de9573b6ebed) — the empty `src/services/` placeholder that was colliding with a `services`-named domain has been removed entirely from both the scaffolder and the build.rs codegen. Verified by scaffolding a workspace with domain literally named `services` (`hero_svctest`) and building it clean — no manual fix-up required. The only `pub mod services;` in the resulting lib.rs is the feature-gated one for the domain itself; the `src/services/` directory is populated entirely by codegen, with no placeholder. Closing as resolved-by-this.
timur closed this issue 2026-05-19 23:42:39 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_blueprint#68
No description provided.