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

Function derive_topic_key

agents/master-coordinator/main.py:481–488  ·  view source on GitHub ↗

Turn free-form topic text into a stable profile key.

(topic: str)

Source from the content-addressed store, hash-verified

479
480
481def derive_topic_key(topic: str) -> str:
482 """Turn free-form topic text into a stable profile key."""
483 cleaned = re.sub(r"\s+", " ", (topic or "").strip().strip("“”\"'`"))
484 canonical_key = resolve_canonical_topic_key(cleaned)
485 if canonical_key:
486 return canonical_key
487 normalized = normalize_direction_key(cleaned)
488 return normalized or cleaned.lower()
489
490
491def clamp_weight(value: float, minimum: float = 0.1, maximum: float = 0.95) -> float:

Callers

nothing calls this directly

Calls 2

normalize_direction_keyFunction · 0.85

Tested by

no test coverage detected