Skip to content

compute: discover the API surface at runtime instead of compiling it in#318

Open
samcm wants to merge 1 commit into
masterfrom
feat/dynamic-compute-spec
Open

compute: discover the API surface at runtime instead of compiling it in#318
samcm wants to merge 1 commit into
masterfrom
feat/dynamic-compute-spec

Conversation

@samcm

@samcm samcm commented Jul 21, 2026

Copy link
Copy Markdown
Member

Replaces the checked-in compute OpenAPI spec and its generated 11k-line client with runtime discovery: the panda server now fetches the service's OpenAPI document through the credential proxy (cached per datasource), and dispatches compute.* operations generically from it — path/query/header args classified by the document, required body fields enforced from its schemas, everything else passed through as body fields. Operations added upstream are callable without touching panda, via panda compute call <operation> and compute.call(...) / list_api_operations() in Python.

Two adapters keep the legacy flat argument shapes working (create_sandbox snapshot source, fork identity nesting) and the old SSH-key operation names remain as aliases. The operation index keeps structural data only (ids, paths, parameter names), never the document's free text, pinned by a sentinel-branded test fixture. All 46 previously wired operations resolve to the same method and path as the generated client did against the production document; 16 more become reachable through call.

Note: panda compute call needs a server running this change — against an older server it returns unknown-operation.

https://claude.ai/code/session_01WmTXRKrnKGn6HvMA2Hdoos

The compute integration was pinned to a hand-copied OpenAPI document: every
upstream API change meant re-copying the spec, regenerating an 11k-line
typed client, and hand-updating the server's per-operation argument mapping,
the CLI, and the Python docs.

The service publishes its OpenAPI 3 document at /v1/openapi.yaml, so fetch
it through the credential proxy at runtime (cached per datasource, stale
tolerated on refresh failure) and dispatch operations generically: path,
query, and header arguments are classified by the document, required body
fields are enforced from its schemas, and everything else passes through as
body fields. Operations added upstream become callable with no panda change,
via `panda compute call <operation>` and compute.call(...) in Python, with
list_api_operations serving the discovered catalog.

Two small adapters keep the legacy flat argument shapes working
(create_sandbox snapshot source, fork identity nesting), and the previous
SSH-key operation names remain as aliases. The index retains only structural
data — operation ids, paths, parameter names — never the document's free
text, so nothing upstream-specific surfaces to callers; tests pin that with
a sentinel-branded fixture. All 46 previously wired operations resolve to
identical method+path against the production document.

The generated client, embedded spec, and codegen tooling are removed
(-14.4k lines).

Claude-Session: https://claude.ai/code/session_01WmTXRKrnKGn6HvMA2Hdoos
@github-actions

Copy link
Copy Markdown
Contributor

🐼 Smoke eval — b71d8d1: ✅ 8/8 pass

📊 Interactive report — tokens p50 20,521 · tokens/solve 25,442.

Reference points: master@1f61a26 100% · v0.38.7 98%.

question result tokens tools
forky_node_coverage 27,855 6
tracoor_node_coverage 19,464 9
mainnet_block_arrival_p50 16,301 9
list_datasources 13,006 2
block_count_24h 21,328 10
missed_slots_24h 27,188 16
chartkit_default_arrival_distribution 58,678 29
storage_upload_session_scoped 19,714 15
🔭 Langfuse traces (8 runs; ⚠️ = failed)

The report walks this branch's commits against the master baseline and the most recent release. A self-contained copy is in the run's eval-smoke-* artifact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant