Raptor handoff: Carcass attribute review

This is the Raptor integration contract for Carcass-assisted product and attribute review. It is implemented through Meat Ontology API contract 1.28.0. The leftover-advice extension in contract 1.29.0 was deployed from Taxonomy commit 2fee816 on 2026-09-22. Contract 1.30.0 adds title-weight role replacements and disagreements. Contract 1.31.0 adds title-grade handoff for assisted Resolve. Contract 1.35.0 adds guarded missing-value rind, bone and calibration handoff. Contract 1.37.0 adds guarded missing-value origin-country handoff. Coordinate Carcass and Raptor enablement before exposing new review controls in the Raptor UI.

The boundary

Raptor continues to call Meat Ontology only. It must not call Carcass, recreate a Carcass response, or apply a model proposal directly.

Meat Ontology:

Raptor:

1. Request a ledgered proposal

Use the normal server-side Meat Ontology client with taxonomy:resolve. Send a ledgered Resolve request with assistance enabled:

{
  "text": "Pork back fat with rind, frozen",
  "mode": "ledgered",
  "assist": "always",
  "metadataLocale": "en",
  "context": { "commodity": "Pork" },
  "includeApplicableAttributes": true
}

The resolve dialog sends assist: "always" so Carcass is asked on auto-tag and when fuzzy matching abstains among candidates, not only after a helpable review. Batch tagging and other non-dialog clients keep assist: "on" or omit it. When Carcass is configured and the resolver reads a title weight, Meat Ontology calls /numbers even if assist is omitted or off; this does not call /read. If Resolve has no product label to send, assist.error.code is product_unavailable.

Do not use interactive mode for the Apply flow: an interactive result has no resolution event and cannot be confirmed. Keep using the sanitized seller title and structured source facts already sent by Raptor; do not substitute a canonical product label for text. Send listing descriptions in supportingTexts and a catalogue name in alternateTexts with role catalogue_product_name. Never paste a description into text.

Assistance is record-only for the product pick. Title weights Carcass classified may set the owner of a matching text-read amount, including one that already has a resolver role; that can clear a weight-only review. A validated Carcass title reading may fill a missing grade, rind, bone, calibration or origin-country value; grade may also replace separate A and B readings with the quoted A/B mix. Product identity and description numbers remain unchanged. If Carcass is unavailable or its answer is invalid, Resolve still succeeds and assist.error explains why no proposal is available.

Origin-country adoption requires one supported country/nationality quote and only one recognized country across the entire title. Existing origins and ambiguities take precedence. Location, destination and Incoterm wording is withheld even when there is only one country: exw France, in Vietnam and to Singapore remain proposals, never automatic origins. Negation, country styles and ambiguous animal names are guarded too. Rejected readings remain in assist.attributes for human review. The handoff reuses resolver nationality wordings and the release's country labels and terms, with Brasil also recognized. It does not infer a new location field.

When /read leaves numbers null, Meat Ontology calls POST /numbers with the selected primary label or the first candidate. An ordinary Resolve with a title weight calls /numbers directly using that label. Title numbers stay under assist.numbers.numbers. Numbers read from supporting text appear under assist.numbers.supporting and must not be written onto the listing. Carcass pick and attributes still see only the title. Classified numbers may include confidence in [0, 1]; show it, do not gate Apply on it.

Carcass num-3 may classify a number as duration, for example valid 7 days or shelf life 18 months. It has value: null, no unit or role, and may carry confidence. Show it separately from calendar date values. A duration read from supporting text is informational and is never saved.

Matcher readings that exist only in a listing_description stay on result.supportingEvidence with effect: "informational". They are not in result.attributes and must not be saved by Apply unless the reviewer adds them as an explicit added decision. Technical-specification additions and corroborating or conflicting description evidence stay visible as such.

Open the review card when resolutionEvent.id is present and any of these are present:

assist.attributes.for must equal assist.pick.choice; Meat Ontology already enforces this. assist.applied.selection stays false. assist.applied.observations lists title numbers whose owners were written onto matching text-read amounts. Each entry includes replacedRole, the resolver role before replacement. assist.applied.attributes lists adopted title grade, rind, bone, calibration and origin-country readings with their quote and any replaced grade values. Description readings are never listed there. assist.weightDisagreements identifies a title weight Carcass classified as a price or another non-weight (not_weight), read with a different amount or unit (amount_mismatch), or proposed with a role the resolver's product validation rejects (role_rejected). It includes the number index and resolver quote. A disagreement adds a weight ambiguity and sends the result to review; the resolver weight remains visible for a person to settle.

Leftover advice (API 1.29)

When the title has unresolved wording and Carcass serves left-v3 / left-1, Meat Ontology returns:

{
  "leftovers": {
    "leftovers": [
      {
        "raw": "in one",
        "reason": "unsupported_vocabulary",
        "kind": "accounted",
        "confidence": 0.99,
        "coveredBy": {
          "field": "packagingOptions",
          "quote": "1 pcs in one vacuum bag"
        }
      }
    ],
    "model": "left-v3",
    "format": "left-1",
    "ms": 16
  }
}

Render the five kinds as advisory labels: accounted, value, changes, home, and not_product. Only accounted has coveredBy; field: "product" means the selected candidate, otherwise the field and quote are an exact resolver reading. Catalogue-product-name residue is not sent to this model.

Do not apply this advice to listing fields or the acceptance gate. The correction control and its feedback write are separate work; until they exist, display the advice without an accept action.

2. Render the review card

Show the proposed product first:

Then render numbers and attributes:

Response Raptor behavior
assist.numbers.numbers[] Show title numbers with kind, role, and optional confidence. Matching title weights can use Carcass's role. Show replacedRole from assist.applied.observations. duration is display-only.
assist.weightDisagreements[] Show the resolver quote beside Carcass's indexed number and require human review. Do not silently accept the disputed resolver weight.
assist.numbers.supporting[] Show description/spec/terms numbers on the card. Never write them onto the listing.
result.supportingEvidence informational attributes Mark as description-only / not saved. Apply does not persist them unless the reviewer adds that field/value.
attributes.read[] Show field, proposed value, confidence, and highlighted exact quote. Require accept, correct, or remove.
attributes.unclear[] Show the quoted wording and listed choices, next to the understood readings. Never choose automatically. A human choice is submitted as an added value.
attributes.noField[] Show as unsupported wording with the same quote highlight as readings. Never mark it covered or invent a field.

Count Understood rows once. Do not add merged result.attributes together with the same supportingEvidence item.

When several result.ambiguities are pairwise attributes.weight diffs, render one question: the amounts in words, and Carcass's proposed owners. Raw pairs stay under Details.

Use Meat Ontology labels for display and machine values for requests and storage. To obtain the complete release-scoped editor choices for the proposed product, make an interactive Resolve using the same original input plus the proposed selection:

{
  "text": "Pork back fat with rind, frozen",
  "mode": "interactive",
  "assist": "off",
  "metadataLocale": "en",
  "context": { "commodity": "Pork" },
  "selection": {
    "conceptId": "<assist.pick.choice>",
    "source": "assist",
    "confidence": 0.99
  },
  "includeApplicableAttributes": true
}

Use applicableAttributes.attributes to populate correction and addition controls. Check that this response has the same ontology release identity as the ledgered proposal; otherwise discard the card and resolve again. Never accept free-text field keys or values.

Also compare suggestions with the interactive response's result.attributes:

If the reviewer changes the product, discard all attribute suggestions because they were read for the previous product. Use Raptor's existing manual product flow and resolve again; do not carry the old readings across products.

3. Submit the decisions

Confirm the immutable proposal event:

POST /v1/resolution-events/{resolutionEventId}/assist-confirmations
Authorization: Bearer <the same taxonomy:resolve client>
Content-Type: application/json

Always send an explicit attributes array, including [] when there were no readings. Although a bodyless request remains supported for backward compatibility, it accepts every proposed reading and does not capture an explicit Raptor review.

{
  "attributes": [
    { "decision": "accepted", "proposalIndex": 0 },
    { "decision": "corrected", "proposalIndex": 1, "value": "rindless" },
    { "decision": "removed", "proposalIndex": 2 },
    { "decision": "added", "field": "fatFirmness", "value": "hard" }
  ]
}

Rules:

4. Persist the confirmation, not the preview

On success, use the returned values as the source of truth:

Keep the full returned applied.attributes decision list. Its basis is assist_confirmed; do not rewrite it as parser, alias, or automatic evidence. Corrected entries also retain the model's original value in proposed; added entries have from: "person" and no model quote.

Only update the listing after the confirmation succeeds. The original Resolve event is immutable and is not rewritten by Apply.

5. Retries and errors

Raptor acceptance checklist

The full consumer contract and examples remain in Structured listing integration; generated request and response schemas are in the OpenAPI 1.29 document.