Repository navigation
docs: PR #15 升级说明加固 + stdin 示例可粘贴 - #16
Merged
Merged
Conversation
…ce, pull-failure guard, paste-able stdin example [Medium] The #15 upgrade snippet masked pull failures: uncommitted edits to the tracked guides make git refuse the fast-forward, yet the snippet kept restoring and exited 0, leaving the user on the old version none the wiser; the fixed /tmp backup path could also resurrect the OTHER guide from an older run on a clone that keeps only one. The bilingual note now: - uses a fresh mktemp -d per run, copies only what exists (no error swallowing); - step 0: stash or commit the tracked local edits first (git stash push -- AGENTS.md CLAUDE.md); - restores only what THIS run backed up, and only inside if git pull --ff-only — a failed pull restores nothing and says so. [Low] SKILL.md stdin example: <id> pasted verbatim is a bash redirect, not a placeholder — replaced with "$SESSION_ID" plus a note on setting it. Verification: simulated pre-#14 clone with uncommitted guide edits — pull refuses, nothing restored, HEAD stays, local edit intact; with the documented stash the full upgrade completes and both guides come back untracked; a clone keeping only AGENTS.md never regains a CLAUDE.md; the stdin example pasted verbatim closes its heredoc and the CLI actually runs (answers session-not-found for the test id). sync-doc-version --check passes.
kyomarshal
added a commit
that referenced
this pull request
Nov 27, 2026
[Medium] The #16 snippet stashed BEFORE backing up: stash reverts the worktree to the old committed content, so the backup captured the pristine version and the user's local edits were never restored — worse, a later git stash pop then conflicts on the same filenames and exits 1. The order is now backup-with-edits FIRST, stash second (it only clears the upstream sync — nothing left to pop, drop it when happy). [Low] The failure branch exits non-zero via 'false' instead of 'exit 1' (which would kill the interactive shell the snippet is pasted into); the per-file restore tests use a guarded if so a clone keeping only AGENTS.md exits 0 instead of failing on the missing CLAUDE.md test. Verification (simulated pre-#14 clones): with uncommitted guide edits the full snippet restores the edits verbatim as untracked files and advances HEAD, stash holding only the redundant copy; an unreachable remote exits 1, restores nothing, edits recoverable via stash pop; a clone keeping only AGENTS.md upgrades with exit 0. sync-doc-version --check passes.
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.
修什么
PR #15 合并后御史复审(
Shared/Transfers/zce-pr15-81cbf677/verdict.md)的 2 项:mktemp -d独立备份目录,只备份实际存在的文件、不吞错误;git stash push -- AGENTS.md CLAUDE.md或分支提交);if git pull --ff-only里——拉取失败什么都不恢复并明确报错,只恢复本次备份到的文件。中英双版同步。<id>原样粘贴会被 bash 当重定向(CLI 根本没启动),改为"$SESSION_ID"并注明先设置会话 ID。验证(逐条实跑,仿真旧克隆)
node scripts/sync-doc-version.mjs --check通过。纯文档改动,未跑全量测试(不动 lib)。