sillyspec 3.22.4 → 3.22.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/worktree.js +18 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sillyspec",
3
- "version": "3.22.4",
3
+ "version": "3.22.5",
4
4
  "description": "SillySpec CLI — 流程状态机,让 AI 严格按步骤来",
5
5
  "icon": "logo.jpg",
6
6
  "homepage": "https://sillyspec.ppdmq.top/",
package/src/worktree.js CHANGED
@@ -309,6 +309,24 @@ export class WorktreeManager {
309
309
  });
310
310
  }
311
311
 
312
+ // 5.4b 立即写占位 meta(防 create 中断导致幽灵 worktree:目录在 + meta 没 →
313
+ // 下次 create 误判幽灵强删)。后续 fetch/overlay/provision 步骤若抛错,占位
314
+ // meta 让 getMeta 返回非 null,下次 create 走 "already exists" 分支(保护
315
+ // worktree 内任何已写入的内容,不触发幽灵清理)。最终完整 meta 在 step 6 覆盖。
316
+ try {
317
+ const placeholderMeta = {
318
+ changeName: name,
319
+ branch,
320
+ baseBranch,
321
+ baseHash,
322
+ worktreePath,
323
+ mode: 'worktree',
324
+ createdAt: new Date().toISOString(),
325
+ provisioning: true,
326
+ };
327
+ writeFileSync(join(worktreePath, META_FILE), JSON.stringify(placeholderMeta, null, 2) + '\n');
328
+ } catch {}
329
+
312
330
  // 5.5 自动同步远程最新代码(防止 worktree 基于过时的 commit)
313
331
  let syncStatus = 'ok';
314
332
  let syncError = null;