Skip to main content

Module load

Module load 

Source
Expand description

Loading the graph, at two speeds.

A completion runs on every TAB and must feel like nothing at all; commands graph runs when a person asks and may take a moment. The difference is not a different graph — it is which inputs are read:

clap treeshell tool registrycapability registryworkflowscache
fastwalkedreadcomposedfrom the cache, when there is oneread
fullwalkedreadcomposedasked of the runnerwritten

Neither loads the repository index. The index takes seconds to build and answers a question the command graph does not ask: nothing about what commands exist depends on what is in .ai/. That is the whole reason the completion can be synchronous.

The workflows are the one input that costs a subprocess, so they are cached: full writes the graph beside the bridge it materialises, and fast reads it back. A cache that is missing or from another version of the executable is not an error — the fast path answers from the two declarations it can read directly, which is every command of both programs and none of the repository’s own workflows.

Structs§

Loaded
A loaded graph and where it came from.

Constants§

CACHE
The file the full load writes and the fast load reads.

Functions§

cache_path
The repository root, for a caller that has already discovered it.
fast
The graph as fast as it can be had: no subprocess, no index, no network.
fast_at
The graph of a repository whose root is already known, without asking the runner.
fast_with
The same, for a caller that already holds a registry.
full
The whole graph, with the workflows asked of the runner, and the cache refreshed.
full_at
The whole graph of a repository whose root is already known.
missing_repository
Map a repository error into the crate’s own.
read_cache
The cached graph, when there is one this executable wrote.
registry
The capability registry, composed from the modules and nothing else.
root
Where the repository is.
write_cache
Write the cache, beside the bridge, atomically.