@dev-loops/core 1.0.0-rc.2 → 1.0.0-rc.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev-loops/core",
3
- "version": "1.0.0-rc.2",
3
+ "version": "1.0.0-rc.3",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=24"
@@ -21,6 +21,8 @@
21
21
  "./debt/shape": "./src/debt/shape.mjs",
22
22
  "./debt/signal": "./src/debt/debt-signal.mjs",
23
23
  "./github/copilot-helpers": "./src/github/copilot-helpers.mjs",
24
+ "./github/issue-ops": "./src/github/issue-ops.mjs",
25
+ "./github/ownership-helpers": "./src/github/ownership-helpers.mjs",
24
26
  "./github/repo-slug": "./src/github/repo-slug.mjs",
25
27
  "./github/review-threads": "./src/github/review-threads.mjs",
26
28
  "./loop/async-start-contract": "./src/loop/async-start-contract.mjs",
@@ -68,6 +70,7 @@
68
70
  "./projects/move-queue-item": "./src/projects/move-queue-item.mjs",
69
71
  "./projects/resolve-project": "./src/projects/resolve-project.mjs",
70
72
  "./harness": "./src/harness/index.mjs",
73
+ "./tracker": "./src/tracker/index.mjs",
71
74
  "./loop/worktree-guard": "./src/loop/worktree-guard.mjs",
72
75
  "./loop/tracker-first-loop-state": "./src/loop/tracker-first-loop-state.mjs"
73
76
  },
@@ -21,6 +21,7 @@ import {
21
21
  extractRepoFlagsFromGhPrCreateSegments,
22
22
  commandContainsRawExternalWrite,
23
23
  extractRepoFlagsFromExternalWriteSegments,
24
+ commandContainsGitStash,
24
25
  TARGET_REPO_SLUG,
25
26
  } from "../loop/bash-command-classify.mjs";
26
27
 
@@ -84,6 +85,19 @@ export function decideBashGate({ command, repoSlug = null, gatePassed = false, g
84
85
  if (typeof command !== "string") {
85
86
  return ALLOW;
86
87
  }
88
+ // `git stash` writes to `refs/stash`, one ref shared by every worktree over this repo's single
89
+ // `.git` directory — a stash from one worktree can pop into another's. Block it outright on the
90
+ // target repo; see skills/docs/worktree-guidance.md#never-git-stash-in-a-shared-git-layout for the
91
+ // stash-free alternative (git diff / a patch file / a scratch checkout).
92
+ if (commandContainsGitStash(command) && (repoSlug ?? "").toLowerCase() === TARGET_REPO_SLUG.toLowerCase()) {
93
+ return {
94
+ decision: "deny",
95
+ reason:
96
+ "git stash blocked: refs/stash is shared across every worktree over this repo's one .git directory, " +
97
+ "so a stash can pop into a different worktree. Use `git diff` (or `git diff --staged`), save changes " +
98
+ "to a patch file, or use a separate scratch worktree instead of stashing.",
99
+ };
100
+ }
87
101
  // Subagent-scoped external-write guard: block ad-hoc `gh issue create`/`gh issue comment`/
88
102
  // `gh issue edit`/`gh pr comment` on the target repo from a subagent, so external writes flow through the
89
103
  // sanctioned node wrappers. The main-agent/operator path (agentType null) is unaffected (#1051).