/crucible:crucible-research-foundationsfrom crucible
Validates research findings by detecting look-ahead bias, label leakage, and causal feature violations in quantitative analysis. Use when reviewing data pipelines or backtesting results.
Ships in crucible. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Self-Evolving Skill: This skill improves through use. If a discipline's guidance fails in practice or a new trap emerges, update the relevant section AND append to
references/evolution-log.md. Don't defer.
Read these in order. The first three (causal, labels, nulls) are the hardest prerequisites — violating any of them silently invalidates every downstream result.
Every feature f[i] used at trigger/decision bar i must be computable using only bars[0:i] — never bars[i], never bars[i+1:]. Violation produces look-ahead bias; findings silently become worthless.
Canonical pattern:
for i in range(n):
lo = max(0, i - window)
wind = values[lo:i] # EXCLUSIVE upper bound — no peeking
f[i] = compute(wind)
Note lo:i (exclusive), not lo:i+1. This discipline "feels off by one" but is correct.
Verification test (add to every new feature function):
def test_causality(fn, n=1000):
bars = generate_test_bars(n)
f_orig = fn(bars)
bars_mod = bars.copy()
bars_mod[500:] *= 2 # perturb the FUTURE
f_mod = fn(bars_mod)
assert np.array_equal(f_orig[:500], f_mod[:500]), "look-ahead detected"
Silent-bug signature: impossibly clean results (tw > 10 bps on FX, win rate > 70%, OOS matches IS perfectly).
Full reference: findings/methodology/10-causal-feature-invariant.md.
Forward labels must be scaled to the triggering bar's own range, NEVER to a window-wide scale. Window-relative labels are tautological.
Trap: If you label fwd+H = UP when close[i+H] - close[i] > window.span/20, then when close[i] is near window.min (loc=B), fwd=UP is near-automatic. Agents will report spurious "signals".
Fix: use bar-local triple-barrier labels:
r = high[i] - low[i] # THIS bar's range, not window's
tp_level = close[i] + tp_mult * r
sl_level = close[i] - sl_mult * r
# walk forward, exit at first tp/sl/expiry
Symptom that you fell into the trap: apparent signal strengthens monotonically with loc quintile; collapses when you test adjacent cells.
Full reference: findings/methodology/02-label-leakage-bar-local-scaling.md.
Shuffled-null tests are mandatory before trust, but the choice of what to shuffle is a design decision.
| Hypothesis class | Shuffle WHAT | Session example |
|---|---|---|
| "Feature X predicts outcomes" | Shuffle the feature values | Phase F-B (used wrong null, "falsified" a real signal) |
| "Trigger pattern fires at informative times" | Shuffle the trigger mask (preserve fire-rate, move locations) | Phase C (validated ngram_triple_fast_up at z=+5.74) |
| "Filter improves selection" | Shuffle which trades pass the filter | Phase L-C (evaluated filters against N-size random draws) |
Rule: ask "what is the alternative hypothesis, in one sentence?" If you can't state it, you don't know what you're testing.
Common mistakes:
Full reference: findings/methodology/03-shuffled-null-design.md.
LLM agents systematically overstate z-scores. Treat agent-reported p-values as upper bounds.
Two overstatement patterns:
sqrt(2 ln K) null-max, the Deflated Sharpe Ratio, the minimum backtest length (MinBTL), FDR/FWER, e-LOND): this repository does not compute, report, rank by or cite them (issue #35). Instead register the winner (rule, threshold, window) and re-test it on data no variant was selected on; report that z.Always verify:
(real - null.mean) / null.stdTrust thresholds:
Full reference: findings/methodology/09-agent-significance-corrections.md.
Every investigation — positive or null — must produce a permanent, discoverable record.
3-layer architecture:
findings/
├── evolution/
│ ├── evolution.jsonl # append-only ledger
│ └── audits/
│ └── YYYY-MM-DD-slug/
│ ├── CLAUDE.md # navigator
│ ├── verdict.md # plain-English conclusion
│ ├── CHRONICLE.md # narrative (for major findings)
│ ├── <reproducer>.py # script that regenerates headline numbers
│ └── <artifact>.json # raw telemetry
└── methodology/ # universal principles
Ledger entry fields: id, date, status, supersedes, superseded_by, headline, key_numbers, evidence (file paths), sha256_results.
The supersedes pattern: when a later finding replaces an earlier one, ADD a new entry with supersedes: "OLD-ID"; UPDATE the old entry with superseded_by: "NEW-ID". Do NOT delete the older audit folder.
Full reference: findings/methodology/07-record-keeping-discipline.md.
Before declaring a signal dead, enrich every trade with causal pre-entry features and hunt filters on individual losses. A "sometimes works" signal is often a filterable signal in disguise.
Pipeline:
Kill-selectivity metric: losers_killed / max(1, winners_killed). < 1.0 = harmful; 1.0-1.2 = marginal; 1.2-1.5 = useful; > 1.5 = strong.
Session example: +0.178 bps baseline → +0.514 bps after Phase-L filter. 2.9× lift from enrichment-driven filter hunt.
Full reference: findings/methodology/06-per-trade-enrichment-postmortem.md.
| Principle | Confirmed | Notes |
|---|---|---|
| 1. causal-feature-invariant | 18+ (every phase) | Fundamental; drop only with proof |
| 2. label-leakage | 2 | Directly caught spurious "lower-rejection-at-bottom" |
| 3. shuffled-null-design | 4 | Phase F-B wrong-null, Phase C right-null, Phase L filter-null, Phase M mgmt-null |
| 4. agent-sig-corrections | 5+ | Combinatorialist, transition-asymmetry, trade-mgmt agents all overstated |
| 5. record-keeping | 5 ledger entries | Full chain for NGRAM3FU-STRADDLE |
| 6. post-mortem | 1 | Phase L delivered the filter; needs re-confirmation on other campaigns |
Higher confirmed = more trustworthy. Principle 6 has only one confirmation and should be treated as provisional.
After invoking this skill:
confirmed count in the table above; note the session where it fired in references/evolution-log.md.superseded_by pointer in references/archive/ with resurrect_if: conditions.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
5 skills in this plugin
/crucible-navigatorstarting a new research campaign, entering a new Claude Code session on a research repo, or when unsure which methodology./crucible-investigation-methodologyactively investigating a hypothesis — running a sweep, dispatching multi-agent analysis, designing serial adversarial gates,/crucible-meta-governancedeciding whether to pivot or persist, whether to ship or hold, whether to scope-narrow a partial pass, how to manage.Other plugins' skills for the same job
npx claudepluginhub terrylica/cc-skills --plugin crucible