Skip to content

docs(api): document datatype stability and ogx-api package surfaces#5719

Open
cdoern wants to merge 3 commits intoogx-ai:mainfrom
cdoern:api-stability-updates
Open

docs(api): document datatype stability and ogx-api package surfaces#5719
cdoern wants to merge 3 commits intoogx-ai:mainfrom
cdoern:api-stability-updates

Conversation

@cdoern
Copy link
Copy Markdown
Collaborator

@cdoern cdoern commented May 5, 2026

Summary

Expands docs/docs/concepts/apis/api_leveling.mdx to cover the ogx-api Python package as a distinct public contract alongside the HTTP API surface. Pre-1.0 cleanup so the stability story is coherent before we ship.

What changed

  • New "Public Datatype Stability" section splitting ogx-api into two surfaces:
    • API datatypes (ogx_api.types.*) — level inherited from the highest-stability route that references the type, with per-level compat tables and explicit breaking/non-breaking lists.
    • Provider SDK (ogx_api.provider.*) — a single v1-stable surface for the plugin ABI (Api, ProviderSpec, protocol classes, webmethod, etc.). Removals/renames/signature changes are major-bump-only; deprecations carry across one major. Includes external-provider pinning recommendations.
    • Status note flags that the sub-namespace split is in progress; today both surfaces export flat from ogx_api.__init__.
  • New "Deprecation timeline"/v1 removals can't happen in the same Y-stream as the deprecation flag; renames are deprecations, not in-place swaps.
  • Replaced the "Testing" stub with "Conformance Testing" — describes the suites that actually exist today (backward-compat.yml, openresponses-conformance.yml, external-spec coverage scripts, test-external*) and what each one catches. Adds an "Outstanding work before 1.0" punch list.
  • Fixed stale references: replaced the now-removed post_training example with current /v1alpha and /v1beta routes, fixed the v1alpha1 typo, removed the broken #3237 link.
  • Dropped the x-stability/oasdiff section (unimplemented; not worth keeping aspirational).

Open questions for review

  • Provider SDK is documented as v1-stable — confirm the team agrees, given protocol classes still occasionally gain abstract methods.
  • Sub-namespace split (ogx_api.types/ogx_api.provider) is called out as in-progress. Happy to follow up with the actual refactor in a separate PR if there's appetite.
  • A separate doc page (docs/docs/api-experimental/index.mdx) still lists Datasets/DatasetIO/Eval/Benchmarks APIs that no longer exist — out of scope here, but flagging.

Test plan

  • Render docs/docs/concepts/apis/api_leveling.mdx locally (docs-build workflow) and verify anchors resolve (#deprecation-timeline, #public-datatype-stability, #conformance-testing).
  • Spot-check the conformance-testing section against current .github/workflows/ (no renamed/removed workflows referenced).

🤖 Generated with Claude Code

cdoern and others added 3 commits May 5, 2026 11:18
Expand the API stability policy to cover the ogx-api Python package as a
distinct public contract. Define two surfaces — API datatypes
(ogx_api.types.*, level inherited from referencing routes) and the
Provider SDK (ogx_api.provider.*, a single v1-stable surface) — with
per-surface compatibility rules, deprecation timelines, and pinning
recommendations for external providers. Replace the stale post_training
example with the current /v1alpha and /v1beta routes, and replace the
abandoned conformance-tracking issue link with descriptions of the
suites that exist today (backward-compat, openresponses-conformance,
external-spec coverage, test-external). Drop the unimplemented
x-stability/oasdiff section.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Charlie Doern <cdoern@redhat.com>
Strip the in-progress namespace paths from the policy doc; the sub-namespace
split will land in a follow-up PR. The two-surface conceptual model stays —
bucketing rules define which surface a symbol belongs to regardless of its
current import path.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Charlie Doern <cdoern@redhat.com>
@cdoern cdoern marked this pull request as ready for review May 6, 2026 17:15
skamenan7 pushed a commit to skamenan7/llama-stack that referenced this pull request May 6, 2026
ogx-ai#5740)

## Summary

Splits the public surface of the `ogx-api` Python package into two
import namespaces, as called out in the API Stability policy work in
ogx-ai#5719. No file moves, no behavioral changes — just aggregate
`__init__.py` modules that re-export from existing per-API submodules.

- **`ogx_api.provider`** (59 symbols) — Provider SDK surface for
out-of-tree providers: `Api`,
`ProviderSpec`/`InlineProviderSpec`/`RemoteProviderSpec`, protocol
classes (`Inference`, `Responses`, `VectorIO`, `Safety`, `Files`, …),
schema utilities (`webmethod`, `json_schema_type`, `register_schema`),
`Resource`/`ResourceType`, version constants, validators. Levelled as a
single `v1`-stable contract per the policy.
- **`ogx_api.types`** (413 symbols) — API datatype surface:
request/response Pydantic models, content blocks, errors, value types.
Each datatype's stability is inherited from the highest-stability route
that references it.

Shared resource/value types (`Model`, `Shield`, `ToolGroup`,
`VectorStore`) are canonically in `ogx_api.types` and re-exported from
`ogx_api.provider` for provider-side ergonomics — these are the only
allowed overlap.

### Backwards compatibility

Top-level imports (`from ogx_api import X`) continue to work unchanged
for every symbol. New code should prefer the explicit namespace path:

```python
from ogx_api.provider import Api, Inference, ProviderSpec
from ogx_api.types import OpenAIResponseObject, ChatCompletionMessage
```

### Out of scope

- Physically moving files into the new directories.
- Deprecating or warning on top-level imports.
- Touching internal `ogx` server imports.

## Test plan

- [x] New contract test `tests/unit/test_ogx_api_namespaces.py` (5
cases): asserts disjoint namespaces, top-level back-compat (every
namespaced symbol resolves to the same object via `ogx_api`), and
presence of core symbols. **All pass.**
- [x] Broader unit-test sweep: `uv run pytest tests/unit/
--ignore=tests/unit/providers` → **973 passed**. Provider-test failures
in this env are pre-existing missing optional deps (`moto`,
`databricks`), not introduced here.
- [x] `pre-commit run` clean on touched files (ruff, ruff-format, mypy,
license-headers, API spec codegen all pass; the `check-init-py` hook
fails on macOS bash 3.2 — pre-existing, unrelated).
- [ ] CI to run `test-external.yml` and
`test-external-provider-module.yml` against this branch to confirm
out-of-tree provider builds still work via top-level imports.

## Related

- Policy doc PR: ogx-ai#5719 (defines the two-surface model conceptually).
This PR is the implementation. Trivial doc conflict expected on
whichever merges second; either is straightforward to resolve.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Charlie Doern <cdoern@redhat.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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