merge: fix/phase1-knowledge-specialist-s3-surface-check — the live surface check lists gradio's own /_ endpoints (hf_oauth's /_check_login_status) rather than failing on them; dev Space ca9fcc8 passed gate, surface and five lookups
Browse files
scripts/check_live_surface.py
CHANGED
|
@@ -90,12 +90,18 @@ def _surface_matches(client) -> bool:
|
|
| 90 |
descriptor = yaml.safe_load(DESCRIPTOR.read_text())
|
| 91 |
expected = {t["api_name"]: list(t["params"]) for t in descriptor["tools"]}
|
| 92 |
named = client.view_api(return_format="dict", print_info=False)["named_endpoints"]
|
|
|
|
|
|
|
| 93 |
live = {
|
| 94 |
name: [p.get("parameter_name") or p.get("label") for p in spec.get("parameters", [])]
|
| 95 |
for name, spec in named.items()
|
|
|
|
| 96 |
}
|
| 97 |
passed = live == expected
|
| 98 |
-
print(
|
|
|
|
|
|
|
|
|
|
| 99 |
if not passed:
|
| 100 |
for name in sorted(set(live) | set(expected)):
|
| 101 |
if live.get(name) != expected.get(name):
|
|
|
|
| 90 |
descriptor = yaml.safe_load(DESCRIPTOR.read_text())
|
| 91 |
expected = {t["api_name"]: list(t["params"]) for t in descriptor["tools"]}
|
| 92 |
named = client.view_api(return_format="dict", print_info=False)["named_endpoints"]
|
| 93 |
+
# Gradio's own endpoints start with "/_" (hf_oauth adds /_check_login_status); listed, not compared.
|
| 94 |
+
internal = sorted(name for name in named if name.startswith("/_"))
|
| 95 |
live = {
|
| 96 |
name: [p.get("parameter_name") or p.get("label") for p in spec.get("parameters", [])]
|
| 97 |
for name, spec in named.items()
|
| 98 |
+
if name not in internal
|
| 99 |
}
|
| 100 |
passed = live == expected
|
| 101 |
+
print(
|
| 102 |
+
f"{'PASS' if passed else 'FAIL'} view_api == descriptor: {sorted(live)}"
|
| 103 |
+
f" (gradio internals: {internal})"
|
| 104 |
+
)
|
| 105 |
if not passed:
|
| 106 |
for name in sorted(set(live) | set(expected)):
|
| 107 |
if live.get(name) != expected.get(name):
|