(value: Any)
| 21 | |
| 22 | |
| 23 | def bounded_finding_details(value: Any) -> dict[str, Any]: |
| 24 | if not isinstance(value, dict): |
| 25 | return {} |
| 26 | prepared: dict[str, Any] = {} |
| 27 | for aliases, maximum_bytes, priority_keys, reserved_fields in ( |
| 28 | ( |
| 29 | ("rootCause", "root_cause"), |
| 30 | FINDING_ROOT_CAUSE_PREVIEW_BYTES, |
| 31 | ( |
| 32 | "summary", |
| 33 | "description", |
| 34 | "detail", |
| 35 | "cause", |
| 36 | "rationale", |
| 37 | "why", |
| 38 | "explanation", |
| 39 | "evidenceRefs", |
| 40 | "evidence_refs", |
| 41 | ), |
| 42 | ( |
| 43 | (("summary", "description", "detail", "cause", "rationale", "why"), 1_000), |
| 44 | (("evidenceRefs", "evidence_refs"), 400), |
| 45 | ), |
| 46 | ), |
| 47 | ( |
| 48 | ("validation",), |
| 49 | FINDING_VALIDATION_PREVIEW_BYTES, |
| 50 | ( |
| 51 | "summary", |
| 52 | "conclusion", |
| 53 | "method", |
| 54 | "status", |
| 55 | "disposition", |
| 56 | "result", |
| 57 | "rationale", |
| 58 | "evidenceRef", |
| 59 | "evidence_ref", |
| 60 | "evidenceRefs", |
| 61 | "evidence_refs", |
| 62 | "assertions", |
| 63 | "evidence", |
| 64 | "limitations", |
| 65 | ), |
| 66 | ( |
| 67 | (("summary", "conclusion", "rationale", "detail", "disposition"), 800), |
| 68 | (("method",), 256), |
| 69 | (("status",), 128), |
| 70 | (("evidenceRefs", "evidence_refs"), 400), |
| 71 | (("assertions",), 400), |
| 72 | (("evidence",), 400), |
| 73 | (("limitations",), 400), |
| 74 | ), |
| 75 | ), |
| 76 | ( |
| 77 | ("attackPath",), |
| 78 | FINDING_ATTACK_PATH_PREVIEW_BYTES, |
| 79 | ( |
| 80 | "narrative", |
no test coverage detected