Skip to content

feat(init): write through symlinked adapter targets; tolerate scratch-only .mancode - #38

Merged
whitelonng merged 4 commits into
mainfrom
feat/init-write-through
Aug 14, 2026
Merged

feat(init): write through symlinked adapter targets; tolerate scratch-only .mancode#38
whitelonng merged 4 commits into
mainfrom
feat/init-write-through

Conversation

@whitelonng

Copy link
Copy Markdown
Owner

① scratch-only .mancode(发布工件等)不再阻塞 greenfield init:交互式搬移+归位,非交互描述性拒绝,空目录静默移除 ② CLAUDE.md → AGENTS.md 写透:链接保持、内容写入解析目标、plan 携带 resolvedTarget 可重放、漂移即 CONFLICT ③ 多平台写透合并到共享 AGENTS 组合 ④ release-check 证据迁出 .mancode → .release/ ⑤ dogfooding:自仓已初始化

… 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
@whitelonng
whitelonng merged commit afe8883 into main Aug 14, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant