feat: interactive replace-or-exit choice for symlinked adapter targets - #37
Merged
Conversation
Interactive greenfield init now detects symlinked fixed adapter targets (like the CLAUDE.md -> AGENTS.md convention) before installing and offers the user two options: exit cleanly, or replace the link with a regular file that preserves the resolved content and continue. Non-interactive invocations keep the descriptive MANCODE_ARTIFACT_PATH_UNSAFE error. - v3-adapter: inspectUnsafeV3AdapterPaths / replaceUnsafeV3AdapterSymlinks - init-onboarding: InitPrompter.resolveUnsafeAdapterPaths (terminal prompt) - init: resolveUnsafeInitAdapterPaths wired into initializeV3 greenfield - tests: contract coverage for inspect/replace plus both interactive choices; DSH_SHELL added to the platform-hint env scrubs so the suite is deterministic inside a DeepSeek Harness session
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.
背景
mancode init遇到仓库里固定适配器目标为符号链接(如CLAUDE.md -> AGENTS.md,openai/codex 惯例)时不再直接报错:交互式初始化会先检测,然后给用户两个选项:非交互调用(无 TTY)保持原有描述性错误不变。
变更
v3-adapter.ts:新增inspectUnsafeV3AdapterPaths/replaceUnsafeV3AdapterSymlinks;安全检查重构为共享的收集式 walker,报错文案不变init-onboarding.ts:InitPrompter.resolveUnsafeAdapterPaths+ 终端提示(中英双语)init.ts:greenfield V3 流程接入检测-询问-替换DSH_SHELL补入平台提示环境变量 scrub(修复在 DeepSeek Harness 会话内跑npm test时 6 个用例的误失败)验证