# `RuleSpec`

> Contract 2.0.0 · package sha256 `a857eca95b35921109faf997094bb4192f12527d9d0fcd4be7e97f06425bad6e` · generated from `configurator-runtime.d.ts` by `services/onsite-scripter/scripts/build-contract-docs.mjs`; edit the source, not this file.

Interface · `import type { RuleSpec } from '@holostep-configurators/runtime-client/contract';` · stable · since 2.0.0 · section 9. Stage

One persistent rule in JSON form: what [`find(query).set(set)`](PartActions.set.md) creates.

## Members

| Member | Kind | Summary |
| --- | --- | --- |
| <a id="id"></a>[`id?`](RuleSpec.id.md) | property | Rule identity in patches. |
| <a id="query"></a>[`query`](RuleSpec.query.md) | property | What the rule matches, re-evaluated at every commit. |
| <a id="set"></a>[`set`](RuleSpec.set.md) | property | What it writes on every match. |

## Declaration

```ts
export interface RuleSpec {
  id?: string;
  query: Query;
  set: PartState;
}
```

## Generic-API test (spec 3.1)

| Rule | Result |
| --- | --- |
| 1. Neutral name | pass: `RuleSpec` names no product |
| 2. A precedent | pass: [CSS cascade (ordered, persistent rules)](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_cascade/Cascade) (row `G32`); [Unity Mesh.SetVertices](https://docs.unity3d.com/ScriptReference/Mesh.SetVertices.html) (row `G63`); [Unity Renderer.shadowCastingMode](https://docs.unity3d.com/ScriptReference/Renderer-shadowCastingMode.html) (row `K34`); [Unity GameObject.Find](https://docs.unity3d.com/ScriptReference/GameObject.Find.html) (row `K7`); [DOM Document.querySelectorAll](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll) (row `K7`); [Unity Renderer.sharedMaterial](https://docs.unity3d.com/ScriptReference/Renderer-sharedMaterial.html) (row `K9`) |
| 3. Two apps, or labs | pass: 12 apps (ledger: app-378d190f1b, app-4f16d2f6da, app-510d750508, app-59c5b5751e, app-b362a81c85, app-b4ae2fce25, app-ceb4eccc72, app-ddfb017681 and 4 more) |
| 4. The cheaper fix first | decided per need in Appendix B: rows `G32`, `G63`, `G8`, `K18`, `K34`, `K7`, `K9` at tier app, stable (a member only where no rule, data, asset or app code serves the need) |
