MCPcopy
hub / github.com/openai/plugins / bounded_code_evidence

Function bounded_code_evidence

plugins/codex-security/scripts/finding_preview.py:178–194  ·  view source on GitHub ↗
(value: Any)

Source from the content-addressed store, hash-verified

176
177
178def bounded_code_evidence(value: Any) -> Any:
179 if not isinstance(value, list):
180 return value
181 bounded = []
182 for item in value[:FINDING_CODE_EVIDENCE_LIMIT]:
183 if not isinstance(item, dict):
184 bounded.append(item)
185 continue
186 evidence = dict(item)
187 code = evidence.get("code")
188 if isinstance(code, str):
189 evidence["code"] = bounded_json_text(
190 code,
191 FINDING_CODE_EVIDENCE_SNIPPET_BYTES,
192 )[0]
193 bounded.append(evidence)
194 return bounded
195
196
197def bounded_json_value(value: Any, budget: list[int], *, depth: int = 0) -> Any:

Callers 2

bounded_finding_detailsFunction · 0.85
bounded_finding_sectionFunction · 0.85

Calls 2

bounded_json_textFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected