# Continuation research module

This module adds automatic oscillator-count selection and explicit refusal diagnostics to the earlier known-count wave predictor. The browser lab is unchanged. Read `FOLLOWUP.md` for assumptions, results and physical limitations.

## Use with a measured history

```python
import numpy as np
from adaptive_predictor import choose_and_forecast

# y: one uniformly sampled channel, or an N × channels array.
# dt: actual sample spacing, in the same time units used for prediction.
diagnostics, model = choose_and_forecast(y, dt=dt, future_samples=300)
if diagnostics['accepted']:
    future_times = (len(y) + np.arange(300)) * dt
    forecast = model.predict(future_times)
else:
    print('Model declined:', diagnostics['reasons'])
```

History must have at least 80 samples. The synthetic benchmark used 240. The search covers a constant plus up to five stationary/damped sinusoidal pairs. It does not represent arbitrary chemistry or quantum dynamics, prove uniqueness of a fit, or guarantee future behavior. A passed diagnostic cannot detect a change that begins only after the observed interval. Returned frequencies are angular frequencies per input time unit, not atomic base frequencies.

## Reproduce

Run from the archive root after installing the versions listed in `requirements.txt`:

```bash
OPENBLAS_NUM_THREADS=1 python continuation_v2/run_followup.py
OPENBLAS_NUM_THREADS=1 python continuation_v2/plot_followup.py
python continuation_v2/make_report.py
```

The public GWOSC data file is included, so no download is needed. `measured_provenance.json` records its source and SHA-256 checksum. The original 32-second record is not altered. Its derived trace is in `measured_trace.csv`.

`protocol.json` and `adaptive_predictor.py` were fixed and hashed before the new benchmark. The protocol hash check runs automatically. `benchmark_trials.csv` retains every trial, rejection reason, observed-history hash and available diagnostic extrapolation error. This includes failed and declined fits. Forty history pairs are deliberately identical but have different target futures, so the 320 cases contain 280 distinct histories.

`geometry_trials.csv` retains all 624 distance-matrix controls. `energy_exchange.csv` contains an ordinary coupled-oscillator counterexample to interpreting unobserved energy as proof of extra space. Charts and the report include these limitations.
