Commit 7a4d60b
committed
Address PR #71 review: error metadata + pairing + bool validation
Four CoPilot threads addressed:
1. CheckpointRecordInvalid (proposal 0029 count-drift raise) now
references the LOADED record's invocation_id via
`context.resume_invocation or context.invocation_id` — on resume
the new run gets a freshly minted id but the error should point
at the saved record being validated, not the new run.
2. _step_fan_out_node's CheckpointError branch now dispatches a
`completed` event with a NodeException wrapper before re-raising
the original CheckpointError. Preserves spec proposal 0012's
started/completed pairing contract while keeping NodeEvent.error
typed as RuntimeGraphError | None (CheckpointError is sibling-
typed). Observers see complete pairing with the original
CheckpointError on `__cause__`; the invoke() caller still
receives the unwrapped checkpoint error via the bare `raise`.
3. SQLite checkpointer's `result_is_error` deserialization now
distinguishes key-absent (pre-0027 records, default False for
backward compat) from key-present (strictly validates it's a
bool and raises CheckpointRecordInvalid on mismatch). The naive
bool() coercion would have misclassified a corrupted record
with `"result_is_error": "false"` (string) as True since
non-empty strings are truthy. Threads invocation_id through
_fan_out_progress_from_dict so the raise points at the correct
persisted record.
4. result_present matcher comment + variable rename make the
semantic explicit: "result is a non-None value" rather than the
fuzzier "field present" framing. Documents the hypothetical
`result = None` on a completed-success entry as out of scope —
spec frames result as "the durable contribution" and no fixture
exercises a None contribution on a completed entry.1 parent 107236b commit 7a4d60b
4 files changed
Lines changed: 85 additions & 29 deletions
File tree
- src/openarmature
- checkpoint/backends
- graph
- tests/conformance
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
120 | 125 | | |
121 | 126 | | |
122 | 127 | | |
| |||
129 | 134 | | |
130 | 135 | | |
131 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
132 | 157 | | |
133 | 158 | | |
134 | 159 | | |
135 | 160 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
| 161 | + | |
142 | 162 | | |
143 | 163 | | |
144 | 164 | | |
| |||
381 | 401 | | |
382 | 402 | | |
383 | 403 | | |
384 | | - | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
385 | 407 | | |
386 | 408 | | |
387 | 409 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1628 | 1628 | | |
1629 | 1629 | | |
1630 | 1630 | | |
1631 | | - | |
1632 | | - | |
1633 | | - | |
1634 | | - | |
1635 | | - | |
1636 | | - | |
1637 | | - | |
1638 | | - | |
1639 | | - | |
1640 | | - | |
1641 | | - | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
1642 | 1660 | | |
1643 | 1661 | | |
1644 | 1662 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
199 | 205 | | |
200 | | - | |
| 206 | + | |
201 | 207 | | |
202 | 208 | | |
203 | 209 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
838 | 838 | | |
839 | 839 | | |
840 | 840 | | |
841 | | - | |
842 | | - | |
843 | | - | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
844 | 845 | | |
845 | | - | |
846 | | - | |
847 | | - | |
848 | | - | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
849 | 859 | | |
850 | | - | |
| 860 | + | |
851 | 861 | | |
852 | 862 | | |
853 | 863 | | |
| |||
0 commit comments