Commit 533001f
Admission refuses a sentinel pointing the wrong way (#109)
`START` is the graph's entry and `END` its exit, but `_check_endpoints`
accepted both in either role — the sentinel test did not look at which side of
the edge it was on. So a proposal carrying `END -> x` or `x -> START` was
admitted, and then died in `Materializer` with `StateGraph`'s own "END cannot
be a start node" / "START cannot be an end node".
The run does not proceed either way. What was wrong is where the failure was
charged and what the planner was told.
`GovernedLoop` counts a `MaterializationError` as an execution failure, against
`max_consecutive_execution_failures` (2), rather than as a rejection against
`max_consecutive_rejections` (3) — so a planner got fewer retries for a mistake
admission is supposed to catch than for one it does catch, and two in a row
ended the run as `EXECUTION_FAILED`, a stop reason claiming the graph ran when
nothing had.
And a rejection is meant to be data. `feedback()` hands the planner codes and
remedies; what it got here was prose assembled from an exception, with no code,
no remedy, and nothing on the `admission` event's failed-check list — because
admission had not failed. The prompt in proposal.py already tells models the
rule; the gate is what did not hold when a model ignored it.
Both endpoints are still reported rather than the first, matching every other
check. The rejection rides `Check.REGISTRY` with code `sentinel_wrong_direction`
and a remedy naming the side the sentinel belongs on.
Two of the three new tests go red without the fix; the third is the guard that
the normal shape still admits, which must stay green either way.
Closes #108
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 00e0c7d commit 533001f
3 files changed
Lines changed: 112 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
| 257 | + | |
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
672 | 672 | | |
673 | 673 | | |
674 | 674 | | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
675 | 694 | | |
676 | 695 | | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
677 | 719 | | |
678 | 720 | | |
679 | 721 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
164 | 233 | | |
165 | 234 | | |
166 | 235 | | |
| |||
0 commit comments