Skip to content

docs: document label passthrough from catalog items to policy engine - #15

Merged
chadcrum merged 3 commits into
dcm-project:mainfrom
chadcrum:flpath-4124-doc-label-passthrough
Apr 29, 2026
Merged

docs: document label passthrough from catalog items to policy engine#15
chadcrum merged 3 commits into
dcm-project:mainfrom
chadcrum:flpath-4124-doc-label-passthrough

Conversation

@chadcrum

@chadcrum chadcrum commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Connects the dots across the catalog items, catalog item instances, and policies user-guide pages so policy authors understand that metadata labels must be declared as catalog item fields to reach input.spec in Rego policies.

  • Added "Fields and Policy Evaluation" subsection to the Catalog Items page explaining the governance boundary
  • Extended the validation note on the Catalog Item Instances page to explain how user_values flow to input.spec
  • Added "How input.spec is Constructed" section and an end-to-end label policy example to the Policies page

Resolves: FLPATH-4124

🤖 Generated with Claude Code

Summary by Sourcery

Clarify how catalog item fields and instance user_values populate input.spec for policy evaluation and provide an end-to-end label-based policy example.

Documentation:

  • Document how catalog item fields and instance user_values are the only sources for input.spec in Rego policies.
  • Explain the governance boundary created by catalog item fields and how labels must be declared as fields to be visible to policies.
  • Update catalog item instance documentation to describe how validated user_values flow into input.spec for policy evaluation.
  • Add an example policy showing how instance labels propagate from catalog item definition to Rego policy input.

Preview: https://chadcrum.github.io/dcm-project.github.io/

Changed sections:

Connect the dots across catalog items, instances, and policies pages
so policy authors understand that metadata labels must be declared as
catalog item fields to reach input.spec in Rego policies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Chad Crum <chadcrum@users.noreply.github.com>
@chadcrum chadcrum self-assigned this Apr 28, 2026
@chadcrum
chadcrum marked this pull request as ready for review April 28, 2026 21:40
@chadcrum
chadcrum requested a review from a team as a code owner April 28, 2026 21:40

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • In the new explanations of how input.spec is built, consider explicitly stating how conflicts between catalog item default values and user_values are resolved (i.e., that user_values effectively override defaults), so policy authors aren't left to infer the precedence.
  • The description of the governance boundary (“only catalog item fields are visible to policies”) is repeated across the three pages; you might centralize the full explanation in one place and keep the others shorter with a pointer to avoid future drift between them.
  • In the catalog item instances note, you reference input.spec.metadata.labels.env “for the label shown above,” but the immediate example uses metadata.labels.region; aligning the example label name across sections would reduce potential confusion.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In the new explanations of how `input.spec` is built, consider explicitly stating how conflicts between catalog item `default` values and `user_values` are resolved (i.e., that `user_values` effectively override defaults), so policy authors aren't left to infer the precedence.
- The description of the governance boundary (“only catalog item fields are visible to policies”) is repeated across the three pages; you might centralize the full explanation in one place and keep the others shorter with a pointer to avoid future drift between them.
- In the catalog item instances note, you reference `input.spec.metadata.labels.env` “for the label shown above,” but the immediate example uses `metadata.labels.region`; aligning the example label name across sections would reduce potential confusion.

## Individual Comments

### Comment 1
<location path="content/docs/user-guide/catalog-item-instances.md" line_range="53" />
<code_context>
+> **Note:** Each value provided in `user_values` will be validated against its corresponding item in the catalog item's `fields` list. If the `field` is not editable (`editable=false`) or the `value` does not pass the `validation_schema` the request will be rejected. After validation, these values become part of the resource spec evaluated by placement [policies](../policies/), accessible as `input.spec.*` in Rego code (e.g., `input.spec.metadata.labels.env` for the label shown above). Only fields declared in the catalog item are included; see [How `input.spec` is Constructed](../policies/#how-inputspec-is-constructed) for details.
</code_context>
<issue_to_address>
**suggestion (typo):** Add a comma before "the request will be rejected" for smoother grammar.

In this sentence, add a comma before "the request will be rejected" so it reads: "...does not pass the `validation_schema`, the request will be rejected."

```suggestion
> **Note:** Each value provided in `user_values` will be validated against its corresponding item in the catalog item's `fields` list. If the `field` is not editable (`editable=false`) or the `value` does not pass the `validation_schema`, the request will be rejected. After validation, these values become part of the resource spec evaluated by placement [policies](../policies/), accessible as `input.spec.*` in Rego code (e.g., `input.spec.metadata.labels.env` for the label shown above). Only fields declared in the catalog item are included; see [How `input.spec` is Constructed](../policies/#how-inputspec-is-constructed) for details.
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread content/docs/user-guide/catalog-item-instances.md Outdated
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Chad Crum <chadcrum@users.noreply.github.com>

@ygalblum ygalblum 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.

Small comment, I'm fine also if you disagree.

Comment thread content/docs/user-guide/catalog-item-instances.md Outdated
Move policy-related content out of the validation note into a dedicated
"Policy Evaluation" subsection to better target the policy author audience.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Chad Crum <chadcrum@users.noreply.github.com>
@chadcrum
chadcrum merged commit 6e3af40 into dcm-project:main Apr 29, 2026
3 checks passed
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.

3 participants