> For the complete documentation index, see [llms.txt](https://docs.rootcause.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rootcause.ai/more-details/applications/application-modules/prescore.md).

# Pre-score

> Score a grid of scenarios in one durable twin run and fill the scenario store reactive simulations answer from.

Scores a whole grid of scenarios up front so a dashboard can answer instantly.

It runs the grid an OriginGrid emits in one durable twin run and writes the twin version's scenario store, which the viewer then reads instead of running a sim. Wired from `OnTwinChange` it re-fills after every retrain, so the store never goes stale. Durable only, and long-running.

## At a glance

|                          |                        |
| ------------------------ | ---------------------- |
| Module type              | `PreScore`             |
| Category                 | Intelligence           |
| Default tier             | `durable`              |
| Runs on                  | `durable`              |
| Starts a flow            | no                     |
| Holds a body             | no                     |
| Keeps state between runs | no                     |
| Available in             | every application type |

## Parameters

### `twinId`

`string` · required · defaults to `""`

The digital twin whose scenario store is filled.

### `simKind`

`"intervention" | "counterfactual" | "forecast"` · required · defaults to `"intervention"`

Which kind of sim the grid is scored with.

## Inputs

| Port   | Kind        | Required | Description                                                                                                                           |
| ------ | ----------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `on`   | `event`     | no       | Implicit on every module that does not itself start a flow: wire an event here to make this module the start of what that event runs. |
| `grid` | `dataframe` | yes      | The scenarios to score, as OriginGrid emits them.                                                                                     |

## Outputs

| Port    | Kind        | Connects to           | Description                                            |
| ------- | ----------- | --------------------- | ------------------------------------------------------ |
| `store` | `dataframe` | `dataframe`, `signal` | What was written to the twin version's scenario store. |

***

[← All application modules](/more-details/applications/application-modules.md)
