Skip to content

fix(cli): checksum --json exit code, unmerged config keys, UTF-8 panics, doc JSON - #1334

Merged
ajianaz merged 1 commit into
developfrom
fix/cli-checksum-config-utf8-json
Oct 7, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/cli-checksum-config-utf8-json

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

What

  • verify-checksums --json returns an error (exit 1) on a checksum mismatch; previously it printed match:false and exited 0.
  • merge_from_file now merges [lifecycle] (all keys), [aging] max_access_count, and the top-level update_check / doctor_footer switches; they were silently ignored when set in a config file.
  • New output::char_prefix; all byte slices of user text in doc listing/search output and edges output use it, so non-ASCII titles/slugs/ids no longer panic.
  • doc move --json and doc update --json are built with serde_json::json! instead of format!, so quotes/backslashes in slug/title/parent produce valid JSON.

Why

Validated findings from the Cora scan of v0.19.1 — see #1331. The checksum exit code is security-relevant for scripts; the config keys were advertised but dead; the slicing panics were reachable with any multibyte text.

Testing

  • cargo clippy --workspace --all-targets clean; cargo test -p uteke-cli passes (87 + 3).
  • New tests: config merge of lifecycle/aging/top-level keys (absent keys keep defaults); char_prefix on ASCII and multibyte input.
  • Manually verified uteke --json verify-checksums end to end: matching file → exit 0, wrong hash → exit 1.
  • Not covered by automated tests: the doc move/update --json output paths (mechanical serde_json::json! swaps).

Refs #1331

🤖 Generated with Claude Code

…config, UTF-8-safe truncation, valid doc JSON

- verify-checksums --json now returns an error (exit 1) on mismatch
- merge [lifecycle], [aging].max_access_count, update_check and doctor_footer from config files
- replace byte slicing in doc/edges output with char-boundary-safe char_prefix (no panics on non-ASCII)
- doc move/update --json built with serde_json (valid JSON for quotes/backslashes)

Refs #1331

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@ajianaz ajianaz added bug Something isn't working scope:cli CLI and UX priority:high Fix in next release labels Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority:high Fix in next release scope:cli CLI and UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant