Skip to content

fix(embed): conformance mock + TypeScript router vs the real Monad API [PRO-455] - #17

Open
Credgate wants to merge 2 commits into
feature/pro-402from
feature/pro-455
Open

fix(embed): conformance mock + TypeScript router vs the real Monad API [PRO-455]#17
Credgate wants to merge 2 commits into
feature/pro-402from
feature/pro-455

Conversation

@Credgate

@Credgate Credgate commented Aug 4, 2026

Copy link
Copy Markdown

Review of the Go router (#15) surfaced defects the TypeScript reference has too — and the conformance mock could not have caught any of them. It returned every row regardless of limit, and had no GET /v1/{org}/{kind}s/{id} route at all, so CI was green on a bug that bites the eleventh pipeline.

First of three stacked fix PRs (PRO-455 → PRO-456 → PRO-457), one per router. Every claim was validated against the API source in monad-inc/api, not the published spec — sdk/openapi.json is ~15 months stale.

Linear: PRO-455

The mock now reproduces the real API

  • pages every list at Monad's default limit of 10, with no maximum (api/pkg/routes/v2/routes/pipelines.go:727)
  • serves the connector detail route with component_of, pinned to the same narrow projection the datastore actually emits — no status, no nodes (core/pkg/datastore/postgres/pipelines.go:292). A too-generous mock here would let a router pass locally and fail live.
  • accepts type on output create, output_type staying a deprecated alias
  • tracks connectors statefully so a delete is observable

test_status_resolves_past_the_first_page_of_pipelines is the gate: it fails against the pre-fix routers and passes after.

TypeScript router

The same six fixes that follow for Go and Python, so the three stay identical on the wire. Detail is in the commit message; the two that matter:

  • pipeline resolution moves to component_of — the old scan sent no limit, so past a tenant's tenth pipeline it reported "not connected" for pipelines that exist
  • setEnabled PATCHes {enabled} alone. PATCH became a true partial update in api#2163; the read-modify-write it replaces rebuilt the graph from a partial field list, silently dropping node config_overrides and edge schema_detection_spec on every toggle.

Reviewer note

One behavior change worth a look: an unknown connector id now returns 404 not_found instead of 200 {hasPipeline:false}, since resolution goes through a connector fetch. test_ingress_lifecycle asserts the new shape after removal.

Verification

pnpm test 13/13, conformance ROUTER=ts 35/35 (ROUTER=go and ROUTER=python also green on this mock, unchanged).

…of [PRO-455]

The mock returned every row regardless of `limit` and had no
`GET /v1/{org}/{kind}s/{id}` route at all, so it could not catch two bugs the
routers actually have: they never send `limit` (Monad defaults it to 10) and
they walk the whole pipeline list to answer a question `component_of` answers
in one call.

- page every list at Monad's default limit of 10, with no maximum
- serve the connector detail route, including `component_of` — pinned to the
  same narrow projection the datastore emits (no `status`, no `nodes`)
- accept `type` on output create, `output_type` staying a deprecated alias
- track connectors statefully so a delete is observable
- add the >10-pipelines scenario; it fails against the pre-fix routers
…[PRO-455]

Review of the Go port (#15) surfaced defects the TypeScript reference has too.
Validated against the API source rather than the published spec, which is stale.

- resolve a connector's pipeline via `GET /v1/{org}/{kind}s/{id}`'s
  `component_of` instead of scanning every pipeline. The scan sent no `limit`,
  so past the tenant's tenth pipeline it reported "not connected" for pipelines
  that exist.
- `setEnabled` now PATCHes `{enabled}` alone. PATCH became a true partial update
  in api#2163; the read-modify-write it replaces silently dropped node
  `config_overrides` and edge `schema_detection_spec` on every toggle.
- drain the connector list instead of one `limit=1000` request
- send `type` on output create; `output_type` is deprecated (api#2156)
- drop the speculative `data` / `config` response-shape fallbacks — Monad
  returns neither
- map `kind` to its path segment explicitly rather than appending "s"
@Credgate
Credgate marked this pull request as draft August 4, 2026 17:10
@Credgate
Credgate marked this pull request as ready for review August 4, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant