feat: rename semantic-value-visibility opportunity to image-enrichment#1570
feat: rename semantic-value-visibility opportunity to image-enrichment#1570yevheniia-severinovska wants to merge 3 commits intomainfrom
Conversation
- Rename mapper class SemanticValueVisibilityMapper to ImageEnrichmentMapper - Rename mapper file, test file, and fixtures folder - Update mapper-registry import + registration - Update audit.model enum SEMANTIC_VALUE_VISIBILITY to IMAGE_ENRICHMENT - Update opportunityType in 5 fixtures and test expectations
dzehnder
left a comment
There was a problem hiding this comment.
The rename is clean and the cross-repo merge plan is well-documented. One in-scope safety improvement worth considering before merge.
Strengths
- Tight, focused diff: enum key, mapper class name,
opportunityTypefield, fixture folder, log strings, JSDoc, and consuming test paths all move in lockstep (no half-renames). - Naming alignment with
multimedia-enrichment(video transcripts) is the right forward call. - Mapper class export is internal:
packages/spacecat-shared-tokowaka-client/src/index.jsonly re-exportsFastlyKVClientandcalculateForwardedHost, so renamingSemanticValueVisibilityMappertoImageEnrichmentMapperdoes not break the npm public API. - Test enforces the new literal:
image-enrichment-mapper.test.js:46assertsgetOpportunityType()returns'image-enrichment', so a future revert would fail loudly. - Fixture rename is consistent: only
opportunityTypechanged; other payload fields (semanticHtml,imageUrl,transformRules) correctly preserved. - No leftover references in this repo: a tree walk at PR head finds zero remaining
semantic-value-visibility/SemanticValueVisibilitystrings.
Issues
Important (Should Fix)
packages/spacecat-shared-data-access/src/models/audit/audit.model.js:98 - removing SEMANTIC_VALUE_VISIBILITY from the published AUDIT_TYPES enum is a breaking change to a public export. No symbolic consumer was found across adobe/* (consumers reference the string literal directly), but AUDIT_TYPES is part of the @adobe/spacecat-shared-data-access contract. Given the cross-repo merge order has this PR landing first, the lower-risk path is to keep both keys for one minor cycle:
IMAGE_ENRICHMENT: 'image-enrichment',
/** @deprecated use IMAGE_ENRICHMENT - remove after mystique#1704 + audit-worker#2447 in prod */
SEMANTIC_VALUE_VISIBILITY: 'image-enrichment',Delete the alias in a follow-up PR once the producer side is fully cut over.
Minor (Nice to Have)
packages/spacecat-shared-tokowaka-client/src/mappers/mapper-registry.js:48 - in-flight messages with the old opportunityType during the rollout window. Between this PR + audit-worker PR 2447 deploying and mystique PR 1704 shipping, mystique will keep emitting opportunityType: 'semantic-value-visibility'. getMapper returns null for unknown types (no fallback), so those messages no-op at the mapping layer. There are two views on whether this needs mitigation:
- One view: register
ImageEnrichmentMapperunder both keys for one release as a safety net. Four-line change, removes the cross-repo merge ordering as a hard correctness constraint. - Other view: the null-mapper return is the documented contract (
mapper-registry.test.js:124-142already asserts this), so unknown types are handled by design. No change needed.
Worth a sentence in the PR description either way - which path are you taking, and what is the expected behavior of in-flight semantic-value-visibility opportunities during the deployment window?
Existing persisted records. Audits and opportunities written before this rename retain auditType: 'semantic-value-visibility' / type: 'semantic-value-visibility'. With no migration, the platform carries two values for the same logical concept indefinitely. This appears consistent with the spacecat convention (no aliases on prior renames either), so not a blocker - but a one-line note in the data-access README listing legacy values would help downstream analytics consumers.
Recommendations
- If you take the alias path, add a
// TODO(remove after mystique PR 1704 + audit-worker PR 2447 in prod)comment so the cleanup PR is greppable.
Out of scope, worth tracking
Coralogix/Splunk dashboards or saved DataPrime queries pinned to semantic-value-visibility will silently lose signal once new records start writing the new value. A grep of observability assets before the audit-worker companion lands is a small but useful step.
Assessment
Ready to merge? With fixes.
Reasoning: The rename is mechanically clean and well-scoped. The one in-scope improvement worth landing here is keeping SEMANTIC_VALUE_VISIBILITY as an aliased enum key for one release - it costs almost nothing and converts the strict 4-PR merge order from a hard constraint into a soft cleanup.
Next Steps
- Add the deprecation alias in
audit.model.js(one line). - Decide on the mapper-registry approach and document in the PR description.
| CWV_TRENDS_AUDIT: 'cwv-trends-audit', | ||
| OFFSITE_BRAND_PRESENCE: 'offsite-brand-presence', | ||
| SEMANTIC_VALUE_VISIBILITY: 'semantic-value-visibility', | ||
| IMAGE_ENRICHMENT: 'image-enrichment', |
There was a problem hiding this comment.
Important: removing SEMANTIC_VALUE_VISIBILITY is a breaking change to the published AUDIT_TYPES enum.
No symbolic consumer was found across adobe/* (consumers use the string literal directly), but AUDIT_TYPES is part of the @adobe/spacecat-shared-data-access contract. Since this PR lands first in the 4-PR cross-repo sequence, the lower-risk path is to keep both keys for one minor cycle:
IMAGE_ENRICHMENT: 'image-enrichment',
/** @deprecated use IMAGE_ENRICHMENT - remove after mystique PR 1704 + audit-worker PR 2447 in prod */
SEMANTIC_VALUE_VISIBILITY: 'image-enrichment',Delete the alias in a follow-up PR once the producer side is fully cut over.
|
This PR will trigger a minor release when merged. |
|
Addressed in c87909f: kept |
|
Round 2 — addressed all in-scope items:
Both aliases will be removed in a follow-up PR after mystique #1704 + audit-worker #2447 reach prod. Skipped README legacy-values note (no AUDIT_TYPES section currently exists in data-access README; happy to add a new section if desired). Re-requesting review. |
dzehnder
left a comment
There was a problem hiding this comment.
Both prior findings are cleanly addressed. Ready to merge.
Strengths
- Prior Important resolved:
audit.model.js:99keepsSEMANTIC_VALUE_VISIBILITYas a deprecated alias mapping to'image-enrichment', with a@deprecatedcomment naming the removal trigger ("after producer cutover"). Test mirror ataudit.model.test.js:224matches exactly. Producers using the enum constant transparently emit the new value. - Prior Minor resolved:
mapper-registry.js:55-58registers the sameImageEnrichmentMapperinstance under both'image-enrichment'and'semantic-value-visibility'keys, with a comment naming the cutover dependency. Symmetric resolution: enum-key consumers and string-literal producers both land on the new mapper. - Cleanup story is concrete: both aliases are time-boxed via comments naming the dependent PRs. Co-locating the removal trigger with the code that has to change is the right pattern - someone closing those PRs has a grep target.
Recommendations
- The mapper-registry alias copies the same instance under two keys. With the current
BaseOpportunityMappershape (stateless, log-only), this is fine. A one-line note in the deprecated comment - "alias relies on mapper instances being stateless" - would protect a future contributor who adds per-key state from being surprised by shared mutation. Not blocking. - Before removing the aliases in the follow-up cleanup PR, a quick Coralogix check on the
semantic-value-visibilityliteral in the days leading up to removal would catch any unexpected legacy producers (archived configs, replay queues). Cheap insurance for the cleanup PR, not this one.
Assessment
Ready to merge? Yes.
Reasoning: The 9-line incremental diff does exactly what the deprecation strategy requires - dual-key aliases with named cutover triggers, and nothing more.
Summary
Renames the audit/opportunity type from
semantic-value-visibilitytoimage-enrichmentto align withmultimedia-enrichment(video transcripts) naming convention. Decision per Slack alignment with Dirk + Yaashi.Changes in this repo
SemanticValueVisibilityMapperclass →ImageEnrichmentMapperinspacecat-shared-tokowaka-clientmapper-registryimport + registrationaudit.model.jsenum:SEMANTIC_VALUE_VISIBILITY: 'semantic-value-visibility'→IMAGE_ENRICHMENT: 'image-enrichment'opportunityTypevalue in 5 fixture JSONs and matching test expectationsCross-repo PRs (must merge in this order)
Test plan
npm test— all unit tests pass (2540 tests across tokowaka-client + data-access)type: image-enrichment→ elmo UI renders correctly🤖 Generated with Claude Code