feat(cli): riskkernel init scaffolds a working starting point - #65
Merged
Conversation
A new user with the binary had no zero-to-running on-ramp — they had to assemble a .env and an agent by hand. `riskkernel init [dir]` now scaffolds both: a .env (provider key, default budget, and the data dir where runs and crash-resume checkpoints live) plus a runnable, key-free quickstart.py — a governed loop the governor stops at its budget — then prints the next steps. It never overwrites an existing file, so it's safe to re-run. The templates are embedded with go:embed so the single binary carries them. Tests cover the scaffold (files, the expected config keys, a governed_run in the example) and the no-overwrite guarantee; verified end to end that the scaffolded quickstart.py runs against the daemon and the governor caps the loop.
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.
What
riskkernel init [dir]scaffolds a working starting point so a new user goes from install to a running governed loop in one command — no hand-assembling a.envor an agent.It writes (without overwriting anything that already exists):
.env— provider key, the default per-run budget, and the data dir where runs and crash-resume checkpoints live.quickstart.py— a runnable, key-free governed loop that the governor stops at its budget.…then prints the next steps (
serve→ install the SDK →python quickstart.py).Details
go:embed, so the single binary carries them.Verified
go test ./cmd/riskkernel— the scaffold (files, the expected config keys, agoverned_runin the example) and the no-overwrite guarantee.quickstart.pyagainst a live daemon — steps 1–8 thenloop_budget_exceeded(exit 0). gofmt + vet + full Go suite clean.