Skip to content

refactor!: simplify SDK contracts and test ownership - #2047

Merged
Sau1707 merged 1 commit into
mainfrom
refactor/sdk-cleanup-contracts
Dec 3, 2026
Merged

Sau1707 merged 1 commit into
mainfrom
refactor/sdk-cleanup-contracts

Conversation

@Sau1707

@Sau1707 Sau1707 commented Dec 3, 2026

Copy link
Copy Markdown
Member

Summary

  • Simplify audit registration, profile upserts, and HTTP method validation through existing model contracts.
  • Register audit listeners on sqlalchemy.orm.Session; retain model filtering for isolation and update the API caller.
  • Restore sys.path after normal, interrupted, and configuration-failure dev command exits.
  • Clean up test setup and boundary mocks; cover TRACE rejection and path restoration.

Breaking change: Replace install_listener(Session, AuditType) with install_listener(AuditType). Unsupported HTTP methods remain rejected, but now use the model validation diagnostic.

Validation

  • SDK: pytest -q -m 'not integration' — 547 passed, 1 deselected; Docker image-build integration excluded.
  • SDK Ruff lint, formatting, and ty checks passed.
  • API: pytest tests/database/models/test_base.py tests/database/test_session.py -q — 3 passed. Changed API session file passed Ruff lint, formatting, and ty checks.
  • Path restoration regression checks fail against the old behavior; a configuration-failure probe confirmed restoration and error propagation.
  • Initial isolated SDK validation lacked ignored frontend assets; reran with existing generated assets. API tests use their required bootstrap settings.
  • git diff --check passed.

Remove duplicate validation and profile-update contracts, scope development import paths, and simplify test boundaries.

BREAKING CHANGE: audit.install_listener now accepts only the audit model type. Replace install_listener(Session, AuditType) with install_listener(AuditType).
@Sau1707 Sau1707 added api Related to the control plane breaking Breaking changes requiring migration refactor Structural improvements without changing intended behavior sdk Related to the applications SDK labels Dec 3, 2026
@Sau1707
Sau1707 merged commit 14da922 into main Dec 3, 2026
16 checks passed
@Sau1707
Sau1707 deleted the refactor/sdk-cleanup-contracts branch December 3, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Related to the control plane breaking Breaking changes requiring migration refactor Structural improvements without changing intended behavior sdk Related to the applications SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant