pub async fn execute_status(
args: &StatusArgs,
config_service: &dyn ConfigService,
) -> Result<()>Expand description
Handle the cache status subcommand.
Loads cache metadata from disk and prints a summary of its location, size, age, AI model, operation count, configuration fingerprint, snapshot freshness, and whether a journal exists.
§JSON output
JSON mode is activated when either the global --output json flag
is set or the legacy subcommand-local --json flag is supplied
(the latter is preserved as a backward-compatible alias per the
cache-management spec). Both invocations route through
emit_success with the same CacheStatusPayload type and emit
byte-identical output.
When no cache file is present, a friendly message is printed (text
mode) or a payload with total = 0, pending = 0, applied = 0 is
emitted (JSON mode) and the function returns Ok(()) without error.
§Arguments
args- Parsedcache statusarguments controlling output format.config_service- Active configuration service, used to recompute the configuration hash for comparison against the cached value.