Phase 4.4 deliverable. A self-contained project that exercises every Phase 1+2+3+4 surface in ~30 minutes on a laptop. No real GPU, no fleet, no LLM keys baked in.
The plan promised "a runnable, ~$5-of-spot-GPU project that goes from
git clone to a paper draft in 30 minutes." Since the loop has no LLM keys
inside Crucible, the orchestrator (you, via Claude Code / Codex / a local
LLM client) drives the LLM round-trips. The demo's training script is the
simulated trainer from examples/basic/ — it produces realistic
val_loss/val_bpb lines without burning compute, so you can run the
entire loop locally and see the orchestrator-contract pattern
end-to-end before pointing it at a real GPU.
| Phase | Surface | How it shows up here |
|---|---|---|
| 1.1 | autonomous_research_loop |
The whole loop is one MCP session |
| 1.2 | state_snapshot + content-hash stale-submit guard |
Each submit references its prior snapshot |
| 1.8 | Cost budget guard | budget_usd=5 passed to action=start |
| 2.1 | tool_router |
Step 4 below — "what's next?" without guessing |
| 2.2 | Briefing next_actions |
get_research_briefing shows the recommendation inline |
| 2.5 | runs_search |
Step 8 — filter results across iterations |
| 3.1 | research_arxiv_search |
Step 3 — seed the first hypothesis with literature |
| 3.4 | hpo_create_study (Optuna) |
Optional: drive a parameter sweep |
| 4.1 | note_generate_paper_draft |
Step 10 — final paper markdown |
| 4.2 | design_synthesize_from_findings(policy=memory_filter) |
Step 7 — synthesis hypotheses |
| 4.3 | research_peer_sync |
Optional: share top finding with peers on HF |
- Python 3.10+
- An MCP-speaking orchestrator (Claude Code, Codex, or any LLM client that can call MCP tools).
- ~30 minutes.
All commands are run from this directory (
examples/full_autonomous_discovery/). Substitutecruciblefor whichever entry point you have installed (PYTHONPATH=src .venv/bin/crucibleif running from the source tree).
cd examples/full_autonomous_discovery
crucible recipe list # sanity check — should print "No recipes yet."crucible mcp call tool_routerExpected: recommended_tool is research_request_prompt (Phase 2.1 router
branch: no completions, no pending hypotheses, no pods → kickstart with
a hypothesis).
crucible mcp call research_arxiv_search --args '{"query": "weight tying language model", "limit": 5, "categories": ["cs.LG", "cs.CL"]}'You'll get 5 recent papers as JSON. Hand them to your orchestrator — they'll inform the next step's hypotheses.
crucible mcp call autonomous_research_loop --args '{"action": "start", "iterations": 3, "tier": "smoke", "budget_usd": 5, "with_literature": true, "literature_k": 5}'Crucible returns {session_id, iteration: 0, stage: "hypothesis", system, user, schema, state_snapshot}. The user block includes the literature
you pulled in Step 3 (because with_literature=true triggers Phase 3.1
inside the session driver).
The orchestrator (your LLM client) calls its own LLM with system +
user, parses against schema, and submits the response:
crucible mcp call autonomous_research_loop --args '{
"action": "submit",
"session_id": "<SID>",
"state_snapshot": <SNAP>,
"response": {
"hypotheses": [
{"hypothesis": "tied embeddings reduce overfitting",
"name": "tied_embed", "expected_impact": 0.05,
"confidence": 0.7, "config": {"TIE_EMBEDDINGS": "true"},
"rationale": "Inan et al 2017 shows it tightens train/val gap.",
"family": "baseline"},
{"hypothesis": "lower lr stabilizes the simulated trainer",
"name": "lower_lr", "expected_impact": 0.04, "confidence": 0.6,
"config": {"LR": "5e-4"}, "rationale": "smaller step size",
"family": "baseline"}
]
}
}'# Each hypothesis becomes a config override; the simulated trainer runs.
crucible run experiment --preset smoke --set TIE_EMBEDDINGS=true --name tied_embed
crucible run experiment --preset smoke --set LR=5e-4 --name lower_lrEach takes ~30 seconds. Leaderboard:
crucible analyze rank --top 5After 2-3 iterations have populated the findings ledger, switch to the synthesis policy to pull the most promising cross-finding combos:
crucible mcp call design_synthesize_from_findings --args '{"scope": "track", "policy": "memory_filter", "k": 3}'You'll get 3 orchestrator-shaped prompts ranked by confidence × recency × cross-project diversity (Phase 4.2's scoring).
crucible mcp call runs_search --args '{
"where": "status == \"completed\" and result.val_loss < 5.0",
"order_by": "result.val_loss",
"direction": "asc",
"limit": 10,
"select": ["name", "result.val_loss", "model_bytes"]
}'crucible mcp call get_research_briefingThe response includes a next_actions field with the structured tool
recommendation, AND a markdown_summary with the rendered briefing
ending in "## Recommended Next Tool".
# Step A: pull the prompt.
crucible mcp call note_generate_paper_draft --args '{"action": "request_prompt", "track_name": "default"}'Hand the system + user to your orchestrator's LLM, get back the JSON
response, then:
# Step B: submit + render.
crucible mcp call note_generate_paper_draft --args '{
"action": "submit",
"track_name": "default",
"response": { <the JSON from the orchestrator> }
}'The returned markdown is your paper draft. Save it:
crucible mcp call note_generate_paper_draft --args '{"action": "submit", "track_name": "default", "response": <...>}' | \
python3 -c "import sys, json; print(json.load(sys.stdin)['markdown'])" > paper-draft.mdIf you've configured hf_collab.leaderboard_repo and have an HF_TOKEN:
crucible mcp call research_peer_sync --args '{"challenge_id": "weight-tying-2026"}'Returns the URL of the shared HF Discussion thread + any peer agents' top findings.
examples/full_autonomous_discovery/
├── crucible.yaml # the project spec
├── train.py # simulated trainer
├── experiments.jsonl # 6-8 completed runs
├── .crucible/
│ ├── autonomous_sessions/ # 1 closed session (canceled / done)
│ ├── research_state.jsonl # hypotheses + findings + beliefs
│ └── ...
└── paper-draft.md # rendered markdown paper
A new user can clone, run these 11 steps, and have a paper draft + reproducibility bundle by lunch. The autonomous loop's closed-loop nature is end-to-end visible.
The exact same playbook works with a real fleet. Two changes:
- Add a RunPod (or SSH) provider block to
crucible.yaml:provider: type: runpod gpu_types: ["NVIDIA GeForce RTX 4090"]
- Replace
crucible run experiment(steps 6) with the fleet flow:crucible fleet provision --count 1 crucible fleet bootstrap crucible run enqueue --spec ./batch.json crucible run dispatch crucible run collect
The autonomous loop driving the experiment lifecycle doesn't change — that's the point of the orchestrator-contract pattern. Local laptop or fleet of A100s, same MCP surface.
- Real code mutation (Phase 5+; design at
docs/code-mutation-design.md) - TUI cockpit interaction (run
crucible tuiseparately; Phase 2.3) - External_mcp servers (Phase 3.5; enable in
crucible.yamlto wire Codex or Spider Chat into the loop) - Real arXiv literature ingestion in the autonomous loop hook
(
with_literature=trueis HF-Papers only today; arxiv as a side query is shown in Step 3)