Skip to main content

Module integrity

Module integrity 

Source
Expand description

Component integrity + recursion/path validation.

Ports integrity_checker.py. Operates on raw &serde_json::Value (not ComponentModel) so it can run on incoming message payloads before they are parsed into the internal model.

v0.9-flat ONLY. Python’s v0.8 structured-component shape ({"component": {"Type": {...}}}) and its arbitrary-nested componentId recursion (extract_pointers) are intentionally omitted: ComponentModel already rejects the v0.8 shape, so the validator stays consistent with the existing parser. In v0.9-flat, a componentId only ever appears inside a children Template object.

Constants§

MAX_FUNC_CALL_DEPTH
Maximum nesting depth of function-call ({call, args}) chains (mirrors Python MAX_FUNC_CALL_DEPTH).
MAX_GLOBAL_DEPTH
Maximum nesting depth of the whole JSON tree (mirrors Python MAX_GLOBAL_DEPTH). Guards against pathological payloads.

Functions§

get_component_references
Extract every (ref_id, field_name) pair from a single v0.9-flat component object.
validate_component_integrity
Validate component integrity: duplicate ids, missing root, dangling references. Collects ALL errors (does not short-circuit), returning a ValidationReport.
validate_recursion_and_paths
Validate recursion depth and path syntax across an arbitrary JSON value.