fix(cli): close small JSON-contract gaps for agent consumers

- --offline now warns when it serves a cache entry past its TTL; before,
  arbitrarily old data was returned with no signal at all
- version, cache info and cache clear honour -o json
- ownership resolve map/merge honour -o json
- stocks quote/compare require at least one symbol instead of printing []
- cache schema-mismatch notice goes through runtime::info so --quiet
  silences it, instead of a raw debug eprintln

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Q2PufCUdvVZoVW1Dy53js
This commit is contained in:
Claude 2026-10-02 12:28:16 +00:00
commit 277273bc78
No known key found for this signature in database
6 changed files with 130 additions and 18 deletions

View file

@ -64,9 +64,14 @@ fn run() -> Result<(), IdxError> {
};
match &cli.command {
Commands::Version => {
println!("{}", env!("CARGO_PKG_VERSION"));
}
Commands::Version => match config.output {
OutputFormat::Json => {
output::json::print_json(&serde_json::json!({
"version": env!("CARGO_PKG_VERSION")
}))?;
}
OutputFormat::Table => println!("{}", env!("CARGO_PKG_VERSION")),
},
Commands::Completions { shell } => {
let mut cmd = Cli::command();
let name = cmd.get_name().to_owned();
@ -97,7 +102,7 @@ fn run() -> Result<(), IdxError> {
}
}
Commands::Cache(cache) => {
if let Err(err) = cli::cache::handle(cache) {
if let Err(err) = cli::cache::handle(cache, &config.output) {
emit_error(&err, &config.output);
return Err(err);
}