Commit 94b8c2a
fix(dryrun): apply the listener's ingress guards in the preview (BACKLOG #1689, #1690) (#1169)
`dry_run` skipped the decode and post-decode guards the live listener runs before routing, so
`messagefoundry check` and the Test Bench previewed RECEIVED for bodies the engine would NAK, and
ERROR or mojibake for bodies it accepts. The divergence ran both ways.
Extract the sequence into `pipeline/ingress_guards.py` -- decode with the connection's declared
`encoding` at errors="strict", reject an embedded NUL, bound the size -- and point `dry_run` and
`_dry_run_raw` at it. Resolve the peek ceiling from the connection's `max_message_bytes` instead of
the bare 16 MiB default, and carry a binary content type via ADR 0028 rather than text-decoding it.
`split_messages` / `read_messages` / `read_message_sets` now hand on BYTES. They decoded UTF-8
tolerantly before any inbound was in scope, so the declared charset never got a chance to apply. The
boundary search moves to a lossless latin-1 byte view, which is charset-agnostic; one fixture is
cross-producted against many inbounds with different encodings, so bytes is the only contract that
can express the operation.
An unmapped HL7 fixture no longer cross-products against a binary inbound. That question -- would
this HL7 file route as a DICOM object -- has one answer and carries no information; a PINNED fixture
still runs against its binary feed, exactly as one pinned to a not-deployed feed does.
#1690: `disposition_for` reports NOT_DEPLOYED for a routed run whose every Send addressed a
present-but-not-deployed destination, `DryRunResult` carries `declined`, the `.expect` vocabulary
accepts NOT_DEPLOYED, and the dryrun CLI emits the declined names.
Two live guards are deliberately not mirrored, recorded in the module docstring and the PR body: the
strict-validation timeout (mirroring it forces `dry_run` async) and `_detach_documents` (async and
side-effecting). The listener still carries its own inline copy of the sequence -- pointing
`_handle_inbound` at the shared function is part B -- so a parity test pins the two together.
Measured on this repository's own fixtures: 2/260 failing runs before, the same 2/220 after. Every
surviving pair keeps its before-state disposition; the 40 dropped runs were all UNROUTED on the two
binary feeds.
Co-authored-by: wshallwshall <mefordev@messagefoundry.org>1 parent c0ae68c commit 94b8c2a
7 files changed
Lines changed: 689 additions & 39 deletions
File tree
- messagefoundry
- pipeline
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3629 | 3629 | | |
3630 | 3630 | | |
3631 | 3631 | | |
| 3632 | + | |
| 3633 | + | |
| 3634 | + | |
| 3635 | + | |
| 3636 | + | |
3632 | 3637 | | |
3633 | 3638 | | |
3634 | 3639 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1101 | 1101 | | |
1102 | 1102 | | |
1103 | 1103 | | |
1104 | | - | |
1105 | | - | |
1106 | | - | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
1107 | 1109 | | |
1108 | 1110 | | |
1109 | 1111 | | |
| |||
1115 | 1117 | | |
1116 | 1118 | | |
1117 | 1119 | | |
1118 | | - | |
| 1120 | + | |
1119 | 1121 | | |
1120 | 1122 | | |
1121 | 1123 | | |
| |||
1216 | 1218 | | |
1217 | 1219 | | |
1218 | 1220 | | |
1219 | | - | |
| 1221 | + | |
| 1222 | + | |
1220 | 1223 | | |
1221 | 1224 | | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
1222 | 1235 | | |
1223 | | - | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
1224 | 1239 | | |
1225 | 1240 | | |
1226 | 1241 | | |
| |||
1239 | 1254 | | |
1240 | 1255 | | |
1241 | 1256 | | |
1242 | | - | |
| 1257 | + | |
1243 | 1258 | | |
1244 | 1259 | | |
1245 | 1260 | | |
| |||
1263 | 1278 | | |
1264 | 1279 | | |
1265 | 1280 | | |
1266 | | - | |
| 1281 | + | |
1267 | 1282 | | |
1268 | 1283 | | |
1269 | 1284 | | |
1270 | 1285 | | |
1271 | | - | |
1272 | | - | |
| 1286 | + | |
| 1287 | + | |
1273 | 1288 | | |
1274 | 1289 | | |
1275 | | - | |
| 1290 | + | |
| 1291 | + | |
1276 | 1292 | | |
1277 | 1293 | | |
1278 | 1294 | | |
| |||
0 commit comments