Skip to content

refactor(me/evolve): fix path/flag bugs + simplify Phase 0 & 1 - #666

Merged
baleen37 merged 9 commits into
mainfrom
quirky-panda-hamilton
May 28, 2026
Merged

refactor(me/evolve): fix path/flag bugs + simplify Phase 0 & 1#666
baleen37 merged 9 commits into
mainfrom
quirky-panda-hamilton

Conversation

@baleen37

@baleen37 baleen37 commented May 28, 2026

Copy link
Copy Markdown
Owner

Summary

Two phases applied to the /me:evolve skill:

  1. Bug fixes (4 commits) — static review surfaced four issues that would have caused real failures or silent signal loss.
  2. Simplifications (4 commits) — a subagent reviewed the post-fix state and proposed targeted reductions; F1–F4 applied, F5–F6 rejected with reasons.

Changes

Fixes

  • f7e21c6e — SKILL.md: use the Base directory for this skill value injected at the command-prompt header instead of ${CLAUDE_PLUGIN_ROOT} (the env var is not guaranteed in the slash-command shell).
  • 91de3f04 — SKILL.md: --dry-run is consumed by the main agent only; forwarding to build-index.ts would crash on the unknown-flag exit-2 path.
  • 4b26bca5 — spec: mark each /me:evolve usage variant as implemented or unimplemented so future Phase 1 subagents don't propose changes for phantom features.
  • 99b09526 — build-index.ts: preserve slash-command args (<command-args> tag or prefix-form remainder, ≤200 chars) on skill events so Phase 1 has the user's actual intent, not just the bare command name.

Simplifications (subagent-proposed, F1–F4)

  • 9b2287d5 — drop large_out EventKind, bytes field, LARGE_OUTPUT_THRESHOLD, and the orphaned ToolResultPayload.size. Pure write-only signal; Phase 1 mapping table never consumed it.
  • bd9d17a8 — drop signal_positions from Summary. clusters + headline already give the LLM dense-region detection and totals; events[] covers sparse cases.
  • c796bc13 — drop skipped field from the Phase 1 proposal schema. Phase 2 never read it.
  • ecb7f4f1 — collapse the 7-row signal→file mapping table into 3 target rules keyed on missing-knowledge type (skill rules / repo navigation / project conventions). The "Nearest" resolution rule is preserved.

Considered but rejected

  • F5 (fold language/forbidden blockquotes into prose) — the emphasis is doing anti-regression work; both rules document mistakes the agent has already made.
  • F6 (merge repeat detection into the main buildEvents loop) — separation is more readable than the merge would be; not a real perf win.

Test plan

  • bun plugins/me/skills/evolve/scripts/build-index.ts runs against the current session transcript and emits valid JSON
  • summary.signal_positions removed; summary keys are exactly {headline, clusters}
  • Slash-command args captured on skill events (verified against /me:evolve in this very session)
  • No large_out events in current-session output
  • All eight commits cleanly separable for git revert <sha> if any individual change is bad

Summary by CodeRabbit

  • Documentation

    • Updated /me:evolve command reference with clarified command variants, default behaviors, and argument specifications.
  • Updates

    • Enhanced session analysis and indexing for the /me:evolve skill with improved event detection and processing accuracy.

Review Change Stack

Test User added 8 commits May 28, 2026 14:15
…KILL.md

The slash-command shell does not guarantee ${CLAUDE_PLUGIN_ROOT} is set.
Use the "Base directory for this skill" value injected into the command
prompt header, which is always present.

Also documents the exit-2 case for unknown flags so the dry-run pitfall
is visible at the bun invocation line.
build-index.ts's parseArgs exits with code 2 on unknown flags, so
forwarding --dry-run would crash Phase 0. SKILL.md now makes the
ownership explicit: --dry-run is consumed by the main agent only.
The 사용법 block advertised --since and skill-name filters that
build-index.ts has never implemented. Mark each variant explicitly and
note the divergence so future Phase 1 subagents don't propose changes
based on phantom features.
Previously detectSlashCommand returned only the command name, so when
the user invoked /me:evolve with arguments (e.g. via <command-args>),
the actual user intent was discarded — only the bare slash event
survived. The Phase 1 subagent then had no signal about *what* the
user asked.

Now skill events carry an optional `args` field (≤200 chars) extracted
from <command-args> tag or the prefix-form remainder.
build-index.ts emitted large_out events for tool_result bodies over
10KB, but SKILL.md's Phase 1 mapping table never consumed them — pure
write-only signal.

Removes: large_out EventKind, bytes field, LARGE_OUTPUT_THRESHOLD, and
the now-unused ToolResultPayload.size field (orphan cleanup).
signal_positions duplicated cluster data in a flatter form. The LLM
already has events[] for granular walks and clusters for dense-region
detection — the per-kind turn list added no new information for the
mapping table to consume.

Simplifies Summary, removes buildSignalPositions, and tightens the
SKILL.md guidance from three sub-fields to two.
The subagent was instructed to return a skipped[] array of low-confidence
events, but Phase 2 never read it. Pure write-only output costing tokens
on every run. classifications[] already labels noise/question events,
and unproposed events are implicitly skipped.
The seven-row signal→file table over-specified what the LLM already
infers from context. Every row's 1st-choice column resolved to one of
three targets (SKILL.md / AGENTS.md / CLAUDE.md), so the discriminator
that matters is "what kind of knowledge is missing," not "which signal
pattern fired."

Replaces the table with three target descriptions keyed on missing-
knowledge type. The "Nearest" resolution rule — the actually load-
bearing piece — is preserved verbatim.
@baleen37
baleen37 enabled auto-merge (squash) May 28, 2026 05:33
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@baleen37, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 56 minutes and 20 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a7e7e1b9-f90a-48fa-b541-0aa90469c789

📥 Commits

Reviewing files that changed from the base of the PR and between ecb7f4f and fcb98c6.

📒 Files selected for processing (1)
  • tests/me/evolve-build-index.bats
📝 Walkthrough

Walkthrough

The /me:evolve skill is refactored across three areas: event schema types now omit large_out and signal_positions while adding optional args to skill events; SKILL.md instructions clarify Phase 0 directory injection, Phase 1 analysis order and target-file selection, and Phase 2 dry-run behavior; build-index.ts implementation updates command detection to extract arguments and error handling to emit error events instead of size-based output events.

Changes

Evolve Skill Schema and Instruction Alignment

Layer / File(s) Summary
Event schema and type contract
plugins/me/skills/evolve/scripts/build-index.ts
EventKind removes large_out; Event adds optional args; ToolResultPayload removes size; Summary removes signal_positions.
Skill execution instruction updates
plugins/me/skills/evolve/SKILL.md
Phase 0 uses injected base directory; Phase 1 specifies headline/clusters analysis order and missing-knowledge target-file selection, removes skipped field; Phase 2 clarifies --dry-run is consumed by main agent only.
Command detection and skill event emission
plugins/me/skills/evolve/scripts/build-index.ts
Slash-command detector supports both tagged and prefix syntax with optional argument extraction; skill events now include extracted args.
Tool-result and event processing
plugins/me/skills/evolve/scripts/build-index.ts
Tool-result ingestion stops recording size; tool-result errors emit error events; large_out events are removed.
Summary indexing and signal cleanup
plugins/me/skills/evolve/scripts/build-index.ts
buildSignalPositions helper is removed; buildSummary stops populating signal_positions.
User-facing command documentation
docs/superpowers/specs/2026-05-27-evolve-skill-design.md
/me:evolve, --session, and --dry-run variants are marked as implemented; me:research and --since options are marked as not yet implemented.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • baleen37/bstack#664: Introduces the /me:evolve feature; this PR evolves its schema, instructions, and command parsing implementation.

Poem

A rabbit in burrows of code did hop,
Refactoring signals from top to bottom,
Commands now parse with arguments in tow,
Schemas evolved—signals let go,
The skill does learn, through transcript and thought! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% 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 directly describes the main changes: bug fixes and simplifications to the /me:evolve skill (Phases 0 & 1), which aligns with the primary objectives of the PR.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch quirky-panda-hamilton

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.

Three tests verified behavior that the refactor commits removed:
- "summary has signal_positions" — field deleted in bd9d17a
- "detects large_out event above 10KB" — kind deleted in 9b2287d
- "signal_positions kinds appear in events" — same field

Replace with:
- positive assertion that summary has no signal_positions key
- positive assertion that large_out events are never emitted
- updated kind allowlists in two coverage tests

Also drops large_out from the allowlist in the false-positive guard.
@baleen37
baleen37 merged commit 43f2c58 into main May 28, 2026
4 of 5 checks passed
@baleen37
baleen37 deleted the quirky-panda-hamilton branch May 28, 2026 05:35
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