docs(#1750): document result format and result_helper functions#1754
docs(#1750): document result format and result_helper functions#1754fullsend-ai-coder[bot] wants to merge 1 commit into
Conversation
Add a "Result format" section to the policy authoring guide that
documents the result object schema expected by the Conforma
evaluation engine, including all fields (code, msg, effective_on,
collections, term, severity) with their types and descriptions.
Document the result_helper, result_helper_with_term, and
result_helper_with_severity functions from data.lib.metadata
with parameter descriptions and usage guidance. Add a table
mapping annotations to result fields, and a complete example
showing a policy rule with result_helper.
Update the "safer version" code example in the Pitfalls section
to use result_helper instead of raw {"msg": "..."} objects,
demonstrating the recommended pattern with proper METADATA
annotations.
Closes #1750
|
🤖 Finished Review · ✅ Success · Started 10:30 AM UTC · Completed 10:43 AM UTC |
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
ReviewFindingsLow
Info
|
| | An additional value for grouping or identifying the specific subject of the violation (e.g., a | ||
| task name or image reference). | ||
|
|
||
| | `severity` |
There was a problem hiding this comment.
[low] technical accuracy
The Result helpers section links to policy-reference#metadata on the OPA website, but the documentation for rego.metadata.chain() lives under policy-language#metadata. The existing links in this same file already use the policy-language path. Using policy-reference#metadata may land on a different section or produce a 404.
Suggested fix: Change the URL from https://www.openpolicyagent.org/docs/policy-reference#metadata to https://www.openpolicyagent.org/docs/policy-language#metadata.
Add a "Result format" section to the policy authoring guide that documents the result object schema expected by the Conforma evaluation engine, including all fields (code, msg, effective_on, collections, term, severity) with their types and descriptions.
Document the result_helper, result_helper_with_term, and result_helper_with_severity functions from data.lib.metadata with parameter descriptions and usage guidance. Add a table mapping annotations to result fields, and a complete example showing a policy rule with result_helper.
Update the "safer version" code example in the Pitfalls section to use result_helper instead of raw {"msg": "..."} objects, demonstrating the recommended pattern with proper METADATA annotations.
Closes #1750
Post-script verification
agent/1750-doc-result-format)71f6e6cf3f4e90d51f66207404e70034b501b3f7..HEAD)