ψ Vikshep

Recipes

CLI recipes and data loaders

Recipes are declarative pipelines — a fixed sequence of ingest, scatter, reduce, and (optionally) classify steps. CLI recipes are executable Python scripts installed as console scripts; agent recipes are MCP tool sequences.

vikshep-recipe calibrate

Fits a linear regression from aggregate features to a target scalar. Useful for detector calibration and response correction.

vikshep-recipe calibrate \
  --features <manifest.json>   # required: path to the ingest manifest
  --target   <column_name>     # required: aggregate scalar to predict
  --output   <report.json>     # optional: default = calibrate_report.json
FlagRequiredDescription
--featuresYesPath to manifest.json from vikshep-ingest
--targetYesAggregate column name to regress against
--outputNoOutput report path (default: calibrate_report.json)

vikshep-recipe tag

Trains a classifier on aggregate features with optional DisCo mass-decorrelation. The --protect flag enforces that the classifier score is statistically independent of the named variable, suppressing mass sculpting.

vikshep-recipe tag \
  --features <manifest.json>   # required
  --label    <column_name>     # required: binary target
  --protect  <column_name>     # optional: variable to decorrelate from
  --lambda   <float>           # optional: DisCo penalty (default 0.0)
  --output   <report.json>     # optional: default = tag_report.json
FlagRequiredDescription
--featuresYesPath to manifest.json
--labelYesBinary label column (0/1 or bool)
--protectNoColumn whose correlation with the score must be zero
--lambdaNoDisCo penalty weight (0 = off, 1 = balanced, >1 = strict)
--outputNoOutput report path (default: tag_report.json)

Data loaders

Loaders are discovered via Python entry points (vikshep.loaders). Each loader writes POSIX shared memory and returns a 28-hex SHA3-256 OID. All loaders are in backend/ingest and installed with pip install -e backend/ingest.

LoaderFormatCLI entry point
g4Geant4 CSV (event_id, layer, phi, theta, momentum[, energy])vikshep-ingest g4
root-uproot.root (Geant4, CMS Open Data)vikshep-ingest root
hdf5.h5, generic HDF5vikshep-ingest hdf5
wellThe Well HDF5 (15 TB physics simulations dataset)vikshep-ingest well_slice

All loaders are CPU-only and require no account. The well loader is available in the Free tier; hosted well-scale ingest (> 1 TB) requires Lab or Enterprise.

Agent recipes

Agent recipes are declarative MCP tool sequences defined in agent/src/recipes/. They chain the same steps as the CLI recipes but run through the TypeScript/Bun MCP orchestrator, enabling async streaming, provenance logging, and the engine GPU paths.

RecipePipeline
hep-tagging-discoG4 ingest → aggregates → r₂ → DisCo classifier
bsm-anomalyingest → scatter → log-mean → HNSW → detect
general-featureingest → scatter (Dim, Group from request) → reduce

Manifest anatomy

The manifest is the control-plane payload produced by any loader. It contains OIDs and scalar metadata — no raw tensors.

{
  "n_events": 10,
  "schema": "komal_v1",
  "aggregate_names": ["layer1_n_hits", "layer1_e_mean", ...],  // 32 scalars/event
  "grid_oids": ["a3f1...", ...],  // 28-char SHA3-256 hex, one per event
  "pad_policy_per_axis": {
    "phi": "Circular",     // correct for azimuthal angle
    "theta": "ZeroPad"     // correct for polar angle
  }
}

The 28-char OIDs are the only handles that cross the AGPL boundary into the engine. Raw grid tensors live in POSIX shared memory and never reach TypeScript or the browser. The schema is frozen; changing it is a breaking change requiring a major version bump in both control plane and data plane.

Benchmark harness

Run the harness on a real analysis pipeline to sweep the DisCo lambda and record AUC-vs-dCorr² trade-offs:

python -m bench.run \
  --manifest manifest.json \
  --label    <signal_col> \
  --protect  <mass_col> \
  --lambdas  0,0.1,1,10

The harness outputs a sweep table and computes the Asimov proxy and Jensen-Shannon divergence for each lambda value. All free, all local.