Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/omnigraph-sdk-0171.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@modernrelay/orbit-omnigraph': patch
---

Upgrade the OmniGraph SDK to 0.17.1 and qualify export and stored-query search against server 0.17.1, retaining HTTP contract 0.14. Regenerate wire fixtures from the released server and exercise authenticated graph policy and the browser proxy in the live integration gate. Separate adapter export/search checks preserve warning-free loading on exact server releases 0.14.0 and 0.15.0 with the new SDK. Other server releases produce a warning rather than a version-only rejection.
16 changes: 9 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,22 @@ jobs:
node-version: 24
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Install OmniGraph 0.14.0
- name: Install recorded OmniGraph release
shell: bash
run: |
mkdir -p "$RUNNER_TEMP/omnigraph-0.14.0"
cd "$RUNNER_TEMP/omnigraph-0.14.0"
release_url=https://github.com/ModernRelay/omnigraph/releases/download/v0.14.0
version=$(node -p "require('./fixtures/omnigraph/recorded/manifest.json').serverVersion")
bin_dir="$RUNNER_TEMP/omnigraph-$version"
mkdir -p "$bin_dir"
cd "$bin_dir"
release_url="https://github.com/ModernRelay/omnigraph/releases/download/v$version"
curl --fail --location --retry 3 "$release_url/omnigraph-linux-x86_64.tar.gz" -o omnigraph-linux-x86_64.tar.gz
curl --fail --location --retry 3 "$release_url/omnigraph-linux-x86_64.sha256" -o omnigraph-linux-x86_64.sha256
sha256sum --check omnigraph-linux-x86_64.sha256
tar -xzf omnigraph-linux-x86_64.tar.gz
"$RUNNER_TEMP/omnigraph-0.14.0/omnigraph" version
"$bin_dir/omnigraph" version
{
echo "OMNIGRAPH_BIN=$RUNNER_TEMP/omnigraph-0.14.0/omnigraph"
echo "OMNIGRAPH_SERVER_BIN=$RUNNER_TEMP/omnigraph-0.14.0/omnigraph-server"
echo "OMNIGRAPH_BIN=$bin_dir/omnigraph"
echo "OMNIGRAPH_SERVER_BIN=$bin_dir/omnigraph-server"
} >> "$GITHUB_ENV"
- name: Install Playwright Chromium
timeout-minutes: 15
Expand Down
41 changes: 33 additions & 8 deletions apps/demo/e2e/omnigraph.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Live OmniGraph 0.14 integration. The fixture script creates a fresh local
* Live OmniGraph integration. The fixture script creates a fresh local
* cluster, seeds it through HTTP, and owns its server until teardown.
* Optional locally; OMNIGRAPH_LIVE_REQUIRED=1 makes missing binaries fail CI.
*/
Expand All @@ -10,10 +10,10 @@ import { readFileSync } from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';

import { Omnigraph } from '@modernrelay/omnigraph';
import { createGraphInstance } from '@modernrelay/orbit-core';
import { FakeEngine } from '@modernrelay/orbit-core/testing';
import { createOmnigraphSearchService, createOmnigraphSource, encodeSourceId } from '@modernrelay/orbit-omnigraph';
import { createOmnigraphServerClient } from '@modernrelay/orbit-omnigraph/server';
import { expect, test } from '@playwright/test';
import type { Page } from '@playwright/test';

Expand All @@ -22,22 +22,25 @@ const CLI = process.env.OMNIGRAPH_BIN || 'omnigraph';
const SERVER = process.env.OMNIGRAPH_SERVER_BIN || 'omnigraph-server';
const BASE = 'http://127.0.0.1:8199';
const REQUIRED = process.env.OMNIGRAPH_LIVE_REQUIRED === '1';
const cliVersion = spawnSync(CLI, ['version'], { encoding: 'utf8' });
const AVAILABLE = cliVersion.status === 0 && cliVersion.stdout.split('\n').includes('omnigraph 0.14.0') &&
spawnSync(SERVER, ['--help'], { stdio: 'ignore' }).status === 0;
const SKIP_REASON = 'Set OMNIGRAPH_BIN and OMNIGRAPH_SERVER_BIN to the pinned 0.14.0 binaries; OMNIGRAPH_LIVE_REQUIRED=1 requires the live test.';
const TOKEN = process.env.OMNIGRAPH_FIXTURE_TOKEN;
const READY_DOT = '[data-testid="status-dot"][title="ready"]';
const NODE_COUNT = '[data-testid="node-count"]';
const EDGE_COUNT = '[data-testid="edge-count"]';
const TYPE_LABEL = /^(Actor|Decision|Trace|Signal|Artifact) · .+/;
const fmt = (n: number): string => n.toLocaleString('en-US');

interface RecordedManifest {
serverVersion: string;
graphId: string;
branch: string;
rowCounts: Record<string, number>;
}
const manifest = JSON.parse(readFileSync(path.join(ROOT, 'fixtures/omnigraph/recorded/manifest.json'), 'utf8')) as RecordedManifest;
const cliVersion = spawnSync(CLI, ['version'], { encoding: 'utf8' });
const AVAILABLE = cliVersion.status === 0 && cliVersion.stdout.split(/\r?\n/).includes(`omnigraph ${manifest.serverVersion}`) &&
spawnSync(SERVER, ['--help'], { stdio: 'ignore' }).status === 0;
const SKIP_REASON = `Set OMNIGRAPH_BIN and OMNIGRAPH_SERVER_BIN to the pinned ${manifest.serverVersion} binaries. OMNIGRAPH_LIVE_REQUIRED=1 requires the live test.`;

function tableTotal(m: RecordedManifest, prefix: 'node:' | 'edge:'): number {
return Object.entries(m.rowCounts).filter(([key]) => key.startsWith(prefix)).reduce((sum, [, count]) => sum + count, 0);
}
Expand All @@ -50,6 +53,7 @@ test.skip(!AVAILABLE && !REQUIRED, SKIP_REASON);
test.beforeAll(async () => {
test.setTimeout(60_000);
if (!AVAILABLE) throw new Error(SKIP_REASON);
if (!TOKEN) throw new Error('Playwright config must provide the fixture reader token');
fixture = spawn(process.execPath, [path.join(ROOT, 'scripts/omnigraph-fixture.mjs'), '--serve'], {
cwd: ROOT, env: { ...process.env, OMNIGRAPH_FIXTURE_PORT: '8199' }, stdio: ['ignore', 'pipe', 'pipe'],
});
Expand All @@ -74,15 +78,16 @@ test.afterAll(async () => {
});

test('live export and stored search share system identity while retaining user id data', async () => {
const client = new Omnigraph({ baseUrl: BASE });
if (!TOKEN) throw new Error('Missing fixture token');
const client = createOmnigraphServerClient({ baseUrl: BASE, token: TOKEN });
const search = createOmnigraphSearchService({
client, graphId: 'demo', queryName: 'search_signals', typeOf: { s: 'Signal' },
labelColumn: 's.title', params: (q) => ({ q }),
});
const instance = createGraphInstance({ engine: () => new FakeEngine(), services: { search } });
try {
const loaded = await createOmnigraphSource({ client, graphId: 'demo' }).load(instance);
expect(loaded.serverVersion).toBe('0.14.0');
expect(loaded.serverVersion).toBe(manifest.serverVersion);
expect(loaded.counts).toMatchObject({ nodes: 300, edges: 500 });
expect(loaded.warnings).toEqual([]);
const id = encodeSourceId('Signal', 'signal-001');
Expand All @@ -97,6 +102,18 @@ test('live export and stored search share system identity while retaining user i
} finally { instance.destroy(); }
});

test('live graph reads require credentials and an applied graph policy', async () => {
const anonymous = await fetch(`${BASE}/graphs/demo/schema`, {
headers: { 'Omnigraph-Http-Api': '0.14' },
});
expect(anonymous.status).toBe(401);
const denied = await fetch(`${BASE}/graphs/ungranted/schema`, {
headers: { 'Omnigraph-Http-Api': '0.14', Authorization: `Bearer ${TOKEN}` },
});
expect(denied.status).toBe(403);
expect(await denied.json()).toMatchObject({ code: 'forbidden', disposition: { effects: 'none' } });
});

/** Sweep a grid around the viewport center until the status bar shows an
* omnigraph hover label (hit-testing exact node centers under a live force
* layout is flaky — same hunt strategy as the ingestion spec's right-click). */
Expand All @@ -122,6 +139,12 @@ test('load from omnigraph → meter completes → counts match manifest → type
}, testInfo) => {
const nodeTotal = tableTotal(manifest, 'node:');
const edgeTotal = tableTotal(manifest, 'edge:');
const browserGraphAuth: Array<string | undefined> = [];
page.on('request', (request) => {
if (new URL(request.url()).pathname.startsWith('/og/graphs/')) {
browserGraphAuth.push(request.headers().authorization);
}
});

await page.goto('/');
await page.waitForSelector(READY_DOT, { timeout: 60_000 });
Expand Down Expand Up @@ -153,6 +176,8 @@ test('load from omnigraph → meter completes → counts match manifest → type
await expect(page.getByTestId('og-count-summary')).toHaveText(
`${fmt(nodeTotal)} nodes · ${fmt(edgeTotal)} edges`,
);
expect(browserGraphAuth.length).toBeGreaterThan(0);
expect(browserGraphAuth.every((auth) => auth === undefined)).toBe(true);

// --- hover a node: the status bar shows a type-derived label ---
await page.waitForSelector(READY_DOT, { timeout: 30_000 });
Expand Down
2 changes: 1 addition & 1 deletion apps/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"e2e": "playwright test"
},
"dependencies": {
"@modernrelay/omnigraph": "0.14.0",
"@modernrelay/omnigraph": "0.17.1",
"@modernrelay/orbit-core": "workspace:*",
"@modernrelay/orbit-data": "workspace:*",
"@modernrelay/orbit-omnigraph": "workspace:*",
Expand Down
12 changes: 9 additions & 3 deletions apps/demo/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { randomUUID } from 'node:crypto';

import { defineConfig } from '@playwright/test';

// Shared by the fixture owner, worker and server-side proxy; never browser code.
const fixtureToken = process.env.OMNIGRAPH_FIXTURE_TOKEN ??= randomUUID();

/**
* Selection-workbench interaction smoke suite.
*
Expand Down Expand Up @@ -38,10 +43,11 @@ export default defineConfig({
},
webServer: {
command: 'pnpm exec vite --host 127.0.0.1 --port 5199 --strictPort',
env: { OMNIGRAPH_PROXY_TOKEN: fixtureToken, OMNIGRAPH_PROXY_TARGET: 'http://127.0.0.1:8199' },
url: 'http://127.0.0.1:5199',
// CI must always exercise this checkout, never an unrelated process that
// happened to bind the demo port first.
reuseExistingServer: !process.env.CI,
// Own the proxy as well as the fixture: an existing dev server may hold a
// different token, even during optional local OmniGraph tests.
reuseExistingServer: false,
timeout: 30_000,
},
});
15 changes: 9 additions & 6 deletions apps/demo/src/omnigraphPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* proxy forwards them to `http://127.0.0.1:8199` with the prefix stripped:
* the same-origin BFF pattern. That gives the SDK client constructed here a
* safe same-origin transport (the demo is the host app and supplies no token;
* `OmnigraphOptions.token` is optional and the fixture server runs
* `--unauthenticated`), which is exactly what the adapter's browser entry
* `OmnigraphOptions.token` is optional and the proxy adds the fixture's
* reader token server-side), which is exactly what the adapter's browser entry
* accepts. Authenticated construction stays confined to
* `@modernrelay/orbit-omnigraph/server`.
*
Expand Down Expand Up @@ -338,12 +338,15 @@ export function OmnigraphPanel({ form, onFormChange, meter, result, error, onLoa
{error}
{CONNECTION_ERROR.test(error) && (
<div style={S.ogHint}>
graph server unreachable — start a fresh local 0.14 fixture:{' '}
Set a disposable{' '}
<code style={S.ogCode}>OMNIGRAPH_FIXTURE_TOKEN</code> and start{' '}
<code style={S.ogCode}>
node scripts/omnigraph-fixture.mjs --serve
</code>{' '}
(set <code style={S.ogCode}>OMNIGRAPH_BIN</code> and{' '}
<code style={S.ogCode}>OMNIGRAPH_SERVER_BIN</code> to the 0.14.0 binaries)
</code>. Start the demo with{' '}
<code style={S.ogCode}>OMNIGRAPH_PROXY_TOKEN</code> set to the same
value. If the fixture binaries are outside PATH, set{' '}
<code style={S.ogCode}>OMNIGRAPH_BIN</code> and{' '}
<code style={S.ogCode}>OMNIGRAPH_SERVER_BIN</code> to their paths.
</div>
)}
</div>
Expand Down
57 changes: 37 additions & 20 deletions fixtures/omnigraph/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
# OmniGraph 0.14 integration fixtures
# OmniGraph 0.17.1 integration fixtures

These are verbatim HTTP bodies recorded from the official **OmniGraph 0.14.0**
server. Adapter tests replay them through the real TypeScript SDK. The live
integration tests also start a fresh local server and exercise both the adapter
and the demo's same-origin `/og` proxy.
These are verbatim HTTP bodies recorded from the official **OmniGraph 0.17.1**
server using HTTP contract **0.14**. Adapter tests replay them through TypeScript
SDK **0.17.1**. Live integration tests start a fresh local server and exercise
both the adapter and the demo's same-origin `/og` proxy.

Qualification with the published SDK 0.17.1 on 2026-11-28:

| Official server | Verified scope |
| --- | --- |
| 0.17.1 | Current recordings and CI: authenticated adapter export/search, default-deny policy and browser proxy loading |
| 0.14.0, 0.15.0 | Separate fresh-fixture adapter export/search checks, stable heads, identity and nullable/date normalization; no historical browser or recurring CI coverage |

## Contents

| Path | Purpose |
| --- | --- |
| `cluster/cluster.yaml` | One graph, `demo`, with a stored search query and no credentials or policies |
| `cluster/cluster.yaml` | `demo` with a stored search query; empty `ungranted` with no policy to check default-deny |
| `cluster/graph.policy.yaml` | Separate loader and reader actors; the reader has `read`, `export`, and `invoke_query` only on `demo` |
| `cluster/demo.pg` | Five node types and six edge types; dates, enums, numeric values, nullable properties, and a nullable user property named `Signal.id` |
| `cluster/queries.gq` | `search_signals`: ordered whole-node and title projections, bounded to ten rows |
| `seed.ndjson` | Deterministic 300-node, 500-edge seed, including hostile strings, Unicode, `Number.MAX_SAFE_INTEGER`, and parallel edges |
Expand Down Expand Up @@ -49,29 +57,34 @@ and the demo's same-origin `/og` proxy.

## Regenerate or serve locally

Install the official 0.14.0 CLI and server in a separate directory. Release
archives and their SHA256 files are available in the
[0.14.0 release](https://github.com/ModernRelay/omnigraph/releases/tag/v0.14.0).
The script checks the exact CLI and running server versions and fails if they
are missing or incompatible.
Use the official 0.17.1 CLI and server. The fixture script checks both versions.
Download the archive and SHA256 checksum for your platform from the
[OmniGraph 0.17.1 release](https://github.com/ModernRelay/omnigraph/releases/tag/v0.17.1).

```sh
export OMNIGRAPH_BIN=/path/to/omnigraph-0.14.0/omnigraph
export OMNIGRAPH_SERVER_BIN=/path/to/omnigraph-0.14.0/omnigraph-server
# Optional if both binaries are already on PATH.
export OMNIGRAPH_BIN=/path/to/omnigraph-0.17.1/omnigraph
export OMNIGRAPH_SERVER_BIN=/path/to/omnigraph-0.17.1/omnigraph-server

# Regenerate seed + recordings, then stop and remove the temporary cluster.
node scripts/omnigraph-fixture.mjs

# Serve a fresh seeded fixture for the demo until Ctrl-C; no files regenerated.
export OMNIGRAPH_FIXTURE_TOKEN=$(node -p 'crypto.randomUUID()')
node scripts/omnigraph-fixture.mjs --serve

# In another terminal with the same fixture token, start the authenticated proxy.
OMNIGRAPH_PROXY_TOKEN="$OMNIGRAPH_FIXTURE_TOKEN" pnpm demo:dev
```

Each invocation copies the declaration into a unique temporary directory and
creates its own operator configuration with an anonymous loopback server target.
It validates/lints the source, plans and applies to an explicit local root target, releases the exact
bootstrap writer lock after that process completes, starts the server, waits
for `/readyz`, and loads the seed through the served target. No operator defaults
or credentials from the host are used. It never opens or
creates its own operator configuration. It validates/lints the source, plans and
applies to an explicit local root target, and verifies that successful bootstrap
released its lock before starting the server. It waits for `/readyz` and loads
the seed once through authenticated `POST /load/ndjson`. The fixture uses a
private random writer token and a separate reader token; recording generates
both, while `--serve` requires `OMNIGRAPH_FIXTURE_TOKEN` for the reader. No operator
defaults or production credentials from the host are used. It never opens or
wipes an existing graph. Shutdown waits for the owned server to exit before
removing that temporary directory. The default bind address is
`127.0.0.1:8199`; `OMNIGRAPH_FIXTURE_PORT` changes the port. An occupied port fails
Expand All @@ -97,6 +110,10 @@ OMNIGRAPH_LIVE_REQUIRED=1 pnpm --filter orbit-demo exec playwright test e2e/omni

The spec owns fixture startup and teardown. It checks real export/search identity,
ordinary `id` data, nullable/date normalization, and browser loading through the
demo proxy. The dedicated CI job downloads the checksum-verified 0.14.0 Linux
release and requires both live tests; missing binaries fail that job. Other
demo proxy. It also verifies that anonymous graph reads fail and that a valid
reader token cannot read the graph without a policy. Playwright generates the
disposable reader token and supplies it only to the fixture and server-side proxy;
browser requests carry no bearer token. Playwright starts its own Vite proxy,
so stop any existing demo on port 5199 before running these tests. The dedicated CI job downloads the
checksum-verified 0.17.1 Linux release and requires all three live tests; missing binaries fail that job. Other
local/demo runs may skip this spec when the pinned binaries are unavailable.
10 changes: 8 additions & 2 deletions fixtures/omnigraph/cluster/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# graph ("demo"). scripts/omnigraph-fixture.mjs copies this declaration into
# a fresh temporary root, applies it, then serves that isolated cluster.
#
# Deliberately minimal: no embedding provider or Cedar policies;
# the stored read query exercises search identity.
# The reader can export and invoke stored queries only on demo. The empty
# ungranted graph has no policy and exercises default-deny for a valid token.
version: 1
metadata:
name: orbit-fixture
Expand All @@ -14,3 +14,9 @@ graphs:
demo:
schema: demo.pg
queries: queries.gq
ungranted:
schema: demo.pg
policies:
demo-access:
file: graph.policy.yaml
applies_to: [demo]
13 changes: 13 additions & 0 deletions fixtures/omnigraph/cluster/graph.policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 1
groups:
loaders: [fixture-bot]
readers: [fixture-reader]
rules:
- id: seed-fixture
allow:
actors: { group: loaders }
actions: [read, change]
- id: read-fixture
allow:
actors: { group: readers }
actions: [read, export, invoke_query]
2 changes: 1 addition & 1 deletion fixtures/omnigraph/recorded/commits.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"commits":[{"graph_commit_id":"hb1.01M5MP45JC4C435R73CJ95BR6H.1.01M5MP45JC4C435R73CJ95BR6H","graph_branch":null,"graph_manifest_version":2,"parent_commit_id":"01M5MP450DGNQ3MJB1CKF0R5P9","merged_parent_commit_id":null,"actor_id":null,"created_at":1792769398348219,"published":true,"kind":"published","root_commit_id":null}],"head_commit_id":"hb1.01M5MP45JC4C435R73CJ95BR6H.1.01M5MP45JC4C435R73CJ95BR6H","next_page_token":"eyJ2ZXJzaW9uIjoxLCJraW5kIjoiY29tbWl0LWxpc3QtcGFnZSIsImdyYXBoX2lkZW50aXR5IjoiTXktYXY3bkR5R1QteUJZZkdjODM0UFJCQ3hoYUN4OVZacUpvMjM0SkRRZyIsImJyYW5jaCI6IkVwRTZqTFRUYzE0QURucFFhNWF5VW5DUHFjQkhmUTJRaXA0MEo4YzkxRGMiLCJoZWFkX2NvbW1pdF9pZCI6ImhiMS4wMU01TVA0NUpDNEM0MzVSNzNDSjk1QlI2SC4xLjAxTTVNUDQ1SkM0QzQzNVI3M0NKOTVCUjZIIiwibmV4dF9jb21taXRfaWQiOiIwMU01TVA0NTBER05RM01KQjFDS0YwUjVQOSIsImJlbG93X2dlbmVyYXRpb24iOjF9uBwd4HcVMUrEfXHXHtosNyZ4Er09hVCp9W-0WliBxjA"}
{"commits":[{"graph_commit_id":"hb1.01M8H65HAATECQ23R02K9HES5K.1.01M8H65HAATECQ23R02K9HES5K","graph_branch":null,"graph_manifest_version":2,"parent_commit_id":"01M8H65H73WMG47FFP8BZ427CY","merged_parent_commit_id":null,"actor_id":"fixture-bot","created_at":1795873228106331,"published":true,"kind":"published","root_commit_id":null}],"head_commit_id":"hb1.01M8H65HAATECQ23R02K9HES5K.1.01M8H65HAATECQ23R02K9HES5K","next_page_token":"eyJ2ZXJzaW9uIjoxLCJraW5kIjoiY29tbWl0LWxpc3QtcGFnZSIsImdyYXBoX2lkZW50aXR5Ijoic0NBbXBKTzZfZGdpZHUyWGdQQ3VzSjE4U05Ob3RrN1FaU2Qwc012MDhiSSIsImJyYW5jaCI6IkVwRTZqTFRUYzE0QURucFFhNWF5VW5DUHFjQkhmUTJRaXA0MEo4YzkxRGMiLCJoZWFkX2NvbW1pdF9pZCI6ImhiMS4wMU04SDY1SEFBVEVDUTIzUjAySzlIRVM1Sy4xLjAxTThINjVIQUFURUNRMjNSMDJLOUhFUzVLIiwibmV4dF9jb21taXRfaWQiOiIwMU04SDY1SDczV01HNDdGRlA4Qlo0MjdDWSIsImJlbG93X2dlbmVyYXRpb24iOjF9gsM9r8X6bPOVkKgIlOL5c96oRGZBN_BXE3exYGpilaU"}
2 changes: 1 addition & 1 deletion fixtures/omnigraph/recorded/health.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"status":"ok","version":"0.14.0","internal_schema_version":16,"source_version":"60bfd19db780fdff3a5178f959c1204143420114"}
{"status":"ok","version":"0.17.1","internal_schema_version":18,"source_version":"5b40a68fc0b29c664b8bc63eae31b2757b0f0f23"}
Loading
Loading