Repository navigation
feat: add kosli get evaluation with --show-input and --fixture for replay - #1319
Conversation
…eplay A server-side evaluation could only be read back through the raw API, and nothing showed what it was given, so a decision could not be re-run with stock OPA to check it (kosli-dev/server#7567). get evaluation prints an evaluation's status, policy, trails, outcome or error, and the decision it recorded. --show-input adds the document the policy read as input under .input, and --fixture --dir writes input.json, data.json (params under "params") and the policy files: an inline policy's from the evaluation, a published version's from its bundle. The command is beta, like the rest of server-side evaluation. The still-pending error now points at kosli get evaluation instead of a raw GET, and the evaluation id is escaped into one path segment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Choices a reviewer may want to question
Small fixes along the way
Not verifiedA full replay with |
|
Claude finished @pbeckham's task in 1m 9s —— View job Follow-up review: c72e7e3..ef419c8This range is one commit, Previous finding addressed by this commit:
Previous findings not touched by this diff (unchanged from the last follow-up, all in
New in this diff: No new bugs, security issues, or regressions found in the changed lines — the fix is minimal, correct, and self-contained to the test fake. |
A URL path resolves . and .. however they are escaped, so `get evaluation .` read the list route and printed an empty evaluation with exit 0 instead of saying the id was wrong. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…its test fake The audit coverage test fails for any command or flag the audit does not know about, so get evaluation and its flags are added to the coverage file and to the audit spec, marked as needing server-side evaluation like the rego-policy commands. Snyk Code fails the build on a test fake that wrote a body looked up by the request path. The fake now picks a route with a switch, so nothing it writes is derived from the request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Follow-up review: 695dda8..d256b4dPrevious findings:
New in this diff: 1 inline comment — the refactored |
The server now returns an inline policy's files only once the evaluation has finished, so polling a pending one does not resend the bundle on every read. Without them a fixture of a pending inline evaluation would have been written with no policy at all; it is refused instead, before anything is read or written. A pending published-policy evaluation is still exported, since its bundle is read from the rego policy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server change that would have dropped an inline policy's files from a pending evaluation (kosli-dev/server#7825) was closed, so the server keeps serving them in every state and the refusal blocked a case that works. This reverts commit dbc79af. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Follow-up review: dbc79af..c72e7e3This range is just two commits that cancel out: Previous findings — none touch the lines changed here, all are either already resolved or live in code this diff doesn't touch:
New in this diff: 1 inline comment — the revert deletes both the pending-inline-policy check in |
The fake's zero-value bundle route turned into a 200 with an empty body, so a test that forgot to stub the bundle would read a successful empty download rather than the 404 the fake's comment promises. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Shows how to read back a pending or finished evaluation, replay it with OPA, and type-check a policy against its input schema before publishing. Beta: server-side evaluation is per-org beta; command released in CLI v2.53.0. Based on [add kosli get evaluation with --show-input and --fixture for replay](kosli-dev/cli#1319), [Serve what an evaluation was given for offline replay](kosli-dev/server#7764) and [Serve the JSON Schemas of a Rego policy's input](kosli-dev/server#7844). --------- Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
Adds
kosli get evaluation(beta) to read a server-side evaluation back, show the input its policy read (--show-input -o json), and write its input, params and policy to a directory (--fixture --dir) so the decision can be re-run with stock OPA. Until now an evaluation could only be read through the raw API, and what it was given was not retrievable. The still-pending timeout message now points at this command.Part of kosli-dev/server#7567
Checklist
Helm chart updatednot neededTerraform provider updatednot needed🤖 Generated with Claude Code