Commit 2c1d58a
committed
Split identifier path validation into loose and strict asserts
`validateSingleIdentifierVariablePath` was applied to every setter
that takes a single-identifier path, which tightened upstream's
inline `variables.size!==1 || !variables.has("identifier")` check
into a stricter one that also rejected the named operators
(`{+identifier}`, `{?identifier}`, etc.) and any explode/prefix
modifier. That restriction only matched the runtime behaviour the
outbox setters historically required; the other eight setters
preserved the looser upstream rule and the TS signatures already
allowed `Rfc6570Expression<"identifier">`.
Split the helper:
- `assertIdentifierPath` keeps the upstream rule (one variable
named `identifier`, any operator).
- `assertStrictIdentifierPath` layers the operator/explode/prefix
guard on top by calling `assertIdentifierPath` first.
Both helpers carry an `asserts path is Path` predicate so callers
get the `Path` narrowing automatically. Apply
`assertStrictIdentifierPath` to setOutboxDispatcher and
setOutboxListeners (the two setters upstream already routed through
the strict centralized validator) and `assertIdentifierPath`
everywhere else. All existing "wrong variables in path" tests pass.
Addresses the type-vs-runtime mismatch flagged by CodeRabbit in
#758 (2026-05-11).
Assisted-by: Claude Opus 4.7 (1M context)1 parent 5e96c8c commit 2c1d58a
1 file changed
Lines changed: 22 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | | - | |
80 | | - | |
| 79 | + | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
83 | 91 | | |
84 | 92 | | |
85 | 93 | | |
| |||
258 | 266 | | |
259 | 267 | | |
260 | 268 | | |
261 | | - | |
| 269 | + | |
262 | 270 | | |
263 | 271 | | |
264 | 272 | | |
| |||
716 | 724 | | |
717 | 725 | | |
718 | 726 | | |
719 | | - | |
| 727 | + | |
720 | 728 | | |
721 | 729 | | |
722 | 730 | | |
| |||
790 | 798 | | |
791 | 799 | | |
792 | 800 | | |
793 | | - | |
| 801 | + | |
794 | 802 | | |
795 | 803 | | |
796 | 804 | | |
| |||
854 | 862 | | |
855 | 863 | | |
856 | 864 | | |
857 | | - | |
| 865 | + | |
858 | 866 | | |
859 | 867 | | |
860 | 868 | | |
| |||
905 | 913 | | |
906 | 914 | | |
907 | 915 | | |
908 | | - | |
| 916 | + | |
909 | 917 | | |
910 | 918 | | |
911 | 919 | | |
| |||
967 | 975 | | |
968 | 976 | | |
969 | 977 | | |
970 | | - | |
| 978 | + | |
971 | 979 | | |
972 | 980 | | |
973 | 981 | | |
| |||
1025 | 1033 | | |
1026 | 1034 | | |
1027 | 1035 | | |
1028 | | - | |
| 1036 | + | |
1029 | 1037 | | |
1030 | 1038 | | |
1031 | 1039 | | |
| |||
1091 | 1099 | | |
1092 | 1100 | | |
1093 | 1101 | | |
1094 | | - | |
| 1102 | + | |
1095 | 1103 | | |
1096 | 1104 | | |
1097 | 1105 | | |
| |||
1157 | 1165 | | |
1158 | 1166 | | |
1159 | 1167 | | |
1160 | | - | |
| 1168 | + | |
1161 | 1169 | | |
1162 | 1170 | | |
1163 | 1171 | | |
| |||
1221 | 1229 | | |
1222 | 1230 | | |
1223 | 1231 | | |
1224 | | - | |
| 1232 | + | |
1225 | 1233 | | |
1226 | 1234 | | |
1227 | 1235 | | |
| |||
0 commit comments