Distill sessions
LLM-agent pipeline for formulaic alpha discovery on WorldQuant BRAIN, published with the full research archive it produced (archived)
npx -y skills add zl3311/alpha-mining --skill distill-sessionsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 12 days oldThe repository was created 12 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Consolidate open draft mining session PRs into a single clean PR. Copies book entries, sessions, knowledge patterns, dead zones, and factors; deduplicates overlapping artifacts; verifies alpha statuses against BRAIN; runs bugbot iteratively; creates a consolidated PR; then closes the originals. Use when asked to "consolidate PRs", "distill sessions", "merge draft PRs", or "clean up mining PRs".
SKILL.md
4.7 KB, as published. Nobody here has run it
Distill Sessions
Consolidate accumulated draft mining-session PRs into one merge-ready PR.
Phase 0: Inventory
gh pr list --state open --draft
Identify mining session PRs (branch prefixes: session/, exp/, cursor/alpha-mining-session-*).
Exclude non-session PRs (e.g. feature/, analysis scripts, infra).
For each PR, collect:
gh pr view <N> --json body,title,files --jq '{title, body, files: [.files[].path]}'
Build a manifest of artifacts to merge, grouped by type:
data/book/*.mddata/sessions/*/data/knowledge/patterns/*.mddata/knowledge/dead_zones/*.mddata/factors/*.md
Phase 1: Create Branch
git checkout main && git pull origin main
git checkout -b chore/distill-draft-prs-<start_date>-<end_date>
Phase 2: Copy Artifacts
For each file in the manifest:
git show origin/<branch>:<path> > <path>
Create directories as needed (mkdir -p).
Conflict resolution:
- Same file appears in multiple PRs → use version from latest session date
- File already exists on main → diff branch version against main, merge new content
Phase 3: Deduplicate Knowledge
Scan new pattern files for overlap:
- Same template/mechanism family → merge into single file
- Preserve all learnings from both sources (anti-patterns, stabilizer tables, etc.)
- Add exclusivity rules when template variants have mutual corr > 0.85
Phase 4: Verify Against BRAIN
uv run python3 scripts/brain_check.py --alpha-ids <space-separated IDs of all new book entries>
For each alpha, reconcile book entry with BRAIN source of truth:
- BRAIN says ACTIVE → set
status: "ACTIVE"in book entry - BRAIN says UNSUBMITTED → set
status: "PENDING" - Never use
CANDIDATE(not a valid book status)
Then propagate implications:
- Update session metas:
submissionscount,submittedlist, candidateverdictfields - Fix stale novelty claims (e.g. "field X absent from book" when it's now ACTIVE)
- Mark sibling companions as BLOCKED if their primary variant is ACTIVE (template variants with mutual corr ~0.90-0.95 are mutually exclusive)
Phase 5: Update Docs
uv run python3 scripts/parse_frontmatter.py --dir data/book --field status,grade 2>&1 | rg -o 'status=\w+' | sort | uniq -c
uv run python3 scripts/parse_frontmatter.py --dir data/book --field family 2>&1 | rg -o 'family=\w+' | sort -u | wc -l
Update AGENTS.md "Submitted alphas" line with fresh counts.
Do NOT update README (immutable superficial info only).
Phase 6: Validate
uv run python3 -m pytest tests/ -q
uv run python3 scripts/parse_frontmatter.py --dir data/book --field status,grade
All tests must pass. All book entries must parse without error.
Phase 7: Create PR
Stage, commit, push:
git add -A
git commit -m "chore: distill draft mining PRs <date_range>"
git push -u origin HEAD
Create PR with structured body (follow PR #67 format):
- New book entries table (Alpha, Grade, Sharpe, Fitness, Self-Corr, Family, Session)
- New sessions list
- Knowledge base additions (patterns, dead zones, factors)
- Merged branches list with PR numbers
- Verification results (test count, book entry count)
Phase 8: Close Drafts
For each source PR:
gh pr close <N> --comment "Consolidated into #<new_pr_number>"
Phase 9: Bugbot Loop
Run bugbot review on the branch diff. For each iteration:
- Fix all high-severity findings
- Fix medium-severity findings that are factual errors (stale claims, schema mismatches)
- Accept medium findings that are historical session documentation (accurate at session time)
- Amend commit, force-push, re-run bugbot
- Stop when no new high-severity findings remain
Known Gotchas
CANDIDATEis not a valid book status — normalize toPENDING- Session candidate schema uses
self_corr_value/self_corr_result/verdict(notself_corr) - Valid verdicts:
SUBMITTABLE,SUBMITTED,BLOCKED,BACKUP - Skill directory is
cloud-review(notsession-reviewas AGENTS.md hierarchy shows) - After submitting one template variant, siblings are blocked (mutual corr 0.90-0.95)
format_email_digest.pyreadsself_corr_valueandself_corr_resultfrom session candidates- BRAIN API is the source of truth for alpha status — always verify before setting ACTIVE