omnigraph/crates/omnigraph-cli/src
Andrew Altshuler d32c1ac191
refactor(cli): collapse write/query forks onto GraphClient (RFC-009 Phase 3b) (#211)
Phase 3a put the GraphClient enum in place and collapsed the five uniform
read forks. 3b folds the remaining data-plane forks onto the same enum:
load, ingest, mutate, query, branch create/delete/merge, and schema apply.

The wrinkle 3a deferred was the local policy attachment. Reads and query
open the local engine without a policy; writes open through
open_local_db_with_policy and attribute a resolved actor. So the Embedded
variant grows an optional policy context (graph/actor) filled by a second
factory, resolve_with_policy; resolve() leaves it empty. open_embedded
picks the open path from whether the context is present, preserving both
of today's behaviors exactly. query still uses resolve() (no policy), as
the read path did.

apply_schema takes the catalog-validator closure as impl FnOnce(&Catalog)
— the embedded arm runs it inside apply_schema_as_with_catalog_check, the
remote arm ignores it (the server runs its own check). That non-object-safe
closure is why GraphClient is an enum, not a trait. The stored-query
registry is still built caller-side and only for the local path.

load and ingest stay separate methods: same operation, but load surfaces
the CLI LoadOutput (two distinct per-arm mappings preserved) while ingest
surfaces the wire IngestOutput. The now-fully-dead execute_read/
execute_read_remote and execute_change/execute_change_remote pairs are
retired (legacy_change_request_body stays — client.rs uses it); the export
pair remains for 3c.

The Phase-1 parity matrix is unchanged and green; full workspace tests pass.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-06-13 19:25:57 +03:00
..
cli.rs refactor(cli): drop cluster init — no replacement scaffold 2026-06-11 23:45:18 +03:00
client.rs refactor(cli): collapse write/query forks onto GraphClient (RFC-009 Phase 3b) (#211) 2026-06-13 19:25:57 +03:00
embed.rs Initial public Omnigraph repository 2026-04-10 20:49:41 +03:00
helpers.rs refactor(cli): collapse write/query forks onto GraphClient (RFC-009 Phase 3b) (#211) 2026-06-13 19:25:57 +03:00
main.rs refactor(cli): collapse write/query forks onto GraphClient (RFC-009 Phase 3b) (#211) 2026-06-13 19:25:57 +03:00
main_tests.rs feat(cli): keyed credentials — servers:, the token chain, login/logout (RFC-007 PR 2) 2026-06-11 21:24:51 +03:00
migrate.rs feat(cli): omnigraph config migrate — the RFC-008 split (stage 2) 2026-06-11 23:32:05 +03:00
operator.rs feat(cli): omnigraph config migrate — the RFC-008 split (stage 2) 2026-06-11 23:32:05 +03:00
output.rs refactor(cli): consume omnigraph-api-types directly; unify the load mapping 2026-06-13 17:05:32 +03:00
read_format.rs Initial public Omnigraph repository 2026-04-10 20:49:41 +03:00