Release 0.8.0
A minor release for hosts. The EXPERIMENTAL hosting crates graphersal-serve and
graphersal-mcp get what a server needs once it knows who sends each request: MCP sessions
that belong to the identity that opened them and can survive a restart, directory selections
that follow a re-pointed or renamed alias, a read-only mark per request, a file root that keeps
client paths inside one directory, and presets a query may lower but not raise. The playground
sends a visitor to the host's login page when the host asks for a login. GQL counts after any
walk without building a row per match, and the knowledge base Docker image is built by one
Python script.
The public API of graphersal is unchanged apart from additions: cargo semver-checks against
0.7.1 reports no break of graphersal, graphersal-session, graphersal-serve and
graphersal-storage-tests. The breaks are in the EXPERIMENTAL crate graphersal-mcp (one API
break and changes of behaviour): read "Upgrading from 0.7.x" first. No format changes; stores,
snapshots, journals and backups of 0.7.x are read and written exactly as before. The
graphersal --server dev server answers as before.
Upgrading from 0.7.x
Stores and files. A drop-in replacement: no format change, no upgrade step. 0.7.x reads everything 0.8.0 writes.
graphersal-mcp (EXPERIMENTAL, breaking). These changes affect hosts built on the crate
and agents of a directory-mode endpoint. The dev server's MCP endpoint is unchanged: it serves
one graph and attaches no identity.
use_graphanswers a new shape. It answersselected(the name the agent asked for, a graph or an alias),graph(the graph that name resolves to now),kind,state,readOnlyandnote. Therequestedkey is gone, andselectedis now the name, not the route.list_graphsgainsselectedGraphbesideselected.- A directory selection follows its name. A session that selected an alias follows it when
the alias is re-pointed (before, it stayed on the graph resolved at
use_graph). A removed name fails the session's calls with a message naminglist_graphsanduse_graphuntil a graph or alias of that name exists again. - A session belongs to its identity. A request that names an MCP session id with another
identity than the session's
initialize(McpRequest::with_identity; none is anonymous, an identity of its own) gets the unknown-session404, and itsDELETEends nothing. Signed session ids minted for an identity differ from anonymous ones; anonymous ids are unchanged.Mcp::verified_session_route(id)now checks the id as anonymous; a host that attaches identities callsMcp::verified_session_route_for(id, identity). Mcpis no longerUnwindSafeandRefUnwindSafe(it may now hold anArc<dyn SessionStore>). Code that moves anMcpintostd::panic::catch_unwindwraps it inAssertUnwindSafe.
graphersal-session (internal). SessionPresets gains the field ceilings (the struct is
#[non_exhaustive], so this is additive).
Hosting pieces for identity-aware servers (EXPERIMENTAL)
These additions to graphersal-serve, graphersal-mcp and the script engine let a host that
authenticates its callers serve them safely. Every one is off unless the host turns it on, so
the dev server and every host that does not use them behave as in 0.7.1. The book page
Serving Layers describes each one.
- Directory selections follow aliases.
use_graphstores the name the agent asked for and the endpoint resolves it again on every call, as an HTTP path/db/<name>/is. A host that renames an alias callsMcp::rename_selection(old, new)(it answers the number of sessions moved); each moved session's next tool answer starts with the linenote: alias "<old>" was renamed to "<new>"(directory mode). - Sessions belong to their identity. Every MCP session is bound to the identity of its
initialize, in table mode and with signed ids, withMcp::verified_session_route_forfor the host's resolver. A host whose graphs differ per caller builds itsGraphDirectoryper request and answers a hidden graph like an unknown one (Sessions belong to their identity). - Sessions survive a restart.
Mcp::with_session_store(Arc<dyn SessionStore>)loads the stored sessions once and saves the whole table after every change. Each row is aStoredSession: the SHA-256 of the id (the table never holds the plain id), the identity, the selected name, a pending rename note, the protocol revision, the client and the creation time. A failed save is atracingwarning, never a failed request.Mcp::forget_sessions_of(identity)ends one identity's sessions at once, for a revoked token or a removed user. Signed ids keep no table, sowith_session_storerefuses them (Sessions survive a restart). - Read-only requests.
Request::mark_read_only()(andRequest::is_read_only()) marks one request as coming from a reader, in the host's router orRequestFilter./api/executeand/api/querythen run under the reading authorizer, every other writing route answers409(READ_ONLY_REQUEST_HELPnames the reason), reads and downloads stay open,/mcpserves the request under the context's profile made read-only (the newProfile::with_read_only), and/api/infoand/api/changesanswerreadOnly: truefor it. The context stays writable for every other request (Read-only requests). - File root.
ContextBuilder::file_root(Some(root))(Context::file_root) confines the paths a client names to one directory: backup job paths ofPOST /api/jobs/define, the jobs of a loaded catalog, and thedirof a Store fork, attic fork or backup. A relative path is relative to the root; one that leaves it (an absolute path elsewhere,.., a symbolic link pointing out) is refused. Jobs already stored in a store the host loads are checked by the host withgraphersal_serve::jobs_outside_file_root, which answers aJobOutsideFileRootper offending job. The default, no root, keeps the old behaviour (File root). - Presets as ceilings.
graphersal::script::graph_scope_with_ceilingsandengine_with_ceilings(the same arguments asgraph_scope_with_optionsandengine_with_options) make the preset limits ceilings: a query'sg.with(..)may lowerevaluationTimeout,repeat.max_loops,bulk.max_expansionand thetraversal.max_*limits without asking the authorizer, and a larger value or no limit at all fails before anything runs with the newTraverserError::OptionAboveCeiling(a raise is refused, never clamped). The rule covers every source the script reaches and the saved queries it calls. Agraphersal-sessionhost setsSessionPresets::with_ceilings(true); its presets then answerceilings: true(Presets as ceilings).
Playground
- Login of a host (EXPERIMENTAL). When a host answers an API request with
401and names its login page in the body ({"error": "...", "login": "/"}), the playground goes to that page with?next=and its own path, when it starts (instead of falling back to the WebAssembly engine) and on every later request. Only a path of the page's own origin is followed, and the page never redirects to itself. The dev server and the WebAssembly playground never send it (Login of a host).
Performance
- GQL
count(*)after any walk is the lazy count. An aggregation that only counts rows (count(*), orcount(x)of a variable that is never NULL, without a grouping key) became the fusedcount()only after a node scan or one plain hop; after any other walk (more hops, joins,OPTIONAL MATCH,UNWIND,WITH) it built a row per match. It is now the lazy count whatever comes before it. On thelargegraph,MATCH (a)-->(b) WHERE b.id <> "x" RETURN count(*)materializes 21.8 MB like the equivalent Gremlincount()(before: 33.5 MB), andMATCH (a)--(b) RETURN count(*)peaks at 8.5 MiB instead of 34.8 MiB (Counts).
Docker
- One build script for the knowledge base image.
docker/prebuilt/build.py(Python 3.9+, standard library only; Linux, macOS and Windows) replacesfetch-binary.shandprepare-kb.sh. It takes the binary from a release archive checked against itsSHA256SUMS, a plain Linux binary, or a GitHub Release or CI run (--version, cached for offline builds), and builds with Docker or Podman (--engine,--pushfor a multi-platform manifest). The image ships the prepared single-file Store as is: the build runs nothing on it, so prepare the store first (store fork,store verify,mcp-cost); a directory store is refused with a hint to fork it into a.gstore(A knowledge base image).