# HubSpot Vertical dependency inputs

A single `salesforce_industry__vertical_` property event contains the child
value. The Vertical mapping evaluates the pair formed by `salesforce_industry`
and that child, then applies the existing composite value map. The Industry
input must be present without treating the entire fetched contact as an update.

`HubSpot_Contact_Lead_Upsert` supplies that dependency in two paths:

- `UseDeltaSalesforceIndustryVerticalForMappings` adds
  `record.salesforce_industry` to the existing sparse assignment. Its delta
  action type still resolves only the Vertical mapping.
- The two coalesced mapping actions pass `transformSourceRecord = record`.
  Core fixes the eligible mappings from observed event fields and uses this
  explicit record only for missing transform dependencies. Observed values
  always win; fetched owner/status and other fields do not select new targets.

`record` is the existing connector BatchRead enrichment for the same source ID.
The official contact profile uses its metadata-owned projection in the request
and flattens the returned `properties` object. Industry and Vertical are already
in that projection. This change adds no fetch, credentials, subscription or
alternative identity lookup. The enrichment is current provider state, not an
as-of-event snapshot.

This Flow depends on [Core PR #4842](https://github.com/pingcap-inc/NexusCRM/pull/4842)
for `transformSourceRecord` on `applyConnectorFieldMappings`; publish and deploy
the Core dependency with this L2 change. Older runtimes ignore an unknown optional input and retain the
coalesced missing-dependency skip, so L2 alone does not fix the live behavior.
No mapping conflict policy, value map, unsupported-value behavior, ownership
policy or general snapshot overwrite is changed. A missing parent remains a
no-write result. An Industry-only single-delta event retains its existing
Industry-only mapping scope.

Run the native metadata regression against the exact Core candidate:

```sh
NEXUSCRM_ROOT=/absolute/path/to/NexusCRM \
NEXUSCRM_EXPECTED_HEAD=<exact-Core-commit> \
python3 tests/test_hubspot_vertical_transform_runtime.py
```

It loads the authored Flow and canonical mapping JSON, executes their assignments
and action through native Automation, and observes the persistence update. It
covers child-only single/coalesced updates, missing dependencies and protection
of unrelated owner/status fields. Production rollout still requires a real
provider event and canonical terminal WorkItem/field verification; this local
source test does not substitute for that acceptance.
