Add source-aware policy params declaration detection - #826
Maksym (maksym-mishchenko) wants to merge 3 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Mark Birger (kusha)
left a comment
There was a problem hiding this comment.
Maksym (@maksym-mishchenko) Could we make this check generic instead of hard-coding params? I’d call it HasDeclaredRuleRootedAt(sourcePath, rootName) and use HasDeclaredRuleRootedAt(sourcePath, "params") here. It should keep the current behavior: inspect declarations in that source, count params and its descendants, including defaults, without evaluating the rules.
|
Maksym (@maksym-mishchenko) I second Mark's suggestion. It is better to make this generic. Also, ensure that we can detect rules that have prefixes. e.g |
Accept exact dotted declaration prefixes without evaluating rules, preserving source grammar, parser context, resource limits, and native/managed error precedence. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
I changed it to |
Policy loaders need to identify policy-authored
paramsrule heads before injecting assignment parameters; evaluatingparamsmisses conditional declarations. Add a nonexecutingHasPolicyParams(sourcePath)API across Rust, FFI, and C# that inspects only the uniquely matched loaded source. It detects default, function, set, and descendant rule heads without rejecting references or generated bridge rules, and reports missing, ambiguous, or unclassifiable sources as errors.