# Meat Ontology API — coding-agent integration guide

Use this document when implementing a client for the Meat Ontology API.

## Authoritative sources

1. OpenAPI consumer contract: <https://taxonomy.meatborsa.com/openapi/v1.json>
2. Human documentation: <https://taxonomy.meatborsa.com/docs>
3. Errors and retries: <https://taxonomy.meatborsa.com/docs/errors>
4. Contract changelog: <https://taxonomy.meatborsa.com/docs/changelog>
5. Localized attribute metadata: <https://taxonomy.meatborsa.com/docs/attributes>
6. Structured listing integration: <https://taxonomy.meatborsa.com/docs/structured-listing-integration>

Treat the OpenAPI contract as authoritative for paths, methods, parameters, request bodies, response
schemas, scopes, and rate limits. Do not infer undocumented fields.

The agreed target is [one MeatBorsa canonical model](/docs/concepts), with external standards
mapped to canonical meaning. Consolidation and client migration are pending. The behavior below
describes the current API, including separate scheme concepts; it does not make those separate
identities a permanent design requirement. Preserve current IDs and evidence until reviewed
migration guidance is published. Do not implement client-side merges by label or fabricate a
standard to obtain a resolved result.

## Integration constraints

- Base URL: `https://taxonomy.meatborsa.com`
- API contract version: `/v1`
- Authentication: `Authorization: Bearer <service-key>`
- Recommended secret variable: `TAXONOMY_API_KEY`
- Optional base URL variable: `TAXONOMY_BASE_URL`
- Media type: `application/json`
- Consumer scopes: `taxonomy:read`, `taxonomy:resolve`, `taxonomy:vocabulary:read`, `taxonomy:knowledge.draft`
- Do not call `/v1/admin` operations from a consumer client.
- Do not expose a service key to browser or mobile code.
- Do not place a key in a URL, exception, trace attribute, metric label, or log.

The API is publicly documented but authenticated. There is no anonymous consumer API and no shared
demo credential. A Meat Ontology administrator creates a dedicated client and reveals its
credential once.

## Version semantics

`/v1` is the HTTP API contract version. `taxonomyRelease.version` is an independent ontology-data
release (field name kept for compatibility). `resolver.version` and `resolver.behaviorChecksum`
independently identify the matching, normalization, scoring, qualifier, and selection behavior
that interpreted the data. Checksum equality—not the human-readable resolver version—is the
authoritative behavior comparison.

Do not place an ontology release such as `0.4.0` into the API path. Preserve both the complete
`taxonomyRelease` reference and complete `resolver` reference with cached or derived resolver
results.

Resolution and ordinary browse operations use the current immutable published release. The API does
not accept a historical release selector for resolution. `GET /v1/releases/diff`,
`GET /v1/releases/:id/dictionary`, `GET /v1/releases/:id/incoterms`, and
`GET /v1/releases/:id/expansions` are deliberate read-only historical operations; they do not make
that release selectable by the resolver.

## Client behavior

For keystroke-driven RFQ assistance, use `GET /v1/suggest` with the full sanitized RFQ (up to 2,000
characters), not repeated ledgered Resolve calls. See [Suggest](/docs/suggest) for matching,
release-change handling, dedicated per-replica limits, privacy, and cancellation. Suggestions are
advisory. At draft checkpoints, use REST `POST /v1/resolve` with `mode: "interactive"` to get the
same resolution result without a `resolutionEvent` or quality-ledger writes; the answer carries
`interactiveDecision`, the decision the ledger would derive, with no event. On submission, omit
`mode`, set `requestReference` to the final RFQ ID, and use the returned event for feedback.
Interactive calls retain `taxonomy:resolve` but have their own allowance. See
[Interactive RFQ resolution](/docs/interactive-resolve); MCP remains ledgered.

1. Load the key from server-side secret configuration.
2. Set `Accept: application/json` on every request.
3. Set `Content-Type: application/json` when sending a JSON body.
4. Send the bearer key on every `/v1` request.
5. Parse non-2xx bodies as `{ error: { code, detail, requestId } }`.
6. Handle `401`, `403`, `429`, and `503` explicitly.
7. Honor `Retry-After` for `429`; use bounded exponential backoff with jitter for `500` and `503`.
8. Treat pagination cursors as opaque and pass `nextCursor` unchanged.
9. Preserve stable entity IDs; do not use labels as durable identifiers.
10. Treat the pair of ontology content checksum and resolver behavior checksum as the resolver
    watermark.
11. Support request cancellation and set an application-appropriate deadline.
12. Request `includeAttributeMetadata` only when stable attribute identities or localized display
    definitions are needed; do not feed its labels back into selection logic.
13. Send long descriptions, specifications, or commercial paragraphs in `supportingTexts`, never
    by concatenating them into `text` or `alternateTexts`. Treat `supportingEvidence` as
    provenance-bearing enrichment; only title and genuine catalogue inputs can supply identity.

## Recommended first call

Call `GET /v1/releases/latest` to verify the credential and record the active ontology and resolver
watermark.

```bash
curl --fail-with-body \
  --header "Authorization: Bearer $TAXONOMY_API_KEY" \
  --header "Accept: application/json" \
  "${TAXONOMY_BASE_URL:-https://taxonomy.meatborsa.com}/v1/releases/latest"
```

## Common operation selection

- Browse/search data: `listConcepts`, `listSpecies`, `getConcept`, `listSchemes`.
- Traverse reviewed structure: `listConceptRelationships`, `browseSchemeTree`.
- Interpret supplier or trade text: `resolveMeatProduct`.
- Expand a semantic selector into current concept IDs: `expandConcepts`.
- Discover explicit governed sets: `listCollections`, `getCollection`.
- Render IDs for one immutable release: `getReleaseDictionary`. Use the localized `displayLabel`,
  not a raw preferred term; structured species, scheme, identifier, and term-scope fields explain
  any identity qualifier without requiring label parsing.
- Query records tagged under one immutable release: `getReleaseExpansions`.
- Enrich the resolver's decision with surrounding ontology evidence: `exploreMeatProduct`.
- Present resolved attributes with stable field/value IDs: set `includeAttributeMetadata: true` on
  Resolve or Explore and read the top-level `attributeMetadata` object.
- Check listing contradictions and unusual values without changing resolution: `validateTradeListings`.
- Compare published concept definitions and reviewed correspondences: `compareMeatCuts`.
- Find reviewed replacements: `findMeatSubstitutes`.
- Plan incremental re-tagging: `getReleaseDiff`.
- Cache an immutable snapshot: `getReleaseExport`.

`validateTradeListings` is an explicit, separate workflow. Do not assume Resolve or Explore runs
validation, and do not add client-side validation outcomes to resolver selection. Route `must_fix`
findings to correction and `worth_checking` findings to review. The price check means strictly more
than 300% above the supplied average (greater than four times that average).

## Resolution authority and Explore parity

Structured clients may send `alternateTexts`, `context`, `observations`, `metadataLocale`, and
opt-in `include` sections to Resolve. Product identity is chosen from the strongest independently
resolved text, while non-conflicting attribute evidence from every supplied text is retained.
`result.selection.selectedFrom`, `result.inputMatches`, and `result.canonicalAttributes` make that decision
auditable. Request `include: ["enrichment"]` for ID-based context around the selected concept; this
cannot rerun or change selection.

Send `inputKind: "question"` when `text` is a person's question about a product rather than a
listing title (for example `What is frozen pork jowl skin on selling for right now, FCA Spain?`).
Unread wording wholly before or after the product phrase is then the question's framing: it stays
in `result.unresolved` marked `clearedBy: "question_framing"` and no longer holds the decision.
Everything else that holds a title holds a question: unread words inside the product phrase,
product vocabulary that was not applied, ambiguity, a second product, or no product at all. Omit
the field, or send `"title"`, for listings.

Some reviewed names are also the name of a prepared food (term flag `sharedWithFinishedFood`, since
resolver 1.207.0; foie gras first). The product stays selected, but the decision is `review` with
reason code `finished_food_name` and a `finished_food_name` ambiguity on `attributes.processing`:
- when the selected product has any flagged name and the text states a processing state other
  than raw (cooked, smoked, cured...), whichever name matched, in a title or a question;
- when the title or the catalogue name (always a title) names the product through a flagged name
  and no raw processing state is stated. Only a stated raw state lifts it: fresh, chilled, frozen,
  a weight or a packaging word does not, since prepared foods are sold chilled and frozen too.
States are read from `text`, the catalogue name and `observations`, never from `supportingTexts`. A
question that states no state is not held: `Who sells duck foie gras?` tags Fat duck liver,
`Who sells cooked duck foie gras?` does not; the title `Frozen duck foie gras` is held. Carcass agreement does not clear this hold; a
`selection` supplied with `source: "human_override"` is not held by it.

`locale` is a text-language hint, never a language filter. `result.detectedLocale` reports the
selected reviewed term's language. `metadataLocale` independently selects display language.

`resolveMeatProduct` is the authoritative product-selection operation. `exploreMeatProduct` runs the
same resolver with the same text, locale, and candidate limit, then adds published terms, schemes,
identifiers, sources, relationships, and a hierarchy path around the resolver-selected concept.

For equivalent inputs:

- Explore returns the resolver's `resolved`, `ambiguous`, or `unresolved` outcome unchanged.
- Explore `focus`, when present, is the resolver's selected primary concept and uses the same score.
- Explore does not create a focus or inflate confidence for an ambiguous or unresolved result.
- Explore graph proximity and concept type never replace the resolver's ranking or ambiguity margin.

Explicit reviewed context inside the text is applied by the shared resolver as a compatibility
filter. For example, `beef` may exclude candidates whose reviewed lineage belongs to veal. Context
does not manufacture a winner among multiple compatible products: `beef rump` remains ambiguous
among the close beef rump concepts until the product description is more specific.

Caller-supplied species can also provide missing commodity terminology when that species has exactly
one reviewed compatible meat commodity. For example, `Loins IVP` with species `Domestic pig` may be
evaluated as pork product wording while the submitted text and species assertion remain distinct.
This bridge requires a non-fuzzy orderable-product match, does not infer a cutting scheme, and is
disabled when the text already contains a commodity or the species maps to multiple commodities.
It therefore cannot manufacture a winner among otherwise compatible products or erase explicit
conflicts and unsupported vocabulary.

Use `resolveMeatProduct` for capture-time tagging. Use `exploreMeatProduct` when a person or agent
also needs evidence and neighboring ontology knowledge. Never treat Explore-only graph data as a
stronger tagging decision than the resolver outcome.

### Actionable unresolved outcomes

An unresolved selection includes a stable `reasonCode`, a `missingContext` array, and `options`.
When otherwise viable candidates differ by species, bone state, or classification scheme, the
resolver returns `missing_species`, `missing_bone_state`, or `missing_scheme` rather than a generic
ambiguity. `options` contains every viable candidate for that decision, independently of the
requested candidate display limit, together with the candidate's species, schemes, and known bone
state.

`missing_scheme` is an existing diagnostic, not the target product workflow. Ask for confirmed
context if available; otherwise keep the unresolved outcome. Under the canonical-model decision,
clarification should concern a material product distinction, not require a trader to select among
parallel standard-owned catalogues. That resolver change has not been delivered by these docs.

For example, an unqualified `Trimmings` description returns `status: "unresolved"`,
`reasonCode: "missing_species"`, and the published pork, turkey, duck, and goose options. Ask for
one of the fields in `missingContext`; do not select the first option or use its score as a default.
`unsupported_product_for_species` means that explicit embedded species or supplied species context
excluded every credible product match; cross-species alternatives are deliberately absent. Route
that outcome to ontology coverage review rather than asking the caller to change the species.
`unsupported_product_for_commodity` has the same hard-boundary meaning for a separately supplied
meat commodity. Preserve both the title and commodity observations and route the disagreement to
coverage or source-data review; do not retry by deleting the commodity or choosing a candidate from
another commodity.
`insufficient_context`, `low_confidence_match`, and `no_candidate` do not claim that a particular
missing field would resolve the input and may have no viable options.

### Full-input and core terminology matches

Every resolver candidate exposes two match classifications:

- `matchType` describes the reviewed term against the complete submitted text. This field retains
  its original `/v1` meaning, so `frozen pork shoulder` is a phrase match for the reviewed term
  `pork shoulder`.
- `matchTypeCore` describes the selected product term after controlled attributes and compatible
  reviewed qualifiers have been safely consumed. The same input has an exact core match while
  `attributes.refrigeration.normalized` is `frozen`.

A phrase match is promoted to an exact core match only for the resolved primary candidate when all
text is accounted for, `ambiguities` is empty, and `unresolved` contains no entries other than
typed `non_product_vocabulary` residue. Fuzzy matches are never promoted. Conflicting attributes
such as `fresh frozen`, or unsupported text such as `special`, keep `matchTypeCore` at phrase or
fuzzy.

`score` retains its existing full-input lexical meaning; `matchTypeCore` does not rerank candidates
or change the selected concept.

Structured attributes normalize what the submitted description states; they are not independent
verification of the product. For example, `attributes.certification` preserves explicit halal,
kosher, organic/BIO, and negative wording, including the raw matched phrase, without inferring a
claim from species, origin, brand, or supplier.

Beef shoulder-clod trade wording follows the same conservative boundary. `Beef shoulder clod` and
`Beef clod` currently select the scheme-neutral product, while explicit IMPS/NAMP 114 or UNECE 2300
evidence selects that narrower standard presentation in the pre-consolidation model. Do not infer
a standard from the unqualified trade name, and do not collapse longer components such as clod
heart—or unsupported regional wording such as clod shin—into the whole-clod identity.

Gizzard wording preserves both species and preparation boundaries. Species-qualified duck and
goose wording selects their scheme-neutral gizzard identity; processed, butterfly-cut, V-style,
partially processed, USDA 71901, and explicit UNECE codes select the reviewed narrower
presentation. Bare `Gizzards`, `Poultry gizzards`, and Polish `żołądki drobiowe` require species.
`Processed` in these official product names describes cutting and removal of lining, contents,
fat, and adhering organs—not cooking. Keep fresh/frozen and raw/cooked/smoked/dried as attributes,
and do not turn unprocessed wording into an edible presentation that the release does not publish.

Poultry presentation wording is scoped before it is normalized. Breast-fillet descriptions may
expose `attributes.innerFilletPresence`; whole-bird or carcass descriptions may expose
`attributes.neckPresence`, `attributes.neckExtent`, and `attributes.gibletsPresence`. In that
carcass context only, `offal` is treated as giblets wording. These values retain what the submitted
description says and do not create separate product identities.

Offered condition alternatives are exposed in `attributes.refrigerationOptions` from ontology
0.4.186. Preserve the options and their optional per-condition packaging. An explicit fresh/frozen
choice does not emit a legacy condition scalar. Generic Box is accepted without a material review;
Since resolver 1.188.0, jumbo is a pallet-sized shipping `bin` with `tradeTerm: "jumbo-box"`.
Octabin, combo bin, gaylord, big box, bulk bin and pallet box are also bins.

- **Confirmed packaging.** `observations.packaging` values are mapped onto `packagingOptions`.
  `hanging` is a presentation, and `plate-frozen` is a freezing method, not packaging.
- **Block inference.** Explicit polyblock or naked-block wording in a single configuration infers
  refrigeration `frozen` with basis `contextual_inference`. RFQ shows this as state `inferred`. A
  stated fresh or chilled condition conflicts with it.
- **Alternatives.** A block alternative does not inherit another option's inner wrap.
- **Attribute metadata.** For `packagingOptions`, metadata matches values by facet (for example
  `form-none` versus `liner-none`), not by machine value alone.

Packaging is exposed losslessly in `attributes.packagingOptions`. A `single` specification contains
one configuration; `alternatives` contains mutually exclusive configurations and must not be
flattened into co-occurring packaging. Each configuration separates immediate-contact components
from shipping containers, block presentation and liner, arrangement, unitization, materials, and
pack-bound net weights. `contentCount` records the exact or ranged number of product pieces inside
that component; `unitsPerParent` remains the number of immediate packages inside the next outer
level. Persist the returned `minimum`, optional `maximum`, `unit`, and `relation` directly; do not
derive `unitsPerParent` from `contentCount`. `IWP` means individually wrapped and does not imply
vacuum; `IVP` entails individual vacuum packaging. `bulk` and `loose` are explicit
no-individual-wrap assertions. The legacy
`attributes.packaging` array remains a best-effort compatibility projection for single
configurations only and is intentionally omitted for alternatives. Since resolver 1.189.0 it keeps
the trade terms: IVP projects to `ivp` (not `vacuum`) and IWP to `iwp`.

Resolver 1.134.0 treats contextual `fixed` and `fixed weight` as a package-weight mode. The
relevant component or presentation carries `weightMode: "fixed"`; a phrase such as `10 kg fixed`
without an explicit container instead stores `weightMode` and `netWeight` on the configuration.
Do not infer carton or box. Bare or unrelated `fixed` wording is not packaging evidence.

Weight observations separate item measurements from commercial quantity. `measurement` is
`product_weight` for a product piece or package, `live_weight` for a source animal, and
`trade_quantity` for an explicitly labelled offer, order, lot, load, or shipment quantity. The
corresponding `offer` or `shipment` role does not describe one item's mass. Units include `g`,
`kg`, `lb`, `oz`, and metric tonnes normalized as `t`.

Since resolver 1.187.0, a weight bound to a packaging component also states which level it
measures in `packagingLevel`.

- **One-piece inner packs.** An IWP or IVP pack, or an inner component whose `contentCount` is
  exactly one piece, holds one piece. A weight bound to it is the piece weight: `role: "piece"` and
  `packagingLevel: "immediate"`. The inner component keeps the same amount as its `netWeight`,
  marked `derived: true`.
- **Other package weights** bound to a component carry `packagingLevel: "immediate"` or
  `"shipping"`.
- **Configuration-level and block weights** carry no `packagingLevel`.
- **A weight beside a multi-piece inner pack** keeps its role reading. When Carcass or a person reads
  it as a piece weight, the packaging structure stays, without a net weight.

`packagingLevel` is optional, and the role enum is unchanged.

### Applicable RFQ fields

Use `includeApplicableAttributes: true` on Resolve to discover the reviewed partial RFQ fields.
Only resolved primaries receive the projection; `not_reviewed` is not a prohibition. Keep original
text and submit confirmed trim choices through `observations.trimCode`. Respect `state`, retain
inferred evidence as inferred, and handle conflicts. See [the contract](/docs/applicable-attributes).

### Localized attribute metadata

`includeAttributeMetadata` is an optional, default-false input on Resolve and Explore. When true,
the top-level `attributeMetadata.attributes` map contains only fields present in the corresponding
resolver attributes. Field IDs are stable; controlled values also have stable IDs. Dynamic
measurements, references, and composite values may have field metadata with an empty `values`
array.

Use `metadataLocale` for Resolve presentation selection; legacy callers without it fall back to the
detected matched-term language. Explore continues to use its request locale. Supported languages
are `en`, `bg`, `pl`, and `de`; regional tags such as `de-DE` select their language. Check both the top-level and per-entry
`fallbackUsed` flags. English is the explicit fallback for unsupported or unavailable
localizations. Cache by `taxonomyRelease.contentChecksum`, locale, and ID.

This read model is behavior-neutral: requesting it does not alter normalized values, ranking, or
selection. Never infer a stronger resolution from localized metadata or feed display labels back
into matching. Use [the dedicated guide](https://taxonomy.meatborsa.com/docs/attributes) for the
full contract.

The immutable ontology release may independently carry active localized recognition aliases.
Resolve and Explore apply the same release-scoped alias index whether or not metadata was
requested. A supplied locale does not suppress an exact alias from another language; the hint is
recorded as a match or mismatch and cannot hide reviewed evidence. Outputs remain canonical machine
values and preserve the submitted wording in `raw`. Alias matching is exact by token or
phrase—never fuzzy—and conflicting explicit values remain ambiguities. Do not assume every
localized display label is a recognized input term.

### Safe automatic tagging policy

The top-level `resolutionEvent.decision` returned by `/v1/resolve` is the supported shared gate:

```ts
const { id: resolutionEventId, decision, reasonCodes } = response.resolutionEvent;
```

An interactive answer carries the same gate as `interactiveDecision` (`{ decision, reasonCodes }`),
derived by the same function from the same result; it has no event ID because nothing is recorded.

| Decision | Meaning | Required action |
|---|---|---|
| `auto_tag` | The resolver selected one concept through exact core terminology, with no unsupported text or ambiguity. Unread wording marked `inputRole: "catalogue_product_name"` came only from the catalogue name and does not block. | Store the selected concept ID, structured attributes, match evidence, and ontology release metadata. |
| `review` | The result is ambiguous, fuzzy, only a phrase-level core match, contains unsupported text, or has conflicting attributes. | Do not write an automatic tag; ask for more detail or route the input to review. |
| `no_match` | The resolver status is `unresolved`. | Do not tag. If `missingContext` is non-empty, ask for that context and show the returned `options`; otherwise use the returned `unresolved` fragments when presenting vocabulary feedback. The service may already aggregate those fragments from the sanitized request. |

`score` is a ranking signal, not a probability, and there is no supported consumer-side score
threshold that makes a fuzzy result safe. `scoreMargin` is diagnostic evidence; the resolver already
uses its ambiguity policy when producing `selection.status`. Do not replace the gate above with raw
score or margin checks. A consumer may choose a stricter review policy, but must not admit fuzzy,
ambiguous, conflicting, or partially unresolved input merely because its score is high.

Before calling Resolve or Explore, extract a sanitized product phrase from the source record. Do not
forward a complete note, conversation, document, or unrelated commercial metadata. Unsupported
fragments and the latest sanitized sample phrase may be retained by Meat Ontology as aggregate
vocabulary evidence and for contextual rechecks.

If a price survives that sanitization, Resolve removes only high-confidence amount-plus-currency
forms from ontology evidence and returns them in `commercialValues`. Do not convert
`commercialValues` into ontology attributes. Currency-free numbers, ratios, weights, codes, and
uncertain formats may remain blocking by design; never discard numeric residue client-side merely
to pass the automatic-tag gate.

For an automatic tag, preserve `resolutionEventId` and the complete `taxonomyRelease` and `resolver` references together
with `selection.primary.concept.id`, `selection.primary.matchedTerm.id`, `selectedFrom`, the
extracted `canonicalAttributes`,
`matchType`, `matchTypeCore`, `score`, and `scoreMargin` when present. Keep enough locale-aware
normalized product vocabulary to find affected rows. This makes the decision auditable and supports
later re-tagging.

## Incremental re-tagging

Poll `GET /v1/releases/latest` and compare both checksums with the watermark from the last completed
tagging pass. If either checksum changes, call:

```http
GET /v1/releases/diff?fromReleaseId=<stored-release-id>&fromResolverBehaviorChecksum=<stored-resolver-checksum>
```

Omit `toReleaseId` on the first page to compare with the current release. Preserve the returned
`toRelease.id` and include it as `toReleaseId` on every later page so a newly published release
cannot move the result set during pagination. Cursors are opaque and bound to `diffChecksum` and
the serving resolver behavior revision; restart the diff if either changes.

Apply `retagging.mode` as follows:

| Mode | Required action |
|---|---|
| `none` | Do not re-resolve rows. The diff may still contain metadata-only changes relevant to a local ontology cache. |
| `targeted` | Re-resolve original inputs associated with an `affectedConceptId`, `affectedTermId`, or locale-aware `affectedVocabulary` entry. Apply the returned selection-status and match-type sets within that target population; exact matches are not exempt because a reviewed term may have been removed or reassigned. |
| `full` | Re-resolve the complete tagged and pending corpus. This is required when prior resolver provenance is missing or changed, or when resolution graph/context changes cannot be bounded safely. |

The diff is computed directly between the two effective snapshots, so crossing several releases
does not require replaying every intermediate release. Missing
`fromResolverBehaviorChecksum` is intentionally treated as unknown provenance and returns a full
re-tagging recommendation. Re-run original product inputs through `/v1/resolve`; do not synthesize
tags from the diff records themselves. Advance the stored watermark only after the selected pass
has completed successfully.

Before re-tagging text, apply `replacements` for deprecated concept, attribute-field,
attribute-value, and collection IDs. These mappings migrate confirmed identities; `retagging`
separately describes which text-derived decisions may change.

## Implementation acceptance checklist

- The client uses the production server from the OpenAPI document unless explicitly overridden.
- The key is read at runtime and is never committed or returned to a browser.
- Required and optional inputs match the OpenAPI schemas exactly.
- Unknown request fields are not sent.
- The client exposes `error.code`, `error.detail`, `error.requestId`, and HTTP status to callers.
- The client exposes or preserves complete `taxonomyRelease` and `resolver` metadata.
- If localized attribute presentation is needed, the client sends `includeAttributeMetadata`,
  exposes stable field/value IDs, handles explicit English fallback, and keeps labels out of
  resolver decision logic.
- Automated tagging applies `recommendedAutomaticTaggingDecision` to the resolver result; Explore
  evidence does not upgrade ambiguity.
- Automatic tags require a resolved primary candidate with `matchTypeCore === "exact"`, empty
  `ambiguities`, and no `unresolved` entries other than typed `non_product_vocabulary` residue.
  Scores do not override this gate.
- Clients preserve the selected concept and matched term IDs, structured attributes, match
  evidence, score margin, ontology release, and resolver revision for every automatic tag.
- Structured clients preserve `selectedFrom`, `canonicalAttributes`, and the original sanitized
  title, alternate texts, context, and observations needed for re-tagging.
- Semantic filters use `expandConcepts` or governed collections, never label prefix matching.
- Historical display and membership use dictionary and expansion projections from the tag's exact
  release; projections from different releases are never mixed.
- Release-watermark changes invoke `getReleaseDiff`; pagination pins the returned `toRelease.id`.
- Stable-ID `replacements` are applied before the required re-tagging pass.
- Re-tagging honors `none`, `targeted`, and `full`, and unknown resolver provenance defaults to
  `full`.
- Pagination continues only when `nextCursor` is present.
- `429` honors `Retry-After`.
- Unit tests cover success, invalid input, invalid credentials, insufficient scope, throttling, and
  dependency unavailability.
- Logs redact `Authorization`, API keys, and resolver request text.

## MCP

The same service exposes authenticated MCP tools at <https://taxonomy.meatborsa.com/mcp>. MCP is
useful when an agent needs to query the ontology directly, but it is not a replacement for the
OpenAPI contract when implementing an HTTP client. The `resolve_meat_product` tool may update
operational unknown-vocabulary aggregates for fragments classified as genuinely unsupported.
Service-key requests retain API-client attribution; interactive SSO requests are aggregated without
an API-client record. The tool accepts the same `includeAttributeMetadata` option and returns the
same structured metadata as REST. Recipe tools read published recipe knowledge (foods, recipes and
ingredient facts) and can submit review drafts through `draft_recipe_subject`,
`draft_subject_formulation` and `draft_ingredient_assessment`; no MCP tool publishes a release or
a knowledge snapshot, or creates meat concepts. The older recipe-profile tools are removed.

Machine clients authenticate with a scoped `mtk_…` bearer service key. Recipe drafts require
`taxonomy:knowledge.draft` or `taxonomy:admin`. Interactive remote clients such as Claude Desktop use
Microsoft Entra OAuth discovery and organizational SSO; Entra's delegated `taxonomy.read` and
`taxonomy.resolve` scopes control the same tool families as service keys and do not grant recipe
drafts. OAuth access tokens must be tenant-, API-audience-, and approved-client-bound. Do not put a
service key into a hosted connector or distribute the Claude OAuth client secret to users.
