Ownership and inventory events¶
Bazaar reports what a batch claim covers, what is installed on a terminal, and what the caller may do next. Two facts feed that view: ownership events for a claim, and installation observations for a device. This page is the contract Bazaar accepts for both.
The ownership producer is TrustMint’s ThingHub, on the topic
trustmint.thing.ownership.v1 (trustmint#298, trustmint#310). Bazaar’s consumer
is built and off by default: it starts only once its read grant on that topic is
applied and BAZAAR_OWNERSHIP_EVENTS_AUTO_STARTUP=true is set, and the live end-to-end
check runs after that (W10-LIVE). Bazaar does not invent ownership or installation
facts to fill the gap: an absent producer reads as unknown, never as success.
What this wave did NOT build (held dependencies)¶
These are recorded dependencies, not completed behaviour. None of them is claimed as met, and no code path pretends otherwise.
Missing capability |
Dependency |
Current behaviour |
|---|---|---|
Bundle authoring (create/update/withdraw) |
~~bazaar#265~~ LANDED (closed 2026-10-21) |
|
Ownership stream feeding the Journal |
The read grant on the topic and the opt-in setting, then |
|
Owner change before notification (box clause) |
A notification dispatcher: none exists in Bazaar or NovaBell |
UNMET. |
Which product an ownership event covers |
No source yet: ThingHub knows devices, not software |
Every event has |
Consent enforcement at fire time |
bazaar#213 per-device dispatch admission — BOUND 2026-10-27 ( |
The five bounds are evaluated at PER-DEVICE factory dispatch: |
Device registry (what a |
ThingHub is the device-identity authority |
Bazaar carries |
Ownership events¶
An event carries one fact about one item of one claim:
Field |
Meaning |
|---|---|
|
The producer’s idempotency key. A redelivery must reuse it. |
|
|
|
What the change is attributed to, and the id of the Journal it lands in. See Claim references. |
|
The owner after the event. It names the Journal that receives the event. |
|
Required for a transfer (a different owner); for a revoke it is the same owner being revoked; an assertion carries none. |
|
The item within the claim. |
|
The software product the item names, when known. ThingHub always sends null. |
|
When the source observed the event. |
|
|
|
What the source believed about listing visibility at |
Rules the consumer enforces:
Identity is account-scoped. Two tenants naming the same claim id own two independent Journals. A revision read from one tenant’s Journal is stale in the other’s.
eventIdis the transition key. A redelivery that matches every stored fact is counted as a duplicate and inserts nothing. The comparison is at the precision the database keeps — microseconds — so sub-microsecond noise does not create a second event. The same key with different facts is refused rather than merged.Previous owner is explicit. A transfer that names the same owner, or no owner, is rejected; a revoke that names a different owner is rejected.
Visibility is re-checked at read time.
visibleAtSourceis never served as current state. A listing that has since gone to draft or been withdrawn reads as hidden now; a product with no listing reads as unknown, not hidden. A transition naming no product is not visibility evidence: itsvisible_at_sourcereads as null in the drill-down and it cannot count as a visibility change.
Consuming the stream¶
OwnershipEventConsumer (group bazaar-ownership-journal-v1) appends each event to the
Journal of the owner after it, keyed by eventId. A transfer appends to the new
owner’s Journal; the previous owner’s Journal is not rewritten. There is no dead-letter
topic. Every record ends in one of three outcomes:
Outcome |
When |
What happens |
|---|---|---|
Consumed |
Appended, or a redelivery that inserted nothing |
The offset moves after the Journal’s transaction commits. |
Rejected |
The record is not this payload; or its |
Logged at ERROR with its topic, partition and offset, counted in |
Held |
The Journal is unavailable, or the payload is a later major than this build reads |
Logged at ERROR, counted in |
Claim references¶
ThingHub’s claimId is not always a claim. It can be a claim artifact id, a batch
transfer id, an adjudication id, or a synthetic owner-transfer:<ref> or
owner-removal:<ref>. All of them are appended, each as its own Journal under the
reference it names: the payload has no field that tells an artifact from a transfer or
adjudication, and a dropped event cannot be recovered once its offset moves. No door
lists Journals, so one of these is reachable only by its owner asking for that exact
reference.
The consequence: a Journal is the history of one reference, not a statement of who
owns a Thing now. A claim’s Journal keeps saying COVERED after its Thing is
transferred away, because that transfer is a different reference. Who owns a Thing now
is ThingHub’s answer.
Appending directly¶
A tenant-authorized caller can also append transitions to its own Journal through the append route, one transition per event:
POST /software-onboarding/v1/claims/{claimId}/journal/transitions
{
"expected_revision": 0,
"transitions": [
{
"transition_key": "<eventId>",
"item_key": "<itemKey>",
"product_id": "<productId>",
"kind": "OWNERSHIP",
"from_state": null,
"to_state": "COVERED",
"outcome": "COVERED",
"visible_at_source": true,
"occurred_at": "2026-10-18T00:00:00Z"
}
]
}
expected_revision is required. 0 creates the Journal for this account; any other
value must equal the stored revision or the append is refused with 409. Because this
route is tenant-writable, an OWNERSHIP row in a Journal is never an answer to who may
be notified about a Thing.
Installation observations¶
Inventory resolution distinguishes four truths, and never collapses them into a boolean:
Truth |
Meaning |
|---|---|
|
A complete snapshot of the device. Absence is evidence that software is missing. Bazaar has no such source today; no code path guesses it. |
|
At least one terminal installation was observed, but the set is not complete. A product with terminal evidence is positively installed; absence proves nothing. |
|
No terminal observation. Rendered as unknown/waiting — never as missing software and never as success. |
|
Terminal evidence older than the freshness window. It records what was installed, not current success. |
What counts as terminal evidence: a recorded installation outcome
(delivery_execution.observed_state = 'INSTALLED') with a non-null observation time.
A dispatch that has been sent but not terminated (PENDING, DOWNLOADING,
INSTALLING) produces no evidence. Every evidence row carries its source and
observedAt, so a positive answer is always attributable to an observation.
Per-item actions¶
The resolution response computes each item’s Get, Configure and Open
decisions on the server from the entitlement, the inventory truth and the caller’s
authorization. Each decision carries allowed and a reason. Clients render the
decision they are given; they must not derive an action from a state name or assume a
newest offer. A missing right blocks delivery of the affected item and requires a
purchase — it never starts one silently.
Bounded automatic consent¶
Automatic update delegation is not a caller-supplied boolean. A persisted consent
names the products, devices, channel, schedule window and charge ceiling it covers.
The bounds are evaluated by a predicate that is called at per-device factory dispatch
admission (FactoryDeliveryService.dispatch → AutomaticConsentEvaluatorBridge →
AutomaticConsent.evaluate, bound 2026-10-27 at e75b546c); scope-level automatic OTA
is refused by design, never evaluated. The resolution preview renders the same decision
for UX and is never the enforcement point. Each bound has its own refusal reason: an
out-of-window fire, an uncovered channel, a charge above the ceiling, an uncovered
product or device, or a revoked consent refuses the delegation instead of inheriting
it. A newly bundled product needs its own right and its own authorization.
The interface dispatch admission calls (bazaar#213)¶
The bazaar-side evaluation answers “would this consent allow this fire?” at the
enforcement point: per-device factory dispatch admission calls exactly this
predicate through AutomaticConsentEvaluatorBridge (bound 2026-10-27 at e75b546c;
OtaRolloutConsentWiringIT#theProductionBridgeDecidesTheFactoryDispatch fails if the
binding disappears). The resolution preview renders the same decision for UX; it is
never the enforcement point. The predicate is account-scoped by construction:
W9 loads the consents of the fire’s account and evaluates them against one
FireContext per covered product. These are the exact facts the interface consumes
or binds:
Input |
Consumed by |
Meaning |
|---|---|---|
|
W9 (consent selection) |
The account that owns the consent and the device. It selects which consents are evaluated; the predicate does not take it. |
|
predicate |
The target terminal; ThingHub identity, opaque to bazaar. |
|
predicate |
The covered product. Consent is product-scoped: it grants automatic updates for a product, not for one release. |
|
W9 (binding only) |
The pinned release the fire would install. The predicate does not take it; W9 admission MUST bind it to the covered |
|
predicate |
|
|
predicate |
The server clock at fire time; the schedule window is half-open |
|
predicate |
The pinned offer’s charge; a different currency is refused, never converted. |
Result: ALLOW, or REFUSE(reason) where reason is one of
consent_missing, consent_product_not_covered, consent_device_not_covered,
consent_channel_not_covered, consent_outside_schedule_window,
consent_charge_currency_mismatch, consent_charge_ceiling_exceeded.
An absent evaluator fails closed: if dispatch admission cannot obtain this
decision, the fire is not admitted (automatic-consent-evaluator-unavailable, a 503
deployment defect — never a caller-repairable conflict). There is no “default allow”
branch. The clause “automatic update consent is enforced at fire time” is BOUND at
per-device factory dispatch (e75b546c).
Post-deploy dependency¶
The live proof of this contract belongs to the W10-LIVE post-deploy check and
requires, besides this deployment:
ThingHub’s ownership producer deployed, and the topic present on the cluster;
Bazaar’s read grant on
trustmint.thing.ownership.v1applied, the consumer turned on, and the consumer group declared in the lag alarms;a real claim’s event read back from its Journal.
“Owner change before notification” cannot be observed at all until a dispatcher exists.
Bundle authoring no longer blocks this list: BundleAuthoringService is the
production writer (bazaar#265, closed 2026-10-21), so a bundle can exist in production
and be resolved; a 404 now means only that no such bundle exists for the caller. The
ownership stream is proven by OwnershipEventConsumerIT, the service ITs and the HTTP
controller IT, none of which is a live end-to-end proof.