MCPcopy Create free account
hub / github.com/917Dhj/DeepPaperNote / contains_old_reference

Function contains_old_reference

scripts/lint_grounding.py:107–118  ·  view source on GitHub ↗
(value: Any)

Source from the content-addressed store, hash-verified

105
106
107def contains_old_reference(value: Any) -> bool:
108 prefixes = WRITING_CONTRACT_RULES["old_bundle_reference_prefixes"]
109 tokens = WRITING_CONTRACT_RULES.get("old_evidence_reference_tokens", ())
110 if isinstance(value, str):
111 return any(prefix in value for prefix in prefixes) or any(
112 token in value for token in tokens
113 )
114 if isinstance(value, dict):
115 return any(contains_old_reference(item) for item in value.values())
116 if isinstance(value, list):
117 return any(contains_old_reference(item) for item in value)
118 return False
119
120
121def valid_section_id(value: Any, valid_ids: set[str]) -> bool:

Callers 2

source_grounding_errorsFunction · 0.85
validate_note_planFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected