Skip to content

refactor(platform-integrations): namespace shared lib under lib/evolve-lite/ - #258

Merged
illeatmyhat merged 4 commits into
mainfrom
refactor/namespace-shared-lib
Jun 1, 2026
Merged

refactor(platform-integrations): namespace shared lib under lib/evolve-lite/#258
illeatmyhat merged 4 commits into
mainfrom
refactor/namespace-shared-lib

Conversation

@illeatmyhat

@illeatmyhat illeatmyhat commented May 14, 2026

Copy link
Copy Markdown
Collaborator

What

The shared lib (entity_io, config, audit) now renders to lib/evolve-lite/ on every host instead of a bare lib/ — and .bob/lib/evolve-lite/ for bob, replacing .bob/evolve-lib/.

Skill scripts resolve the lib by walking ancestors for lib/evolve-lite/, so multiple plugins can share a host's lib/ directory without their modules colliding. This establishes a namespacing standard (lib/<plugin>/) for plugins to coexist.

How

  • Canonical source stays flat (plugin-source/lib/). build_plugins.py gains a SHARED_TARGET_REWRITES rule (^lib/lib/evolve-lite/) applied to every platform at render time, so a new platform inherits it automatically.
  • Skill scripts (all 7, incl. the .j2): resolution snippet simplified to a single ancestor-walk for lib/evolve-lite/, dropping the old lib / evolve-lib dual candidates.
  • install.sh: bob copies the lib to .bob/lib/evolve-lite/; bob + codex status lines updated.
  • Tests: path references updated across 10 files in tests/platform_integrations/.
  • Docs: INSTALL_SPEC.md, plugin-source/_bob/README.md, tests/platform_integrations/AGENTS.md.

Verification

  • build_plugins.py check — clean (no drift)
  • Full test suite: 527 passed

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Installation guides and READMEs updated to document the standardized shared-library location under lib/evolve-lite/.
  • Refactor

    • Installer and tooling now use a single namespaced layout (lib/evolve-lite/) for shared libraries and packaging.
  • Tests

    • Test suites and assertions updated to validate the shared library and config modules at the new lib/evolve-lite/ locations; added an idempotency test for install/uninstall.

…e-lite/

The shared lib (entity_io, config, audit) now renders to lib/evolve-lite/
on every host instead of a bare lib/ — and .bob/lib/evolve-lite/ for bob,
replacing .bob/evolve-lib/. Skill scripts resolve it by walking ancestors
for lib/evolve-lite/, so multiple plugins can share a host's lib/
directory without their modules colliding.

The canonical source stays flat (plugin-source/lib/); build_plugins.py
applies a shared target rewrite to namespace it at render time. install.sh
and the platform-integration tests are updated to the new layout.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c5ceb8eb-419c-4a11-bfaf-5f5f0815695e

📥 Commits

Reviewing files that changed from the base of the PR and between d0921df and 64bde95.

📒 Files selected for processing (2)
  • platform-integrations/install.sh
  • tests/platform_integrations/test_idempotency.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/platform_integrations/test_idempotency.py

📝 Walkthrough

Walkthrough

Standardizes the plugin shared-library layout to lib/evolve-lite/ across build output, platform integrations (Bob, Claude, Claw, Codex), installer, tests, and docs; scripts now search ancestor paths for lib/evolve-lite/entity_io.py and the build emits lib/evolve-lite/ via a shared rewrite.

Changes

Shared Library Path Standardization

Layer / File(s) Summary
Build system shared rewrite mapping
plugin-source/build_plugins.py
Adds SHARED_TARGET_REWRITES to map ^lib/ -> lib/evolve-lite/ for all platforms.
Plugin source library discovery scripts
plugin-source/skills/evolve-lite/*/scripts/*
Canonical skill scripts now search only for lib/evolve-lite/entity_io.py when walking ancestor directories (removes prior lib/evolve-lib candidate checks).
Bob platform integration & docs
platform-integrations/bob/evolve-lite/..., plugin-source/_bob/README.md
Bob skill scripts and READMEs updated to use .bob/lib/evolve-lite/ and to discover lib/evolve-lite shared lib.
Claude platform integration
platform-integrations/claude/plugins/evolve-lite/...
Claude skill scripts updated to discover shared lib under lib/evolve-lite/.
Claw-Code platform integration
platform-integrations/claw-code/plugins/evolve-lite/...
Claw-Code skill scripts updated to discover shared lib under lib/evolve-lite/.
Codex platform integration & docs
platform-integrations/codex/..., platform-integrations/INSTALL_SPEC.md
Codex skill scripts and INSTALL_SPEC updated to use lib/evolve-lite/ (INSTALL_SPEC copy source corrected).
Installation and validation
platform-integrations/install.sh
Installer now copies/validates lib/evolve-lite/ for Bob and checks Codex plugin plugins/<codex>/lib/evolve-lite/entity_io.py.
Test suite updates
tests/platform_integrations/* and tests/platform_integrations/AGENTS.md
Integration tests updated to insert .../lib/evolve-lite into sys.path and to assert module/file existence under lib/evolve-lite/.

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • vinodmut
  • gaodan-fang
  • visahak

"🐰 I hopped through folders far and wide,
Found one bright path where helpers hide.
lib/evolve-lite, one cozy nest,
No more searching—now it's best.
Shared code sleeps there, neat and spry."

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: namespacing the shared library under lib/evolve-lite/ across all platform integrations.
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 refactor/namespace-shared-lib

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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
plugin-source/_bob/README.md (1)

23-23: ⚡ Quick win

Use consistent path notation with line 22.

Line 22 documents the skills directory as ~/.bob/skills/ (absolute path with tilde), but this line uses .bob/lib/evolve-lite/ (relative path). For consistency, since Bob installs to the user's home directory, both should use the same notation.

📝 Suggested fix
-- Shared library in `.bob/lib/evolve-lite/`
+- Shared library in `~/.bob/lib/evolve-lite/`
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugin-source/_bob/README.md` at line 23, Update the path notation for the
shared library entry so it matches the absolute-tilde style used on line 22:
replace the string ".bob/lib/evolve-lite/" with "~/.bob/lib/evolve-lite/" in the
README (ensure you update the exact text ".bob/lib/evolve-lite/" to the
tilde-prefixed "~/.bob/lib/evolve-lite/" so both entries use the same notation
as "~/.bob/skills/").
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@platform-integrations/install.sh`:
- Line 1072: The printed status message is inconsistent: the existence check
uses (plugin_dir / 'lib' / 'evolve-lite' / 'entity_io.py') but the printed label
shows "lib/entity_io.py"; update the printed label to match the actual path
being checked (e.g., "lib/evolve-lite/entity_io.py") in the print statement so
the output accurately reflects the checked file; locate the print(...) call that
contains "lib/entity_io.py" and change only the displayed path string to match
the checked path.

---

Nitpick comments:
In `@plugin-source/_bob/README.md`:
- Line 23: Update the path notation for the shared library entry so it matches
the absolute-tilde style used on line 22: replace the string
".bob/lib/evolve-lite/" with "~/.bob/lib/evolve-lite/" in the README (ensure you
update the exact text ".bob/lib/evolve-lite/" to the tilde-prefixed
"~/.bob/lib/evolve-lite/" so both entries use the same notation as
"~/.bob/skills/").
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 178777f9-09ba-47ce-8c34-496242a4ab14

📥 Commits

Reviewing files that changed from the base of the PR and between 003bd53 and 699e817.

📒 Files selected for processing (66)
  • platform-integrations/INSTALL_SPEC.md
  • platform-integrations/bob/evolve-lite/README.md
  • platform-integrations/bob/evolve-lite/lib/evolve-lite/__init__.py
  • platform-integrations/bob/evolve-lite/lib/evolve-lite/audit.py
  • platform-integrations/bob/evolve-lite/lib/evolve-lite/config.py
  • platform-integrations/bob/evolve-lite/lib/evolve-lite/entity_io.py
  • platform-integrations/bob/evolve-lite/skills/evolve-lite-learn/scripts/save_entities.py
  • platform-integrations/bob/evolve-lite/skills/evolve-lite-provenance/scripts/log_influence.py
  • platform-integrations/bob/evolve-lite/skills/evolve-lite-publish/scripts/publish.py
  • platform-integrations/bob/evolve-lite/skills/evolve-lite-recall/scripts/retrieve_entities.py
  • platform-integrations/bob/evolve-lite/skills/evolve-lite-subscribe/scripts/subscribe.py
  • platform-integrations/bob/evolve-lite/skills/evolve-lite-sync/scripts/sync.py
  • platform-integrations/bob/evolve-lite/skills/evolve-lite-unsubscribe/scripts/unsubscribe.py
  • platform-integrations/claude/plugins/evolve-lite/lib/evolve-lite/__init__.py
  • platform-integrations/claude/plugins/evolve-lite/lib/evolve-lite/audit.py
  • platform-integrations/claude/plugins/evolve-lite/lib/evolve-lite/config.py
  • platform-integrations/claude/plugins/evolve-lite/lib/evolve-lite/entity_io.py
  • platform-integrations/claude/plugins/evolve-lite/skills/evolve-lite/learn/scripts/save_entities.py
  • platform-integrations/claude/plugins/evolve-lite/skills/evolve-lite/provenance/scripts/log_influence.py
  • platform-integrations/claude/plugins/evolve-lite/skills/evolve-lite/publish/scripts/publish.py
  • platform-integrations/claude/plugins/evolve-lite/skills/evolve-lite/recall/scripts/retrieve_entities.py
  • platform-integrations/claude/plugins/evolve-lite/skills/evolve-lite/subscribe/scripts/subscribe.py
  • platform-integrations/claude/plugins/evolve-lite/skills/evolve-lite/sync/scripts/sync.py
  • platform-integrations/claude/plugins/evolve-lite/skills/evolve-lite/unsubscribe/scripts/unsubscribe.py
  • platform-integrations/claw-code/plugins/evolve-lite/lib/evolve-lite/__init__.py
  • platform-integrations/claw-code/plugins/evolve-lite/lib/evolve-lite/audit.py
  • platform-integrations/claw-code/plugins/evolve-lite/lib/evolve-lite/config.py
  • platform-integrations/claw-code/plugins/evolve-lite/lib/evolve-lite/entity_io.py
  • platform-integrations/claw-code/plugins/evolve-lite/skills/evolve-lite/learn/scripts/save_entities.py
  • platform-integrations/claw-code/plugins/evolve-lite/skills/evolve-lite/provenance/scripts/log_influence.py
  • platform-integrations/claw-code/plugins/evolve-lite/skills/evolve-lite/publish/scripts/publish.py
  • platform-integrations/claw-code/plugins/evolve-lite/skills/evolve-lite/recall/scripts/retrieve_entities.py
  • platform-integrations/claw-code/plugins/evolve-lite/skills/evolve-lite/subscribe/scripts/subscribe.py
  • platform-integrations/claw-code/plugins/evolve-lite/skills/evolve-lite/sync/scripts/sync.py
  • platform-integrations/claw-code/plugins/evolve-lite/skills/evolve-lite/unsubscribe/scripts/unsubscribe.py
  • platform-integrations/codex/plugins/evolve-lite/lib/evolve-lite/__init__.py
  • platform-integrations/codex/plugins/evolve-lite/lib/evolve-lite/audit.py
  • platform-integrations/codex/plugins/evolve-lite/lib/evolve-lite/config.py
  • platform-integrations/codex/plugins/evolve-lite/lib/evolve-lite/entity_io.py
  • platform-integrations/codex/plugins/evolve-lite/skills/evolve-lite/learn/scripts/save_entities.py
  • platform-integrations/codex/plugins/evolve-lite/skills/evolve-lite/provenance/scripts/log_influence.py
  • platform-integrations/codex/plugins/evolve-lite/skills/evolve-lite/publish/scripts/publish.py
  • platform-integrations/codex/plugins/evolve-lite/skills/evolve-lite/recall/scripts/retrieve_entities.py
  • platform-integrations/codex/plugins/evolve-lite/skills/evolve-lite/subscribe/scripts/subscribe.py
  • platform-integrations/codex/plugins/evolve-lite/skills/evolve-lite/sync/scripts/sync.py
  • platform-integrations/codex/plugins/evolve-lite/skills/evolve-lite/unsubscribe/scripts/unsubscribe.py
  • platform-integrations/install.sh
  • plugin-source/_bob/README.md
  • plugin-source/build_plugins.py
  • plugin-source/skills/evolve-lite/learn/scripts/save_entities.py
  • plugin-source/skills/evolve-lite/provenance/scripts/log_influence.py
  • plugin-source/skills/evolve-lite/publish/scripts/publish.py
  • plugin-source/skills/evolve-lite/recall/scripts/retrieve_entities.py.j2
  • plugin-source/skills/evolve-lite/subscribe/scripts/subscribe.py
  • plugin-source/skills/evolve-lite/sync/scripts/sync.py
  • plugin-source/skills/evolve-lite/unsubscribe/scripts/unsubscribe.py
  • tests/platform_integrations/AGENTS.md
  • tests/platform_integrations/test_audit.py
  • tests/platform_integrations/test_bob_sharing.py
  • tests/platform_integrations/test_codex.py
  • tests/platform_integrations/test_config.py
  • tests/platform_integrations/test_entity_io.py
  • tests/platform_integrations/test_entity_io_core.py
  • tests/platform_integrations/test_idempotency.py
  • tests/platform_integrations/test_plugin_structure.py
  • tests/platform_integrations/test_subscribe.py

Comment thread platform-integrations/install.sh Outdated
… path notation

Address CodeRabbit review on #258:
- install.sh: codex status line label now matches the path it checks
  (lib/evolve-lite/entity_io), consistent with the bob status line.
- _bob/README.md: shared-library path uses ~/.bob/ tilde notation to
  match the skills-directory entry above it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gaodan-fang

Copy link
Copy Markdown
Collaborator

Codex Review

Target: branch diff against main

The relocated Bob library path is not included in Bob's uninstall/purge cleanup, leaving installed artifacts behind after uninstall. The main runtime lookup changes otherwise appear internally consistent.

Review comment

  • [P2] Remove Bob's relocated lib on uninstallplatform-integrations/install.sh:527
    For Bob lite installs, the shared library now lands at .bob/lib/evolve-lite, but Bob uninstall still only calls _purge_evolve_artifacts(), which removes evolve-prefixed entries directly under .bob plus skills/commands. After install --platform bob followed by uninstall --platform bob, .bob/lib/evolve-lite/entity_io.py is left behind and status will still report the library as installed. Please extend the purge/uninstall path to remove this specific nested directory without deleting unrelated .bob/lib content.

visahak and others added 2 commits May 29, 2026 13:12
…e path

Two bob-installer correctness fixes surfaced while wiring up global installs:

- Uninstall now removes the namespaced shared lib at `.bob/lib/evolve-lite/`.
  After the lib/ rename it is no longer an evolve-prefixed top-level dir, so
  the generic purge loop missed it and left artifacts behind (gaodan-fang's
  PR #258 review). Adds a regression test.

- Install/uninstall/status now resolve the custom-mode (and full-mode MCP)
  file by scope: Bob reads GLOBAL modes from `~/.bob/settings/custom_modes.yaml`
  but PROJECT modes from `<project>/.bob/custom_modes.yaml`. The installer
  previously always wrote the top-level path, so a global install (`--dir $HOME`)
  landed in a file Bob never loads. Uninstall also strips the legacy top-level
  file so pre-fix installs get cleaned up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@illeatmyhat
illeatmyhat merged commit a8c7d61 into main Jun 1, 2026
12 checks passed
vinodmut added a commit to vinodmut/kaizen that referenced this pull request Jun 1, 2026
PR AgentToolkit#258 moved each platform's shared lib from `lib/` to
`lib/evolve-lite/`. My _lib walker was looking for `lib/audit.py` and
`evolve-lib/audit.py` and would fail to find the helpers post-merge.
Update the walker to match the simplified pattern used by save_entities
and other recall scripts: a single `lib/evolve-lite/` candidate.
vinodmut added a commit that referenced this pull request Jul 8, 2026
…262)

* feat: add synthesize-skill skill for all platforms

A new evolve-lite skill that converts a saved trajectory into a reusable
agent skill (SKILL.md + supporting scripts). Models the SKILL.md shape
on the existing learn skill: judgment lives in a forked subagent (read
trajectory, identify the successful workflow, draft a SKILL.md and
scripts), file-system plumbing lives in scripts/synthesize.py
(frontmatter validation, dual writes, audit-log entry).

Lives at plugin-source/skills/evolve-lite/synthesize-skill/ — universal,
ships to all four platforms (claude, codex, claw-code, bob). The SKILL.md
template uses the shared invoke()/skill_ref() macros for platform-aware
shell paths and slash-prefixes; the script is templated to set
_RUNTIME_MIRROR_DIR per platform. On claude, the script writes both to
.evolve/skills/<name>/ (canonical) and .claude/skills/<name>/ (so the
Claude Code skill loader picks it up automatically). Other platforms
write only to .evolve/skills/<name>/ for now — adopting an automatic
runtime mirror on those hosts is a follow-up.

The skill is invoked manually for now; not wired into a Stop hook.

* test(experiments): add skill-from-trajectory experiment runner

Three-way comparison driver (no_recall / guidelines / skill) that runs
the seed → synthesize → measure flow per trial. Reuses helpers from
experiments/token_savings.py. Captures token usage from
--output-format json plus per-turn usage and tool-call summaries from
saved transcripts. Supports --seed-utterances to test multi-utterance
seeding (e.g. gps + focal_length, then measure on lens) for skill
generalization.

Also resolves /tmp -> /private/tmp on macOS (Docker bind-mount of /tmp
subdirs doesn't follow the symlink, breaking the prior plumbing for
hidden subdirs).

* fix(claude-plugin): apply ruff format to synthesize.py

Ruff format wants `text[match.end() :]` (slice spacing) instead of
`text[match.end():]`. Apply to the .j2 source plus all four rendered
outputs so re-running the renderer stays consistent.

Fixes failing CI check: check-formatting (3.12)

* fix(experiments): apply ruff format to skill_from_trajectory.py

Fixes failing CI check: check-formatting (3.12)

* fix(experiments): silence mypy on sys.path-hack import

The token_savings import goes through sys.path.insert so mypy can't
resolve the module. Add `# type: ignore[import-not-found]` and
explicitly annotate the wrapper return so the no-any-return error is
also resolved.

Fixes failing CI check: check-typing (3.12)

* fix(claude-plugin): tag SKILL.md fenced blocks with language identifiers

Markdownlint MD040 wants every fenced code block to declare a language.
The frontmatter example fence becomes ```yaml; the directory-tree fence
becomes ```text. Edit the .j2 source so re-rendering propagates to all
four platforms.

Addresses CodeRabbit review findings:
- "Add language identifier to fenced code block" (frontmatter)
- "Add language identifier to fenced code block" (directory tree)
- "Add language identifiers to fenced code blocks (root cause for deployed copies)"

* fix(claude-plugin): harden synthesize.py finalize against partial installs

Two robustness fixes in cmd_finalize:

1. Wrap the _parse_frontmatter call in a try/except ValueError so
   malformed SKILL.md files exit cleanly (SystemExit with the parser's
   message) instead of bubbling up a traceback.

2. Pre-check both destinations (.evolve/skills/<name>/ and the
   platform-specific runtime mirror, when set) before performing any
   copy. Previously, if the runtime-mirror destination already existed
   and --force was off, evolve_dst would already have been written —
   leaving a partial install on disk.

Refactor: extract _check_dest() (existence guard) from _copy_into()
(actual write), and call _check_dest on both targets before either
_copy_into. Also collapse the platform-specific _RUNTIME_MIRROR_DIR
declaration to a single line so the rendered output matches ruff
format directly (no post-render reformatting cycle).

Addresses CodeRabbit review findings:
- "Frontmatter parse errors escape as tracebacks instead of clean CLI errors"
- "Pre-check both destinations before copying to avoid a partial install"
- "Partial install on runtime-mirror failure (claude variant)"

* fix(claude-plugin): adapt synthesize.py walker to the namespaced lib/

PR #258 moved each platform's shared lib from `lib/` to
`lib/evolve-lite/`. My _lib walker was looking for `lib/audit.py` and
`evolve-lib/audit.py` and would fail to find the helpers post-merge.
Update the walker to match the simplified pattern used by save_entities
and other recall scripts: a single `lib/evolve-lite/` candidate.

---------

Co-authored-by: Vatche Isahagian <visahak@users.noreply.github.com>
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.

3 participants