Skip to content

sdk: migrate to omnigraph-server v0.6.0 (graphs, query/mutate, multi-graph) - #8

Merged
ragnorc merged 2 commits into
mainfrom
ragnorc/check-main-sdk-migration-impact
May 30, 2026
Merged

sdk: migrate to omnigraph-server v0.6.0 (graphs, query/mutate, multi-graph)#8
ragnorc merged 2 commits into
mainfrom
ragnorc/check-main-sdk-migration-impact

Conversation

@ragnorc

@ragnorc ragnorc commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Brings @modernrelay/omnigraph from omnigraph-server 0.4.2 → 0.6.0. v0.6 reshapes the SDK contract in three places at once: a new flat management endpoint (GET /graphs) plus MethodNotAllowedError (HTTP 405) on single-graph mode; multi-graph cluster routing under /graphs/{id}/... modeled as a transport prefix knob; and (today's upstream PR #110) canonical POST /query / POST /mutate plus a ChangeRequest field rename that ripples into a breaking TS API change.

What changed

SDK (@modernrelay/omnigraph)

  • og.graphs.list() against flat GET /graphs; new GraphInfo / GraphList public types.
  • new Omnigraph({ baseUrl, graphId: "alpha" }) and og.graph(id) for multi-graph clusters. Transport rewrites graph-scoped paths under /graphs/{encodeURIComponent(id)}/... and exempts the flat paths /healthz and /graphs. Single-graph behaviour is unchanged.
  • MethodNotAllowedError mapped from code: "method_not_allowed" / HTTP 405.
  • SchemaApplyInput.allowDataLoss?: boolean (camelized from the regenerated spec).
  • PR #110 surface: og.query() (POST /query) and og.mutate() (POST /mutate) as the canonical successors; og.read() / og.change() carry @deprecated JSDoc explaining the Deprecation + Link: rel="successor-version" response headers the server emits.
  • Breaking at the TS layer: ChangeInput field rename querySource → query, queryName → name (mirrors the upstream ChangeRequest rename; the server still accepts both via serde aliases, so the wire is byte-stable). ReadInput is unchanged.

MCP (@modernrelay/omnigraph-mcp)

  • OMNIGRAPH_GRAPH_ID env var + CreateServerOptions.graphId thread the graph id through to the client.
  • New tools graphs_list, query, mutate; new resource omnigraph://graphs. Legacy read / change tools are retitled with deprecation notes; change's input schema is renamed to query / name to match the SDK.

Docs

  • SDK README: multi-graph clusters section, v0.6 auth states (Open / DefaultDeny / PolicyEnabled), unauthenticated-must-be-explicit, token-without-policy default-denies non-read, allowDataLoss, query / mutate migration callout.
  • MCP README: OMNIGRAPH_GRAPH_ID, new tools / resources documented; legacy tools tagged.

E2E

  • Single-graph workflow writes a Cedar policy + omnigraph.yaml and starts the server via --target e2e --config so non-read actions are authorized — necessary because v0.6 moved tokens-without-policy from permissive to DefaultDeny.
  • New e2e-multigraph job: initializes alpha + beta graphs with a server-level policy + per-graph policies, runs the multi-graph SDK suite (gated by OMNIGRAPH_E2E_MULTIGRAPH=1).

Validation

Verified end-to-end against a locally-built v0.6 omnigraph-server in both modes:

  • Single-graph: 81 unit + 19 e2e + a 26-case comprehensive endpoint driver — all pass.
  • Multi-graph: 103 tests + 27-case driver — all pass, including og.graphs.list() returning [alpha, beta] and og.graph("beta").snapshot() routing under /graphs/beta/....
  • pnpm run check-coverage: 17 SDK call sites ↔ 17 spec operations (was 15 ↔ 15 pre-v0.6).
  • One upstream-side finding surfaced and verified at the wire level: duplicate POST /branches returns 500 internal (Lance "Clone operation should not enter build_manifest") instead of the documented 409 conflict. The SDK maps the wire correctly; worth a follow-up issue against ModernRelay/omnigraph.

Expected-red until upstream cuts v0.6.0

  • pnpm run check-drift fails with a 404 against https://raw.githubusercontent.com/ModernRelay/omnigraph/v0.6.0/openapi.json.
  • Both e2e jobs fail at the binary-download step (the v0.6.0 release asset doesn't exist yet).

The wire surface itself is fully validated; both go green automatically once the upstream tag publishes.

Test plan

  • pnpm run check-coverage — 17/17.
  • pnpm run typecheck — clean.
  • pnpm -r run test — 81 SDK + 12 MCP unit, all pass.
  • OMNIGRAPH_E2E=1 + live server, single-graph — 100/100.
  • OMNIGRAPH_E2E=1 OMNIGRAPH_E2E_MULTIGRAPH=1 OMNIGRAPH_GRAPH_ID=alpha + live server, multi-graph — 103/103 (1 single-graph-only case correctly gated off).
  • pnpm run build — clean.
  • pnpm run check-drift — expected red until upstream cuts v0.6.0.
  • CI e2e jobs — expected red until upstream cuts v0.6.0.

Note

Medium Risk
Large API and auth-behavior shift (Cedar default-deny, breaking TS mutation field names for new code) with broad transport and CI changes; legacy paths preserved on the wire but consumers must migrate and configure policies correctly.

Overview
Bumps the repo to omnigraph-server v0.6.0 (pinned spec, SDK, and MCP all at 0.6.0) and aligns the TypeScript client and MCP server with the new API surface.

The SDK adds og.query() / og.mutate() as the canonical read/write paths; og.read() / og.change() stay as deprecated aliases, with og.change() normalizing legacy querySource/queryName or canonical query/name onto the v0.6 wire body. Multi-graph support uses optional graphId, og.graph(id), and transport rewriting to /graphs/{id}/... while /healthz and GET /graphs stay flat; og.graphs.list() maps single-graph 405 to MethodNotAllowedError. schema.apply gains optional allowDataLoss.

MCP mirrors the same: OMNIGRAPH_GRAPH_ID, tools query, mutate, graphs_list, resource omnigraph://graphs, and legacy read/change with dual input shapes on change.

CI/release adds pnpm run check-versions, stale checks for packages/mcp/src/version.gen.ts, and e2e that boots v0.6 with Cedar policies + omnigraph.yaml (token default-deny) plus a new e2e-multigraph job for alpha/beta routing.

Reviewed by Cursor Bugbot for commit fe5a2cc. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Migrates @modernrelay/omnigraph to omnigraph-server v0.6.0 with multi-graph routing, canonical POST /query and POST /mutate, and a flat graphs registry. Adds CI guards to enforce the v0.6 pin and keep SDK/MCP versions in sync; single-graph behavior remains unchanged by default.

  • New Features

    • Multi-graph: new Omnigraph({ graphId }) and og.graph(id); transport rewrites to /graphs/{id}/... while /healthz and /graphs stay flat.
    • Graphs registry: og.graphs.list() for GET /graphs; single-graph returns 405 mapped to MethodNotAllowedError.
    • Canonical endpoints: og.query() and og.mutate(); og.read()/og.change() deprecated. Type rename: querySourcequery, queryNamename (wire remains compatible).
    • Schema: SchemaApplyInput.allowDataLoss?: boolean.
    • MCP (@modernrelay/omnigraph-mcp): supports OMNIGRAPH_GRAPH_ID; adds tools graphs_list, query, mutate and resource omnigraph://graphs; legacy tools kept with deprecation notes. Reports MCP package version in initialize.
  • Migration

    • Move from og.readog.query and og.changeog.mutate; update inputs to query/name.
    • For multi-graph clusters set graphId or use og.graph(id); do not include /graphs/{id} in baseUrl.
    • Handle MethodNotAllowedError when calling og.graphs.list() against single-graph servers.
    • CI/release: versions must match the pinned server; pnpm run check-versions enforces alignment, and pnpm run gen-version now generates SDK and MCP version files.

Written for commit fe5a2cc. Summary will update on new commits.

Review in cubic

- Bump serverVersion pin 0.4.2 -> 0.6.0; resync spec/openapi.json from
  upstream main (includes today's PR #110 + PR #119 multi-graph).
- Expose og.graphs.list() on flat GET /graphs; add GraphsResource.
- Multi-graph routing via OmnigraphOptions.graphId and og.graph(id):
  Transport rewrites graph-scoped paths to /graphs/{id}/..., leaves
  /healthz and /graphs flat.
- Add MethodNotAllowedError mapped from HTTP 405 / code:method_not_allowed.
- SchemaApplyInput auto-gains allowDataLoss (Camelize over the spec).
- PR #110 follow-up: add og.query() (POST /query) and og.mutate()
  (POST /mutate); mark og.read()/og.change() @deprecated. ChangeInput
  field rename (querySource->query, queryName->name) is intentional and
  breaking at the TS layer; wire still works via serde aliases.
- MCP package: expose graphId, register graphs_list tool +
  omnigraph://graphs resource, add canonical query/mutate tools,
  retitle legacy read/change tools, read OMNIGRAPH_GRAPH_ID env.
- READMEs: multi-graph clusters section, v0.6 auth states
  (Open / DefaultDeny / PolicyEnabled), allowDataLoss, query/mutate
  migration callout, MethodNotAllowedError.
- E2E workflow: single-graph job writes a Cedar policy and starts via
  --target/--config so non-read actions are authorized in v0.6.
  New e2e-multigraph job initializes alpha+beta graphs and runs the
  multi-graph SDK suite (gated by OMNIGRAPH_E2E_MULTIGRAPH=1).
- Tests: 81 unit + 19 single-graph e2e + 4 multi-graph e2e — all green
  against a locally-built omnigraph-server v0.6.0. check-coverage now
  binds 17 SDK call sites to 17 spec operations.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e8a6b9ea00

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/mcp/src/server.ts Outdated
Comment on lines +309 to +314
inputSchema: {
query: z.string().min(1),
name: z.string().optional(),
params: z.record(z.unknown()).optional(),
branch: z.string().optional(),
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve legacy change tool inputs

For existing MCP clients that still call the legacy change tool with its previously documented querySource / queryName arguments, this new schema rejects the request before it reaches the server because query is now required. Since the tool is kept as a legacy alias and the server still accepts the old wire fields, this breaks backward compatibility for current MCP integrations; accept both shapes here (or keep the old schema on change) and translate to the canonical SDK call.

Useful? React with 👍 / 👎.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 6 additional findings.

Open in Devin Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 25 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/mcp/src/server.ts
@ragnorc
ragnorc merged commit 084a50c into main May 30, 2026
5 checks passed
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