@crvouga/mockingbird-service-junction 1.9.0 → 2.1.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,6 +1,42 @@
1
1
  # Changelog — @crvouga/mockingbird-service-junction
2
2
 
3
- ## 1.9.0 (2026-10-02)
3
+ ## 2.1.0 (2026-10-04)
4
+
5
+ ### Features
6
+
7
+ - use shared forms for service actions ([af19eb9](https://github.com/crvouga/mockingbird/commit/af19eb9d4896d8418f5db850f20808a89291b949))
8
+ - replace UI with Ant Design ([6547b4e](https://github.com/crvouga/mockingbird/commit/6547b4ef1663fb597ab515cce06245c82010407a))
9
+
10
+ ### Fixes and improvements
11
+
12
+ - fill the embedded viewport ([c1a35a4](https://github.com/crvouga/mockingbird/commit/c1a35a4789389ee9cd06c286d09bd47c4d06c71e))
13
+ - make dialog cleanup immediate ([0c1a3c5](https://github.com/crvouga/mockingbird/commit/0c1a3c5b12584d50c19dcae595b951b8e5417b9c))
14
+
15
+ ### Dependencies
16
+
17
+ - `@crvouga/mockingbird-service-sqlite`
18
+
19
+ ## 2.0.0 (2026-10-04)
20
+
21
+ ### ⚠️ Breaking changes
22
+
23
+ - isolate internal routes ([5e19b21](https://github.com/crvouga/mockingbird/commit/5e19b21d403acc74b04778a8b545e80bcbdf8d51))
24
+
25
+ ### Features
26
+
27
+ - add route filtering ([4e59b1d](https://github.com/crvouga/mockingbird/commit/4e59b1d42a76550f844b744f8431a637433a0781))
28
+ - publish agent package indexes ([eca61d3](https://github.com/crvouga/mockingbird/commit/eca61d358b86982cf0b777ae8bd7feaa3663aaa6))
29
+
30
+ ### Fixes and improvements
31
+
32
+ - clarify runtime prefix options ([f899a78](https://github.com/crvouga/mockingbird/commit/f899a7891f29413e4f08e9534d0c977f16acf7d7))
33
+ - honor configured prefixes ([4f569d7](https://github.com/crvouga/mockingbird/commit/4f569d74ca8089f2ed5e33a1abf32b90973f41dd))
34
+ - explain configurable internal paths ([21b47ae](https://github.com/crvouga/mockingbird/commit/21b47ae4d4a096cdf63189aaeaf721ccb369bcf3))
35
+ - parse ISO journal timestamps ([20b39a2](https://github.com/crvouga/mockingbird/commit/20b39a2c738e278533d610dfc91f1cb3ae9b3f1e))
36
+ - scope collector controls ([af9ee8f](https://github.com/crvouga/mockingbird/commit/af9ee8f4ccd98695831cd04eb0655ebd0280ecf6))
37
+ - harden shared controls ([7822614](https://github.com/crvouga/mockingbird/commit/7822614f6cba0387aeb60ba7320b0379aa1ef690))
38
+
39
+ ## 1.9.0 (2026-10-01)
4
40
 
5
41
  ### Features
6
42
 
package/DISCOVERY.md ADDED
@@ -0,0 +1,55 @@
1
+ # @crvouga/mockingbird-service-junction discovery
2
+
3
+ This is the installed-package index for coding agents and tooling. All relative links resolve
4
+ inside `node_modules/@crvouga/mockingbird-service-junction/`; no repository checkout is needed to discover the mock's
5
+ supported surface or documented behavior.
6
+
7
+ ## Capability and behavior sources
8
+
9
+ | Question | Authoritative file | What it contains |
10
+ | --- | --- | --- |
11
+ | Behaviour and integration | [`README.md`](README.md) | Routes, state transitions, auth, webhooks, controls, presets and deliberate omissions. |
12
+ | Exact capabilities | [`SUPPORT.md`](SUPPORT.md) | Supported, unsupported and parity-covered operations or commands, including reasons for gaps. |
13
+ | Wire contract | [`openapi.yaml`](openapi.yaml) | Machine-readable paths, methods, schemas, responses and parity annotations. |
14
+ | Public API | [`dist/index.d.ts`](dist/index.d.ts) | The installed package's exact TypeScript exports and signatures. |
15
+ | Package metadata | [`package.json`](package.json) | Runtime/entry-point claims, vendor links, parity scope/tier and `mockingbird.discovery`. |
16
+
17
+ Read these together: the contract/capability matrix says *what* is available, while the README
18
+ defines stateful behavior, lifecycle rules, test controls, and intentional oracle differences.
19
+ If prose and an executable surface disagree, report a parity mismatch instead of adding a
20
+ consumer-side workaround.
21
+
22
+ ## Parity and oracle
23
+
24
+ - Declared parity surface: **Users, orders, and lab results**.
25
+ - Parity tier: **cold** (the repository controls when live checks run).
26
+ - Oracle: **Live vendor API or sandbox**.
27
+ - Repository command: `bun run parity:service -- junction`.
28
+ - Evidence model: Run from a Mockingbird checkout; credentials come only from .env.local or GitHub Actions secrets. Missing credentials exit 2.
29
+
30
+ The npm package contains evidence summaries and the exact contract, not credentials or the
31
+ repository-only parity harness. Self-parity/property and acceptance tests run in the Mockingbird
32
+ repository; live parity is an additional oracle check, not a substitute for the packaged matrix.
33
+
34
+ ## Runtime introspection
35
+
36
+ - `GET /__admin/health`
37
+ - `GET /__admin`
38
+ - `GET /__admin/state`
39
+ - `GET /__admin/requests`
40
+ - `GET /__admin/metrics`
41
+ - `GET /__admin/faults/presets`
42
+ - `GET /__admin/ui`
43
+
44
+ For HTTP services, use `x-mockingbird-namespace` (or the documented credential/path carrier) so
45
+ parallel tests do not share state. Admin state, journal, metrics and fault-preset endpoints are
46
+ designed for assertions and diagnosis by consuming test suites.
47
+
48
+ ## Report a mismatch or missing capability
49
+
50
+ Follow the [agent reporting contract](https://github.com/crvouga/mockingbird/blob/main/docs/REPORTING_ISSUES.md). Include package version,
51
+ operation/command, a minimal redacted request, actual mock result, expected oracle result or vendor
52
+ documentation, and whether the mismatch appears in the matrix. Never include keys, tokens,
53
+ customer data, prompts, PHI, card data, or unredacted recordings.
54
+
55
+ Service key: `junction`.
package/README.md CHANGED
@@ -111,7 +111,7 @@ npx mockingbird-junction serve --config mockingbird.json
111
111
  import { createServer } from "@crvouga/mockingbird-service-junction/server"
112
112
 
113
113
  const server = await createServer() // shipped corpus, any free port
114
- const health = await fetch(`${server.url}/health`)
114
+ const health = await fetch(`${server.url}/__admin/health`)
115
115
  console.log(health.status) // 200
116
116
 
117
117
  // Point the Vital SDK (or your backend's Junction base URL) at server.url, then:
@@ -226,7 +226,7 @@ while keeping the production and sandbox guards intact.
226
226
 
227
227
  Every Mockingbird service answers the same control surface, outside the vendor's auth gate:
228
228
 
229
- - `GET /health` — unauthenticated readiness probe:
229
+ - `GET /__admin/health` — unauthenticated readiness probe:
230
230
  `{ "status": "ok", "service": "junction", "corpus": "<label>", "geo": "corpus", … }`.
231
231
  - `/__admin/*` — the control plane. Open by default; with `--admin-key` / `adminKey` it requires
232
232
  `x-mockingbird-admin-key`, which is separate from any vendor key. Admin errors have one shape,
@@ -696,7 +696,7 @@ With a fixed clock (`clock` / `POST /__admin/clock {"set": …, "freeze": true}`
696
696
  replays exactly. Stable across runs: user ids, order ids, event ids, sample ids, booking keys and
697
697
  webhook message ids (derived from sequence numbers), timestamps (from the clock), generated
698
698
  availability, and which requests a partial-`rate` fault hits. Wall-clock by design: webhook
699
- `svix-timestamp`, `/health` uptime, and request log durations.
699
+ `svix-timestamp`, `/__admin/health` uptime, and request log durations.
700
700
 
701
701
  ## What is and is not modelled
702
702
 
@@ -739,7 +739,7 @@ Main entry (`@crvouga/mockingbird-service-junction`, runtime-neutral):
739
739
  | `pullCorpus` | `(options: PullCorpusOptions) => Promise<SealedCorpus>` — record a corpus from a real team (GETs only). |
740
740
  | `diffCorpus` | `(before, after) => CorpusDiff` — ZIPs, lab tests, lab accounts and observations added / removed / changed. |
741
741
  | `fingerprintCorpus` | `(corpus) => Promise<string>` — SHA-256 of a corpus's content. |
742
- | `corpusLabel` | `(corpus) => string` — the short label `/health` and logs show, e.g. `v1-2026-09-18-HqFDuEAuhkwD`. |
742
+ | `corpusLabel` | `(corpus) => string` — the short label `/__admin/health` and logs show, e.g. `v1-2026-09-18-HqFDuEAuhkwD`. |
743
743
  | `parseSealedCorpus` | `(value: unknown) => SealedCorpus`; throws on a non-object or unsupported `version`. |
744
744
  | `SEALED_CORPUS_VERSION` | Current corpus format version (`2`: adds `teamId`). |
745
745
  | `SUPPORTED_SEALED_CORPUS_VERSIONS` | Versions `parseSealedCorpus` loads (`[1, 2]`). |
package/SUPPORT.md ADDED
@@ -0,0 +1,50 @@
1
+ # Junction API (Mockingbird subset) — operation support
2
+
3
+ Generated from `openapi.yaml`; do not edit by hand.
4
+
5
+ - operations in spec: **40**
6
+ - supported by the mock: **40**
7
+ - parity enabled: **22**
8
+
9
+ | operationId | route | mock | parity | notes |
10
+ | --- | --- | --- | --- | --- |
11
+ | `get_teams_users_v2_user_get` | `GET /v2/user` | ✅ supported | ✅ | |
12
+ | `create_user_v2_user_post` | `POST /v2/user` | ✅ supported | ✅ | |
13
+ | `get_user_v2_user__user_id__get` | `GET /v2/user/{user_id}` | ✅ supported | ✅ | |
14
+ | `delete_user_v2_user__user_id__delete` | `DELETE /v2/user/{user_id}` | ✅ supported | ✅ | |
15
+ | `patch_user_v2_user__user_id__patch` | `PATCH /v2/user/{user_id}` | ✅ supported | ✅ | |
16
+ | `get_user_by_client_user_id_v2_user_resolve__client_user_id__get` | `GET /v2/user/resolve/{client_user_id}` | ✅ supported | ✅ | |
17
+ | `patch_user_info_v2_user__user_id__info_patch` | `PATCH /v2/user/{user_id}/info` | ✅ supported | ✅ | |
18
+ | `get_latest_user_info_user_v2_user__user_id__info_latest_get` | `GET /v2/user/{user_id}/info/latest` | ✅ supported | ✅ | |
19
+ | `get_paginated_lab_tests_for_team_v3_lab_test_get` | `GET /v3/lab_test` | ✅ supported | ✅ | |
20
+ | `get_team_lab_accounts_v3_lab_test_lab_account_get` | `GET /v3/lab_test/lab_account` | ✅ supported | ❌ disabled | lab-account inventory is fixture-owned; the mock models the documented shape, filters and routing rules, not a live account inventory |
21
+ | `get_lab_tests_for_team_v3_lab_tests_get` | `GET /v3/lab_tests` | ✅ supported | ✅ | |
22
+ | `get_lab_test_for_team_v3_lab_tests__lab_test_id__get` | `GET /v3/lab_tests/{lab_test_id}` | ✅ supported | ✅ | |
23
+ | `get_labs_v3_lab_tests_labs_get` | `GET /v3/lab_tests/labs` | ✅ supported | ✅ | |
24
+ | `get_markers_for_lab_test_v3_lab_tests__lab_test_id__markers_get` | `GET /v3/lab_tests/{lab_test_id}/markers` | ✅ supported | ✅ | |
25
+ | `list_order_set_markers_v3_lab_tests_list_order_set_markers_post` | `POST /v3/lab_tests/list_order_set_markers` | ✅ supported | ✅ | |
26
+ | `create_order_v3_order_post` | `POST /v3/order` | ✅ supported | ✅ | |
27
+ | `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 a mock cannot replicate per-zip; covered by the client-parity scenario shape checks instead |
28
+ | `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 mock cannot replicate per-zip; covered by the client-parity scenario shape checks instead |
29
+ | `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 mock-internal scheduling property suite instead |
30
+ | `get_phlebotomy_appointment_cancellation_reason_v3_order_phlebotomy_appointment_cancellation_reasons_get` | `GET /v3/order/phlebotomy/appointment/cancellation-reasons` | ✅ supported | ✅ | |
31
+ | `get_psc_appointment_availability_v3_order_psc_appointment_availability_post` | `POST /v3/order/psc/appointment/availability` | ✅ supported | ❌ disabled | availability slots are provider-side data whose values shift between sandbox calls; covered by the mock-internal scheduling property suite instead |
32
+ | `get_psc_appointment_cancellation_reason_v3_order_psc_appointment_cancellation_reasons_get` | `GET /v3/order/psc/appointment/cancellation-reasons` | ✅ supported | ✅ | |
33
+ | `get_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_get` | `GET /v3/order/{order_id}/phlebotomy/appointment` | ✅ supported | ❌ disabled | appointment payloads embed provider-side slot data; covered by the mock-internal scheduling property suite instead |
34
+ | `book_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_book_post` | `POST /v3/order/{order_id}/phlebotomy/appointment/book` | ✅ supported | ❌ disabled | booking depends on live provider slot state; covered by the mock-internal scheduling property suite instead |
35
+ | `reschedule_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_reschedule_patch` | `PATCH /v3/order/{order_id}/phlebotomy/appointment/reschedule` | ✅ supported | ❌ disabled | rescheduling depends on live provider slot state; covered by the mock-internal scheduling property suite instead |
36
+ | `cancel_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_cancel_patch` | `PATCH /v3/order/{order_id}/phlebotomy/appointment/cancel` | ✅ supported | ❌ disabled | cancellation depends on live provider appointment state; covered by the mock-internal scheduling property suite instead |
37
+ | `get_psc_appointment_v3_order__order_id__psc_appointment_get` | `GET /v3/order/{order_id}/psc/appointment` | ✅ supported | ❌ disabled | appointment payloads embed provider-side slot data; covered by the mock-internal scheduling property suite instead |
38
+ | `book_psc_appointment_v3_order__order_id__psc_appointment_book_post` | `POST /v3/order/{order_id}/psc/appointment/book` | ✅ supported | ❌ disabled | booking depends on live provider slot state; covered by the mock-internal scheduling property suite instead |
39
+ | `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 mock-internal scheduling property suite instead |
40
+ | `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 mock-internal scheduling property suite instead |
41
+ | `get_order_v3_order__order_id__get` | `GET /v3/order/{order_id}` | ✅ supported | ✅ | |
42
+ | `cancel_order_v3_order__order_id__cancel_post` | `POST /v3/order/{order_id}/cancel` | ✅ supported | ✅ | |
43
+ | `simulate_order_v3_order__order_id__test_post` | `POST /v3/order/{order_id}/test` | ✅ supported | ✅ | |
44
+ | `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 mock-internal results property suite instead |
45
+ | `get_result_metadata_v3_order__order_id__result_metadata_get` | `GET /v3/order/{order_id}/result/metadata` | ✅ supported | ✅ | |
46
+ | `get_result_pdf_v3_order__order_id__result_pdf_get` | `GET /v3/order/{order_id}/result/pdf` | ✅ supported | ❌ disabled | PDF bytes are provider-rendered; compared by shape (byteLength) only in the scenario script |
47
+ | `get_order_requisition_pdf_v3_order__order_id__requisition_pdf_get` | `GET /v3/order/{order_id}/requisition/pdf` | ✅ supported | ❌ disabled | PDF bytes are provider-rendered; compared by shape (byteLength) only in the scenario script |
48
+ | `get_orders_v3_orders_get` | `GET /v3/orders` | ✅ supported | ✅ | |
49
+ | `get_order_transaction_v3_order_transaction__transaction_id__get` | `GET /v3/order_transaction/{transaction_id}` | ✅ supported | ❌ disabled | order transactions are not available to the sandbox team (feature not available) |
50
+ | `get_order_transaction_result_v3_order_transaction__transaction_id__result_get` | `GET /v3/order_transaction/{transaction_id}/result` | ✅ supported | ❌ disabled | lab results are not available to the sandbox team (feature not available) |