feat(init): write through symlinked adapter targets; tolerate scratch-only .mancode - #38
Merged
Conversation
… authority Greenfield init used to refuse with a bare MANCODE_V3_TARGET_EXISTS whenever .mancode existed at all, so release tooling writing evidence into .mancode/local/ made mancode's own repository uninitializable. - layout inspection now distinguishes scratch-only targets (unknown local content such as release artifacts) from real V3 authority; a local/ holding any Continuity child (sessions/workflows/cache/quarantine/publish/runtime) is never scratch - the command layer offers an interactive move-aside with best-effort restore under .mancode/local/ after success; non-interactive runs get a descriptive refusal (MANCODE_V3_SCRATCH_TARGET_REQUIRES_CHOICE); an empty .mancode is removed silently - the journaled initializer keeps its strict never-touch-existing-target rule; the project-boundary gate lets scratch-only targets through to that flow - release-check writes evidence to .release/ (outside the Continuity namespace) and existing artifacts are migrated - dogfood: self-repo initialized with the codex adapter; AGENTS.md carries the managed bootstrap block
…ing them A fixed adapter target that is a symlink resolving to a regular file inside the project root (the CLAUDE.md -> AGENTS.md convention) is now a legal write-through target: the link survives and the resolved file receives the managed block beside user content. - reads (planning, inspection, adapter status) resolve the link; escaping, broken, and non-regular links stay unsafe - file plans carry the resolved target so the journal replays without extra options, and publication verifies the link still resolves there before writing (MANCODE_V3_ADAPTER_TARGET_CONFLICT on drift) - direct install/remove resolve the physical write path, so atomic rename never clobbers the link - interactive init offers keep-link-write-through / replace / exit; non-interactive runs keep the link and write through - realpath canonicalization handles macOS /private/var vs /var text drift
Planning a multi-platform init on a repo where CLAUDE.md symlinks to AGENTS.md produced one plan per logical target, both pinned to the same original before-content snapshot. The first plan's write changed the shared file, so the second failed MANCODE_V3_ADAPTER_TARGET_CONFLICT. - effectivePrimaryTarget maps a write-through primary landing on AGENTS.md onto the shared 'agents' target; all AGENTS platforms compose their blocks into one plan, one atomic write, no conflicting snapshots - write-through to other in-root files keeps the resolvedTarget journal annotation path - regression test: codex+claude-code through the link installs both blocks and keeps the link; live CLI verified both adapters ready
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.
① scratch-only .mancode(发布工件等)不再阻塞 greenfield init:交互式搬移+归位,非交互描述性拒绝,空目录静默移除 ② CLAUDE.md → AGENTS.md 写透:链接保持、内容写入解析目标、plan 携带 resolvedTarget 可重放、漂移即 CONFLICT ③ 多平台写透合并到共享 AGENTS 组合 ④ release-check 证据迁出 .mancode → .release/ ⑤ dogfooding:自仓已初始化