Repository navigation
Conversation
A request carrying omnigraph-expect-actor is refused with 412 actor_mismatch, after authentication and the contract check and before graph lookup, body work or effects, when its credential resolves to another actor. A match changes nothing, so the header only narrows a request and never supplies an actor. Every protected router and /mcp check it. The CLI sends it for --as on served writes and cluster --server commands, which no longer refuse --as. A mismatch is a not-started refusal and exits 4, like a failed graph-commit precondition.
AppState::local opens a standalone graph read-only or read-write behind a generated bearer token and a Cedar policy generated for one actor, which it installs on the engine as well as at the HTTP layer. Every policy action has a local-server class, so an action added later is never granted until it is given one. A read-only local server refuses every write-class route in ingress before reading its body. No local server mounts the cluster deployment routes; each enables MCP ad-hoc reads and lists write tools only when it writes. A root inside a cluster is refused. serve_local runs the deployment's serving lifecycle, now one private type both entry points share, on a loopback listener the caller bound. It writes nothing to stdout, disarms the shutdown watchdog when it returns, and reports an uncertain outcome instead of exiting. install_log_subscriber puts the server's restricted log filter on another writer.
LocalScope::Cluster serves a cluster's storage root from its applied state for one actor, with the cluster's own policies, stored queries, embedding-provider bindings and external-Blob rules. A read-only one captures one ledger revision without admission, opens every graph read-only and validates it against that revision, and forbids every write action in each policy it loads, so policy answers report the refusal. A read-write one takes the cluster's serving admission and refuses while another owner holds it; serve_local releases it after a clean drain through the release the deployment runs, and keeps it when a completion is uncertain. PolicyEngine::forbidding adds a Cedar forbid for a set of actions, and a prepared graph open now names its access: writable within a storage scope, or read-only against a captured ledger revision.
Every error body carries an outcome object (execution, effects, action) that the server computes for the request it answered: not_started with no effects when it refused before submitting a write, or refused the write's one publication with a typed reason, which an engine gives only before it publishes; unknown otherwise, including a typed refusal after a load forked its branch. The next step a caller takes is retry, refresh, recover or reconcile. A write whose completion is uncertain answers outcome_unknown instead of internal. Errors that carried a reason only in their details gain registry codes: precondition_failed, recovery_required, external_blob_source and change_feed_gap. CLI data-write failures print the same object as outcome, in place of command_outcome, and take the server's when its request was the command's only effectful one.
The exit follows from the failure's outcome: a command that did not start exits 1, one whose effects are unknown 2, one refused for a condition the caller set 4, and one refused before starting with retry 75. A refused command line exits 64 (EX_USAGE) instead of Clap's 2. Read commands report the same failure envelope as data writes, always not_started with no effects, so a failed read prints its outcome too. An embedded engine write's own error now carries the engine's completion evidence, as a server's does: a typed refusal before any request, outside a load that forks its branch, did not start, so embedded load conflicts and failed conditions exit as served ones instead of claiming unknown effects. Any later error, such as one rendering a committed receipt, stays unknown. Embedded writes refuse a noncanonical branch name and read their data file before opening storage. Managed commands keep their own exits until the managed relay lands.
GET /graphs/{graph_id}/access and the MCP access tool return the
caller's resolved actor, the actions its credential allows on the whole
graph, and, for a named branch and target branch, the actions allowed
there. Each action is evaluated through authorize with the branch and
target branch shaped as the route that performs it shapes them, so the
answer matches those routes' decisions. The route needs no action of
its own, reads no graph data and judges branches by name.
A target is one complete binding in ~/.omnigraph/config.yaml: a direct graph or cluster root, or a server with its credential owner or anonymous access. --target NAME, else defaults.target, addresses a command; it refuses every other address and --profile beside it, and resolves through the scope resolver profiles use. A server target's owner keys the existing token chain and is bound to the target's endpoint, so its token goes only to URLs under it; the file refuses an owner at two endpoints, two owners for one endpoint and an anonymous target beside a keyed one. target list|show|add|remove lists the targets without secrets or network, with a binding digest, and edits one entry at a time: an edit holds config.yaml.lock, changes only that entry's lines, proves by parsing that every other key is unchanged, and replaces the file by rename. login/logout --target store under the target's owner, and credential get --target hands a server target's token to a pipe, never a terminal. Refusals carry registry codes (target_unknown, target_invalid, target_exists, target_is_default, config_not_editable, target_kind_unsupported, credential_terminal, credential_anonymous, credential_missing). version --json reports protocols.target and protocols.credential. Existing servers, profiles and their flags keep working.
# Conflicts: # crates/omnigraph-server/tests/integration/auth_policy.rs
omnigraph access names the caller's actor and the actions the graph's policy grants it: graph-wide, on --branch, and from it to --target-branch for branch_create and branch_merge. A server target asks the server's access route with the target's token. For direct storage the CLI decides for the actor --as or operator.actor names: a cluster graph by its applied policy, which allows nothing without an actor, and a standalone graph, which has no policy, allows every action, as direct writes do. The decision shape moves into api-types (AccessOutput::evaluate and the AccessAction to PolicyAction mapping), so the route and the CLI decide alike. version --json reports protocols.access.
# Conflicts: # crates/omnigraph-server/tests/integration/auth_policy.rs
The shutdown listener registered its SIGTERM and SIGINT handlers only when its spawned task first ran, and `serve_local` installed the lifecycle only after the caller had announced readiness. A signal in either window met the default disposition and ended the process without the drain. The lifecycle now registers both handlers before it returns, and `start_local` installs it so a caller announces between `start_local` and `LocalServing::serve`. `serve_local` remains the two calls in one.
…server # Conflicts: # crates/omnigraph-server/src/lib.rs # crates/omnigraph-server/tests/boot_settings.rs # docs/dev/control-plane.md
`omnigraph serve` serves one direct target, a standalone graph or a cluster root, on 127.0.0.1 to clients of the same account. It is read-only unless `--write`, acts as the `--as` or `operator.actor` actor, and answers behind a token generated for the run. It keeps an owner-only record a client attaches by reading, held by a lock its process owns, so a killed server's record is ignored and removed by the next reader. Starts of one destination are elected: one serves and the others refuse with `local_server_exists`, or print the live server's ready line with `--reuse` when its access, actor and HTTP contract fit. A guard outside every server layer admits only requests whose Host names this server's loopback address, refuses any Origin, strips CORS headers and marks every response same-origin. The ready line follows `start_local`, so a signal after it drains the server. `target list` and `target show` name each target's live local servers, and `version --json` reports `protocols.serve` and `protocols.local_server_record`.
…e records A reuse from another target of the same root now reports that target's graph. A platform without Unix permissions refuses to keep a record, since it holds a bearer token, and a target listing reads records without creating their directory or failing on it. The listener binds before a read-write cluster open takes the cluster's admission.
…es it A server built before `omnigraph-expect-actor` speaks the same HTTP contract and ignores the header, so `--as` on a served write would run as the credential's actor. Every response now lists the assertions its server enforces in `omnigraph-http-api-assertions`, and the CLI refuses before sending when discovery does not list `expect-actor`. A served `cluster plan` or `cluster apply` refused for another actor now exits 4 as a data write does: its requests are observed, and a refused assertion with nothing effectful sent before it is a condition, with or without `--json`.
`main` returned an undelivered failure as an error, so the process exited 1, the status that says nothing changed, after a write whose receipt met a closed stdout. It now reports the error as before and exits with the code the outcome chose. `alias` is a read, as `query` is, so its failures report an outcome and exit by it. Command classification is now an exhaustive match, so a new command declares how its failure reads.
…s everywhere Credential lookup now reads the same validated bindings as the ownership checks, so a server target that fails validation can no longer win a request's credential and send another owner's token to its endpoint. `queries` and `policy` resolve `--target` and `defaults.target` like every other command: a target is a complete address that excludes `--cluster` and `--profile`, only a cluster-root target names a cluster, and its default graph applies. `login` and `logout` check after parsing that exactly one of a server name, `--api` and `--target` names the credential, so a global `--target` before the subcommand works and a conflict refuses. A configuration refusal keeps its code through the invocation's captured configuration, and a target edit is a local write: a failure after its rename no longer reports that nothing changed.
# Conflicts: # crates/omnigraph-cli/src/command_outcome.rs
# Conflicts: # crates/omnigraph-cli/src/command_outcome.rs
A quarantined graph's policy bundle is withheld from the serving snapshot and an unknown graph has none, so `access` read either as a graph without a policy and reported every action allowed. It now checks the snapshot first: a graph that is not applied refuses with `not_found`, naming the applied graphs, and a quarantined one with `graph_unavailable` and the cluster's reason, as a server refuses them.
…tests off the account's records A records directory that does not exist means no local server has run, so a direct target lists none; one that cannot be read safely leaves `local_servers` absent. CLI tests point the records directory at a path that does not exist, so no test reads the account's own records. `serve` reports its own failures and takes no outcome kind.
The cluster skill page still said `cluster apply --server` refuses `--as`; it now names the assertion `cluster plan` and `cluster apply` send and its exit 4. The release note moves to `breaking`, since a matching `--as` now runs a write the CLI used to refuse. The server guide says `/mcp` has no contract check, an empty assertion joins the malformed-header test, and stale comments name the current behaviour.
…ne's policy - A relative or URL-special local root now names its cluster. `LocalBinding::from_root` makes a local root absolute, and the cluster storage URI is built with `Url::from_file_path`, so `./cluster` no longer becomes `file://./cluster`, which the cluster store refused in both modes. - A ledger revision that moves between a read-only open's capture and its validation refuses the whole server. `GraphOpenFailure` carries the cluster's refusal from `validate_opened`, and the read-only open turns it into `LocalOpenError::Cluster`. A graph whose schema drifted from its achieved contract is still blocked alone, as normal serving blocks it. - A user rule can share an id with the generated forbid. Cedar policy ids are namespaced `permit:` and `forbid:`, so the two can no longer collide and fail `PolicySet::add`. A matched rule still reports the bare rule id. - `LocalServing::release` stops a local server that never served. It closes request admission, drains the logical owners, releases a read-write cluster's serving admission as `serve` does after a clean drain, and disarms the watchdog. Before this, a caller that failed after `start_local` could only drop it, which keeps the admission lock. - `/readyz` and `/graphs` report the ledger revision served. Both access modes install the boot witness from the applied snapshot instead of the default revision 0. - A local cluster server refuses when no graph opens, as a deployment's startup does. Read-only now applies the same check as `finish_graph_startup`, and both modes honour `OMNIGRAPH_REQUIRE_ALL_GRAPHS` through the config's `require_all_graphs`, not a hard-coded `false`. - A graph the cluster binds no policy to gets `read` alone for the actor, which is what a deployment's routes grant without a bundle. The grant is installed on the engine too, so an embedder holding the handle can no longer write through an engine with no policy. - Read-write refusals before any graph opens release the admission, as a refused settings preflight does. The catalogue policy now loads before graph preparation. A failed startup after a graph open keeps the admission and names its lock in `LocalOpenError::AdmissionRetained`. - The read-only catalogue policy passes through the same write forbid as every other policy it loads.
The access report's branch slots were lists in the evaluator, so a new policy action compiled and stayed out of the report. One exhaustive match on `PolicyAction` now gives each action its slot (source, target, transition, graph-wide or unreported), shared by the access route and `omnigraph access`.
A write whose outcome is unknown still stops the server that ran it, so `AppState::local` refuses `LocalAccess::ReadWrite` with `LocalOpenError::ReadWriteUnavailable` until it no longer does. The read-write path stays and stays tested: the `test-util` feature's `with_local_read_write` scope opens it for tests alone, enabled from dev-dependencies only (this crate's own included) and checked by the test-util guard, and a build with the feature still refuses outside the scope. `LocalBinding::local(path)` replaces the string constructor. It takes a root on this machine's file system, made absolute, and refuses a URI: a remote root's endpoint and credentials would come from the process environment when it opens, which a captured binding must not depend on. A read-only local server's engine refuses a direct write, now tested on the handle. The developer guide says what the read-write gate is, that an embedder a browser can reach adds the loopback guard in `extend`, and that Tokio keeps the signal handlers for the rest of the process. The invariants say the library serves one standalone graph on loopback while the binary stays cluster-only, and the release notes no longer claim read-write or a wider signal window than the code covers.
Brings in ModernRelay#1075's fix through ModernRelay#1077: the read-only refusal names no --write, and a local binding folds `..` before it is stored.
The engine re-exports the storage crate's lexical absolutizer for the local server's binding; the split-crate re-export guard lists every such item by name, so it now names this one.
The key-conflict description said the refused rows wrote nothing; the OpenAPI vocabulary guard keeps graph vocabulary in the published description, so it now says the refused write changed nothing.
Brings in the engine's pinned re-export of absolutize_lexically.
Brings in the key-conflict description in graph vocabulary.
Brings in the key-conflict description in graph vocabulary.
Brings in the key-conflict description in graph vocabulary.
Brings in the key-conflict description in graph vocabulary.
Brings in the engine's pinned re-export of absolutize_lexically.
|
Recommendation: approve. Why, what, how, impact
This re-review covers The blocking item from the review at Previous findings
BlockingNone. Optional
Where the code and RFC #1017 differRFC head
StackLeave these on their own pull requests.
Tradeoffs and liabilityThe records directory, the JSON record, the liveness lock, and the election file stay the four primitives. The host id is now a closed input: no id means no records. That removes the shared-home fail-open for a missing file. It adds a refusal on a host that has no id. The optional format check is that same rule for a file that is present and is not an id. Further record readers should call
Exit 1 for The 100 ms election poll blocks one worker for at most 60 seconds. This process does no other work during the wait. The bound is in ValidationReviewed head: A Local, exact head, Library: 6 passed, 0 failed (0.21s). Integration: 7 passed, 0 failed (0.33s). Regression proof for the host-id fix. At
CI on this SHA: run LimitationsThe terminal path that omits |
A host identifier was any non-empty string, so two machines that both read systemd's `uninitialized` first-boot marker, or an all-zero id, compared equal and could reap or reuse each other's records and tokens in a shared home. A machine id is now 32 hex digits and not all zeros, which both sources produce (a Linux machine-id and macOS's 16-byte host UUID); anything else refuses with `local_server_records_unsafe`. The server-policy reference no longer says there is no single-graph server mode: `omnigraph serve` serves one direct target on loopback.
|
Both optional findings addressed at 3480267:
|
|
Recommendation: approve. Why, what, how, impact
This re-review covers The machine field is the fact that keeps one machine from reaping or reusing another machine's record when a home directory is shared. The old check treated every non-empty string as an id. Two hosts that both read systemd's Previous optional findings
Is the 32-hex rule right?Yes for every host id this code reads. Refusing every other value is the correct fail-closed behavior. Linux. machine-id(5) defines macOS. Other platforms. BlockingNone. Optional
Where the code and RFC #1017 differRFC head
Stack, and the rebase onto main
Sibling heads today:
Tradeoffs and liabilityThe records directory, the JSON record, the liveness lock, and the election file stay the four primitives. The host id now has one grammar, at the only gate that opens records. That removes the shared-home fail-open for a sentinel or an all-zero id. It adds a refusal on a host that has no real machine id yet, including a first boot that still shows A further platform source should normalize to 16 bytes in The check is one predicate on a short string. It does not change publication, snapshots, or Lance. ValidationReviewed head: A Regression proof for the host-id grammar. The test committed at Failed.
This machine's CI on this SHA: run LimitationsI did not run macOS, so |
…uses The serve guide and its release note said a machine refuses to keep records only when its host identifier cannot be read. Since records accept only 32 hexadecimal digits that are not all zeros, a present identifier refuses too: systemd's first-boot `uninitialized` marker, all zeros, a short id or a non-hexadecimal one.
|
Recommendation: approve. Why, what, how, impact
This re-review covers The optional finding from the review at Previous optional findingThe guide named only a missing host identifier. Resolved.
The same rule refuses each case in
A newline after a valid id is removed by trim, so the id is accepted. Uppercase On Linux,
The release note says a machine refuses to keep records when the identifier cannot be read, or is not 32 hexadecimal digits other than all zeros. That is the same set of values. The guide names the error code. The release note does not repeat the code. BlockingNone. OptionalNone. Rebase onto mainThis pull request still conflicts with
The conflict is the embedded branch create from #1016. Main's function is
StackThis docs commit does not change the stack notes from the review at
Tradeoffs and liabilityThe commit adds no code, no record field, and no new gate. The host id stays one predicate, and both record doors call it. The guide was the remaining copy that described only a missing file. That copy could tell an operator that A further platform source should still normalize to 16 bytes inside The check does not change publication, snapshots, or Lance. A cloned valid id can still match. That limit stays with the RFC. ValidationReviewed head:
Local, on a detached worktree at the exact head: Documentation OK (354 Markdown files). Exit 0. Dependencies were 1 passed, 0 failed. 6 passed, 0 failed. 259 other library tests were filtered out. The test profile compiled in 16m 29s. On this SHA, GitHub run LimitationsI did not run macOS, so the |
Brings in main through ModernRelay#1083, including branch creation at a commit, the disposition, the actor-mismatch fix expectations and the machine id grammar. `mcp_target_lost` joins the error-code registry as a CLI-only code that asks the caller to fix the target: the bridge has already resolved it again once.
Disposition — 2026-10-20
The second serving model is discontinued. OmniGraph retains one cluster-backed
server model, including on localhost: the ordinary applied state, authentication,
policies, admission, routes and deployment lifecycle.
This PR is closed without merging. The standalone/local serving APIs, generated
local policies and credentials, and local-server discovery/election/reuse
registry are not proceeding. This decision supersedes the implementation and
sequencing proposed below; draft #1017 is being revised accordingly. No part of
this serving stack has shipped. General improvements to the existing server
may be proposed independently without introducing another serving mode.
Historical proposal
Why
RFC #1017 phase 3: a local server for you. A same-account client (an editor, a notebook, Studio) should reach a direct target over the HTTP API without running a deployment.
What
omnigraph serve [--target NAME] [--reuse] [--port PORT] [--as ACTOR] [--json]serves one direct target on127.0.0.1:--as/operator.actoractor, behind a bearer token generated for the run.--writerefuses withlocal_server_read_write_unavailableuntil a write whose outcome is unknown no longer stops the server (bug: one storage write with an unknown outcome stops the server until a manual unlock #1067); that gate is the server's, from feat(server): serve one standalone graph to the same account on loopback #1075.--json, stdout carries one line (protocol 1) once the server handles signals. It includes the token only when stdout is not a terminal.~/Library/Application Support/OmniGraph/servers, Linux~/.local/state/omnigraph/servers, orOMNIGRAPH_LOCAL_SERVERS_DIR). A liveness lock held by the process means a killed server's record is ignored and reaped. Platforms without Unix permissions refuse, since a record holds a token.local_server_exists, or with--reuseprints the live server's ready line, carrying the requesting target's graph. Reuse refuses on an access, actor or HTTP-contract mismatch.Hostmust name this server's loopback address, anyOriginrefuses, CORS headers are stripped, and every response carriesCross-Origin-Resource-Policy: same-origin.target list|showname each direct target's live local servers.version --jsonreportsprotocols.serveandprotocols.local_server_record.How
servebinds the listener, opensAppState::localthroughLocalBinding::localwith the destination's canonical path, and installs the lifecycle withstart_localbefore announcing. A failure after that (holding, writing or announcing the record) ends the server withLocalServing::release, so a start never strands a cluster's admission.Stack
This branch contains #1081 (and through it #1073, #1074, #1076, #1078, #1080) and #1077 (and #1075). The delta reviewed here is
crates/omnigraph-cli/src/commands/serve/,crates/omnigraph-cli/src/local_servers.rs, theservewiring,docs/user/cli/serve.mdandcli_local_servers. Merge after those.Tests
cli_local_servers:SIGTERMexiting 0 with the record removed;