<!-- Sema documentation — std.completion
     Sema is a new AI-native, neurosymbolic programming language most models
     have not been trained on. Full corpus: https://sema.49.12.246.95.sslip.io/llms-full.txt
     Install language support: https://sema.49.12.246.95.sslip.io/install-skill/ -->

# std.completion

> Reflected API reference for the Sema standard-library module std.completion.

> Generated by `sema doc` from `stdlib/sema/completion.sema`. Import with `from std.completion import …`. For a narrative introduction see [std.completion](/stdlib/completion/).

# `completion`

Contract-first bounded completion policies and weighted belief evidence.

# `struct CompletionEvidence`

**Fields**

| field | type | descriptor |
|---|---|---|
| `source` | `str` |  |
| `modality` | `str` |  |
| `weight` | `float` |  |
| `confidence` | `float` |  |
| `stale` | `bool` |  |

# `struct CompletionPolicy`

**Fields**

| field | type | descriptor |
|---|---|---|
| `threshold` | `float` |  |
| `max_reviews` | `int` |  |
| `no_progress_limit` | `int` |  |

# `def weighted_evidence`

```sema
def weighted_evidence(evidence: list[CompletionEvidence]) -> float !{}
```

**Parameters**

| name | type |
|---|---|
| `evidence` | `list[CompletionEvidence]` |

**Returns** `float`

**Effects** `!{}`

# `def contract_belief_complete`

```sema
def contract_belief_complete(hard_contracts_passed: bool, evidence: list[CompletionEvidence], policy: CompletionPolicy[any]) -> bool !{}
```

**Parameters**

| name | type |
|---|---|
| `hard_contracts_passed` | `bool` |
| `evidence` | `list[CompletionEvidence]` |
| `policy` | `CompletionPolicy[any]` |

**Returns** `bool`

**Effects** `!{}`
