Skip to content

chore(release): reflexio-ai v0.2.14#29

Closed
yilu331 wants to merge 13 commits into
mainfrom
chore/release-0.2.14
Closed

chore(release): reflexio-ai v0.2.14#29
yilu331 wants to merge 13 commits into
mainfrom
chore/release-0.2.14

Conversation

@yilu331
Copy link
Copy Markdown
Collaborator

@yilu331 yilu331 commented Apr 21, 2026

Summary

Version bump: reflexio-ai 0.2.13 → 0.2.14

What's in 0.2.14

  • SessionEnd hook: use SessionEnd (once per session) instead of Stop (per-turn); --force-extraction; logging to ~/.reflexio/logs/stop-hook.log; shell-safe positional args
  • Expert skill restructure: triggering logic moved to rules/reflexio.md (always loaded); skill simplified from 235 → 98 lines; references extracted to references/
  • Client cache invalidation: clear() and invalidate() methods; 12 mutation methods now invalidate stale cache
  • CLI fix: reflexio interactions list falls back to REFLEXIO_USER_ID env var
  • Setup wizard: expert→normal downgrade cleans up all expert artifacts; shell-quoted hook paths

Test plan

  • TestPyPI install verified: reflexio --version → 0.2.14
  • Real PyPI install verified: pip install reflexio-ai==0.2.14 → OK
  • 47 setup_cmd tests, 21 cache tests pass

Summary by CodeRabbit

  • New Features

    • Added expert mode for Claude Code integration with SessionEnd hook support and skill references.
    • Enhanced cache management with clearing and invalidation capabilities for improved data consistency.
  • Bug Fixes

    • Strengthened user ID validation in interactions list command.
    • Improved cache invalidation after mutations to ensure data freshness.
  • Documentation

    • Updated Claude Code hook configuration guidance with SessionEnd details.
    • Added comprehensive guides for proactive extraction patterns and server management.

yilu331 added 13 commits April 21, 2026 15:14
…install

- Add --force-extraction to session-end publish so extraction runs
  regardless of batch-interval throttling
- Redirect publish output to ~/.reflexio/logs/stop-hook.log instead of
  silently discarding errors
- Remove dead stop_hook_active guard (field not in Claude Code payload)
- Auto-install Stop hook when expert mode is enabled via setup wizard
- Update HOOK.md to reflect all changes
Add 5 high-signal patterns that trigger auto-publish without user input:
- Self-recovered tool failures (error + recovery arc)
- Retry chains (2+ failures on same operation)
- Documentation/behavior gaps (docs say X, reality is Y)
- Workarounds for limitations (used alternative approach)
- Anomalous results (unexpected zeros, row-count mismatches)

Also add end-of-session extraction nudge: suggest /reflexio-extract
when session had any friction points.
- test_normal_mode_no_stop_hook: verifies Stop hook absent without --expert
- test_expert_mode_installs_stop_hook: verifies Stop hook present with --expert,
  checks command points to handler.js
- test_expert_mode_stop_hook_idempotent: verifies no duplication on repeated install
- test_remove_from_dir_cleans_stop_hook: verifies uninstall removes the Stop hook
Stop fires once per turn (every assistant response), causing repeated
publishes of the growing transcript and wasteful --force-extraction on
every turn. SessionEnd fires once when the session exits — correct for
full-session capture.

- _merge_hook_config: Stop → SessionEnd
- _remove_hook_config: add SessionEnd to removal list (keep Stop for
  backwards compat with old installs)
- handler.js: update JSDoc comments
- HOOK.md: update event name, installation example, frontmatter
- tests: rename and update all SessionEnd assertions
Root cause: description led with "Search" which framed Reflexio as a
search tool, causing Claude to route corrections to its built-in memory
system instead of triggering the Reflexio publish flow.

Changes:
- Lead description with "Publish user corrections" (the missed trigger)
- Add when_to_use field with concrete trigger phrases
- Explain profile vs playbook: facts publish immediately, procedures
  publish after user confirmation (explicit or implicit)
- Distinguish from Claude's built-in local memory
- Add callout in skill body preventing memory/Reflexio conflation
- Reorder trigger list: corrections first, search second
Root cause: skill tried to handle both when-to-trigger and how-to-publish,
but Claude decides whether to invoke a skill before reading its content.
Triggering guidance needs to be in rules (always loaded).

Changes:
- rules/reflexio.md: add "When to Publish to Reflexio" section with
  profile/playbook/procedure guidance and confirmation model; soften
  existing section titles from commanding to guiding tone
- skill/SKILL-expert.md: simplify from 235 to 98 lines; keep only
  how-to (payload formats, correction patterns, end-of-session nudge)
- skill/SKILL.md: update description to triggering conditions only
  per skill creation guidelines
- skill/references/: new directory with proactive-patterns.md and
  server-management.md (heavy content moved out of main skill)
- setup_cmd.py: copy references/ dir in expert mode
- tests: add test_expert_mode_installs_references and
  test_normal_mode_no_references
delete_all_*, delete_*_by_ids, delete_*, update_*, and publish_*
methods now clear relevant cache entries so subsequent list/get
calls return fresh data instead of stale cached results.

Changes:
- cache.py: add clear() and invalidate(method_name) methods;
  store method_name in each entry for prefix-based invalidation
- client.py: call cache.invalidate("get_profiles") on profile
  mutations, cache.invalidate("get_agent_playbooks") on playbook
  mutations, cache.clear() on nuclear deletes (delete_all_interactions,
  delete_all_playbooks)
- tests: 7 new tests for clear, invalidate, and client integration
reflexio interactions list without --user-id failed with a Pydantic
validation error because GetInteractionsRequest requires user_id.
Now uses require_user_id() to fall back to REFLEXIO_USER_ID env var,
matching the pattern used by other list commands.
- setup_cmd.py: shell-quote all hook paths with shlex.quote for
  paths with spaces; remove SessionEnd hook + expert artifacts
  (references/, reflexio-extract command) when re-installing in
  normal mode; extract _remove_reflexio_hook helper
- handler.js: use positional args ($1..$5) instead of template
  literal interpolation in sh -c to prevent shell injection
- HOOK.md: fix inaccurate docs — tool_use blocks ARE preserved
  as tools_used metadata, not skipped
- server-management.md: add language identifier to code fence
- tests: add test_normal_reinstall_removes_expert_artifacts
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This release adds version 0.2.14 with cache invalidation management, expert mode setup support for Claude Code hooks, SessionEnd event integration, and comprehensive documentation updates. Changes include cache clearing/invalidation methods, client-side cache management after mutations, enhanced CLI setup logic for expert configuration, and updated hook and skill documentation.

Changes

Cohort / File(s) Summary
Version metadata
pyproject.toml
Package version bumped from 0.2.13 to 0.2.14.
CLI command enhancements
reflexio/cli/commands/interactions.py
list_interactions now validates user_id via require_user_id() before passing to client API, adding validation control flow.
Setup command expert mode
reflexio/cli/commands/setup_cmd.py
Added _remove_reflexio_hook() helper; extended _merge_hook_config() with expert: bool parameter to conditionally install SessionEnd hooks and apply shell escaping; updated _install_claude_code_integration() to manage expert-only skill references and commands; extended _remove_hook_config() to clean SessionEnd events during uninstall.
Client cache operations
reflexio/client/cache.py
Added clear() and invalidate(method_name) public methods to InMemoryCache; cache entries now track originating method_name for targeted invalidation.
Client-side cache invalidation
reflexio/client/client.py
Implemented cache invalidation/clearing after mutations: publish_interaction invalidates profiles/playbooks; delete/update methods invalidate related caches; bulk and global delete methods clear or invalidate appropriately.
Claude Code hook documentation & implementation
reflexio/integrations/claude_code/hook/HOOK.md, reflexio/integrations/claude_code/hook/handler.js
Replaced Stop event with SessionEnd; updated handler to use positional shell parameters, add dedicated logging to ~/.reflexio/logs/stop-hook.log, removed stop_hook_active guard, and appended --force-extraction flag to publish command.
Claude Code skill & rule documentation
reflexio/integrations/claude_code/rules/reflexio.md, reflexio/integrations/claude_code/skill/SKILL.md, reflexio/integrations/claude_code/skill/SKILL-expert.md
Updated skill descriptions and renamed sections; reframed SKILL-expert from search-focused to publish-focused flow; added correction application guidance and cross-session persistence clarification.
Claude Code reference documentation
reflexio/integrations/claude_code/skill/references/proactive-patterns.md, reflexio/integrations/claude_code/skill/references/server-management.md
Added proactive extraction trigger patterns (5 categories) and server management operational modes (managed remote vs. local) with setup/error-handling procedures.
Setup command tests
tests/cli/test_setup_cmd.py
Added test coverage for expert mode installation of references directory and SessionEnd hook, idempotency checks, and mode switching verification.
Cache functionality tests
tests/client/test_cache.py
Added unit tests for clear() and invalidate() methods and integration tests for cache invalidation behavior after delete_all_profiles() and delete_all_interactions() operations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 Cache is cleared with hop and bound,
SessionEnd hooks now all around,
Expert mode brings secrets new,
Proactive patterns guide what's true!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore(release): reflexio-ai v0.2.14' directly and clearly identifies the main change—a version bump release—which aligns with the PR's primary objective to release v0.2.14.
Docstring Coverage ✅ Passed Docstring coverage is 97.96% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 chore/release-0.2.14

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

@yilu331
Copy link
Copy Markdown
Collaborator Author

yilu331 commented Apr 21, 2026

Version bump pushed directly to main in 9813a8a. PR no longer needed.

@yilu331 yilu331 closed this Apr 21, 2026
@yilu331 yilu331 deleted the chore/release-0.2.14 branch April 21, 2026 22:45
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