conductor-harness 1.2.0 → 1.2.1
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
|
@@ -5,7 +5,7 @@ description: "End-of-task ritual — writes memory, updates Linear, confirms PR-
|
|
|
5
5
|
Task completion for the current Linear issue:
|
|
6
6
|
|
|
7
7
|
1. Run the type checker and any available tests. Fix any failures before continuing.
|
|
8
|
-
2. Write a memory following the memory skill. Include what was built, key decisions, gotchas discovered, and patterns worth reusing.
|
|
8
|
+
2. Write a memory following the memory skill. Include what was built, key decisions, gotchas discovered, and patterns worth reusing. If in a worktree, write to the main repo's memory path (see session context).
|
|
9
9
|
3. Update `.harness/progress.md`: status: done, completed: [date], PR: [branch].
|
|
10
10
|
4. Update the Linear issue status to "In Review" using the Linear MCP tool. Add a comment with a one-sentence summary of what was done.
|
|
11
11
|
5. Confirm: "Ready for PR. Run ⌘⇧P in Conductor to create the PR."
|
|
@@ -41,6 +41,37 @@ else:
|
|
|
41
41
|
with open(progress_path, "w") as f:
|
|
42
42
|
f.write("# Harness Progress\n\nstatus: idle\n")
|
|
43
43
|
|
|
44
|
+
# Detect worktree — resolve main repo root for memory persistence
|
|
45
|
+
main_repo_root = cwd
|
|
46
|
+
try:
|
|
47
|
+
git_common = subprocess.check_output(
|
|
48
|
+
["git", "-C", cwd, "rev-parse", "--git-common-dir"],
|
|
49
|
+
stderr=subprocess.DEVNULL, text=True
|
|
50
|
+
).strip()
|
|
51
|
+
# git-common-dir returns the .git dir of the main repo (not worktree's .git file)
|
|
52
|
+
# If it's not the same as the local .git dir, we're in a worktree
|
|
53
|
+
local_git = subprocess.check_output(
|
|
54
|
+
["git", "-C", cwd, "rev-parse", "--git-dir"],
|
|
55
|
+
stderr=subprocess.DEVNULL, text=True
|
|
56
|
+
).strip()
|
|
57
|
+
if os.path.abspath(git_common) != os.path.abspath(local_git):
|
|
58
|
+
# We're in a worktree — main repo root is parent of .git/
|
|
59
|
+
main_repo_root = os.path.dirname(os.path.abspath(git_common))
|
|
60
|
+
except Exception:
|
|
61
|
+
pass
|
|
62
|
+
|
|
63
|
+
is_worktree = os.path.abspath(main_repo_root) != os.path.abspath(cwd)
|
|
64
|
+
|
|
65
|
+
# Read main repo's MEMORY.md if in a worktree (worktree memory path is ephemeral)
|
|
66
|
+
main_memory = ""
|
|
67
|
+
if is_worktree:
|
|
68
|
+
# Claude Code memory path: ~/.claude/projects/-path-segments/memory/MEMORY.md
|
|
69
|
+
sanitized = main_repo_root.replace("/", "-")
|
|
70
|
+
main_memory_path = os.path.expanduser(f"~/.claude/projects/{sanitized}/memory/MEMORY.md")
|
|
71
|
+
if os.path.exists(main_memory_path):
|
|
72
|
+
with open(main_memory_path) as f:
|
|
73
|
+
main_memory = f.read().strip()
|
|
74
|
+
|
|
44
75
|
# Build context block
|
|
45
76
|
lines = ["## Harness: Session Context", ""]
|
|
46
77
|
lines.append(f"**Branch:** `{branch}`")
|
|
@@ -55,7 +86,23 @@ if progress:
|
|
|
55
86
|
lines.append("")
|
|
56
87
|
lines.append("**Last session progress:**")
|
|
57
88
|
lines.append(progress)
|
|
58
|
-
|
|
59
|
-
lines.append("
|
|
89
|
+
if is_worktree:
|
|
90
|
+
lines.append("")
|
|
91
|
+
lines.append(f"**Worktree detected.** Main repo: `{main_repo_root}`")
|
|
92
|
+
lines.append(f"Write all memories to the main repo's memory path, not the worktree's.")
|
|
93
|
+
# Provide the resolved main memory dir so Claude can write there
|
|
94
|
+
sanitized = main_repo_root.replace("/", "-")
|
|
95
|
+
main_mem_dir = os.path.expanduser(f"~/.claude/projects/{sanitized}/memory")
|
|
96
|
+
lines.append(f"**Memory directory:** `{main_mem_dir}/`")
|
|
97
|
+
lines.append(f"**Memory index:** `{main_mem_dir}/MEMORY.md`")
|
|
98
|
+
if main_memory:
|
|
99
|
+
lines.append("")
|
|
100
|
+
lines.append("**Main repo MEMORY.md:**")
|
|
101
|
+
lines.append(main_memory)
|
|
102
|
+
lines.append("")
|
|
103
|
+
lines.append("**Action:** Scan the main repo memory above for entries relevant to this branch/task before responding.")
|
|
104
|
+
else:
|
|
105
|
+
lines.append("")
|
|
106
|
+
lines.append("**Action:** MEMORY.md is loaded automatically. Scan it for entries relevant to this branch/task before responding.")
|
|
60
107
|
|
|
61
108
|
print(json.dumps({"promptText": "\n".join(lines)}))
|
|
@@ -14,6 +14,10 @@ Uses Claude Code's built-in memory system. Memories are stored as markdown files
|
|
|
14
14
|
- To **read** a specific memory: use the Read tool on a file listed in MEMORY.md
|
|
15
15
|
- To **update** the index: add a one-line pointer to MEMORY.md after writing a memory file
|
|
16
16
|
|
|
17
|
+
## Worktree sessions
|
|
18
|
+
|
|
19
|
+
If the SessionStart hook reports a **worktree detected**, always write memories to the **main repo's memory path** (provided in the session context), not the worktree's. Worktree memory paths are ephemeral and get destroyed on cleanup. The hook provides the resolved memory directory and MEMORY.md path — use those directly.
|
|
20
|
+
|
|
17
21
|
## Memory file format
|
|
18
22
|
|
|
19
23
|
```markdown
|