@@ -45,7 +45,7 @@ class KBRunError(Exception):
4545 """Raised when the operation script exits non-zero."""
4646
4747
48- def _get_kb (adj_dir : Path , kb_name : str ) -> dict [str , str ]:
48+ def get_kb (adj_dir : Path , kb_name : str ) -> dict [str , str ]:
4949 """Return the registry entry for kb_name or raise KBNotFoundError.
5050
5151 Delegates to the canonical registry parser in manage.py and converts
@@ -62,6 +62,11 @@ def _get_kb(adj_dir: Path, kb_name: str) -> dict[str, str]:
6262 return entry .as_dict ()
6363
6464
65+ def _get_kb (adj_dir : Path , kb_name : str ) -> dict [str , str ]:
66+ """Backward-compatible alias for older call sites and tests."""
67+ return get_kb (adj_dir , kb_name )
68+
69+
6570_VALID_OPERATION = re .compile (r"^[a-z][a-z0-9_-]*$" )
6671
6772
@@ -144,7 +149,7 @@ def get_operation_script(adj_dir: Path, kb_name: str, operation: str) -> Path:
144149 "Use lowercase letters, digits, hyphens, or underscores."
145150 )
146151
147- entry = _get_kb (adj_dir , kb_name )
152+ entry = get_kb (adj_dir , kb_name )
148153 kb_path_str = entry .get ("path" , "" )
149154 if not kb_path_str :
150155 raise KBNotFoundError (f"KB '{ kb_name } ' has no path in registry." )
@@ -232,7 +237,7 @@ def kb_run(
232237 "Use lowercase letters, digits, hyphens, or underscores."
233238 )
234239
235- entry = _get_kb (adj_dir , kb_name )
240+ entry = get_kb (adj_dir , kb_name )
236241 kb_path_str = entry .get ("path" , "" )
237242 if not kb_path_str :
238243 raise KBNotFoundError (f"KB '{ kb_name } ' has no path in registry." )
0 commit comments