Skip to content

Commit fbf7d0d

Browse files
authored
Revert "fix(learn): resolve saved-trajectory path via shared get_trajectories…" (#250)
This reverts commit a584af6.
1 parent a584af6 commit fbf7d0d

5 files changed

Lines changed: 16 additions & 171 deletions

File tree

platform-integrations/claude/plugins/evolve-lite/lib/entity_io.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,6 @@ def get_default_entities_dir():
9797
return base.resolve()
9898

9999

100-
def get_trajectories_dir():
101-
"""Return (and create) the trajectories directory as an absolute Path.
102-
103-
Uses :func:`get_evolve_dir` for the base so trajectories land alongside
104-
entities under the same ``EVOLVE_DIR`` / ``.evolve`` root.
105-
"""
106-
base = get_evolve_dir() / "trajectories"
107-
base.mkdir(parents=True, exist_ok=True, mode=0o700)
108-
return base.resolve()
109-
110-
111100
# ---------------------------------------------------------------------------
112101
# Slugify / filename helpers
113102
# ---------------------------------------------------------------------------

platform-integrations/claude/plugins/evolve-lite/skills/learn/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ This skill analyzes the current conversation to extract guidelines that **correc
2929

3030
This skill runs in a forked context with no access to the parent conversation. The stop-hook message (produced by `on_stop.py`) contains one literal marker:
3131

32-
- `The saved trajectory path is: <path>` — a copy of the session transcript written by the save-trajectory Stop hook. The path is absolute and resolves under `$EVOLVE_DIR/trajectories/` (or the project's `.evolve/trajectories/` when `EVOLVE_DIR` is unset), with filename `claude-transcript_<session-id>.jsonl`. Take everything after the colon, strip surrounding whitespace and quotes, and use the result as `saved_trajectory_path`. You will also attach this exact path to each entity's `trajectory` field in Step 4.
32+
- `The saved trajectory path is: <path>` — a copy of the session transcript saved inside the project tree at `.evolve/trajectories/claude-transcript_<session-id>.jsonl`. Take everything after the colon, strip surrounding whitespace and quotes, and use the result as `saved_trajectory_path`. You will also attach this exact path to each entity's `trajectory` field in Step 4.
3333

3434
**Read this file with the `Read` tool — do NOT shell out.** `Read` pages large files natively (use its `offset` / `limit` parameters if needed). Do not use `cat`, `head`, `wc`, `find`, or `python3 -c` loops on the transcript — those trigger a permission prompt for every invocation and are unnecessary.
3535

platform-integrations/claude/plugins/evolve-lite/skills/learn/scripts/on_stop.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
import sys
66
from pathlib import Path
77

8-
sys.path.insert(0, str(Path(__file__).resolve().parent.parent.parent.parent / "lib"))
9-
from entity_io import get_trajectories_dir # noqa: E402
10-
118

129
def main():
1310
try:
@@ -23,7 +20,7 @@ def main():
2320
if transcript_path:
2421
session_id = Path(transcript_path).stem.removeprefix("claude-transcript_")
2522
if session_id:
26-
saved_trajectory = str(get_trajectories_dir() / f"claude-transcript_{session_id}.jsonl")
23+
saved_trajectory = f".evolve/trajectories/claude-transcript_{session_id}.jsonl"
2724
reason += f" The saved trajectory path is: {saved_trajectory}"
2825

2926
print(

platform-integrations/claude/plugins/evolve-lite/skills/save-trajectory/scripts/on_stop.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
import tempfile
1111
from pathlib import Path
1212

13-
sys.path.insert(0, str(Path(__file__).resolve().parent.parent.parent.parent / "lib"))
14-
from entity_io import get_trajectories_dir # noqa: E402
15-
1613

1714
_log_file = None
1815

@@ -41,6 +38,20 @@ def log(message):
4138
pass
4239

4340

41+
def get_trajectories_dir():
42+
evolve_dir = os.environ.get("EVOLVE_DIR")
43+
if evolve_dir:
44+
base = Path(evolve_dir) / "trajectories"
45+
else:
46+
project_root = os.environ.get("CLAUDE_PROJECT_ROOT", "")
47+
if project_root:
48+
base = Path(project_root) / ".evolve" / "trajectories"
49+
else:
50+
base = Path(".evolve") / "trajectories"
51+
base.mkdir(parents=True, exist_ok=True, mode=0o700)
52+
return base.resolve()
53+
54+
4455
def main():
4556
try:
4657
input_data = json.load(sys.stdin)

tests/platform_integrations/test_stop_hooks_path_resolution.py

Lines changed: 0 additions & 152 deletions
This file was deleted.

0 commit comments

Comments
 (0)