Plan: Immediate nova init Validation
Problem Summary
nova init and nova init -e currently collect the full interactive answer set and only then reject an invalid scaffold value, because Read-NovaModuleAnswerSet performs ProjectName validation after all prompts in src/private/scaffold/ReadNovaModuleAnswers.ps1.
This creates a poor UX: one bad early answer can waste the entire questionnaire and end in a terminating error.
Goals
- Validate scaffold answers immediately at the prompt where the value is entered.
- Retry inline with a clear validation message instead of failing after the full questionnaire.
- Keep one shared behavior path for both
nova init and nova init -e, since both flow through Initialize-NovaModule and Get-NovaModuleInitializationWorkflowContext.
- Preserve existing prompt ordering, defaults, and mandatory-empty retry behavior.
Proposed Design
- Move scaffold-specific validation metadata into the question model returned by
Get-NovaModuleQuestionSet in src/private/scaffold/GetNovaModuleQuestions.ps1, starting with ProjectName.
- Extend the standard prompt loop in
Read-AwesomeStandardPrompt and Test-AwesomePromptRequiresRetry in src/private/cli/ReadAwesomeStandardPrompt.ps1 and src/private/cli/TestAwesomePromptRequiresRetry.ps1 so it can evaluate both:
- empty mandatory input
- invalid non-empty input against prompt-level validation rules
- Keep
Read-AwesomeHost in src/private/cli/ReadAwesomeHost.ps1 as the shared entrypoint so the behavior automatically applies to standard and example scaffold flows.
- Convert the current post-questionnaire
ProjectName check in Read-NovaModuleAnswerSet into a defensive fallback only, or remove it if prompt-level validation fully covers interactive callers and tests confirm no regression.
- Update help text in
src/resources/cli/help/init.psd1 and docs/NovaModuleTools/en-US/Initialize-NovaModule.md to describe immediate retry behavior.
Implementation Phases
- Define prompt-level validation shape in
Get-NovaModuleQuestionSet for ProjectName.
- Refactor
Read-AwesomeStandardPrompt to loop until required and validation checks both pass.
- Add user-facing inline validation messaging without changing CLI command routing.
- Simplify
Read-NovaModuleAnswerSet so it no longer delays interactive validation until the end.
- Update init help and docs to reflect the new retry-first UX.
Tests
- Extend prompt-loop coverage in
tests/CoverageCompletion.Tests.ps1 for invalid-then-valid standard prompt retries, alongside existing mandatory retry coverage.
- Update scaffold tests in
tests/CoverageGaps.Tests.ps1 to verify invalid ProjectName is retried inline instead of throwing after all questions.
- Add regression coverage for both standard and example flows so
nova init and nova init -e share the same validation behavior.
- Keep a fallback test, if retained, to ensure non-interactive or mocked callers still receive a terminating validation error when prompt-level validation is bypassed.
Risks
- Prompt objects currently mix hashtables and
pscustomobject; new validation metadata must work in both shapes.
- Default-value handling must not create a loop where empty input repeatedly resolves to an invalid default.
- Removing the late validation entirely could weaken protection for non-interactive consumers unless a defensive guard remains.
Rollout Notes
- This is a UX-only change for interactive scaffold creation; no CLI syntax or parameter contract changes are required.
- Release notes should call out that invalid scaffold answers now retry immediately instead of failing at the end.
- Documentation should clarify that
nova init and nova init -e now share the same inline validation experience.
Plan: Immediate
nova initValidationProblem Summary
nova initandnova init -ecurrently collect the full interactive answer set and only then reject an invalid scaffold value, becauseRead-NovaModuleAnswerSetperformsProjectNamevalidation after all prompts insrc/private/scaffold/ReadNovaModuleAnswers.ps1.This creates a poor UX: one bad early answer can waste the entire questionnaire and end in a terminating error.
Goals
nova initandnova init -e, since both flow throughInitialize-NovaModuleandGet-NovaModuleInitializationWorkflowContext.Proposed Design
Get-NovaModuleQuestionSetinsrc/private/scaffold/GetNovaModuleQuestions.ps1, starting withProjectName.Read-AwesomeStandardPromptandTest-AwesomePromptRequiresRetryinsrc/private/cli/ReadAwesomeStandardPrompt.ps1andsrc/private/cli/TestAwesomePromptRequiresRetry.ps1so it can evaluate both:Read-AwesomeHostinsrc/private/cli/ReadAwesomeHost.ps1as the shared entrypoint so the behavior automatically applies to standard and example scaffold flows.ProjectNamecheck inRead-NovaModuleAnswerSetinto a defensive fallback only, or remove it if prompt-level validation fully covers interactive callers and tests confirm no regression.src/resources/cli/help/init.psd1anddocs/NovaModuleTools/en-US/Initialize-NovaModule.mdto describe immediate retry behavior.Implementation Phases
Get-NovaModuleQuestionSetforProjectName.Read-AwesomeStandardPromptto loop until required and validation checks both pass.Read-NovaModuleAnswerSetso it no longer delays interactive validation until the end.Tests
tests/CoverageCompletion.Tests.ps1for invalid-then-valid standard prompt retries, alongside existing mandatory retry coverage.tests/CoverageGaps.Tests.ps1to verify invalidProjectNameis retried inline instead of throwing after all questions.nova initandnova init -eshare the same validation behavior.Risks
pscustomobject; new validation metadata must work in both shapes.Rollout Notes
nova initandnova init -enow share the same inline validation experience.