[M3] stale_field error returns the submitted value as current_options instead of the live taxonomy options (PUBLISH-20) #82

Closed
opened 2026-09-20 18:16:48 +00:00 by grokbot_ty · 1 comment
Owner

Summary

PUBLISH-20 requires a stale value to produce a field-level error with the current options. The API returns the value the client just submitted in that slot, so a UI rendering detail.current_options would present the rejected value as if it were the option list.

Found in a read-only review of main @ b99cbdf (2026-09-20). 63 backend tests pass and both docs gates pass at that commit; these are gaps the green suite does not cover.

Observed evidence

backend/slabs.py:148-158:

if not _check_taxonomy(conn, table, val):
    return _err("stale_field", f"{field} not in current taxonomy",
                {"current_options": val}, status=422)   # val == the submitted value

Reproduction:

PUT /api/v1/slabs/s1  {"client_rev": 1, "edge_type_term_id": 999}
-> 422 {"error": {"code": "stale_field",
            "message": "edge_type_term_id not in current taxonomy",
            "detail": {"current_options": 999}}}

999 is the client's own input echoed back. The live options live in woo_attribute_terms / woo_categories / woo_tags — the same tables _check_taxonomy just queried.

Acceptance

  • detail.current_options carries the actual current term/category/tag list for that field (id + name), read from the taxonomy tables.
  • A test asserts the returned options are the seeded taxonomy rows and that the submitted bogus value is not among them.
  • The field name in the message maps to an owner-readable label, not a column name (QUALITY-120).

Related

  • #77 (stale-field recovery at publish UI), #45
  • Requirements: PUBLISH-20, REVIEW-35, QUALITY-120
## Summary `PUBLISH-20` requires a stale value to produce a field-level error **with the current options**. The API returns the value the client just submitted in that slot, so a UI rendering `detail.current_options` would present the rejected value as if it were the option list. Found in a read-only review of `main` @ `b99cbdf` (2026-09-20). 63 backend tests pass and both docs gates pass at that commit; these are gaps the green suite does not cover. ## Observed evidence `backend/slabs.py:148-158`: ```python if not _check_taxonomy(conn, table, val): return _err("stale_field", f"{field} not in current taxonomy", {"current_options": val}, status=422) # val == the submitted value ``` Reproduction: ``` PUT /api/v1/slabs/s1 {"client_rev": 1, "edge_type_term_id": 999} -> 422 {"error": {"code": "stale_field", "message": "edge_type_term_id not in current taxonomy", "detail": {"current_options": 999}}} ``` `999` is the client's own input echoed back. The live options live in `woo_attribute_terms` / `woo_categories` / `woo_tags` — the same tables `_check_taxonomy` just queried. ## Acceptance - `detail.current_options` carries the actual current term/category/tag list for that field (id + name), read from the taxonomy tables. - A test asserts the returned options are the seeded taxonomy rows and that the submitted bogus value is **not** among them. - The field name in the message maps to an owner-readable label, not a column name (QUALITY-120). ## Related - `#77` (stale-field recovery at publish UI), `#45` - Requirements: PUBLISH-20, REVIEW-35, QUALITY-120
Author
Owner

Closed by M3 Option A: main 0c00d25 + UAT QUALITY-110 evidence.

  • Deploy: version 0.5.0-m3, woo_reachable: true
  • test-woo ok (taxonomy synced)
  • Inference off for the walk; SLAB-UAT-125846 → Woo draft product_id=48147 matching reviewed ready set
  • Must-fix covered: #79 UA/403, #82 live current_options, #83 unknown-field/taxonomy 4xx, #84 health probe+version, #89 Create title/short from review, #98 live-edge from synced edge term + attr slug resolve
Closed by M3 Option A: main `0c00d25` + UAT QUALITY-110 evidence. - Deploy: version `0.5.0-m3`, `woo_reachable: true` - `test-woo` ok (taxonomy synced) - Inference off for the walk; **SLAB-UAT-125846** → Woo draft `product_id=48147` matching reviewed ready set - Must-fix covered: #79 UA/403, #82 live `current_options`, #83 unknown-field/taxonomy 4xx, #84 health probe+version, #89 Create title/short from review, #98 live-edge from synced edge term + attr slug resolve
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Ty_Tech/SlabUploader#82