Skip to content

fix(semantic-value-visibility): use CODE_CHANGE as suggestion type#2481

Merged
yevheniia-severinovska merged 1 commit intomainfrom
fix/svv-suggestion-type
May 6, 2026
Merged

fix(semantic-value-visibility): use CODE_CHANGE as suggestion type#2481
yevheniia-severinovska merged 1 commit intomainfrom
fix/svv-suggestion-type

Conversation

@yevheniia-severinovska
Copy link
Copy Markdown
Contributor

Summary

Fixes ValidationError2: type is invalid on PROD: the guidance handler set type: 'SUGGESTION_CODE', which is not in the suggestion type enum. As a result, opportunities are created but all Mystique-returned suggestions fail to persist.

Discovered during a prod debugging session with Daniel.

Fix

Replace 'SUGGESTION_CODE' with 'CODE_CHANGE' — matches the pattern used by other Tokowaka HTML-injection handlers:

  • src/summarization/guidance-handler.js:52
  • src/toc/handler.js:454
  • src/headings/handler.js:545
  • src/hreflang/handler.js:293
  • src/canonical/handler.js:675
  • src/csp/csp.js:196
  • src/structured-data/handler.js:133

Image-enrichment generates <section data-llm-shadow>... HTML, same shape as those handlers. CONTENT_UPDATE (used by faqs, wikipedia-analysis) is for text/copy rewrites and does not fit HTML injection.

Files changed

  • src/semantic-value-visibility/guidance-handler.js:110
  • test/audits/semantic-value-visibility/guidance-handler.test.js:187

Test plan

  • npx mocha test/audits/semantic-value-visibility/guidance-handler.test.js passes (11 tests)
  • Verified on PROD after merge: suggestions persist with type: 'CODE_CHANGE'

Related

🤖 Generated with Claude Code

The guidance handler set `type: 'SUGGESTION_CODE'`, which is not a
valid suggestion type. Valid values: CODE_CHANGE, CONTENT_UPDATE,
REDIRECT_UPDATE, METADATA_UPDATE, AI_INSIGHTS, CONFIG_UPDATE.

Result on PROD: opportunity is created but all Mystique-returned
suggestions fail to persist with `ValidationError2: type is invalid`.

Replace with `CODE_CHANGE` — matches the pattern used by other
Tokowaka HTML-injection handlers (summarization, toc, headings,
hreflang, canonical, csp, structured-data). Image-enrichment generates
`<section data-llm-shadow>` HTML, same shape as those handlers.

Discovered during prod debugging session with Daniel.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@yevheniia-severinovska yevheniia-severinovska merged commit b99830b into main May 6, 2026
18 checks passed
@yevheniia-severinovska yevheniia-severinovska deleted the fix/svv-suggestion-type branch May 6, 2026 08:43
solaris007 pushed a commit that referenced this pull request May 6, 2026
## [1.432.2](v1.432.1...v1.432.2) (2026-05-06)

### Bug Fixes

* **semantic-value-visibility:** use CODE_CHANGE as suggestion type ([#2481](#2481)) ([b99830b](b99830b))
@solaris007
Copy link
Copy Markdown
Member

🎉 This PR is included in version 1.432.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-native bug Something isn't working released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants