mining-session
Skill0 starsChanged 4 months agoMITView on GitHub
Master orchestrator for alpha mining sessions. Entry point for both cloud automation and local manual use. Reads state, selects adaptive strategy, chains other skills. Trigger on: session start, daily automation, mine, alpha mining, start mining, run session.
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- alpha-miningSkill
- brain-checkSkill
- session-reviewSkill
- context-gatherSkill
- distill-sessionsSkill
- econ-reasoningSkill
- experiment-reportingSkill
- hf-serverSkill
- pnl-correlationSkill
- result-analysisSkill
- signal-generationSkill
- trace-analysisSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Read THIS skill completely before doing anything else.
- Very specific: line 41
After reading context (via context-gather skill), select a strategy using this decision tree evaluated top-to-bottom — first match wins:
- Distinctive: line 74
NOT for more IV-spread or fundamental-blend variants.
- Distinctive: line 114
Verify the repo is on main with a clean working tree before ending the session.
- Very specific: line 136
If none exist for today, start at 001.
- Distinctive: line 157
Exploration complete: all planned directions have been tested
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Mining Session — Master Orchestrator
This is the entry point for every alpha mining session. Read this skill first; it chains all other skills in the correct order.
Session Start Protocol
- Read THIS skill completely before doing anything else.
- Determine whether this is a cloud automation or local manual session.
- Sync to latest
mainBEFORE branching (mandatory for cloud, strongly recommended for local):
This guarantees the experiment counter, the submitted book (git fetch origin && git checkout main && git pull --ff-onlydata/book/), and the self-corr baseline are current. Skipping this is what caused duplicate rediscovery and a frozen experiment counter (every run re-branched from stale state and re-found the same families). Ifpull --ff-onlyfails, stop and surface the conflict rather than proceeding from stale state. - Assign a session ID (see format below) — derive
NNNfrom the freshly-synceddata/sessions/so the counter actually advances. - Create the session directory now (Phase 0.5, do not defer to recording):
create
data/sessions/YYYYMMDD-NNN/meta.mdwith at leastid,date,strategy(best guess, update later), andtrigger. This guarantees an audit trail even if the session is interrupted. Append to it as you go. - Chain through the workflow in order. The workflow starts with context-gather (Phase 0), then applies the adaptive strategy selection (next section) to choose a mode, then continues through signal generation and beyond.
Adaptive Strategy Selection
After reading context (via context-gather skill), select a strategy using this
decision tree evaluated top-to-bottom — first match wins:
READ data/knowledge/opportunities/ (ignore type: submit-candidate files —
those are the submission queue, not ideas)
└─ High-priority hypothesis/idea items exist?
YES → HYPOTHESIS mode (test the opportunity)
CHECK: Has the agent run EXPLORE mode in the last 3 sessions?
└─ NO → EXPLORE mode (novel templates and cross-family interactions)
(Book is near saturation; novel structures are the highest-value use
of budget. See data/knowledge/rules/novelty-required.md.)
CHECK multiple gate-passers from different families
└─ 2+ gate-passers from UNEXPLOITED distinct mechanism families?
YES → RECOMBINE mode (crossover blending of novel combos)
QUERY HF server for new gate-passers (via hf-server skill)
└─ New gate-passer from a GENUINELY NEW mechanism family
(not IV-spread, not analyst revision, not fundamental blend)?
YES → EXPLOIT mode (directed mutation of the gate-passer)
CHECK existing gate-passers with BRAIN check failures
└─ Gate-passer exists but fails one or more BRAIN checks?
YES → REFINE mode (targeted fix for the specific failure)
DEFAULT → EXPLORE modeKey change from prior behavior: EXPLORE and RECOMBINE now take priority over EXPLOIT. The book is saturated with known pattern families. EXPLOIT should only trigger for genuinely novel gate-passers from unexplored mechanism families — NOT for more IV-spread or fundamental-blend variants.
Workflow Chain
For every session, regardless of mode, execute these phases in order:
- Context Gather — Read and execute
.cursor/skills/context-gather/SKILL.md. This produces a state assessment and confirms the strategy. - Signal Generation — Read and execute
.cursor/skills/signal-generation/SKILL.mdwith the chosen strategy mode. This produces candidate expressions. - Submit Candidates — Submit expressions to the HF server:
Then poll the batch to completion with the canonical poller (do NOT write ad-hoc heredoc poll loops):uv run python3 scripts/hf_submit.py --expressions "expr1" "expr2" \ --priority 5 --tags <session_tag> <batch_tag>uv run python3 scripts/hf_poll.py --tag <session_tag> - Result Analysis — Read and execute
.cursor/skills/result-analysis/SKILL.md. This produces verdicts on each candidate AND, for any SAFE/RISKY candidate, labels it on the BRAIN platform viascripts/brain_metadata.py(the HF queue path leaves alphas unlabeled otherwise) and records astatus: PENDINGdata/book/<id>.mdentry. - Iterate or Stop — If a SAFE/RISKY candidate already meets the session's grade target, STOP and proceed to recording (satisficing — see AGENTS.md). Otherwise, if budget remains AND the improvement trend continues (at least one gate-passer in this round OR metrics improved over last round), return to step 2 with updated context (winners inform the next generation).
- Record — Read and execute
.cursor/skills/experiment-reporting/SKILL.md. This creates session files, updates knowledge, and opens a PR. - Cleanup — After the PR is created, the
experiment-reportingskill's Step 6 handles switching back tomainand restoring any stashed changes. Verify the repo is onmainwith a clean working tree before ending the session.
Cloud vs Local Differences
| Aspect | Cloud Automation | Local Manual |
| Budget cap | 100 simulations per run | No hard cap (human decides) |
| End-of-session | Auto-PR (draft, never merged) | Human decides when to stop |
| BRAIN submission | NEVER submit — provide platform URLs only | Human may submit via platform URL |
| Self-corr check | Read self_corr from server (hf_query --gate-passers) | pnl_correlation.py --vs-book (direct BRAIN PnL) |
| Job tagging | daily_YYYYMMDD + batch tags | Session ID + descriptive tags |
| Trigger | Noon PT daily Cursor Automation | Human invokes skill or starts chat |
| Iteration limit | Max 5 rounds or budget exhausted | No limit |
Session IDs
Format: YYYYMMDD-NNN where NNN is a zero-padded 3-digit counter.
To assign the next ID:
- List existing directories in
data/sessions/. - Filter for entries matching today's date prefix
YYYYMMDD-. - Take the highest NNN found for today, increment by 1.
- If none exist for today, start at
001.
Example: if data/sessions/20260603-001/ exists, the next is 20260603-002.
Stop Conditions
Terminate the session (proceed to recording phase) when ANY of these is true:
- Viable candidate found (DEFAULT for autonomous sessions): A SAFE or RISKY candidate exists that meets the user's grade threshold (e.g., EXCELLENT+). The session goal is to find ONE viable candidate, not the best possible one. Once found, proceed immediately to recording/PR. Only continue iterating if the user explicitly requested multiple candidates or specified a budget to exhaust.
- Budget exhausted: simulation count >= budget cap
- Diminishing returns: 3 consecutive rounds with zero gate-passers
- Family blocked: 3+ variants of the same expression family hit the SAME
BRAIN check failure (e.g.
CONCENTRATED_WEIGHT). Stop mutating that family and pivot to a structurally different template — do not keep burning sims on a structural block. (Lesson from 20260604-001:group_neutralize(IV spread)was EXCELLENT but always failed CONCENTRATED_WEIGHT + SUB_UNIVERSE across all variants; thezscore(ts_mean(...))template broke through.) - Exploration complete: all planned directions have been tested
- Explicit human stop: user says to stop (local mode only)
- Clock limit: cloud automation has been running > 45 minutes
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

