Commit b8c2cfc
feat(client)!: live-verified spec drift batch + verification harness
Reusable harness (``scripts/spec_drift_verify.py`` + per-issue probe
scripts) for running tagged POSTs against a live Katana tenant and
cleaning up afterwards. Every test artifact gets an ``SDT-<date>``
prefix and is recorded in ``/tmp/spec-drift-ledger.jsonl``; a single
``cleanup`` subcommand walks the ledger in reverse and deletes
everything (idempotent — already-deleted rows are skipped).
Spec-drift findings encoded in ``docs/katana-openapi.yaml``:
**#737 — CustomFieldDefinition**
- ``id``: ``integer`` → ``string, format: uuid`` (per README example,
inferred — couldn't live-verify because our API key lacks create
permission on this endpoint, but README is authoritative and the
shape is universal across Katana custom-field surfaces).
- ``field_type``: ``string maxLength: 50`` → new
``CustomFieldType`` enum (``shortText`` / ``number`` /
``singleSelect`` / ``date`` / ``boolean`` / ``url``). Verified
via live-API 422 introspection.
- ``entity_type``: ``string maxLength: 50`` → new
``CustomFieldEntityType`` enum with **19 values** (vs README's
documented 1). Verified via live-API 422 introspection — the
enum spans SalesOrder, SalesOrderRow, ManufacturingOrder*,
PurchaseOrder*, StockAdjustment*, Production*, Customer,
ProductVariant, MaterialVariant, ServiceVariant.
- ``CustomFieldDefinition`` no longer extends ``UpdatableEntity``
because the singleton's ``id`` is a UUID string, not the integer
``BaseEntity`` defines for the rest of the API surface.
``created_at`` / ``updated_at`` are inlined.
**#736 — variant_bin_locations + CreateServiceVariant.sku**
- ``POST /variant_bin_locations`` request body wrapped in array
(``minItems: 1, maxItems: 500``). The endpoint description
already said "accepts up to 500 variant storage bin objects"
but the schema was a single object. Verified via live API:
single-object body returns ``422 must be array``.
- ``CreateServiceVariantRequest.sku`` is no longer required. The
field is nullable. Verified by creating a service variant via
the live API with ``sku`` omitted — server accepted it and
returned ``sku: null``.
**#738 — StockTransferRowRequest.quantity**
- Changed from ``number`` to ``string``. Verified via live-API
422 introspection — sending a JSON number returns
``must be string``. Wire format is a fixed-precision decimal
string (e.g. ``"1.0000000000"``). MCP boundary in
``stock_transfers._build_row_requests`` stringifies the pydantic
``float`` input at the call site.
**#739 — SalesOrderFulfillment**
- No spec change needed. Verified ``sales_order_fulfillment_rows``
IS required on create — local spec is correct, README is stale.
Findings deferred to follow-ups:
- **#734** ``custom_fields`` shape — live API rejects array-shaped
custom_fields with ``must be object`` at both SO and SO-row
create paths; dict-shape is accepted. Local READ schemas use
structured-array shape, which contradicts this. Read-side
verification requires a populated example (tenant has zero
``custom_field_definitions`` and our key can't create them).
Sweeping all the READ schemas is broader than this PR.
- **#736** ``CustomFieldDefinition`` ``options`` shape, ``id`` type
via live API, ``UpdateCustomerRequest.default_billing_id``,
``Operator`` fields — all blocked by either authorization
(custom_field_definitions endpoint) or absence of populated
fixtures on this tenant.
BREAKING CHANGE: ``CustomFieldDefinition.id`` becomes a UUID string
(was integer); ``field_type`` / ``entity_type`` become enums;
``CreateServiceVariantRequest.sku`` is no longer required (callers
omitting it will continue to work, but ``required`` removal is a
schema-level breaking change); ``StockTransferRowRequest.quantity``
becomes a string. The MCP ``stock_transfers`` boundary already
stringifies the input float so MCP callers don't have to.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 96d467e commit b8c2cfc
23 files changed
Lines changed: 1615 additions & 235 deletions
File tree
- docs
- katana_mcp_server/src/katana_mcp/tools/foundation
- katana_public_api_client
- api
- custom_fields
- variant_default_storage_bin
- models_pydantic/_generated
- models
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7632 | 7632 | | |
7633 | 7633 | | |
7634 | 7634 | | |
7635 | | - | |
| 7635 | + | |
| 7636 | + | |
| 7637 | + | |
| 7638 | + | |
7636 | 7639 | | |
7637 | 7640 | | |
7638 | | - | |
7639 | | - | |
7640 | 7641 | | |
7641 | 7642 | | |
7642 | | - | |
7643 | | - | |
| 7643 | + | |
| 7644 | + | |
| 7645 | + | |
| 7646 | + | |
| 7647 | + | |
| 7648 | + | |
| 7649 | + | |
7644 | 7650 | | |
7645 | 7651 | | |
7646 | 7652 | | |
| |||
10658 | 10664 | | |
10659 | 10665 | | |
10660 | 10666 | | |
| 10667 | + | |
| 10668 | + | |
| 10669 | + | |
| 10670 | + | |
| 10671 | + | |
| 10672 | + | |
| 10673 | + | |
| 10674 | + | |
| 10675 | + | |
| 10676 | + | |
| 10677 | + | |
| 10678 | + | |
| 10679 | + | |
| 10680 | + | |
| 10681 | + | |
| 10682 | + | |
| 10683 | + | |
| 10684 | + | |
| 10685 | + | |
| 10686 | + | |
| 10687 | + | |
| 10688 | + | |
| 10689 | + | |
| 10690 | + | |
| 10691 | + | |
| 10692 | + | |
| 10693 | + | |
| 10694 | + | |
| 10695 | + | |
| 10696 | + | |
| 10697 | + | |
| 10698 | + | |
| 10699 | + | |
| 10700 | + | |
| 10701 | + | |
| 10702 | + | |
| 10703 | + | |
| 10704 | + | |
| 10705 | + | |
| 10706 | + | |
| 10707 | + | |
| 10708 | + | |
| 10709 | + | |
| 10710 | + | |
| 10711 | + | |
10661 | 10712 | | |
10662 | 10713 | | |
10663 | 10714 | | |
10664 | 10715 | | |
10665 | 10716 | | |
10666 | 10717 | | |
10667 | | - | |
10668 | | - | |
10669 | | - | |
10670 | | - | |
10671 | | - | |
10672 | | - | |
10673 | | - | |
10674 | | - | |
10675 | | - | |
10676 | | - | |
10677 | | - | |
10678 | | - | |
10679 | | - | |
10680 | | - | |
10681 | | - | |
10682 | | - | |
10683 | | - | |
10684 | | - | |
10685 | | - | |
10686 | | - | |
10687 | | - | |
10688 | | - | |
10689 | | - | |
10690 | | - | |
10691 | | - | |
10692 | | - | |
10693 | | - | |
10694 | | - | |
10695 | | - | |
10696 | | - | |
10697 | | - | |
10698 | | - | |
10699 | | - | |
10700 | | - | |
10701 | | - | |
10702 | | - | |
10703 | | - | |
10704 | | - | |
10705 | | - | |
10706 | | - | |
10707 | | - | |
10708 | | - | |
10709 | | - | |
10710 | | - | |
10711 | | - | |
10712 | | - | |
10713 | | - | |
10714 | | - | |
10715 | | - | |
| 10718 | + | |
| 10719 | + | |
| 10720 | + | |
| 10721 | + | |
| 10722 | + | |
| 10723 | + | |
| 10724 | + | |
| 10725 | + | |
| 10726 | + | |
| 10727 | + | |
| 10728 | + | |
| 10729 | + | |
| 10730 | + | |
| 10731 | + | |
| 10732 | + | |
| 10733 | + | |
| 10734 | + | |
| 10735 | + | |
| 10736 | + | |
| 10737 | + | |
| 10738 | + | |
| 10739 | + | |
| 10740 | + | |
| 10741 | + | |
| 10742 | + | |
| 10743 | + | |
| 10744 | + | |
| 10745 | + | |
| 10746 | + | |
| 10747 | + | |
| 10748 | + | |
| 10749 | + | |
| 10750 | + | |
| 10751 | + | |
| 10752 | + | |
| 10753 | + | |
| 10754 | + | |
| 10755 | + | |
| 10756 | + | |
| 10757 | + | |
| 10758 | + | |
| 10759 | + | |
| 10760 | + | |
| 10761 | + | |
| 10762 | + | |
| 10763 | + | |
| 10764 | + | |
| 10765 | + | |
| 10766 | + | |
| 10767 | + | |
| 10768 | + | |
| 10769 | + | |
| 10770 | + | |
| 10771 | + | |
| 10772 | + | |
| 10773 | + | |
| 10774 | + | |
| 10775 | + | |
| 10776 | + | |
| 10777 | + | |
| 10778 | + | |
| 10779 | + | |
| 10780 | + | |
| 10781 | + | |
| 10782 | + | |
10716 | 10783 | | |
10717 | | - | |
10718 | | - | |
10719 | | - | |
10720 | | - | |
10721 | | - | |
| 10784 | + | |
| 10785 | + | |
| 10786 | + | |
| 10787 | + | |
| 10788 | + | |
10722 | 10789 | | |
10723 | 10790 | | |
10724 | | - | |
10725 | | - | |
10726 | | - | |
10727 | | - | |
10728 | | - | |
10729 | | - | |
| 10791 | + | |
| 10792 | + | |
| 10793 | + | |
| 10794 | + | |
| 10795 | + | |
| 10796 | + | |
| 10797 | + | |
| 10798 | + | |
| 10799 | + | |
10730 | 10800 | | |
10731 | 10801 | | |
10732 | 10802 | | |
| |||
10742 | 10812 | | |
10743 | 10813 | | |
10744 | 10814 | | |
10745 | | - | |
10746 | | - | |
10747 | | - | |
| 10815 | + | |
| 10816 | + | |
| 10817 | + | |
| 10818 | + | |
| 10819 | + | |
| 10820 | + | |
10748 | 10821 | | |
10749 | | - | |
10750 | | - | |
10751 | | - | |
| 10822 | + | |
| 10823 | + | |
| 10824 | + | |
| 10825 | + | |
| 10826 | + | |
| 10827 | + | |
10752 | 10828 | | |
10753 | 10829 | | |
10754 | 10830 | | |
10755 | | - | |
| 10831 | + | |
| 10832 | + | |
| 10833 | + | |
10756 | 10834 | | |
10757 | 10835 | | |
10758 | 10836 | | |
| |||
10763 | 10841 | | |
10764 | 10842 | | |
10765 | 10843 | | |
10766 | | - | |
| 10844 | + | |
| 10845 | + | |
| 10846 | + | |
| 10847 | + | |
| 10848 | + | |
| 10849 | + | |
| 10850 | + | |
10767 | 10851 | | |
10768 | | - | |
10769 | | - | |
10770 | | - | |
10771 | | - | |
10772 | | - | |
| 10852 | + | |
| 10853 | + | |
| 10854 | + | |
| 10855 | + | |
| 10856 | + | |
10773 | 10857 | | |
10774 | | - | |
10775 | | - | |
10776 | | - | |
10777 | | - | |
| 10858 | + | |
| 10859 | + | |
| 10860 | + | |
| 10861 | + | |
10778 | 10862 | | |
10779 | 10863 | | |
10780 | 10864 | | |
| |||
10809 | 10893 | | |
10810 | 10894 | | |
10811 | 10895 | | |
10812 | | - | |
10813 | | - | |
10814 | | - | |
10815 | | - | |
10816 | | - | |
10817 | | - | |
| 10896 | + | |
| 10897 | + | |
| 10898 | + | |
| 10899 | + | |
| 10900 | + | |
| 10901 | + | |
10818 | 10902 | | |
10819 | | - | |
10820 | | - | |
10821 | | - | |
10822 | | - | |
10823 | | - | |
10824 | | - | |
| 10903 | + | |
| 10904 | + | |
| 10905 | + | |
| 10906 | + | |
| 10907 | + | |
| 10908 | + | |
| 10909 | + | |
| 10910 | + | |
| 10911 | + | |
10825 | 10912 | | |
10826 | 10913 | | |
10827 | 10914 | | |
| |||
12747 | 12834 | | |
12748 | 12835 | | |
12749 | 12836 | | |
12750 | | - | |
12751 | | - | |
| 12837 | + | |
| 12838 | + | |
| 12839 | + | |
| 12840 | + | |
| 12841 | + | |
| 12842 | + | |
12752 | 12843 | | |
12753 | 12844 | | |
12754 | 12845 | | |
| |||
17253 | 17344 | | |
17254 | 17345 | | |
17255 | 17346 | | |
| 17347 | + | |
| 17348 | + | |
| 17349 | + | |
| 17350 | + | |
| 17351 | + | |
17256 | 17352 | | |
17257 | 17353 | | |
17258 | 17354 | | |
17259 | 17355 | | |
17260 | 17356 | | |
17261 | 17357 | | |
17262 | 17358 | | |
17263 | | - | |
| 17359 | + | |
| 17360 | + | |
| 17361 | + | |
| 17362 | + | |
| 17363 | + | |
17264 | 17364 | | |
17265 | 17365 | | |
17266 | 17366 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
292 | 296 | | |
293 | 297 | | |
294 | | - | |
| 298 | + | |
295 | 299 | | |
296 | 300 | | |
297 | 301 | | |
| |||
0 commit comments