Skip to content

Improve class object navigation and client lifetime docs#9

Merged
terjekv merged 2 commits into
mainfrom
agent/improve-class-object-navigation
Jul 24, 2026
Merged

Improve class object navigation and client lifetime docs#9
terjekv merged 2 commits into
mainfrom
agent/improve-class-object-navigation

Conversation

@terjekv

@terjekv terjekv commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add client.classes.by_id(id) with synchronous and asynchronous class operations plus nested .objects access
  • use client.classes.by_name(name).objects for name-addressed object workflows
  • remove the unreleased client.objects(id) and client.objects_by_class_name(name) selectors
  • migrate README, documentation, unit tests, and pinned-server e2e tests to the nested resource hierarchy
  • document application-lifetime client ownership, HTTPX connection-pool reuse, and explicit sync/async shutdown
  • add sync/async regression coverage for selected-class CRUD, nested object queries, and absence of the old aliases

Why

client.objects(42) obscures the resource hierarchy and makes the numeric argument's role less obvious. The nested selectors make class selection explicit and give ID-addressed navigation the same shape as the existing by-name interface:

client.classes.by_id(42).objects
client.classes.by_name("Servers").objects

The package has not been released, so retaining compatibility aliases would unnecessarily establish two public ways to express the same operation.

The lifetime guidance also clarifies that a context-managed client remains persistent for its full block and that framework or worker applications can manage one client from startup through shutdown to reuse eligible TCP/TLS connections.

User impact

Object services are now accessed exclusively through an explicitly selected class. This is an intentional pre-release API cleanup; there is no released compatibility contract to preserve.

Validation

  • uv sync --extra dev
  • uv run ruff format --check .
  • uv run ruff check .
  • uv run mypy
  • uv run bandit -q -r src scripts
  • uv run zizmor .
  • uv run pytest --cov — 307 passed, 99.42% coverage
  • uv run mkdocs build --strict
  • uv build
  • ./scripts/run-e2e-tests.sh — 6 passed against the pinned Hubuum v0.0.3 image

@terjekv
terjekv marked this pull request as ready for review July 24, 2026 22:48
@terjekv
terjekv merged commit 7dfc3ad into main Jul 24, 2026
7 checks passed
@terjekv
terjekv deleted the agent/improve-class-object-navigation branch July 24, 2026 22:48
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