fix: align new-project map gate and guard onboarding summary overwrite

init new-project now uses the same seven-file codebase map completeness
check as init onboard, so partial .planning/codebase/ directories no longer
skip the brownfield mapping offer after onboarding warns about an incomplete
map.

The onboard workflow now branches on onboarding_summary_exists and asks for
confirmation before regenerating SUMMARY.md on repeat runs.
This commit is contained in:
Cursor Agent
2026-07-03 15:30:48 +00:00
committed by Codesmith
parent 53f81ab5a9
commit 7b3bf9be3f
3 changed files with 36 additions and 4 deletions

View File

@@ -747,6 +747,9 @@ function cmdInitNewProject(cwd: string, raw: boolean): void {
const hasCode = hasCodeFilesInternal(cwd);
const hasPackageFile = hasPackageFileInternal(cwd);
const isBrownfield = hasCode || hasPackageFile;
const codebaseMapFiles = listCodebaseMapFiles(cwd);
const hasCodebaseMap = codebaseMapFiles.length === REQUIRED_CODEBASE_MAP_FILES.length;
const result: Record<string, unknown> = {
researcher_model: resolveModelInternal(cwd, 'gsd-project-researcher'),
@@ -756,14 +759,13 @@ function cmdInitNewProject(cwd: string, raw: boolean): void {
commit_docs: config.commit_docs,
project_exists: pathExistsInternal(cwd, '.planning/PROJECT.md'),
has_codebase_map: pathExistsInternal(cwd, '.planning/codebase'),
has_codebase_map: hasCodebaseMap,
planning_exists: pathExistsInternal(cwd, '.planning'),
has_existing_code: hasCode,
has_package_file: hasPackageFile,
is_brownfield: hasCode || hasPackageFile,
needs_codebase_map:
(hasCode || hasPackageFile) && !pathExistsInternal(cwd, '.planning/codebase'),
is_brownfield: isBrownfield,
needs_codebase_map: isBrownfield && !hasCodebaseMap,
...getInitGitState(cwd),