@crvouga/mockingbird-service-junction 3.7.1 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog — @crvouga/mockingbird-service-junction
2
2
 
3
+ ## 3.8.0 (2026-10-21)
4
+
5
+ ### Features
6
+
7
+ - raise the serve and fleet body limit to the S3 maximum ([86b9e2b](https://github.com/crvouga/mockingbird/commit/86b9e2b80bcaaaef57f52edbac50b27da0b42f33))
8
+
9
+ ### Fixes and improvements
10
+
11
+ - finish junction, notion and bedrock docs and tests ([f1b4ccb](https://github.com/crvouga/mockingbird/commit/f1b4ccb4441144b5151b536aaacc8519b2e86075))
12
+ - lab account and cancel parity fixes ([cd61107](https://github.com/crvouga/mockingbird/commit/cd61107577e07dda2d8598409f4c23d998c91f49))
13
+
3
14
  ## 3.7.1 (2026-10-20)
4
15
 
5
16
  ### Fixes and improvements
package/README.md CHANGED
@@ -408,7 +408,7 @@ are validated but do not change the price, and no other charge components are mo
408
408
  Both routes follow the published contract
409
409
  ([markers](https://docs.junction.com/api-reference/lab-testing/biomarkers),
410
410
  [estimate](https://docs.junction.com/api-reference/lab-testing/estimate-order-set-pricing)); neither
411
- has been compared with the live sandbox (prices are contract-owned), so their parity is disabled and
411
+ has been compared with the live sandbox (prices are contract-owned; best guess, not oracle-verified), so their parity is disabled and
412
412
  the 400 messages for unknown tests/markers are borrowed from `create_order`.
413
413
 
414
414
  `addOnSourceMarkers: true` (`--add-on-source-markers`) makes each biomarker line of an add-on order
@@ -417,7 +417,9 @@ default result lines carry no `source_markers`, and was reported from a sandbox
417
417
  been re-verified.
418
418
 
419
419
  `GET /v3/lab_tests` lists every lab test unless filtered; pass `status=active` to exclude inactive
420
- ones. The documented default of that filter is not stated, so the emulator does not change it.
420
+ ones. The documented default of that filter is not stated, so the emulator does not change it:
421
+ default-excludes-inactive (as #470 reports) is an unverified claim and is **not implemented**
422
+ (best guess, not oracle-verified; `junction.markers-overlays.test.ts` pins the current contract).
421
423
 
422
424
  ## Lab accounts
423
425
 
@@ -549,7 +551,8 @@ accepts `client_bill` when no account is named). No account at any lab lists DC,
549
551
  either. `bioreference_current_platform`, `quest_sandbox_platform` and `sonora_quest_production_platform`
550
552
  follow listings an agent
551
553
  reported from `GET /v3/lab_test/lab_account` (a consumer-audit report with synthetic ids, not a
552
- repository probe); the older presets keep their shapes so pinned suites do not change.
554
+ repository probe, so **best guess, not oracle-verified**); the older presets keep their shapes so
555
+ pinned suites do not change.
553
556
 
554
557
  Every preset is `status: "active"` unless named `suspended_*`. `GET /__admin/lab-accounts/presets`
555
558
  returns the full records, the deprecated `aliases`, and the `synthetic` presets (not a recorded
@@ -1110,21 +1113,39 @@ successful delegated-account selection or retry a rejected customer order by dro
1110
1113
 
1111
1114
  These controls do not model why Junction overrides the requested billing, validate physician
1112
1115
  selection, or establish any production omission/returned-identity rule. Native behavior remains
1113
- the default. For the separately reported NY/NJ exception in #441, `allowBilling` can map an
1114
- explicit billing type to allowed states on that fixture's account, for example
1115
- `{ allowBilling: { client_bill: ["NY", "NJ"] } }`; this too is a best guess, not oracle-verified.
1116
+ the default. The separately reported NY/NJ acceptance uses the
1117
+ [`allowBilling` positive control](#explicit-nynj-customer-account-billing-441) below.
1116
1118
  `GET/PUT /__admin/lab-account-behavior` inspect/change one
1117
1119
  namespace's policy; changes survive its reset and never affect another namespace.
1118
1120
  Unknown profile names are rejected. CLI/server equivalents are `--lab-account-profile`
1119
1121
  and `--lab-account-sandbox-policies <json-file>` (the account-policy object).
1120
1122
 
1121
1123
  `sandbox-observed` also encodes the owner-recorded October 2026 sandbox omission controls
1122
- (#439), which are recorded observations, not a live repository probe: an order whose
1124
+ (#439), which are recorded observations, **best guess, not oracle-verified by this repository**
1125
+ (its sandbox probe still finds no matching account inventory; no live POST/GET identity
1126
+ comparison has been run here): an order whose
1123
1127
  **root** `lab_account_id` is omitted, nested only in `order_set`, or an unknown UUID is
1124
1128
  placed on the lab's platform account (`lab_account_id: null` on POST and GET, no listed
1125
1129
  `allowed_billing` check), while a root ID naming a listed account keeps its identity and
1126
1130
  policy. `expected-contract` keeps the strict behavior (unknown ID → 400, omission → the
1127
- house account).
1131
+ house account). The `native` profile keeps its historical response shape (no `lab_account_id`
1132
+ on the order); the explicit profiles return the stored association, never the requested id, so a
1133
+ test that asserts identity on both POST and an independent GET cannot pass on an ignored id.
1134
+ `junction.account-profiles.test.ts` holds the positive control and the six negative controls.
1135
+
1136
+ #### Explicit Junction-owned account in an uncovered state (#494)
1137
+
1138
+ Under `sandbox-observed` (or `observed` with `oracle: "sandbox"`), a **root** `lab_account_id`
1139
+ naming a Junction-owned account (`org_id: null`) whose listing has no billing type for the
1140
+ patient's state is refused with `400 {"detail":"Lab <lab name> does not support state <ST>"}`
1141
+ (for example `Lab BioReference does not support state AZ`) before any billing-type check, and no
1142
+ order or webhook is created. This follows the reported sandbox refusal (2026-10-19); it is a
1143
+ **best guess, not oracle-verified** here, and the reporter did not re-probe a covered state. It is
1144
+ kept apart from the billing-type message (`Lab 13 does not support billing type ...`) that a
1145
+ customer-owned account returns. A state that the account lists for another billing type keeps the
1146
+ billing message, an account-owned `allowBilling` exception counts as coverage, and
1147
+ customer-owned accounts, `native`, `expected-contract` and the production oracle keep their
1148
+ existing messages (the state rule is a sandbox observation only).
1128
1149
 
1129
1150
  The explicit profiles also accept `order_set.add_on` with `provider_ids` or `marker_ids`
1130
1151
  from one lab's configured marker catalog. The selected markers determine the synthetic
@@ -1135,6 +1156,54 @@ an order; requested add-on markers are never silently discarded.
1135
1156
  Panel and custom orders share account/billing checks for home and walk-in collection.
1136
1157
  The native profile keeps its existing panel-only contract.
1137
1158
 
1159
+ ### Explicit NY/NJ customer-account billing (#441)
1160
+
1161
+ The positive control for [#441](https://github.com/crvouga/mockingbird/issues/441) is a
1162
+ **best guess, not oracle-verified**. The reporter observed a non-delegated customer-owned
1163
+ BioReference account accepting explicit `client_bill` in NY despite advertising only
1164
+ `patient_bill_passthrough` for NY/NJ. The reported POST and independent GET both retained
1165
+ the requested account ID and `client_bill`. The
1166
+ [public billing rules](https://docs.junction.com/lab/overview/lab-accounts#billing-types)
1167
+ require the requested billing type and patient state to be listed; they do not establish this
1168
+ account-specific exception. The repository's
1169
+ [2026-10-20 sandbox probe](https://github.com/crvouga/mockingbird/actions/runs/39397939244)
1170
+ returned `complete: false` with `matching account inventory unavailable`, no observations and
1171
+ no resources created. No vendor acceptance was verified by that run.
1172
+
1173
+ Load a synthetic active BioReference customer account with `delegated_flow: "not_delegated"`
1174
+ and `allowed_billing: { patient_bill_passthrough: ["NY", "NJ"] }`, plus an orderable
1175
+ BioReference panel. Set `labAccountBehavior` to the following, replacing the synthetic UUID
1176
+ with that fixture account's ID:
1177
+
1178
+ ```json
1179
+ {
1180
+ "profile": "observed",
1181
+ "oracle": "sandbox",
1182
+ "accounts": {
1183
+ "22222222-2222-4222-8222-222222222222": {
1184
+ "allowBilling": { "client_bill": ["NY", "NJ"] }
1185
+ }
1186
+ }
1187
+ }
1188
+ ```
1189
+
1190
+ Submit a valid order with that ID at the root `lab_account_id`, explicit
1191
+ `billing_type: "client_bill"` and a NY or NJ patient address. POST and independent GET
1192
+ preserve both the selected account ID and `client_bill`; the account listing still advertises
1193
+ only its original `patient_bill_passthrough` states. This models an ordering exception without
1194
+ rewriting inventory or changing the requested billing. Including NJ is an explicit fixture
1195
+ assumption from the reported NY/NJ account, not an observed NJ oracle response.
1196
+
1197
+ The exception applies only to the configured account, explicit billing type and configured
1198
+ states under `observed` (or its `sandbox-observed` alias). An unconfigured account or a state
1199
+ outside NY/NJ still fails the listed billing/state checks. Omitting `billing_type` evaluates
1200
+ `defaultBillingTypes` against the listed account billing: the default `client_bill` rejects,
1201
+ while an explicitly configured `patient_bill_passthrough` default accepts in NY/NJ and is
1202
+ returned as such. Native and `expected-contract` profiles retain their existing validation.
1203
+ The separate delegated refusal in #440 still requires its own `rejectBilling` entry; neither
1204
+ control establishes a universal rule based on delegation or lab. See
1205
+ `junction.account-profiles.test.ts` for the acceptance cases and strict negative controls.
1206
+
1138
1207
  ### Observed profile and oracle label
1139
1208
 
1140
1209
  `profile: "observed"` with `oracle: "sandbox" | "production"` is the general form of
@@ -1145,8 +1214,9 @@ account and never as a blanket delegated-account rule: a delegated customer acco
1145
1214
  explicit `client_bill` only when its own entry says so. The October 2026 sandbox omission
1146
1215
  recordings (#439) are sandbox observations, so they apply only to `oracle: "sandbox"`; with
1147
1216
  `oracle: "production"` an omitted account selects the house account as `expected-contract`
1148
- does. Whether production also refuses a delegated account when `billing_type` is omitted is
1149
- unverified, so it is not modelled. `oracle` on any other profile, or `production` on the
1217
+ does, except that the production oracle defaults `omittedAccountBilling` to
1218
+ `{ bioreference: "unchecked" }` (#495, below). Whether production also refuses a delegated account
1219
+ when `billing_type` is omitted is unverified, so it is not modelled. `oracle` on any other profile, or `production` on the
1150
1220
  `sandbox-observed` alias, is refused.
1151
1221
 
1152
1222
  ### Omitted house-account billing (#467)
@@ -1155,7 +1225,13 @@ A reporter observed production accepting an AZ `client_bill` order with no `lab_
1155
1225
  a team whose house BioReference account lists only `patient_bill_passthrough` for NY and NJ,
1156
1226
  placing it on the house account (its requisition prints the house account number). That is a
1157
1227
  single consumer report, not a repository probe, so the default is unchanged (the listing is
1158
- enforced). Opt in per lab:
1228
+ enforced). `profile: "observed", oracle: "production"` is the named profile for this
1229
+ production recording (#495) and turns it on for BioReference by default, **best guess, not
1230
+ oracle-verified** (sandbox, by contrast, places an omitted-id order on the platform account with a
1231
+ null association, see #439 above). With it, an omitted `lab_account_id` places the order on the
1232
+ Junction-owned account, the requisition names that account's number, and the account listing is
1233
+ unchanged (it still lists `client_bill` for no state). Set `omittedAccountBilling: { bioreference:
1234
+ "listed" }` to turn it off. For any other profile, opt in per lab:
1159
1235
 
1160
1236
  ```ts
1161
1237
  import { createRuntime } from "@crvouga/mockingbird-service-junction"
@@ -1192,7 +1268,9 @@ Behaviors the sandbox shows that clients must tolerate, every one off by default
1192
1268
  | --- | --- |
1193
1269
  | `sameSecondCancelStatus` (#474) | `POST /v3/order/{id}/cancel` in the same wall-clock second as the order's creation records a `cancelled.<method>.cancelled` event with the same timestamp, but `status`, `last_event` and `updated_at` stay `received`; a repeat cancel is a no-op. A cancel at least one second later reads back `cancelled`. |
1194
1270
 
1195
- This was reported from the sandbox (not re-measured here, production unverified). The quirk does
1271
+ This was reported from the sandbox (not re-measured here, production unverified), so it is a
1272
+ **best guess, not oracle-verified**. It is off by default; a client that tests it should read the
1273
+ event log and wait at least a second between creating and cancelling. The quirk does
1196
1274
  not publish a webhook or cascade-cancel appointments for the stale cancel; the report does not say
1197
1275
  what the vendor does there.
1198
1276
 
package/SUPPORT.md CHANGED
@@ -25,7 +25,7 @@ Generated from `openapi.yaml`; do not edit by hand.
25
25
  | `get_markers_v3_lab_tests_markers_get` | `GET /v3/lab_tests/markers` | ✅ supported | ❌ disabled | the marker inventory is the team's catalog (and any configured marker catalog); prices and availability are account-owned, so the emulator models the documented shape and filters, not a live inventory |
26
26
  | `get_markers_for_lab_test_v3_lab_tests__lab_test_id__markers_get` | `GET /v3/lab_tests/{lab_test_id}/markers` | ✅ supported | ✅ | |
27
27
  | `list_order_set_markers_v3_lab_tests_list_order_set_markers_post` | `POST /v3/lab_tests/list_order_set_markers` | ✅ supported | ✅ | |
28
- | `create_order_v3_order_post` | `POST /v3/order` | ✅ supported | ✅ | Native profile parity only; explicit account profiles add fixture-owned billing policies and custom-marker orders as a best guess, not oracle-verified. Account-specific billing refusals are opt-in report-derived behavior, not a global vendor rule. |
28
+ | `create_order_v3_order_post` | `POST /v3/order` | ✅ supported | ✅ | Native profile parity only; explicit account profiles add fixture-owned billing policies and custom-marker orders as a best guess, not oracle-verified. Account-specific billing refusals and NY/NJ explicit client_bill acceptance (#441) are opt-in report-derived behavior, not a global vendor rule; the acceptance preserves POST/GET account identity and billing without changing advertised allowed_billing. The sandbox-observed omission/nested/unknown-id controls (#439), the explicit Junction-owned account state refusal (#494) and the production-oracle omitted-id house-account placement (#495) are recorded or reported observations, best guess, not oracle-verified by this repository. |
29
29
  | `get_area_info_v3_order_area_info_get` | `GET /v3/order/area/info` | ✅ supported | ❌ disabled | central_labs presence, within_radius counts and getlabs market coverage are provider-owned geo data that an emulator cannot replicate per-zip; covered by the client-parity scenario shape checks instead |
30
30
  | `get_psc_info_v3_order_psc_info_get` | `GET /v3/order/psc/info` | ✅ supported | ❌ disabled | patient_service_centers are real site inventories per zip (thousands of sites, result-capped at 30) that a fixture emulator cannot replicate per-zip; covered by the client-parity scenario shape checks instead |
31
31
  | `get_phlebotomy_appointment_availability_v3_order_phlebotomy_appointment_availability_post` | `POST /v3/order/phlebotomy/appointment/availability` | ✅ supported | ❌ disabled | availability slots are provider-side data whose values shift between sandbox calls; covered by the emulator-internal scheduling property suite instead |
@@ -41,7 +41,7 @@ Generated from `openapi.yaml`; do not edit by hand.
41
41
  | `reschedule_psc_appointment_v3_order__order_id__psc_appointment_reschedule_patch` | `PATCH /v3/order/{order_id}/psc/appointment/reschedule` | ✅ supported | ❌ disabled | rescheduling depends on live provider slot state; covered by the emulator-internal scheduling property suite instead |
42
42
  | `cancel_psc_appointment_v3_order__order_id__psc_appointment_cancel_patch` | `PATCH /v3/order/{order_id}/psc/appointment/cancel` | ✅ supported | ❌ disabled | cancellation depends on live provider appointment state; covered by the emulator-internal scheduling property suite instead |
43
43
  | `get_order_v3_order__order_id__get` | `GET /v3/order/{order_id}` | ✅ supported | ✅ | |
44
- | `cancel_order_v3_order__order_id__cancel_post` | `POST /v3/order/{order_id}/cancel` | ✅ supported | ✅ | |
44
+ | `cancel_order_v3_order__order_id__cancel_post` | `POST /v3/order/{order_id}/cancel` | ✅ supported | ✅ | Default cancel always reads back cancelled; the sandbox same-second stale-status behavior is the opt-in quirk sameSecondCancelStatus (#474), reported from the sandbox, best guess, not oracle-verified. |
45
45
  | `simulate_order_v3_order__order_id__test_post` | `POST /v3/order/{order_id}/test` | ✅ supported | ✅ | |
46
46
  | `get_result_raw_v3_order__order_id__result_get` | `GET /v3/order/{order_id}/result` | ✅ supported | ❌ disabled | results carry provider-side specimen data; covered by the emulator-internal results property suite instead |
47
47
  | `get_result_metadata_v3_order__order_id__result_metadata_get` | `GET /v3/order/{order_id}/result/metadata` | ✅ supported | ✅ | |
@@ -13,7 +13,7 @@ import {
13
13
  pullCorpus,
14
14
  resolveAdminPrefix,
15
15
  restoreClock
16
- } from "./chunk-ZJCE4VM4.js";
16
+ } from "./chunk-GYYWJPZH.js";
17
17
  import {
18
18
  defaultCorpus
19
19
  } from "./chunk-2FZJPMTR.js";
@@ -3070,7 +3070,7 @@ async function preflightFleet(config, options) {
3070
3070
  break;
3071
3071
  }
3072
3072
  }
3073
- targets.set(name, { ...target, packageVersion: packageVersion ?? "3.7.1" });
3073
+ targets.set(name, { ...target, packageVersion: packageVersion ?? "3.8.0" });
3074
3074
  } catch (error) {
3075
3075
  throw new Error(`service ${name}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
3076
3076
  }
@@ -3296,7 +3296,11 @@ var serve = async (api, options = {}) => {
3296
3296
  // ../../adapters/node/dist/listen.js
3297
3297
  var listen = async (api, options = {}) => {
3298
3298
  const host = options.host ?? "127.0.0.1";
3299
- const server = await serve(api, { port: options.port ?? 0, host });
3299
+ const server = await serve(api, {
3300
+ port: options.port ?? 0,
3301
+ host,
3302
+ ...options.maxBodyBytes !== void 0 ? { maxBodyBytes: options.maxBodyBytes } : {}
3303
+ });
3300
3304
  const address = server.address();
3301
3305
  const port = typeof address === "object" && address !== null ? address.port : options.port ?? 0;
3302
3306
  const shown = host.includes(":") ? `[${host}]` : host;
@@ -3495,7 +3499,8 @@ var httpChild = async (target, entry, options, admission, generation, privateAcc
3495
3499
  try {
3496
3500
  server = await listen(api, {
3497
3501
  port: entry.port ?? target.defaultPort,
3498
- host: entry.host ?? "127.0.0.1"
3502
+ host: entry.host ?? "127.0.0.1",
3503
+ ...target.maxBodyBytes !== void 0 ? { maxBodyBytes: target.maxBodyBytes } : {}
3499
3504
  });
3500
3505
  target.listening?.(server);
3501
3506
  } catch (error) {
@@ -4886,7 +4891,11 @@ var start = async (target, values, config) => {
4886
4891
  });
4887
4892
  if (config.idBase !== void 0)
4888
4893
  runtime.setIdBase?.(config.idBase);
4889
- const listening = await listen(runtime, { port: config.port, host: config.host });
4894
+ const listening = await listen(runtime, {
4895
+ port: config.port,
4896
+ host: config.host,
4897
+ ...target.maxBodyBytes !== void 0 ? { maxBodyBytes: target.maxBodyBytes } : {}
4898
+ });
4890
4899
  target.listening?.(listening);
4891
4900
  console.log(`${target.name} emulator listening on ${listening.url}`);
4892
4901
  console.log(`${target.name} health: GET ${listening.url}${adminPrefix}/health`);
@@ -5255,4 +5264,4 @@ export {
5255
5264
  createServer2 as createServer,
5256
5265
  serveTarget
5257
5266
  };
5258
- //# sourceMappingURL=chunk-BGYGWODK.js.map
5267
+ //# sourceMappingURL=chunk-3KASXIUZ.js.map