Skip to content

Revert "fix(learn): resolve saved-trajectory path via shared get_trajectories_dir"#250

Merged
visahak merged 1 commit into
mainfrom
revert-247-stop-hook-bug
May 4, 2026
Merged

Revert "fix(learn): resolve saved-trajectory path via shared get_trajectories_dir"#250
visahak merged 1 commit into
mainfrom
revert-247-stop-hook-bug

Conversation

@visahak
Copy link
Copy Markdown
Collaborator

@visahak visahak commented May 4, 2026

Reverts #247

Summary by CodeRabbit

  • Documentation

    • Updated trajectory save path specification to clarify files are stored at .evolve/trajectories/ within the project directory.
  • Bug Fixes

    • Improved consistency in how trajectory file paths are resolved across different components.
  • Tests

    • Added integration tests to validate trajectory path resolution behavior.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 54d173f2-6d02-48ba-aa24-71abecae579b

📥 Commits

Reviewing files that changed from the base of the PR and between a584af6 and 54f8818.

📒 Files selected for processing (5)
  • platform-integrations/claude/plugins/evolve-lite/lib/entity_io.py
  • platform-integrations/claude/plugins/evolve-lite/skills/learn/SKILL.md
  • platform-integrations/claude/plugins/evolve-lite/skills/learn/scripts/on_stop.py
  • platform-integrations/claude/plugins/evolve-lite/skills/save-trajectory/scripts/on_stop.py
  • tests/platform_integrations/test_stop_hooks_path_resolution.py

📝 Walkthrough

Walkthrough

This PR refactors trajectory directory resolution by removing the shared get_trajectories_dir() function from the library, adding a local implementation to the save-trajectory hook, and updating the learn hook to use a hardcoded relative path. An integration test validates path resolution consistency across both hooks.

Changes

Trajectory Path Resolution Decentralization

Layer / File(s) Summary
Shared Library Removal
lib/entity_io.py
get_trajectories_dir() function deleted; no longer provides centralized trajectories directory resolution.
Learn Hook Hardcoded Path
skills/learn/scripts/on_stop.py
Removes sys.path manipulation and get_trajectories_dir import; switches to hardcoded relative path .evolve/trajectories/claude-transcript_{session_id}.jsonl.
Save-Trajectory Hook Local Implementation
skills/save-trajectory/scripts/on_stop.py
Removes import from entity_io; adds local get_trajectories_dir() that resolves via EVOLVE_DIR, then CLAUDE_PROJECT_ROOT/.evolve/trajectories, then .evolve/trajectories, with directory creation.
Documentation Update
skills/learn/SKILL.md
Updates Step 0 stop-hook marker guidance to reflect trajectory path as .evolve/trajectories/claude-transcript_<session-id>.jsonl instead of absolute $EVOLVE_DIR/trajectories/ path.
Integration Test
tests/platform_integrations/test_stop_hooks_path_resolution.py
New test suite validates consistent path resolution between learn and save-trajectory hooks under custom EVOLVE_DIR and default project-tree scenarios.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • vinodmut
  • illeatmyhat

Poem

🐰 A hop, skip, and refactor bright,
The shared path now takes flight,
Each hook charts its own way,
While tests keep parity at bay,
Trajectories nested, perfectly tight!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch revert-247-stop-hook-bug

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@visahak visahak merged commit fbf7d0d into main May 4, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant