1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- """Backend-agnostic rule-engine primitives shared by both CEL backends.
16-
17- ``Violation``, ``RuleContext``, ``CompilationError``, and the ``Rules`` ABC do
18- not depend on the CEL implementation (celpy vs cel-expr-python) or the
19- descriptor/value model (protobuf-py vs google.protobuf) — they only speak the
20- public ``validate_pb`` path types. Both the celpy engine (``rules.py``) and the
21- cel-expr-python engine (``celexpr/rules.py``) import them from here so violation
22- output and path bookkeeping are identical across backends.
23- """
15+ """Backend-agnostic rule-engine primitives shared by both CEL backends."""
2416
2517import abc
2618import typing
@@ -33,12 +25,7 @@ class CompilationError(Exception):
3325
3426
3527class Violation :
36- """A singular rule violation.
37-
38- Field and rule paths accumulate as element lists during recursion
39- (messages are immutable and do not auto-vivify), then materialize into a
40- ``validate_pb.Violation`` lazily via :attr:`proto`.
41- """
28+ """A singular rule violation."""
4229
4330 field_value : typing .Any
4431 rule_value : typing .Any
@@ -69,7 +56,6 @@ def extend_rule_elements(self, elements: list[validate_pb.FieldPathElement]) ->
6956 self ._rule_elements .extend (elements )
7057
7158 def finalize_paths (self ) -> None :
72- """Reverses the accumulated leaf-to-root paths into root-to-leaf order."""
7359 self ._field_elements .reverse ()
7460 self ._rule_elements .reverse ()
7561
0 commit comments