feat(use-cases): add inline use-case definitions #44

Merged
goldstein merged 1 commit from feat/inline-use-case into main 2026-04-18 19:05:07 +00:00
Owner

Adds RequestIX.use_case_inline so callers can ship an ad-hoc extraction schema in the request itself, bypassing the registry. The pipeline builds fresh (Request, Response) Pydantic classes per call via ix.use_cases.inline.build_use_case_classes; structural errors map to IX_001_001. Inline wins when both use_case and use_case_inline are set. No behaviour change for existing REST callers.

TDD: 25 new unit tests covering types, Optional/required, choices → Literal, dup/invalid names, class-naming, and SetupStep precedence. Full unit suite green (266 passing). Ruff clean.

Prepares for feat/ui (PR 2) where the UI can submit custom use cases without touching the backend.

Adds `RequestIX.use_case_inline` so callers can ship an ad-hoc extraction schema in the request itself, bypassing the registry. The pipeline builds fresh (Request, Response) Pydantic classes per call via `ix.use_cases.inline.build_use_case_classes`; structural errors map to `IX_001_001`. Inline wins when both `use_case` and `use_case_inline` are set. No behaviour change for existing REST callers. TDD: 25 new unit tests covering types, Optional/required, choices → Literal, dup/invalid names, class-naming, and SetupStep precedence. Full unit suite green (266 passing). Ruff clean. Prepares for feat/ui (PR 2) where the UI can submit custom use cases without touching the backend.
goldstein added 1 commit 2026-04-18 19:01:42 +00:00
feat(use-cases): add inline use-case definitions
All checks were successful
tests / test (push) Successful in 2m1s
tests / test (pull_request) Successful in 1m18s
703da9035e
Adds RequestIX.use_case_inline so callers can define ad-hoc extraction
schemas in the request itself, bypassing the backend registry. The
pipeline builds a fresh (Request, Response) Pydantic class pair per
call via ix.use_cases.inline.build_use_case_classes; structural errors
(dup field, bad identifier, choices-on-non-str, empty fields) raise
IX_001_001 to match the registry-miss path. Inline wins when both
use_case and use_case_inline are set. Existing REST callers see no
behavioural change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
goldstein merged commit 1481a7baac into main 2026-04-18 19:05:07 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: goldstein/infoxtractor#44
No description provided.