Skip to content

feat(cli): tole doctor coverage ledger (#378, 3/3) - #392

Merged
ajianaz merged 3 commits into
developfrom
feat/doctor-ledger
Oct 16, 2026
Merged

ajianaz merged 3 commits into
developfrom
feat/doctor-ledger

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

What

Part 3 of 3 of tole doctor: the persisted coverage ledger and the READY n-of-m summary. Builds on #388 (offline/catalog) and #390 (full).

Why

#378. Release validation needs the result of a run to outlive the terminal, and a one-line answer to "how many providers are proven, and what blocks the first one that is not?".

Changes

  • doctor.rs: ledger at $CODECORA_HOME/tole/doctor-ledger.json — per provider + model: level reached, first blocker, fix command, timestamp. The provider identity is the redacted URL (no userinfo/query/fragment); the API key is never stored. Latest run wins per provider + model.
  • Atomic write (temp file + rename); the temp file is created exclusively with mode 0600 after removing any stale file, so a pre-planted file or symlink is never written through. A missing ledger is empty; a corrupt one is an error and is never silently replaced.
  • main.rs: tole doctor --summary prints READY n-of-m + first blocker + fix without running anything; --no-ledger skips recording.
  • README, CONTRIBUTING (release validation result lands in the ledger), CHANGELOG.

Testing

  • 4 new unit tests: record/summary/roundtrip and latest-wins, missing vs corrupt ledger, stale-tmp symlink not written through with 0600 mode, owner-only file mode.
  • fmt, clippy -D warnings, cargo test --workspace pass; cora review --staged clean.
  • Debug binary end to end against a local mock: full green run records READY 1-of-1, a no-tool-calling provider exits 1, the ledger file is 0600 and contains neither the API key nor URL credentials.
  • Not done: a live run against a real provider (none configured here); feat(cli): provider doctor with tiered diagnostics + persisted coverage ledger #378 stays open for that.

Refs #378

@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 43749ef into develop Oct 16, 2026
17 checks passed
@ajianaz
ajianaz deleted the feat/doctor-ledger branch October 16, 2026 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant