Skip to content

fix(api): publish real HTTP class contracts and typed async client - #100

Merged
marlon-costa-dc merged 10 commits into
0.12.0-devfrom
fix/api-http-contracts-tip
Sep 19, 2026
Merged

marlon-costa-dc merged 10 commits into
0.12.0-devfrom
fix/api-http-contracts-tip

Conversation

@marlon-costa-dc

@marlon-costa-dc marlon-costa-dc commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

fix(api): publish real HTTP class contracts and typed async client

What this delivers

Flext-API's HTTP surface gains owner-derived class-object contracts and a
typed async client, converging the salvage of fix/api-http-contracts-tip
with the current 0.12.0-dev integration line (merged --no-ff, commit
206ccb80).

1. Httpx protocol namespace with owner-derived status contracts

  • FlextApiProtocolsTransports.Httpx (_protocols/transports.py): runtime-checkable
    protocol namespace carrying CONFLICT: ClassVar[int] = int(httpx.codes.CONFLICT).
  • Keeps class identity OUT of the protocol namespace: construction and
    isinstance semantics stay intact and the Protocol/namespace census contract
    is preserved (rationale documented in the class docstring).

2. Module-level Httpx* class-object re-exports

  • protocols.py now publishes HttpxAsyncClient, HttpxClient, HttpxHTTPError,
    HttpxHTTPStatusError, HttpxRequestError, HttpxResponse,
    HttpxTimeoutException through an explicit __all__ — consumers can construct
    and isinstance-narrow these names with both static and runtime class semantics.
  • tests/unit/test_transports_facade_httpx.py (TestsFlextApiHttpxContracts)
    covers the facade.

3. Typed async client

  • FlextApiAsyncClient (and FlextApiClient) construction stays on the
    integration convention: explicit runtime_settings= binding through the s
    service base — no global-singleton fallback, per the dependency-injection law.

Convergence with integration (fork 822a53a1 → integration 9e418cd8)

The branch merged origin/0.12.0-dev with --no-ff and resolves the divergence
in integration's favor wherever the two lineages overlapped:

  • Services plumbing keeps integration's newer shape: c.Api message constants
    (URL_PATH_EMPTY_ERROR, URL_PATH_SEPARATOR), self.settings.Api binding,
    integration MRO order (RequestMixin, Base).
  • Feature surface (transports protocol namespace, Httpx* re-exports, facade
    tests) is kept from this branch — it does not exist in integration.
  • Generated surfaces (tests/unit/__init__.py lazy map, workspace projections)
    regenerated through the canonical make gen; make fix / make fmt applied.

Fleet audit context (bead flext-v4fmn)

This PR is the single surviving open PR of the 2026-09-18 fleet supersession
audit: every other branch/PR evaluated was either fully absorbed by the
integration line (evidence recorded in the bead) or retained as active lane
state. The HTTP contract work here is real undelivered functionality verified
absent from 0.12.0-dev (git grep Httpx|CONFLICT empty on the integration tip
before this change).

Validation

  • make setup, make gen, make fix, make fmt from the workspace dispatcher
    (exit 0, receipts in bead flext-v4fmn).
  • Standalone CI=Y make gen fixed point, make check, make test — see PR
    checks.

Marlon Costa added 5 commits September 15, 2026 08:52
…ntracts-tip

# Conflicts:
#	README.md
#	docs/api-reference/README.md
#	docs/api-reference/generated/overview.md
#	src/flext_api/_protocols/transports.py
#	src/flext_api/protocols.py
#	src/flext_api/services/_services/base_request.py
#	src/flext_api/services/async_client.py
#	src/flext_api/services/base_client.py
#	src/flext_api/services/client.py
#	tests/unit/__init__.py
#	tests/unit/test_transports_facade_httpx.py
@marlon-costa-dc marlon-costa-dc changed the title fix(api): publish real HTTP class contracts fix(api): publish real HTTP class contracts and typed async client Sep 18, 2026
Marlon Costa added 5 commits September 18, 2026 20:59
… with 1f0add9

- Normalized corrupted fences (4-backtick openers, indented closers, orphan
  pairs) in docs/architecture/decisions/002-railway-pattern.md and
  docs/api/core.md so embedded python blocks extract cleanly
  (markdown-code gate: 41 -> 0 findings)
- prettier reflow via canonical make fmt (markdown-format: 9 -> 0)
- gen fixed point against integration tip 1f0add9
The new namespace structure rule requires each test facade to declare
exactly one nested class composing the production letter. The five
test facades carried empty helper nesteds plus a second Tests class;
collapsed to the canonical single Tests MRO shape. Full check (19
gates) and test suite green locally.
@sonarqubecloud

Copy link
Copy Markdown

@marlon-costa-dc
marlon-costa-dc merged commit 93677f3 into 0.12.0-dev Sep 19, 2026
6 checks passed
@marlon-costa-dc
marlon-costa-dc deleted the fix/api-http-contracts-tip branch September 21, 2026 18:44
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