Skip to content

Commit df3039e

Browse files
chore(plugin): deslop merged plugin cleanup (#256)
* chore(plugin): trim host bundle comments * docs(plugin): tighten generated plugin prompts * test(plugin): remove stale contract commentary * docs(plugin): condense validation guidance * docs(plugin): clarify shared bundle contracts * docs(plugin): refresh Cursor README workflow notes
1 parent a5ffec2 commit df3039e

51 files changed

Lines changed: 250 additions & 577 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/plugin-validation.yml

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
1-
# Schema/lint layer for the shipped agent plugin bundles. Mirrors the official
2-
# Cursor marketplace validation workflow:
1+
# Schema/lint layer for the shipped agent plugin bundles. Mirrors:
32
# https://github.com/cursor/plugins/blob/main/.github/workflows/validate-plugins.yml
4-
# (ajv + ajv-formats against the plugin/marketplace JSON schemas; the schemas
5-
# are vendored in tests/fixtures/cursor-schemas/).
63
#
7-
# The Rust contract tests for the bundles already run in ci.yml — do not add
8-
# plain cargo test jobs here. The MCP conformance smoke below is the one
9-
# exception: it needs a built binary plus npx, which cargo test can't provide.
4+
# Rust contract tests already run in ci.yml. Keep this workflow to schema checks
5+
# and the SDK-backed MCP smoke, which needs a built binary plus npx.
106
name: Plugin Validation
117

128
on:
139
pull_request:
1410
paths:
1511
- "plugin/**"
1612
- "tests/fixtures/cursor-schemas/**"
17-
# Plugin/skill test modules (e.g. plugin_manifest_schema_test.rs,
18-
# plugin_skill_contract_test.rs, the skill lint tests).
1913
- "tests/agent_suite/*plugin*"
2014
- "tests/agent_suite/*skill*"
2115
- "scripts/mcp-conformance-smoke.sh"
22-
# The Inspector smoke is the workflow's SDK-backed coverage for
23-
# `tracedecay serve` protocol and tool-schema compatibility.
2416
- "src/serve.rs"
2517
- "src/main.rs"
2618
- "src/lib.rs"
@@ -48,7 +40,6 @@ jobs:
4840
with:
4941
node-version: 22
5042

51-
# Pinned, unlike upstream's floating `npm install ajv ajv-formats`.
5243
- name: Install ajv-cli
5344
run: npm install --no-save ajv-cli@5.0.0 ajv-formats@2.1.1
5445

@@ -66,9 +57,6 @@ jobs:
6657
-s tests/fixtures/cursor-schemas/plugin.schema.json \
6758
-d plugin/.cursor-plugin/plugin.json
6859
69-
# The Codex manifest follows Codex's own layout (e.g. its `interface`
70-
# block), so the Cursor schema does not apply; keep it to a strict JSON
71-
# well-formedness check alongside the other bundle JSON files.
7260
- name: Check bundle JSON files parse
7361
run: |
7462
set -euo pipefail
@@ -79,10 +67,8 @@ jobs:
7967
echo "ok: $f"
8068
done
8169
82-
# Drives a real `tracedecay serve` stdio server through the MCP Inspector
83-
# CLI (pinned version), which embeds the official TypeScript MCP SDK client
84-
# — covering protocol-version negotiation and SDK-side schema validation
85-
# that the in-repo Rust MCP tests cannot. See scripts/mcp-conformance-smoke.sh.
70+
# Uses MCP Inspector's TypeScript SDK client to cover stdio handshake and
71+
# schema compatibility beyond the in-repo Rust MCP tests.
8672
mcp-conformance-smoke:
8773
name: MCP conformance smoke
8874
runs-on: ubuntu-latest

docs/AGENT-MEMORY-INTERCEPTION.md

Lines changed: 32 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
11
# Agent Memory Interception: Codex CLI & Cursor × TraceDecay Fact Store
22

3-
**Status:** research + design proposal (2026-07-02).
3+
**Status:** research + design proposal (2026-07-02; plugin paths refreshed
4+
2026-07-03).
45
**Goal:** make Codex CLI and Cursor use the TraceDecay holographic fact store
56
(`tracedecay_fact_store` add/search/probe/reason, `memory_facts` table, HRR
67
vectors + trust scores) as their agent memory for both **recall** (facts reach
78
the model at the right moment) and **storage** (new durable facts get written),
89
instead of — or layered on top of — each agent's native memory mechanism.
910

10-
All file paths below were verified on this machine (Codex CLI 0.142.4, Cursor
11-
with hooks + plugins, tracedecay plugin v0.0.23 installed for both agents).
12-
13-
> **Note (as of 2026-07-03):** the per-host `cursor-plugin/` / `codex-plugin/`
14-
> source trees have since collapsed into a single shared `plugin/` tree, so
15-
> skill/command/agent sources now live under `plugin/skills/…`,
16-
> `plugin/commands/…`, and `plugin/agents/…` (Cursor-only surfaces under
17-
> `plugin/overlays/cursor/…`). The `recalling-project-memory` and
18-
> `curating-project-memory` skills were also merged into a single
19-
> `project-memory` skill. References below to the old paths/slugs are retained
20-
> as historical design context; the current locations are the shared-tree
21-
> equivalents.
11+
Current plugin source lives under the shared `plugin/` tree: shared skills in
12+
`plugin/skills/`, Claude commands in `plugin/commands/`, shared agents in
13+
`plugin/agents/`, and Cursor-only surfaces in `plugin/overlays/cursor/`.
2214

2315
---
2416

@@ -169,8 +161,9 @@ tool calls (reliable but discretionary). **Storage** interception rides on
169161

170162
### 3.1 `tracedecay install --agent cursor` (`src/agents/cursor.rs`)
171163

172-
Writes an embedded plugin (`EMBEDDED_PLUGIN_FILES`, `src/agents/cursor.rs:175`)
173-
to `~/.cursor/plugins/local/tracedecay/`:
164+
Writes the Cursor projection of the shared plugin bundle
165+
(`src/agents/plugin_bundle.rs::cursor_files`) to
166+
`~/.cursor/plugins/local/tracedecay/`:
174167

175168
- **`mcp.json`** — stdio server `tracedecay serve --path ${workspaceFolder}`
176169
(all fact-store/memory/graph tools available to the model).
@@ -182,11 +175,12 @@ to `~/.cursor/plugins/local/tracedecay/`:
182175
- **`rules/tracedecay.mdc`** — always-applied rule; its **Recall** bullet
183176
steers models to `tracedecay_message_search` / `tracedecay_fact_store`
184177
search and the `project-memory` skill.
185-
- **`skills/`** — 25+ workflow skills incl. `project-memory` (the merged
186-
recall+curate memory skill) and `recalling-session-context`; plus an
187-
agent-managed skill overlay (`install_cursor_managed_skill_overlay`).
188-
- **`agents/`**`code-explorer`, `code-health-auditor`, `session-historian`
189-
subagent definitions.
178+
- **`skills/`** — shared model-invocable skills, excluding the
179+
`tracedecay-*` dispatcher skills that Cursor exposes as native commands.
180+
- **`commands/`** — Cursor-native workflow commands from
181+
`plugin/overlays/cursor/commands/`.
182+
- **`agents/`** — Cursor agent definitions from
183+
`plugin/overlays/cursor/agents/`.
190184

191185
What the hooks currently do (all fail-open):
192186

@@ -205,8 +199,8 @@ What the hooks currently do (all fail-open):
205199

206200
### 3.2 `tracedecay install --agent codex` (`src/agents/codex.rs`)
207201

208-
Installs a **plugin bundle** (`CODEX_EMBEDDED_PLUGIN_FILES`,
209-
`src/agents/codex.rs:209`) to
202+
Installs the Codex projection of the shared plugin bundle
203+
(`src/agents/plugin_bundle.rs::codex_files`) to
210204
`~/.codex/plugins/cache/personal/tracedecay/<version>/` plus a personal
211205
marketplace entry (`install_codex_marketplace_entry`) and
212206
`[plugins."tracedecay@personal"] enabled = true` in `config.toml`:
@@ -218,7 +212,8 @@ marketplace entry (`install_codex_marketplace_entry`) and
218212
`PostToolUse` (matcher `Bash|apply_patch`), `PostCompact`
219213
(matcher `auto|manual`). Hooks require one-time `/hooks` trust
220214
(`print_hook_trust_guidance`); trusted hashes live in `[hooks.state]`.
221-
- **`skills/`** — same 25 workflow skills + `agent-managed/` overlay.
215+
- **`skills/`** — shared skills from `plugin/skills/` plus the
216+
`agent-managed/` overlay.
222217
- **No rule surface exists in Codex**, so the steering text Cursor gets via
223218
`tracedecay.mdc` is injected through `SessionStart`/`UserPromptSubmit`
224219
`additionalContext` instead (`build_codex_session_context`,
@@ -300,13 +295,9 @@ model electing to call an MCP tool; storage depends on the user saying
300295

301296
---
302297

303-
## 5. Ranked integration designs
304-
305-
Ranked by effect ÷ effort. A + B are the core; C–F layer on.
298+
## 5. Integration designs
306299

307-
### A. Codex per-prompt & session-start fact injection via existing hooks — **do first**
308-
309-
*Effort: S–M. Effect: high. Risk: low (fail-open, additive).*
300+
### A. Codex per-prompt & session-start fact injection via existing hooks
310301

311302
Codex is the lowest-effort path because `UserPromptSubmit` carries the prompt
312303
text and honors `hookSpecificOutput.additionalContext`, and the hook binary is
@@ -335,9 +326,7 @@ Implementation pointers: `src/hooks/codex.rs`, `src/hooks/cursor.rs`,
335326
change; hook hashes change → users re-trust via `/hooks` (already documented
336327
in the Codex plugin README).
337328

338-
### B. Cursor session-start injection + a materialized memory rule — **do with A**
339-
340-
*Effort: M. Effect: high (rule) / medium (hook, due to Cursor bugs). Risk: low.*
329+
### B. Cursor session-start injection + a materialized memory rule
341330

342331
Per-prompt injection is impossible in Cursor (§2.3), so combine the two
343332
channels that exist:
@@ -358,16 +347,13 @@ channels that exist:
358347
and/or a scheduler task. Keep it small (facts are one-liners; cap ~1–2 KB)
359348
and deterministic (sorted) so diffs are reviewable.
360349

361-
Implementation pointers: rule generation next to
362-
`cursor_plugin_manifest`/`write_embedded_plugin` (`src/agents/cursor.rs:404`),
363-
refresh in `hook_cursor_workspace_open` (`src/hooks/cursor.rs`); mark the file
364-
managed the same way the skill overlay marks generated skills
365-
(`managed_skill_format.rs`) so uninstall (`remove_cursor_plugin_install`) and
366-
doctor checks cover it.
350+
Implementation pointers: add the managed rule to the Cursor projection in
351+
`src/agents/plugin_bundle.rs` / `src/agents/cursor.rs`, refresh it from
352+
`hook_cursor_workspace_open` (`src/hooks/cursor.rs`), and mark it managed the
353+
same way generated skills are marked (`managed_skill_format.rs`) so uninstall
354+
and doctor checks cover it.
367355

368-
### C. Rule/skill text: make storage proactive — **small, ship with A/B**
369-
370-
*Effort: XS. Effect: medium. Risk: memory spam (mitigated by write-time dedupe).*
356+
### C. Rule/skill text: make storage proactive
371357

372358
Today `project-memory`'s guardrail says add facts "**only when the
373359
user asks**" — the opposite of agent-memory behavior. Change the instruction
@@ -384,9 +370,7 @@ user asks**" — the opposite of agent-memory behavior. Change the instruction
384370
This mirrors Cursor's hybrid design (sidecar + tool calls), with the tool-call
385371
half pointed at TraceDecay.
386372

387-
### D. Enable the reflection loop (sidecar-equivalent storage) — **medium**
388-
389-
*Effort: S (config/UX) — the code exists. Effect: high over time.*
373+
### D. Enable the reflection loop (sidecar-equivalent storage)
390374

391375
session_reflector is the background sidecar analog: transcripts (both agents,
392376
already ingested by the hooks) → evidence-cited fact proposals → dashboard
@@ -404,9 +388,7 @@ Pointers: `src/automation/config.rs` (defaults/validation),
404388
dashboard curation UI (concurrent work in `dashboard/` — coordinate, don't
405389
touch).
406390

407-
### E. Codex-native-memory coexistence policy — **decide, small change**
408-
409-
*Effort: XS–S. Effect: avoids divergence/duplication.*
391+
### E. Codex-native-memory coexistence policy
410392

411393
With `features.memories = true`, Codex builds a parallel memory in
412394
`~/.codex/memories/` from the same sessions. Options:
@@ -430,9 +412,7 @@ is the Settings toggle. Once B+C are live, recommend users disable "Generate
430412
Memories" to keep one memory system (document in `KIRO-INTEGRATION.md`-style
431413
agent doc; can't be automated).
432414

433-
### F. Materialized `AGENTS.md` / memory-file generation — **fallback, partial overlap with B2**
434-
435-
*Effort: M. Effect: medium. Risk: touches user-owned files.*
415+
### F. Materialized `AGENTS.md` / memory-file generation
436416

437417
Scheduled materialization of facts into files agents read natively without
438418
any tool call: a `## Memory (generated by tracedecay)` fenced section in repo
@@ -466,8 +446,8 @@ alongside D and reusing the managed-file conventions from the skill overlay.
466446
+ `src/memory/retrieval.rs` helpers; measurable via existing hook
467447
analytics.
468448
2. **B2 + C** (materialized Cursor memory rule + proactive storage wording) —
469-
one PR in `src/agents/cursor.rs` embedded files + plugin rule/skill text
470-
(shared skill text under `plugin/skills/`).
449+
one PR in `src/agents/plugin_bundle.rs`, `src/agents/cursor.rs`, and plugin
450+
rule/skill text (shared skill text under `plugin/skills/`).
471451
3. **D** (reflector enablement UX) — config/doctor/dashboard nudge.
472452
4. **E** (coexistence policy + optional Codex-memories harvest importer).
473453
5. **F** (generalized AGENTS.md materialization across all 15 agent

0 commit comments

Comments
 (0)