# OIP-0018 draft folder

The proposal and, under `patches/`, the exact edits acceptance would make. Nothing here changes the protocol until the
editors accept the proposal and its patches are applied in the same change. The proposal requires OIP-0006 and OIP-0008;
the patches are made against the current tree and apply to it on their own; with all four applied, every patch of every
other draft still applies.

| File | What it changes on acceptance |
|---|---|
| [`OIP-0018.md`](OIP-0018.md) | the proposal |
| `patches/spec.patch` | §4.2 row TriggerDefinition, TriggerEvaluation; new §15 (TRG-1 to TRG-9) |
| `patches/registers.patch` | `registers/requirements.yaml` regenerated (TRG-1 to TRG-9; the §5.9 rows gain the new cases) |
| `patches/schemas-fixtures.patch` | new schemas `trigger-definition` and `trigger-evaluation`; five positive and sixteen negative fixtures; a definition and an evaluation in the OBSP-GRID and OBSP-CONSUMER example sets, and the observation record the consumer's evaluation cites |
| `patches/evaluator-cases.patch` | reference evaluator and the four invariants in the new `sdk/python/src/obsp/triggers.py` (registered from `obsp/__init__.py`); `sdk/python/tests/test_triggers.py` (17 tests); ten vectors in `conformance/vectors/triggers/`; cases CT-GRID-095 and CT-CONSUMER-095 |

Apply all four together. Acceptance removes `patches/`.

Overlaps (each proposal applies on its own; whichever is accepted second resolves these):

- OIP-0016 also edits `sdk/python/src/obsp/__init__.py` (one import line each), the end of `spec/OBSP-0.1.md` (its §14
  before this §15), the §4.2 table next to the same row, and `registers/requirements.yaml` (regenerate with
  `python3 tools/requirements.py`).
- OIP-0008: the copied `$defs.SignatureEnvelope` matches its definition; once OIP-0008's validator group runs, add both
  schemas (signature member `present`) to an object class of `registers/algorithms.yaml` and re-sign the fixtures and
  examples with the test keys (their signature bytes are placeholders).
- OIP-0005: see the proposal for `alert-notice.trigger`.
- `registers/functions.yaml` and relation rows: see the proposal.

## On acceptance after the drafts it builds on

The example sets cannot show a `MET` evaluation over a record in the current tree: an observation record written before
OIP-0006 has no `origin`, and the evaluator never admits such a record (ORIGIN). The `MET` outcome is shown by the vector
`met` and the fixture `trigger-evaluation.met.valid`. Once OIP-0006 is accepted, OBSP-GRID gains a second definition,
`trigger-definition.warm.example.json` (the same trigger at 20 Cel), and its evaluation
`trigger-evaluation.met.example.json`: `MET` over the `4.0.0` alert evidence record (GOOD only, trusted time, origin
`MEASURED`), with the SUSPECT record excluded (QUALITY); `sdk/python/tests/test_triggers.py` selects the evaluations by
UNI and checks the admission. The 0.5 integration series does this at step 19.

Check that every patch still applies to the current tree: `python3 -m unittest tests.test_validate -k draft_patches`.
