fix(embed): Python router vs the real Monad API [PRO-457] - #19
Open
Credgate wants to merge 11 commits into
Open
Conversation
…[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"
…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
Addresses the review on #15. Each item was validated against the API source rather than the published spec, which is ~15 months 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`, and Monad defaults it to 10 — past a tenant's tenth pipeline the router reported "not connected" for pipelines that exist. Also turns an O(n) request fan-out into two calls. - `setEnabled` now PATCHes `{enabled}` alone. PATCH became a true partial update in api#2163; the read-modify-write it replaces rebuilt the whole graph from a partial field list, silently dropping node `config_overrides` and edge `schema_detection_spec` on every toggle. - drain the connector list rather than one `limit=1000` request - send `type` on output create; `output_type` is deprecated (api#2156) - drop the speculative `data` / `config` response-shape fallbacks — the list returns only `{pipelines, pagination}` and the detail is flat - `componentKind` type with an explicit path mapping, replacing `kind + "s"` - inline `url.PathEscape` instead of the one-letter `esc` alias - README: document `GetCustomerOrgID` as the tenant-isolation boundary
…-457]
Ports the fixes from the Go and TypeScript routers so all three stay
contract-identical on the wire.
- resolve a connector's pipeline via `component_of` instead of scanning every
pipeline; the scan sent no `limit` and Monad defaults it to 10
- `set_enabled` PATCHes `{enabled}` alone now that PATCH is a true partial
update, instead of rebuilding and replacing the node/edge graph
- drain the connector list rather than one `limit=1000` request
- send `type` on output create; `output_type` is deprecated
- drop the speculative `data` / `config` response-shape fallbacks
- map `kind` to its path segment explicitly rather than appending "s"
Credgate
requested review from
alastaird-monad,
andrewc-monad,
brenth-monad,
mattj-monad,
mon-aneesh and
saikapuluru99
as code owners
August 4, 2026 16:39
…[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"
# Conflicts: # routers/typescript/src/monad.ts
# Conflicts: # routers/typescript/src/monad.ts
Credgate
marked this pull request as draft
August 4, 2026 17:10
Credgate
marked this pull request as ready for review
August 4, 2026 18:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the fixes from #17 (TypeScript) and #18 (Go) so all three routers stay contract-identical on the wire. Same defects, found by the review on #15 and validated against the API source in
monad-inc/api.Third of three stacked fix PRs. Stacked on #18 (PRO-456) — review/merge bottom-up; the upstream commits drop out of this diff as each merges.
Linear: PRO-457
What changed
pipeline_forresolves a connector's pipeline viacomponent_ofinstead of scanning every pipeline. The scan sent nolimitand Monad defaults it to 10, so past a tenant's tenth pipeline it reported "not connected" for pipelines that exist.set_enabledPATCHes{enabled}alone now that PATCH is a true partial update, instead of rebuilding and replacing the node/edge graph — which silently dropped nodeconfig_overridesand edgeschema_detection_spec.limit=1000request.typeon output create;output_typeis deprecated.data/configresponse-shape fallbacks are gone — Monad returns neither.kindmaps to its path segment explicitly rather than by appending"s".Behavior change
An unknown connector id now returns
404 not_foundrather than200 {hasPipeline:false}, matching the other two routers.Verification
Router unit tests 11/11; conformance
ROUTER=python35/35, andROUTER=go/ROUTER=tsalso green on this branch — all three drive the same suite.