From memesis
Vendored autoresearch skill — iterates a Modify→Verify→Keep/Discard loop over the defined mutation surface (D-14), gated by the full guard suite (D-15) and a token budget (D-16). Invoked by `evolve --autoresearch` to automatically improve pipeline fidelity against a compiled eval delta. Memesis ships its own copy; upstream updates are pulled in deliberately, not auto-tracked.
How this skill is triggered — by the user, by Claude, or both
Slash command
/memesis:autoresearchThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Iterates a Modify→Verify→Keep/Discard loop over the memesis pipeline mutation surface.
Iterates a Modify→Verify→Keep/Discard loop over the memesis pipeline mutation surface.
Driven by a compiled eval delta (from /memesis:evolve) and a YAML config file.
This skill is a vendored sibling under skills/autoresearch/.
Memesis ships its own copy — no external skill dependency.
Upstream updates are pulled in deliberately, not auto-tracked.
Invoked by evolve --autoresearch (Task 4.2 wiring). Not called directly.
from core.autoresearch import Autoresearcher
researcher = Autoresearcher(session_path=Path("~/.claude/memesis/evolve/<session>"), eval_slug="<slug>")
researcher.run()
Reads <session_path>/autoresearch.yaml at construction. Example:
max_iterations: 10
token_budget: 50000
| Key | Type | Default | Description |
|---|---|---|---|
max_iterations | int | 10 | Hard cap on loop iterations (D-16) |
token_budget | int | (required) | Cumulative LLM token spend ceiling (D-16) |
iteration_count | int | 0 | Written back after each kept mutation |
token_spend | int | 0 | Written back after each kept mutation |
Autoresearch may only propose mutations to these files:
| File | What changes |
|---|---|
core/prompts.py | OBSERVATION_EXTRACT_PROMPT, SESSION_TYPE_GUIDANCE |
core/issue_cards.py | ISSUE_SYNTHESIS_PROMPT |
core/rule_registry.py | ParameterOverrides numeric thresholds |
core/consolidator.py | _execute_keep() logic |
core/crystallizer.py | Crystallization gates |
Any attempt to mutate a file outside this surface raises ValueError.
After every mutation, ALL of the following must pass before keep:
python3 -m pytest tests/ — full unit suiteTestCardImportanceTestAllIndicesInvalidDemotionTestRule3KensingerRemovedTestEvidenceIndicesValidationeval/recall/ — regression suite (prevents fixing session A by breaking session B)If any guard fails → discard (git checkout -- ).
If all guards pass → keep (atomic write, update YAML).
for iteration in range(max_iterations):
if token_spend >= token_budget:
halt() # D-16: mid-iteration, no grace period
target_file = select_mutation_target()
new_content = _propose_mutation(target_file)
apply_mutation(target_file, new_content)
if guard_suite_passes():
keep(target_file, new_content)
update_yaml(iteration_count, token_spend)
else:
discard(target_file)
Token spend is accumulated from llm_envelope events in the active TraceWriter.
The Autoresearcher accepts an optional token_counter injection for tests.
iteration_count >= max_iterations — hard captoken_spend >= token_budget — checked before each iteration starts (mid-iteration halt, no grace period)Keep: atomic write via tempfile.mkstemp + shutil.move, then update autoresearch.yaml with new iteration_count and token_spend.
Discard: git checkout -- <file> to revert the working-tree file.
core/autoresearch.py — Autoresearcher class.
_propose_mutation(target_file) -> str is a stub method returning new file content. The orchestrator or LLM provides content; the engine focuses on apply/verify/keep/discard plumbing.subprocess.run(["python3", "-m", "pytest", ...], check=False).npx claudepluginhub emmahyde/memesis --plugin memesisCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.