Skip to content

Commit e4e78e7

Browse files
committed
fix(codex): rebase sharing changes onto claude branch
1 parent 7df5069 commit e4e78e7

22 files changed

Lines changed: 1641 additions & 39 deletions

File tree

platform-integrations/codex/plugins/evolve-lite/.codex-plugin/plugin.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "evolve-lite",
3-
"version": "1.0.0",
4-
"description": "Recall and save Evolve entities in Codex without MCP.",
3+
"version": "1.1.0",
4+
"description": "Recall, save, and share Evolve entities in Codex without MCP.",
55
"author": {
66
"name": "Vinod Muthusamy",
77
"url": "https://github.com/AgentToolkit/altk-evolve"
@@ -13,16 +13,18 @@
1313
"skills": "./skills/",
1414
"interface": {
1515
"displayName": "Evolve Lite",
16-
"shortDescription": "Recall and save reusable Evolve entities.",
17-
"longDescription": "A lightweight Codex plugin that helps you save reusable entities from successful sessions and recall them automatically on new prompts.",
16+
"shortDescription": "Recall, save, and share reusable Evolve entities.",
17+
"longDescription": "A lightweight Codex plugin that helps you save reusable entities, publish selected guidance, subscribe to shared repos, and recall relevant memory automatically on new prompts.",
1818
"developerName": "AgentToolkit",
1919
"category": "Productivity",
2020
"capabilities": ["Interactive", "Write"],
2121
"websiteURL": "https://github.com/AgentToolkit/altk-evolve",
2222
"defaultPrompt": [
2323
"Recall Evolve entities for this task.",
2424
"Save new Evolve learnings from this session.",
25-
"Show me the entities stored for this repo."
25+
"Show me the entities stored for this repo.",
26+
"Publish one of my Evolve guidelines.",
27+
"Subscribe to a teammate's Evolve guidelines repo."
2628
],
2729
"brandColor": "#2563EB"
2830
}

platform-integrations/codex/plugins/evolve-lite/README.md

Lines changed: 195 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Evolve Lite Plugin for Codex
22

3-
A plugin that helps Codex learn from conversations by automatically extracting and applying entities.
3+
A plugin that helps Codex save, recall, and share reusable entities across workspaces.
44

55
⭐ Star the repo: https://github.com/AgentToolkit/altk-evolve
66

@@ -9,20 +9,54 @@ A plugin that helps Codex learn from conversations by automatically extracting a
99
- Automatic recall through a repo-level Codex `UserPromptSubmit` hook when Codex hooks are enabled
1010
- Manual `evolve-lite:learn` skill to save reusable entities into `.evolve/entities/`
1111
- Manual `evolve-lite:recall` skill to inspect everything stored for the current repo
12+
- Manual `evolve-lite:publish` skill to publish private guidelines to your public repo
13+
- Manual `evolve-lite:subscribe` and `evolve-lite:unsubscribe` skills to manage shared guideline repos
14+
- Automatic or manual `evolve-lite:sync` to mirror subscribed repos into local recall storage
1215

1316
## Storage
1417

15-
Entities are stored in the active workspace under:
18+
Entities and sharing data are stored in the active workspace under:
1619

1720
```text
18-
.evolve/entities/
19-
guideline/
20-
use-context-managers-for-file-operations.md
21-
cache-api-responses-locally.md
21+
.evolve/
22+
entities/
23+
guideline/
24+
use-context-managers-for-file-operations.md
25+
subscribed/
26+
alice/
27+
guideline/
28+
prefer-small-functions.md
29+
public/
30+
guideline/
31+
no-eval.md
32+
subscribed/
33+
alice/
34+
guideline/
35+
prefer-small-functions.md
36+
audit.log
2237
```
2338

2439
Each entity is a markdown file with lightweight YAML frontmatter.
2540

41+
Sharing configuration lives in `evolve.config.yaml` at the repo root:
42+
43+
```yaml
44+
identity:
45+
user: alice
46+
47+
public_repo:
48+
remote: git@github.com:alice/evolve-guidelines.git
49+
branch: main
50+
51+
subscriptions:
52+
- name: team
53+
remote: git@github.com:myorg/evolve-guidelines.git
54+
branch: main
55+
56+
sync:
57+
on_session_start: true
58+
```
59+
2660
## Source Layout
2761
2862
This source tree intentionally omits `lib/`.
@@ -33,7 +67,12 @@ The shared library lives in:
3367
platform-integrations/claude/plugins/evolve-lite/lib/
3468
```
3569

36-
`platform-integrations/install.sh` copies that shared library into the installed Codex plugin so the installed layout is self-contained.
70+
`platform-integrations/install.sh` installs Codex in this order:
71+
72+
1. copy the Codex plugin source into `plugins/evolve-lite/`
73+
2. copy the shared `lib/` from the Claude plugin into `plugins/evolve-lite/lib/`
74+
3. wire the marketplace entry
75+
4. wire the Codex hooks
3776

3877
## Installation
3978

@@ -60,6 +99,85 @@ If you do not want to enable Codex hooks, you can still invoke the installed `ev
6099

61100
The installed Codex hook does not require `git`. It walks upward from the current working directory until it finds the repo-local `plugins/evolve-lite/.../retrieve_entities.py` script.
62101

102+
The installer always registers a `SessionStart` hook with matcher `startup|resume`; it runs on every Codex session start or resume and exits quickly unless `sync.on_session_start` is enabled and subscriptions are configured in `evolve.config.yaml`.
103+
104+
## Sharing Guidelines
105+
106+
Evolve Lite supports sharing guidelines between users via public Git repositories. You can publish your own guidelines so others can subscribe to them, and subscribe to guidelines published by others.
107+
108+
### Setup
109+
110+
Sharing uses `evolve.config.yaml` at the project root. Minimal structure:
111+
112+
```yaml
113+
identity:
114+
user: yourname
115+
116+
public_repo:
117+
remote: git@github.com:yourname/evolve-guidelines.git
118+
branch: main
119+
120+
subscriptions: []
121+
122+
sync:
123+
on_session_start: true
124+
```
125+
126+
The `.evolve/` directory is kept out of version control.
127+
128+
### Publishing Guidelines
129+
130+
Use `evolve-lite:publish` to share one or more of your local guidelines with others:
131+
132+
1. Pick a file from `.evolve/entities/guideline/`
133+
2. Publish it into `.evolve/public/guideline/`
134+
3. The published file is stamped with `visibility: public`, `published_at`, and a `source` label derived from config when available
135+
4. The original private guideline is removed from `.evolve/entities/guideline/`
136+
137+
Others can then subscribe using that public remote URL.
138+
139+
### Subscribing to Guidelines
140+
141+
Use `evolve-lite:subscribe` to pull in guidelines from another user's public repo.
142+
143+
The repo is cloned to `.evolve/subscribed/{name}/` and mirrored into `.evolve/entities/subscribed/{name}/` so recall can pick them up immediately.
144+
145+
### Syncing Subscriptions
146+
147+
Use `evolve-lite:sync` to pull the latest changes from all subscribed repos.
148+
149+
If `sync.on_session_start: true` is set in config, this runs automatically whenever a Codex session starts or resumes.
150+
151+
### Unsubscribing
152+
153+
Use `evolve-lite:unsubscribe` to remove a subscription and delete its locally cloned files.
154+
155+
This removes both `.evolve/subscribed/{name}/` and its mirrored recall copy under `.evolve/entities/subscribed/{name}/`.
156+
157+
### Sharing Storage Layout
158+
159+
```text
160+
.evolve/
161+
public/
162+
guideline/
163+
guideline-name.md # published guideline, included in recall
164+
subscribed/
165+
alice/
166+
guideline/
167+
her-guideline.md # git clone of alice's public repo
168+
entities/
169+
guideline/
170+
private-guideline.md # private local guideline
171+
subscribed/
172+
alice/
173+
guideline/
174+
her-guideline.md # mirrored for recall, annotated [from: alice]
175+
```
176+
177+
## Example Walkthrough
178+
179+
See the [Codex example walkthrough](../../../../docs/examples/hello_world/codex.md) for a step-by-step example showing the save-then-recall loop in a Codex workspace.
180+
63181
## Included Skills
64182

65183
### `evolve-lite:learn`
@@ -68,4 +186,73 @@ Analyze the current session and save proactive Evolve entities as markdown files
68186

69187
### `evolve-lite:recall`
70188

71-
Show the entities already stored for the current workspace.
189+
Show the entities already stored for the current workspace, including published guidelines under `.evolve/public/`.
190+
191+
### `evolve-lite:publish`
192+
193+
Move selected private guidelines into `.evolve/public/`, stamp them as public, and push them to your configured sharing repo.
194+
195+
### `evolve-lite:subscribe`
196+
197+
Clone another user's public guideline repo into `.evolve/subscribed/` and register it in `evolve.config.yaml`.
198+
199+
### `evolve-lite:unsubscribe`
200+
201+
Remove a configured subscription and delete its local clones and mirrored recall entities.
202+
203+
### `evolve-lite:sync`
204+
205+
Pull every configured subscription and mirror its markdown files into `.evolve/entities/subscribed/` so recall can include them automatically.
206+
207+
## Environment Variables
208+
209+
- `EVOLVE_DIR`: Override the default `.evolve` directory location for entities, sharing data, audit logs, and the mirrored subscription store.
210+
211+
## Verification
212+
213+
After installation, verify that:
214+
215+
- `plugins/evolve-lite/` exists in the repo
216+
- `.agents/plugins/marketplace.json` contains the `evolve-lite` entry
217+
- `.codex/hooks.json` contains the Evolve `UserPromptSubmit` and `SessionStart` hooks
218+
219+
You can also run:
220+
221+
```bash
222+
platform-integrations/install.sh status
223+
```
224+
225+
## Plugin Structure
226+
227+
```text
228+
evolve-lite/
229+
├── .codex-plugin/
230+
│ └── plugin.json
231+
├── skills/
232+
│ ├── learn/
233+
│ │ ├── SKILL.md
234+
│ │ └── scripts/
235+
│ │ └── save_entities.py
236+
│ ├── recall/
237+
│ │ ├── SKILL.md
238+
│ │ └── scripts/
239+
│ │ └── retrieve_entities.py
240+
│ ├── publish/
241+
│ │ ├── SKILL.md
242+
│ │ └── scripts/
243+
│ │ └── publish.py
244+
│ ├── subscribe/
245+
│ │ ├── SKILL.md
246+
│ │ └── scripts/
247+
│ │ └── subscribe.py
248+
│ ├── unsubscribe/
249+
│ │ ├── SKILL.md
250+
│ │ └── scripts/
251+
│ │ └── unsubscribe.py
252+
│ └── sync/
253+
│ ├── SKILL.md
254+
│ └── scripts/
255+
│ └── sync.py
256+
├── README.md
257+
└── lib/ # copied in at install time from the Claude plugin
258+
```

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Examples of artifacts that must be immediately created once proven as the succes
2727
Unless that artifact happens to be:
2828
- code which is a trivial one-liner that future agents would not benefit from reusing
2929
- code which embeds secrets, tokens, or user-specific sensitive data
30+
- the guideline would instruct the agent to invoke a skill, tool, or external command by name (e.g. "run evolve-lite:learn", "call save_trajectory") - such guidelines trigger prompt-injection detection when retrieved by the recall skill in a future session
3031
- the user explicitly asked for a one-off result and not to persist helper code
3132
- redundant because an equivalent local artifact on disk would be just as effective
3233

platform-integrations/codex/plugins/evolve-lite/skills/learn/scripts/save_entities.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
in the entities directory, organized by type.
66
"""
77

8+
import argparse
89
import json
910
import sys
1011
from pathlib import Path
@@ -13,9 +14,14 @@
1314
_script = Path(__file__).resolve()
1415
_lib = None
1516
for _ancestor in _script.parents:
16-
_candidate = _ancestor / "lib"
17-
if (_candidate / "entity_io.py").is_file():
18-
_lib = _candidate
17+
for _candidate in (
18+
_ancestor / "lib",
19+
_ancestor / "platform-integrations" / "claude" / "plugins" / "evolve-lite" / "lib",
20+
):
21+
if (_candidate / "entity_io.py").is_file():
22+
_lib = _candidate
23+
break
24+
if _lib is not None:
1925
break
2026
if _lib is None:
2127
raise ImportError(f"Cannot find plugin lib directory above {_script}")
@@ -42,6 +48,10 @@ def normalize(text):
4248

4349

4450
def main():
51+
parser = argparse.ArgumentParser()
52+
parser.add_argument("--user", default=None, help="Stamp owner on every entity written")
53+
args = parser.parse_args()
54+
4555
try:
4656
input_data = json.load(sys.stdin)
4757
log(f"Received input with keys: {list(input_data.keys())}")
@@ -82,6 +92,11 @@ def main():
8292
log(f"Skipping duplicate: {content[:60]}")
8393
continue
8494

95+
if args.user and not entity.get("owner"):
96+
entity["owner"] = args.user
97+
if not entity.get("visibility"):
98+
entity["visibility"] = "private"
99+
85100
path = write_entity_file(entities_dir, entity)
86101
existing_contents.add(normalize(content))
87102
added_count += 1

0 commit comments

Comments
 (0)