MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _resolve_broad_must_read_keyword

Function _resolve_broad_must_read_keyword

agents/must-read-manager/main.py:133–147  ·  view source on GitHub ↗

Return a canonical direction when a keyword is too broad for hard must-read.

(value: str)

Source from the content-addressed store, hash-verified

131
132
133def _resolve_broad_must_read_keyword(value: str) -> Optional[str]:
134 """Return a canonical direction when a keyword is too broad for hard must-read."""
135 cleaned = clean_must_read_value(value)
136 normalized_key = normalize_direction_key(cleaned)
137 if normalized_key in BROAD_MUST_READ_KEYWORD_ALIASES:
138 return BROAD_MUST_READ_KEYWORD_ALIASES[normalized_key]
139
140 resolved = resolve_canonical_direction(cleaned, include_paper_terms=True)
141 if not resolved:
142 return None
143
144 canonical = str(resolved.get("canonical_name") or "").strip()
145 if canonical in BROAD_MUST_READ_KEYWORD_DIRECTIONS:
146 return canonical
147 return None
148
149
150def _keyword_resolves_to_direction(value: Any, canonical_direction: str) -> bool:

Callers 1

add_must_readFunction · 0.70

Calls 4

clean_must_read_valueFunction · 0.85
normalize_direction_keyFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected