Skip to content

docs: describe controls as closed by server-side evaluation decisions - #469

Open
ToreMerkely wants to merge 5 commits into
mainfrom
7656-controls-closed-by-decisions
Open

ToreMerkely wants to merge 5 commits into
mainfrom
7656-controls-closed-by-decisions

Conversation

@ToreMerkely

Copy link
Copy Markdown
Contributor

Rewrite the Working with controls tutorial so a control's decision is recorded by evaluating a published policy on the server, not with kosli attest decision or flow templates. It states that a decision must be complete, notes that multi-level evaluations are not supported yet, and refreshes the decision screenshots.

See https://github.com/kosli-dev/server/issues/7656

🤖 Generated with Claude Code

A decision is now recorded by evaluating a published policy on the
server with `kosli evaluate policy --control`, and the server refuses a
decision from an inline policy. The tutorial still taught `kosli attest
decision`, attaching evidence by hand, and requiring decisions through
flow templates, all of which lead to trail compliance, the direction we
are moving away from.

The page now covers publishing a policy and recording a decision from
it, states that a decision must be complete to close a control, and
notes that multi-level evaluations are not supported yet. The decision
screenshots are retaken from a decision recorded by evaluation.

See kosli-dev/server#7656

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ToreMerkely
ToreMerkely requested a review from a team as a code owner October 26, 2026 12:28
@mintlify

mintlify Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
kosli 🟢 Ready View Preview Oct 26, 2026, 2:03 PM

@claude

claude Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @ToreMerkely's task in 1m 30s —— View job


Follow-up review (commits 26e8d83..54bf416)

Scope: policy-reference/rego_policy.mdx only — the sole file touched by 82e7fb4..54bf416's last two commits (26e8d83, 54bf416) is policy-reference/rego_policy.mdx (13 lines changed, mostly renaming trail_is_compliant → requirements_met and rewording "compliant" → "requirements met" throughout the Safe policy design section, plus a one-line addition to the compliance_status.is_compliant field description).

Previous finding Status
"Only a published policy can record a decision" contradicts client_reference/kosli_attest_decision.md Out of scope for this diff — tutorials/working_with_controls.mdx wasn't touched by these commits. Per the author's 47c2d1c comment, this is accepted as-is (deprecating kosli attest decision is a separate product decision).
.rego content / kosli publish rego-policy / kosli evaluate policy undocumented Resolved (in 82e7fb4, unaffected by this diff).
Regression: examples declaring package snyk_high/pr_approved broke test_rego_policy_follows_the_kosli_contract's package == "policy" assertion Resolved (in 26e8d83, unaffected by this diff) — confirmed via mcp__github_ci__get_ci_status: "PR Quality Checks" is green on the current head.

New inline comments: 0. The rename (trail_is_compliant → requirements_met) is applied consistently everywhere it's used (lines 43, 119, 120, 123, 344, 350 — checked via grep), and the generalization from "compliant"/"compliance" to "requirements met" language is consistent with the commit's stated intent. The simplified params-section example (allow if max_high >= 0 replacing the Snyk-specific check) still compiles and still declares package policy with a satisfiable allow rule, so it doesn't regress the test suite — it's a reasonable simplification since that example's purpose is demonstrating the schemas METADATA annotation, not a realistic policy.

No bugs, broken links, or regressions found in the changed lines.

Comment thread tutorials/working_with_controls.mdx Outdated
Comment thread tutorials/working_with_controls.mdx
mbevc1
mbevc1 previously approved these changes Oct 26, 2026

@mbevc1 mbevc1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, only minor comment about the screenshots, when zoomed in they are a bit blurry. Not a blocker

The screenshots were captured at 1x and blurred when zoomed in, so all
four are retaken at 2x from the same 1920x1000 viewport while logged in.

"Only a published policy can record a decision" read as if `kosli attest
decision` no longer records decisions, which it still does. The rule
applies to evaluations, so the sentence now says so. The page also lost
its only pointer to Rego authoring, so it now links the Rego policy
reference and says the trail input schema gives the same input as
`kosli evaluate trail`.

See kosli-dev/server#7656

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ToreMerkely

Copy link
Copy Markdown
Contributor Author

@mbevc1 Fixed in 47c2d1c: all four screenshots retaken at 2x (3840 × 2000, from a 1920 × 1000 viewport), so they stay sharp when zoomed.

@claude

claude Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Follow-up review (commits 28afb5d..47c2d1c)

Scope: only the lines touched by the newest commit in tutorials/working_with_controls.mdx.

Previous finding Status
"Only a published policy can record a decision" contradicts client_reference/kosli_attest_decision.md Not addressed — sentence reworded, but kosli_attest_decision.md still describes kosli attest decision --compliant and is still in config/navigation.json, so the contradiction stands.
rctl-043.rego never shown / no reference page for kosli publish rego-policy or kosli evaluate policy Partially addressed — added a link to /policy-reference/rego_policy and a note that --input-schema trail matches kosli evaluate trail's input. The .rego file content is still not shown, and that reference page doesn't document kosli publish rego-policy, kosli evaluate policy, or the --input-schema flag itself, so the equivalence claim isn't backed by an authoritative source.

New inline comments: 0 — no bugs, security issues, or regressions found in the changed lines themselves.

The reference described only `kosli evaluate trail` and `kosli evaluate
trails`, which evaluate a policy in the CLI. Decisions against controls
now come from policies published with `kosli publish rego-policy` and
evaluated on the server with `kosli evaluate policy`, and that route has
a different contract: any package name with an `allow` rule, outputs
chosen by entrypoint annotations, multi-file bundles, a params schema
checked at evaluation, a trail moment as input with `evaluation.time` as
the only clock, and nondeterministic built-ins refused.

The page now documents that contract first and keeps the CLI commands in
a local evaluation section, with a table of how their input differs. The
controls tutorial no longer claims the two inputs are the same, and the
OPA tutorial links to the local sections it describes.

See kosli-dev/server#7656

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread policy-reference/rego_policy.mdx Outdated
@claude

claude Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Follow-up review (commits 47c2d1c..82e7fb4)

Scope: policy-reference/rego_policy.mdx (rewritten), plus anchor-link updates in tutorials/working_with_controls.mdx and tutorials/evaluate_trails_with_opa.mdx.

Previous finding Status
"Only a published policy can record a decision" contradicts client_reference/kosli_attest_decision.md Not touched by this commit — the sentence in working_with_controls.mdx wasn't changed since 47c2d1c. Per ToreMerkely's prior comment, this is accepted as-is: kosli attest decision still works outside controls, and deprecating it is a separate product decision out of scope for this PR.
.rego file content not shown / no docs for kosli publish rego-policy, kosli evaluate policy, --input-schema Resolved. policy-reference/rego_policy.mdx now shows full .rego examples (lines 282, 319), documents kosli publish rego-policy and its version-validation lifecycle ("Publishing a policy"), documents --input-schema trail/trails, and documents kosli evaluate policy end-to-end including output, exit codes, and --output json error kinds.

New regression (blocks CI): the rewritten examples at lines 142, 282, and 319 now declare packages other than policy (snyk_high, pr_approved), per the new text that "any package name works" for server-side evaluation. tests/test_rego_examples.py::test_rego_policy_follows_the_kosli_contract wasn't updated and still hard-asserts package == "policy" for every fenced block — the "Test live-docs scripts" job already fails on this PR (run). Posted as an inline comment on policy-reference/rego_policy.mdx:146.

No other bugs, broken anchors, or regressions found in the changed lines — the updated #local-input-data / #local-exit-codes / #policy-contract / #trail-moment anchor links all resolve to real headings in the rewritten page.

View job run

The repo's example test reads every Rego block with a package as a file
to create and requires `package policy` and an `allow` rule. The server
accepts any package name, but `package policy` is valid on both routes,
so the examples now declare it and also run with `kosli evaluate trail`.
The params schema snippet becomes a complete policy for the same reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread policy-reference/rego_policy.mdx
The safety rules and the example helper spoke of a trail being
compliant, which reads as checking flow-template compliance, the
direction we are moving away from. They now talk about a policy's
requirements, the helper is renamed `requirements_met`, and the
`is_compliant` field notes that a policy should check the attestations
it requires instead. The params schema snippet no longer reads an
attestation path that does not exist.

See kosli-dev/server#7656

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
staging — 54bf416a Deployed Oct 26, 2026 by mintlify[bot]
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.

2 participants