# `Assembly.candidates`

> 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.

Method of [`Assembly`](Assembly.md) · stable · since 2.0.0 · called as `session.assembly.candidates`

```ts
candidates(node: string, options?: {
  from?: string;
  near?: Point3;
  to?: ConnectorRef | {
    node: string;
  };
}): Array<{
  readonly from: ConnectorRef;
  readonly to: ConnectorRef;
  readonly score: number;
}>;
```

The pairs [`attach`](Assembly.attach.md) would accept, measured as [`attach`](Assembly.attach.md) measures them: at each node's
scene-model pose (spec section 6.12, A5), never over `connectors()`, which adds pose rules and
a held drag pose on top of the scene-model pose. Grouped by `from` connector, the one nearest
`near` first; within a group by `score` (1.4's), highest first; [`attach`](Assembly.attach.md) takes the first. A
connected node's own connectors are occupied: detach it to re-place it. A full `to` keeps only
pairs with that target, at any distance; `{ node }` only pairs whose target lies on it.
Sync; changes nothing. Ties and the score formula: spec section 6.12, A1. Its pair search is
start-up code, a pure function over scene-model connectors, so it never waits for code and
never throws HoloBusyError('code-unavailable') (spec section 6.3).

**Default:** options.from every connector of `node`; options.near the node's position; options.to any other node

## Options

Through [`Session`](Session.md):

| Option | Type | Default | What it does |
| --- | --- | --- | --- |
| `from` | `string` | — |  |
| `near` | `Point3` | — |  |
| `to` | `ConnectorRef \| { node: string }` | — |  |

Through [`Tx`](Tx.md):

| Option | Type | Default | What it does |
| --- | --- | --- | --- |
| `from` | `string` | — |  |
| `near` | `Point3` | — |  |
| `to` | `ConnectorRef \| { node: string }` | — |  |

## Generic-API test (spec 3.1)

| Rule | Result |
| --- | --- |
| 1. Neutral name | pass: `candidates` names no product |
| 2. A precedent | not recorded: no ledger row (coverage.json) names this member or its owner |
| 3. Two apps, or labs | pass: 14 apps (fleet cross-check: app-04c2774145, app-37356bf09f, app-4762caacdc, app-510d750508, app-b362a81c85, app-bcb7ef21da, app-c1384707fc, app-ceb4eccc72 and 6 more) |
| 4. The cheaper fix first | not recorded per member (Appendix B decides it per need) |
