fix(cli): reject invalid derived app ids before scaffolding - #102
Open
be-student wants to merge 2 commits into
Open
be-student wants to merge 2 commits into
be-student wants to merge 2 commits into
Conversation
Author
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.

What
pn initwhen the generatedcom.example.<segment>app ID violates the existing configuration validator.--forcefrom bypassing validation and document the behavior.Why
Names such as
class,cla-ss, and current directories such asClassall derive the reserved Java package segmentclass. The scaffold previously succeeded, but later configuration loading rejected the generated project.How
init_project()now derives the app ID once, validates it with the configuration's existing app-ID validator before inspecting or mutating the target, and reuses that exact value when rendering the configuration. Errors identify the source name, generated ID, and a valid next command.Regression coverage includes all 53 configured Java keywords, normalization collisions, explicit and no-name initialization, new/empty/existing targets,
--force, and valid substring names whose generated configurations load on both platform app-ID commands.Testing
./scripts/check.sh: passed on exact headf5744c34323d0ac2ab9297546757ffab786da0cf(Ruff, Black over 314 files, MyPy over 205 source files, package builds, full pytest, and E2E coverage).Risks / Impact
The change rejects only projects whose generated app ID would already fail when loaded. Valid name derivation remains unchanged. Validation evidence is from macOS; hosted Linux and Windows CI remain authoritative.
Docs / Follow-ups
The getting-started and CLI documentation now describe rejection of generated Java reserved package segments.
Implemented and tested with AI assistance, followed by an independent context-free review. No human manual or device testing is claimed.
Closes #78