Repository navigation
fix(cli)!: print the load route's body from load --json - #1113
Conversation
load --json printed a CLI-only LoadOutput that added uri, dropped actor_id and omitted a null base_branch. Both the embedded and served arms now return the route's GraphBatchLoadOutput: the served arm as the server sent it, the embedded arm built by the constructor the route uses. The human output still names the graph from the client address.
RecommendationMerge. I found no blocking defect. Why
WhatThis change deletes How the values stay trueThe direct actor is
ImpactA script that read Tradeoff and liabilityOne type now owns the machine contract. Human output takes the address from the client, so the route type stays the route body. That split is the right one. The change removes two mappers that could drift from the route. A new field on Five more changes of this kind delete the next private output types the same way. They do not add a framework. Managed load uses the remote arm, so it prints this same body. Catalogue load refuses before any body. Open PRs 1114 and 1115 edit the CLI and do not replace this body. PR 1115 will conflict in InvariantThe broken rule is one public JSON contract (RFC 1017 and invariant 12, one source of truth). The class is every command that projects a private DTO over a route body. The fix sits at the CLI boundary that owns TestsA Before, commit
Result: failed. The payload still had After, commit
CI on this commit is green, including Test Workspace, Clippy, rustfmt, the GQT jobs, and the docs checks. I did not re-run that full set locally. LimitationsI did not run the full CLI integration suite. The first parity run in this environment timed out because the harness looks for FindingsBlocking: none. Optional, on |
# Conflicts: # crates/omnigraph-cli/src/client.rs
# Conflicts: # crates/omnigraph-cli/src/client.rs
What
omnigraph load --jsonnow prints the load route's response body,GraphBatchLoadOutput(the body ofPOST /graphs/{graph_id}/load/ndjson), ondirect, served and managed targets. The CLI-only
LoadOutputis removed.uriactor_idnullwhen the write has no actorbase_branch--fromwas not givennullwithout--fromThe other fields (
branch,branch_created,mode,nodes,edges,total_entities,embedding_generation,commit) keep their values. Theirorder in the JSON follows the route type now, so
modecomes afterbranch_created. Human output is unchanged: the address it prints comes fromthe client, not the body.
Each field was checked against
GraphBatchLoadOutputincrates/omnigraph-api-types/src/lib.rs:graph_batch_load_receipt_output, the same constructorserver_load_ndjsonuses. Itsactor_idis the actor the CLI attributesthe write to (
--as, elseoperator.actor), the same value ascommit.actor_id. On the served arm it is the actor the server resolvedfrom the credential.
This changes machine output, hence the
!and abreakingrelease note.Why
Backing RFC: #1017, "Graph access and cross-process writes", section One set
of operations: a command's
--jsonoutput is the route's response body. Itsgap table lists "
load --jsonprints a CLI-onlyLoadOutput, which addsuri, dropsactor_idand omits a nullbase_branch→ Print the route'sbody."
Tests
parity_matrix::parity_load: both arms printactor_id: act-parityand anexplicit
base_branch: null, and each arm's output round-trips throughGraphBatchLoadOutputunchanged, so it has no field the route lacks. Theexisting scrubbed embedded/remote comparison still holds.
cli_data::load_json_outputs_summary_for_main_branch: the direct output hasno
uri, hasbase_branch: nullandactor_id: null(equal tocommit.actor_id), and round-trips through the route type.output::tests::load_human_preserves_branch_and_embedding_diagnosticsnowbuilds the route type and passes the address separately.
No existing test asserted the load output's
uri. Parity had scrubbed it asvolatile.
Verification
Run locally with
RUST_MIN_STACK=16777216, aftercargo build -p omnigraph-server:cargo test --locked -p omnigraph-cli --lib --test integration -- output:: transfer:: client:: cli_data::load parity_matrix::parity_load cli_cluster::managed_data system_local::local_cli_ingest system_local::local_cli_load system_local::local_cli_end_to_end system_local::local_cli_failed_load system_remote::remote_ingest system_remote::remote_load system_remote::remote_unix_socket system_remote::remote_policy_enforces_branch_first --test-threads=6:lib 33 passed, 3 ignored (
nightly:deadline tests); integration 21 passed.cargo test --locked -p omnigraph-cli --test integration -- parity_matrix:: cli_data:: --test-threads=6:127 passed.
cargo test --locked -p omnigraph-cli --lib -- skill::: 6 passed;cargo test --locked -p omnigraph-skill: 1 passed.cargo clippy -p omnigraph-cli -p omnigraph-api-types -p omnigraph-server --all-targets --locked -- -D warnings -W clippy::dbg_macro: clean.cargo fmt --all --check,python3 scripts/check-docs.py,bash scripts/check-agents-md.sh,typoson the changed files: clean.