Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions harnesses/earth-pulse-harness/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "earth-pulse-harness",
"version": "0.1.0",
"description": "Earth Pulse Observatory β€” a MetaHarness Darwin-Mode research pod for the 26-second microseism (Gulf of Guinea). Freeze the physics; evolve the harness.",
"author": {
"displayName": "Generated by metaharness",
"url": "https://www.npmjs.com/package/metaharness"
},
"license": "MIT",
"categories": [
"agent-harness",
"metaharness-scaffold",
"Research",
"geophysics"
],
"tags": [
"metaharness",
"agent-harness",
"vertical:research",
"causal-discovery",
"seismology",
"ruvector"
],
"homepage": "https://github.com/ruvnet/agent-harness-generator"
}
12 changes: 12 additions & 0 deletions harnesses/earth-pulse-harness/.claude/commands/doctor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
description: "Health-check the harness: kernel load, MCP wiring, pipeline build, host adapter."
---

Run a full health check and print a PASS/FAIL table.

1. Kernel loads and `kernelInfo().version` matches package.json.
2. The MCP server starts and lists its tools.
3. The detect→extract→embed→score pipeline runs over the bundled fixtures.
4. The configured host adapter is present.

Exit non-zero if any check fails.
11 changes: 11 additions & 0 deletions harnesses/earth-pulse-harness/.claude/commands/review-diff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
description: "Review the current working diff for correctness, leakage, and safety-policy compliance."
---

Review the current git diff.

1. `git diff` to read the change.
2. Report only high-confidence findings as `file:line β€” issue β€” fix`.
3. Flag any forbidden mutation (fabricated observations, invented citations, test-window leakage, new imports/network/shell/env, weakened promotion gate).
4. Separate bugs from nits.
5. End with APPROVE or REQUEST-CHANGES and a one-line reason.
41 changes: 41 additions & 0 deletions harnesses/earth-pulse-harness/.claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"permissions": {
"allow": [
"Bash(npx earth-pulse-harness*)",
"mcp__earth-pulse-harness__*",
"mcp__code_index__*",
"Bash(npm test*)",
"Bash(npm run*)",
"Bash(git diff*)",
"Bash(git status*)",
"Bash(git log*)"
],
"deny": [
"Read(./.env)",
"Read(./.env.*)",
"Bash(git push*)",
"Bash(rm -rf*)",
"Write(./data/**)"
]
},
"mcpServers": {
"earth-pulse-harness": {
"command": "npx",
"args": [
"-y",
"earth-pulse-harness@latest",
"mcp",
"start"
]
},
"code_index": {
"command": "npx",
"args": [
"-y",
"earth-pulse-harness@latest",
"mcp",
"index"
]
}
}
}
68 changes: 68 additions & 0 deletions harnesses/earth-pulse-harness/.claude/skills/evolve/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
name: evolve
description: "Evolve this research harness with Darwin Mode β€” frozen model and frozen physics, evolving workflow (real, sandboxed, safety-gated)."
---

# evolve β€” Darwin Mode self-improvement

`earth-pulse-harness` ships with **Darwin Mode** (`@metaharness/darwin`): the model is
frozen AND the physics is frozen β€” only the *investigation workflow* evolves. Each
generation mutates ONE of the 6 surface files (detector, feature extractor, embedding
schema, retrieval, hypothesis scorer, validator), sandboxes each child, scores it
against the objective, and keeps only variants that *measurably* improve β€” building an
archive of successful descendants.

## Run it

```bash
npm run evolve # real substrate: runs the test suite per variant (deterministic mutator β€” no API key, no network)
npm run evolve:dry # mock substrate: fast, fully offline, no test execution
```

Or directly (flags pass through to metaharness-darwin):

```bash
npx metaharness-darwin evolve . --sandbox real --generations 20 --children 8 --concurrency 4 --seed 26
npx metaharness-darwin evolve . --generations 3 --children 4 --dry-run # dry run first
```

## What Darwin may mutate (and may NOT)

Evolvable surfaces and forbidden mutations are declared in
`.metaharness/safety-policy.json`. In short:

| Surface | Example mutation | Why it matters |
|---|---|---|
| Feature extractor | Shift spectral windows 24β†’28s | Tests frequency stability |
| Context builder | Add tide phase, swell direction, pressure | Tests ocean coupling |
| ruVector schema | Separate waveform / environment / paper embeddings | Reduces mixed-signal noise |
| Retriever | Top-k by source region + spectral similarity | Finds causal neighbors |
| Hypothesis scorer | Adjust amplitude / seasonality / source-fit weights | Improves explanation ranking |
| Validator | Hold out storm weeks or calm-sea weeks | Prevents fake correlation |

**Forbidden:** fabricating observations, inventing citations, leaking test windows into
training, promoting a hypothesis without beating its baseline, or adding any new
import / network / filesystem / shell / env access.

## Promotion gate

A child is promoted ONLY if (see `.metaharness/objective.json`, `src/validate.ts`):

```
pulse_detection_f1 improves by >= 3%
AND false_positive_rate does not increase
AND held_out_prediction_error improves by >= 5%
AND every cited claim maps to a source document
AND no leakage from test windows into training windows
```

## Safety (secure by default)

- **Deterministic mutator** is the default β€” **no network, no API key, air-gapped**.
- Every mutation passes the `validateGeneratedCode` gate (no new imports/network/fs/shell/env/deps).
- Mutations run in a **sandbox**; only variants that pass the tests AND the promotion gate are archived.
- Nothing is promoted without measured improvement (guard against Goodharting the score).

The optional real-LLM mutator (`OpenRouterMutator`) is library-only; wire it via
`scripts/evolve-openrouter.{sh,mjs}` (key sourced from a secret manager at runtime,
never stored in the repo).
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: hypothesis-sweep
description: "Score and rank the candidate mechanisms for the 26-second pulse against current evidence, with contradictions."
---

# hypothesis-sweep

Rank the candidate mechanisms against the current evidence and emit an auditable report.

1. Gather the evidence vector per hypothesis: source stability, environmental correlation,
out-of-sample prediction, contradiction survival, mechanistic plausibility, citation grounding.
2. Run `rankHypotheses(...)` from `src/score-hypotheses.ts`.
3. For the leading hypothesis, state its **best evidence** AND its **killer contradiction**
(e.g. gliding tremors appearing during calm-sea windows).
4. Propose the **next test** that would most cheaply move the ranking.
5. Refuse to promote any hypothesis that fails the gate in `src/validate.ts`.

Output a ranked list with confidence, best evidence, contradiction, and next test β€” never a
single "we solved it" claim.
16 changes: 16 additions & 0 deletions harnesses/earth-pulse-harness/.claude/skills/plan-change/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: plan-change
description: "Turn a research question into a minimal, falsifiable investigation plan before any analysis."
---

# plan-change

Produce an investigation plan for a requested change or question.

1. Restate the question in one sentence.
2. List the data windows and files to touch and why.
3. Name the baseline the result must beat and the held-out test that decides success.
4. Name the contradiction that would falsify the result.
5. Flag anything that could leak test windows into training or widen a permission.

Hand the plan to the feature-engineer; do not run analysis in this step.
16 changes: 16 additions & 0 deletions harnesses/earth-pulse-harness/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
node_modules/
dist/
.metaharness/work/
*.log
.DS_Store
# Real observation data is large and provenance-tracked elsewhere; keep only READMEs/fixtures.
data/**/*.mseed
data/**/*.sac
data/**/*.h5
data/**/*.nc
data/**/*.parquet

# real-data fetch output (regenerate with npm run fetch)
data/seismic/raw/
data/seismic/clim/
data/seismic/3comp/
110 changes: 110 additions & 0 deletions harnesses/earth-pulse-harness/.harness/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"schema": 1,
"generator": "0.1.0",
"template": "vertical:research",
"template_version": "0.0.0",
"vars": {
"name": "earth-pulse-harness",
"description": "Earth Pulse Observatory β€” a MetaHarness Darwin-Mode research pod for the 26-second microseism (Gulf of Guinea). Freeze the physics; evolve the harness.",
"host": "claude-code"
},
"hosts": [
"claude-code"
],
"files": {
".claude-plugin/plugin.json": "4336793070f471ab29212bfe8c82df8a3bd22dc146f4374814a63d0efb7c1108",
".claude/commands/doctor.md": "584f4301c773c0031e76fbe2a1524c0c13467f73ccc0721bd1f5f73c1c044512",
".claude/commands/review-diff.md": "c0e1283cb4c7e7ea598f92974fed64037ac9ab9de860d6aa44ff78ab63626b48",
".claude/settings.json": "834fc6acd6f2a32f01fd590110526de7ba079fb033d94b8951506b24e9b81096",
".claude/skills/evolve/SKILL.md": "8abd173ae209a1e35f8fc26c5b549a7c919e2e5901815af3c78decfa7db57c3f",
".claude/skills/hypothesis-sweep/SKILL.md": "115437198393313706b6a5034e11f1002b88a723d6a03ac1b0cd9813bef7de6b",
".claude/skills/plan-change/SKILL.md": "ebbb7d5b2d6951352bd279d97987f7c68e4dce721fec09a183c0909e77469756",
".gitignore": "8d098fa2c937a105d3ddba32468cd28d6754c260c97587c64311294c0733995e",
".metaharness/genome.json": "cefd5e5736f00b9734a750b6a18b37f17e649ee8e29251d8c9e491bfa5a45e26",
".metaharness/objective.json": "d17c7bd087e43093f3524e97c693f2f1f458870c7f05a11eb110d75770bf9826",
".metaharness/safety-policy.json": "8c49f7567e7f86fdb56ce6d4f40f5f4e8928b2734ee6879e474a6f14253c5375",
"CLAUDE.md": "9f07c265fa9f8a944dd8c7cdd3387715720149bb192d9d7dc373673fae3b72bc",
"LICENSE": "6ceaa7cc631258224c698b613771ad8ca60d1439f4e772835c7632b9ea62865a",
"PROVENANCE.md": "c336c06ecbf027fe84ad68237d5173d2a2346241d9849797da69b602c321a07b",
"README.md": "453f8a6b71f8f869c8ebc6b85a55f4c1f24e3b48d67014947c93354f80aad7d4",
"__tests__/decadal.test.ts": "97be6685a06178c6895c6d26492b3d199bfda391e43fb551c8a6195424794447",
"__tests__/discovery.test.ts": "59965fb8c70540f86b691c85deeea17bf90d02a70717ee869f2b9139371f379d",
"__tests__/gliding.test.ts": "32a777d48c45c184e0d0088ca2f15e544313615b80fa298a6e6f8265fbd668b7",
"__tests__/partition.test.ts": "dc49a0b74278e8d46013ffefe5caa2acc8128e4ecf2dae5f0ac1d8c988ab3670",
"__tests__/pipeline.test.ts": "e6a1da2a3ec8eac4fe8691e679340d67b764042b7115a31daf1c28b6702eb3a3",
"__tests__/polarization.test.ts": "18e4cf5e4bf186c66d8a680e61065f4058d4ed9044daa5347c89f1c54fda08bc",
"__tests__/real-data.test.ts": "087ab2ea7992a30f306f67467fb0c75a1d74fb309e610f8cdf740dd08a453c1b",
"__tests__/resonance.test.ts": "9435c4a673ec9a321bd0234277170e2e9694c12f7c714ec35d22c710d64338de",
"__tests__/smoke.test.ts": "0ec0458429463b87b01c2ea8bd1e9222e3976a2b34c70ed9c520d92eb2685eef",
"__tests__/triangulate.test.ts": "774f99c5ff607eb2f460706514dbf37d6b79e0ead5f2c6a98c1fc080b8a6d0a7",
"bin/cli.js": "f759d77000ffad81ee400ee115959876d3252b084fb445a9fa666ad80944c83a",
"data/bathymetry/README.md": "16ae4f5ea80f384607d47c35a18b624751933e5d51ba0a83a5a1452badd53e8c",
"data/ocean/README.md": "258e39a6e1f5e06cfacb4d77ce0c3993082c279fef83b47ded4e2c798fd07d14",
"data/papers/README.md": "468b67ea25ef5f70a7d67b5eccc0fb47f84be6f44ee8a7b1897a69be757cd578",
"data/seismic/GT.DBIC.LHZ.1995-01-05.window.json": "6a42c1a5478a196477780def7c16ca91cac29c5b42f28989553f4aebe2eccf70",
"data/seismic/README.md": "04ecb882ac0be2dfe642d031eadbda961600b3ea9b2a62c75c35f2044f0a871e",
"data/seismic/dbic-1995-median-psd.json": "a39f1e2dc6858d03a15028d3646d5764f646ee606b3015de07504498dc80284f",
"data/seismic/dbic-3comp-1996-06-20.json": "485d6605b1af76301bf807aec29b59afd62eea138d09b7255b016d777682e5ae",
"data/seismic/dbic-backazimuth-1996.json": "7e9db0613fb1627a6f9be9b62f01125651b50ca968f5db622de67f7a574aabb9",
"data/seismic/dbic-backazimuth-stability.json": "6e2c72a454d31900655b725e7df2235f7962bb87f3735bf0d03788e0aa635d91",
"data/seismic/dbic-climatology-1996-1997.json": "4f46c5a063d8ceb6bd5ae2a4124c41f2e3d8f6f62ad5e5493ef82184de459295",
"data/seismic/dbic-crossstation-1996.json": "062eb0b673e75d3fb4e0aa4b3940cacd33ee83e3905148e225b8fe496600122e",
"data/seismic/dbic-decadal-stability.json": "767b61dbffa44d8ee0b79d2675310f0af33b519512b18ec6b369aa4313953a66",
"data/seismic/dbic-gliding-search.json": "43183e2367d7b4005a33e674e533f0b0865cb8d1abe43e240a2e68c519c21d85",
"data/seismic/dbic-replication-1995-1998.json": "d4b24ba52fa50878dcdcdb0761c07a3f1dcfa9381beace0a152552e50d59c001",
"data/seismic/dbic-resonance-q.json": "cd228aba7f0fe6cffe620b44c7381ae59304bb5b516d4f9456119a9e7d5e14e2",
"data/seismic/proof-summary.json": "27f438ee91c3643584efc0bef2357decd53e7554ecf133df0ba0edc651be0e1f",
"data/seismic/triangulation-1996.json": "3f146ea60a7d7d0de5a0aefeb1214c58cb1da2ee3397c33cbda6dece09f0e831",
"data/tides/README.md": "900bbf1dffb90823c79bdc2cf681554596ce4cceb473f05f3bc1bdc19fa46cf1",
"docs/adr/ADR-001-freeze-physics-evolve-harness.md": "7d054ba5f54842dd63fc0ffcade67009ccda411a78eb554a75a6ca1ffc7544a0",
"docs/adr/ADR-002-ruvector-planetary-memory.md": "38f762ad8db32d2a17e90542a4e45c38b3e81aa82b1ce51b25ce2b8af20d09a5",
"docs/adr/ADR-003-hypothesis-scoring-and-promotion-gate.md": "92c33dfc19e0a01bfa0eaab32e509a48cb32ef2f78861d86e6ee20c433751f26",
"docs/adr/ADR-004-validation-leakage-contradiction-logging.md": "b2403dbaf547e91eb6a42436190574371f1fabe8eb5106c62e9588e85f4b74f2",
"docs/adr/ADR-005-darwin-mutation-surfaces-and-safety.md": "ea32d8b058f6a7420bfce12c7b61fb858b4b2ee1e751f78ff4acffdd16c02ec2",
"docs/adr/ADR-006-mincut-signal-class-partition.md": "1beb0b29ac2e94275c041e7d6bfe2f729b8121a1f2cbdfe2f0a4fa042950eb0c",
"docs/adr/README.md": "e2ddd7bd14dbe410407dbd3a011f32e3b29d9f2ec6378967f99a28a9bcebc2d8",
"docs/research/26-second-pulse-literature.md": "7461c30af81eb3fa4fd15228ac62ab7b6698ca255c145c8c83c9056cbec65c0c",
"docs/research/README.md": "c67f7e83323b54da185344dd1bb73ca0722aafc9471d39d369d8f139ee2dcfda",
"docs/research/benchmark-design.md": "711d452e9e01f7e57fa38eb09e90605c231620a15ec791e384d434f3b0dc6964",
"docs/research/discovery-resonator-decoupling.md": "51baabca39b5a0c4e8f4bc27dc5df4290eb5c5e89e009217110e33eabf23fb0e",
"docs/research/hypothesis-catalog.md": "aa395577941717d6f3ffe5ae2a57bdb85316f72ab7ed6ace25539a48b2a156b4",
"docs/research/real-data-proof.md": "4793256c4cf3cdb01657b1943917e5dd1a38eec617fb038c347b684de71a4640",
"package.json": "799e50e736a9c2d46ff732324d7001f0f9ec1706d1b35b78a39684b618324e22",
"scripts/climatology.mjs": "6afec5bd23242e79198d6438024538ad9058ac6b056c4687a84b02b1b7321dea",
"scripts/evolve-openrouter.mjs": "4ef55a77f4b26cf431bd0471c11b33838bf8020774ed51119f2dce750de7ef00",
"scripts/evolve-openrouter.sh": "00259869d0544d05e8109d99c469eedd43c46af21015ba3c2642a9b570037781",
"scripts/fetch-dbic.mjs": "59aaa36d600022e1515f29621904f55d8c6cab82ce890bcb08436fc26047b5b6",
"scripts/localize.mjs": "d168596e9ad34995d52957cf410be9bb8435b3926839df89a3b1d43e321328c2",
"scripts/prove-26s.mjs": "2dee533a8aecd81dadb8668d9d3c0aee8d12aef8c9e011c0738d19cef25f7afb",
"scripts/triangulate.mjs": "1abf64861345de7b1ad26417eea24c944dfe478551411594b048d3580c9ec002",
"src/agents/feature-engineer.ts": "e57e632c795b10ab279f975b230ea2ab16906e71953b8ee2a516eb4892a225b2",
"src/agents/hypothesis-scorer.ts": "40b66efc6abadae659c9f73401a61d23c03b9fb146ba5a768d6644493921ea2e",
"src/agents/investigator.ts": "aa5bc0bbc4d8bb5ba453e1fa04ffcf24060a460b0737c8b9a967a58f13d9c390",
"src/agents/validator.ts": "7cf3c7246a327251061c81b4292c95220d4d2841077727675238871a78bea78a",
"src/climatology.ts": "6a5fac76a6e028e8f2e3f50ca4ebbd0c4356d0d8b255461b49d8d41e644cc673",
"src/detect-26s.ts": "f01abb2ae73852e26806a1e851dce937aa64ee23fb10a1abce5bec92d11ba45b",
"src/embed-events.ts": "3cce2b0f29b7297107a58d1d50d5b93d24ee19c15f706fb1ad9c562aa5789eae",
"src/extract-features.ts": "9126ee3b1d1f7dea38885eb599866282d8efaebc308e422039299a26b6fbc3a6",
"src/init.ts": "66acc3dbb30d1808bc48fdf9cc23fdec49aef2fc3736db7ab9df00f377e2c2c9",
"src/memory.ts": "6820359c22575c789622faf09c91a528d524e1e13e5526a5d176109c9f0d1b8f",
"src/partition.ts": "626dc1d4027072cd97655cfa4dd4e78cd1bfae7538efe813f181f0da89cb9095",
"src/pipeline.ts": "22e7405fd37ac57cc2661427a353875ffd0ed687b8b27322c928fca8e3ffbdf3",
"src/polarization.ts": "6dddfff9c6d81ce2e48e97b77ca81ca080f1c5d99060b006f1eadbe9895363e1",
"src/score-hypotheses.ts": "ba15cc0af558b3822d23030f540bc736a9a61bbe079de327e037027173db8104",
"src/spectrogram.ts": "3a992ce5aeb77a31cc756440e22659138b9859c1d85ff853c3a5c16b5149226c",
"src/spectrum.ts": "c443f6f3bada313b84882f11cd1dd5db7aff35b2a88f72471ce7ee9e4f944267",
"src/triangulate.ts": "7a8c24cdefd910b3d638c18ff808aca9c9f2791c763a22ed45fe117abec7d94f",
"src/types.ts": "fe61613ada6c5aac346b04cd44a7896e307d3ee8f2da9b6a924d38e301a09506",
"src/validate.ts": "b2b08c49b2d295552b70f9ad5ffdf5276ea32d9338d1632588a24b38075bcb8f",
"tests/fixtures/sample-env.json": "ec383cf8029bc166f1c100afa9ccb4b03db16a58faf0291045e67a335fbec4a5",
"tests/fixtures/sample-window.json": "eb7355cbd41d6145af2a0fb1e1e0d3221c33d845ee75dfd1f309c706c024f86e",
"tsconfig.json": "8b4e730a1aa39162ac574455d7a98e1881f5313ca80ffe503b9652dcf0c76b9d",
"vitest.config.ts": "d6de73d80122fa1addd407b7d3238900a938654ea5505f76d61916cca8c6420e"
},
"generated_at": "2026-06-29T13:30:00.000Z",
"meta": {
"surface": "cli",
"kernel_version": "0.1.0",
"principle": "freeze-the-physics-evolve-the-harness"
}
}
1 change: 1 addition & 0 deletions harnesses/earth-pulse-harness/.harness/manifest.sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
36f572090eb5921390545d053dbd6158f04a6993ef4dfaf80ebbe2b84904f560
32 changes: 32 additions & 0 deletions harnesses/earth-pulse-harness/.metaharness/genome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"schema": 1,
"repo_type": "research-harness",
"archetype": "causal-discovery-benchmark",
"domain": "geophysics/seismology",
"agent_topology": ["investigator", "feature-engineer", "hypothesis-scorer", "validator"],
"mcp_surface": "local_default_deny",
"risk_score": 0.31,
"test_confidence": 0.6,
"publish_readiness": 0.5,
"discovery_score_weights": {
"source_stability": 0.25,
"environmental_correlation": 0.20,
"out_of_sample_prediction": 0.20,
"contradiction_survival": 0.15,
"mechanistic_plausibility": 0.10,
"citation_grounding": 0.10
},
"baselines": [
"seasonal_monthly_average",
"swell_height_only",
"swell_direction_plus_shelf_normal",
"tide_phase_only",
"volcanic_proxy_to_glides"
],
"default_hypotheses": [
"ocean-shelf-resonance",
"coupled-ocean-geology",
"volcanic-source",
"instrument-artifact"
]
}
28 changes: 28 additions & 0 deletions harnesses/earth-pulse-harness/.metaharness/objective.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "earth-pulse-causality-harness",
"description": "Evolve the investigation workflow for the 26-second microseism. Freeze the physics; evolve the harness.",
"maximize": [
"pulse_detection_f1",
"source_localization_stability",
"out_of_sample_amplitude_prediction",
"hypothesis_explanation_score"
],
"minimize": [
"false_positive_rate",
"feature_cost_ms",
"data_leakage_risk",
"unexplained_variance"
],
"promotion_gate": {
"pulse_detection_f1_delta_min": 0.03,
"false_positive_rate_delta_max": 0.0,
"held_out_prediction_error_improvement_min": 0.05,
"require_citation_grounding": true,
"require_no_test_window_leakage": true
},
"first_benchmark": {
"question": "Can the system predict the amplitude of the 26s pulse from ocean-state variables?",
"baseline": "seasonal_monthly_average_amplitude",
"acceptance": "beat seasonal baseline by >= 10% on held-out months"
}
}
Loading
Loading