|
1 | 1 | # @typeonce/effect-machine |
2 | 2 |
|
| 3 | +## 0.14.0 |
| 4 | + |
| 5 | +### Minor Changes |
| 6 | + |
| 7 | +- 4554c4d: Make `MachineTest.coverage` report transition definitions and their exact branches separately. Read definition coverage through `coverage.transitions.definitions` and conditional branch coverage through `coverage.transitions.branches`. |
| 8 | + |
| 9 | + Replace the `targetBounds` verification law group with `definitions`. The new laws validate the declared startup root, transition registration, retained `branchIndex`, and the selected branch's exact target kind and scope. |
| 10 | + |
| 11 | +- a4cd309: Add exact `transitionCoverage` to `MachineTest.Exploration`. Coverage includes startup and every concretely planned event, including state-limit candidates, while unplanned depth- and transition-limit frontiers remain misses. |
| 12 | +- 324ae69: Retain exact static and runtime transition evidence for testing and visualization. Transition branch inspection now includes the selected target kind and scope, retained planner transitions identify the zero-based branch that executed, and `Machine.initialDefinition` exposes the root startup selection without executing its resolver. |
| 13 | + |
| 14 | + Use `branchIndex` to associate a retained transition with the corresponding entry in `Machine.transitionDefinitions(machine).branches`. Direct transitions use index `0`; conditional cases retain their declaration index and `otherwise` follows the final case. |
| 15 | + |
| 16 | +- 2c67924: Require `Machine.transition` for every machine transition and capture each possible target as static machine topology. Direct transitions declare `target` and `resolve`; conditional transitions declare titled `cases` whose `when` functions return `Option`, plus an explicit `otherwise` branch. The selected target builder and conditional match value are inferred in each resolver. |
| 17 | + |
| 18 | + Initial state construction now uses the same `target` and `resolve` shape, restricted to the machine's declared initial state. Replace process logic previously created with `Machine.transition` by `Machine.logic`, and replace function handlers, target upper-bound lists, and `States.initial` construction with the explicit transition and initial target selectors. |
| 19 | + |
| 20 | +- 944cdb5: Allow conditional `Machine.transition` definitions to infer any number of heterogeneous cases. Define `cases` with its locally supplied `branch` constructor so each predicate match and selected target remain exact in the corresponding resolver: |
| 21 | + |
| 22 | + ```ts |
| 23 | + Machine.transition({ |
| 24 | + cases: (branch) => [ |
| 25 | + branch({ |
| 26 | + title: "cached", |
| 27 | + when: ({ event }) => event.cached, |
| 28 | + target: (to) => to.full.Ready(), |
| 29 | + resolve: ({ match, target }) => target.from({ data: match }) |
| 30 | + }) |
| 31 | + ], |
| 32 | + otherwise: { |
| 33 | + target: (to) => to.full.Loading(), |
| 34 | + resolve: ({ target }) => target.from() |
| 35 | + } |
| 36 | + }) |
| 37 | + ``` |
| 38 | + |
| 39 | + Replace each object previously written directly in the `cases` array with `branch({ ... })` inside the `cases: (branch) => [...]` factory. Direct transitions and `otherwise` keep their existing shape. |
| 40 | + |
| 41 | +- 64094df: Make `MachineTest.verify` accept startup roots reached through exact retained initial-choice routes and reject retained targets whose choice, initial, or history resolution is inconsistent with their selected static branch. Resolution failures are reported as `definitions.resolution`. |
| 42 | + |
3 | 43 | ## 0.13.0 |
4 | 44 |
|
5 | 45 | ### Minor Changes |
|
0 commit comments