feat(cli): riskkernel doctor — diagnose a setup - #121
Merged
Conversation
Add a `riskkernel doctor` command that runs a checklist over a setup and prints ✓/⚠/✗ for each, exiting non-zero on a hard failure (CI-friendly): - data dir is creatable + writable (the file the user owns must persist), - the default provider is known and has its credential (Ollama is key-free, Bedrock is flagged as a stub), - the default budget isn't explicitly unlimited (a reliability runtime shouldn't run unbounded), - the API token is set (warns when the API is unauthenticated), - a configured riskkernel.yaml parses (a bad one would fail daemon startup), - the daemon is reachable on the configured port (info/warn — useful either way). The config + filesystem checks are split into a pure diagnose() so they're unit tested (provider matrix, budget states, token, policy-file valid/invalid/missing, data-dir writable/uncreatable). Reduces time-to-first-value: a new user can see exactly what's missing before "why doesn't it work?".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
riskkernel doctor— a setup diagnostic that tells a new user exactly what's missing before "why doesn't it work?". Closes #94.Checks: data dir creatable/writable · default provider known + credential present (Ollama key-free, Bedrock flagged) · default budget not explicitly-unlimited · API token set · a configured
riskkernel.yamlparses · daemon reachable. Exits non-zero on a hard failure (✗), so it's CI-friendly; warnings (⚠) don't fail.Testing
diagnose()— unit-tested across the provider matrix, budget states, token set/unset, policy-file valid/invalid/missing, and data-dir writable/uncreatable.go vetclean; full suite green; race detector clean across the repo.