Skip to content

fix(content): make guidance and policy factual - #978

Open
trac3r00 wants to merge 3 commits into
release/product-value-20260912-08from
release/product-value-20260912-09
Open

trac3r00 wants to merge 3 commits into
release/product-value-20260912-08from
release/product-value-20260912-09

Conversation

@trac3r00

@trac3r00 trac3r00 commented Sep 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

fix(content): make guidance and policy factual. This is logical change 9/11 in the dependency-ordered product-audit release stack.

Refs #969

What changed

  • fix(content): make guidance and policy factual
  • Exact source commit: fe81d8b964327feac887cb0a1a6578cb9fe4c3f5; validated tree: 52777f0a38508bf23e8b3717289719eaccf3bf57.
  • Depends on the preceding release-stack PR. Retarget to main only after its dependency is merged and deployed.

Why

Replace unsupported and generic guidance with task-specific localized content and consistent advertising disclosures.

Verification

  • bun run build passed on this exact candidate tree.
  • npm test -- --maxWorkers=2 passed on this exact candidate tree.
  • Affected behavior manually exercised as described below.
  • Latest GitHub Build, Unit Tests (Vitest), and E2E Tests (Playwright) must all pass before merge.
Tests  781 passed (781)
CANDIDATE_BUILD_UNIT_GREEN
Committed tree equals validated tree: 52777f0a38508bf23e8b3717289719eaccf3bf57

20 content routes returned 200 with one h1; localized legal, FAQ and article rendering checked; 90 localized broad articles and 126 FAQ entries preserve code/links/keys.

Final combined tree additionally passed 801 unit tests and all 293 Playwright tests with retries disabled, plus all 48 primary tool workflows at desktop and mobile. The exploratory Color Converter exact-HEX boundary remains a documented pre-existing defect; its runtime is unchanged by this stack.

Risk & rollback

  • Risk: Dependent commits require earlier stack changes; merge in order.
  • Rollback: revert this PR through a new PR; do not revert dependencies beneath already-merged dependents.
  • Release: require an approving review and latest-SHA CI. Respect the 15-minute soak between deploy-affecting merges and verify the production deployment before continuing.

Summary by cubic

Makes guidance and policy factual by replacing generic copy with task-specific localized content and aligning ad disclosures with the actual placement rules. Refs #969.

Changes

  • Blog and FAQ use reviewed localized articles and entries for nine languages; the FAQ generator runs in CI so stale output fails the suite.
  • FAQ answer links keep the ?lang query, with a unit test matching localized hrefs against source links; security keeps its detailed localized response while contact stays generic.
  • About derives its public tool count from PRODUCTION_TOOL_COUNT; the historical changelog entry stays free of the live count.
  • Ad copy and docs describe manual units on JSON Formatter and legal pages only; home is reserved but excluded from manual-unit inventory.
  • Blog and FAQ load the AdSense script for site connect but have no ad units; a render-level test binds the legal ad-scope markup to getAdPolicySnapshot().
  • No copy claims account-level AdSense state (Auto ads, CMP, consent) that the repository cannot verify.

Rollout

  • Merge in dependency order: this PR depends on the preceding release-stack PR being merged and deployed.

Written for commit a2d1c12. Summary will update on new commits.

Review in cubic

Preserve task-focused articles and localized troubleshooting, derive public counts, and bind localized disclosures to the actual advertising scope without account-state claims.

Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 20 files

Confidence score: 4/5

  • In src/ui/honest-copy.test.js, the expected regex token does not match the doubled backslash emitted by the article template, so the test will fail; align the expectation with the rendered content.

Not reviewed (too large): scripts/data/content-locales.json (~1,661 lines), src/ui/generated-content-locales.js (~1,661 lines), src/ui/blog.js (~953 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/ui/honest-copy.test.js">

<violation number="1" location="src/ui/honest-copy.test.js:336">
P2: This test will fail as written. The regex-guide content renders the token as a doubled backslash `\d` (the article source writes `<code>\\d</code>`, which a template literal evaluates to backslash-backslash-d), so `codeTokens.find((token) => token === "\d")` never matches, `digitToken` is `undefined`, and `expect(digitToken).toBe("\d")` throws while the page shows `\d`. The test's intent (asserting the example demonstrates single-backslash `\d` matching ASCII digit `5` but not Arabic-Indic `٥`) requires the content to render a single backslash; fix the article content to `<code>\d</code>` in the blog.js template literal (one escaped backslash under the template-literal convention) rather than `\\d`.</violation>
</file>

Shadow auto-approve: would not auto-approve because issues were found.

Re-trigger cubic

Comment thread scripts/i18n-content-locales.mjs
Comment thread src/ui/faq-content.js Outdated
Comment thread src/ui/legal-content.js Outdated
Comment thread src/ui/legal-pages.js
const codeTokens = [...article.content.matchAll(/<code>([^<]+)<\/code>/g)].map(
(match) => match[1],
);
const digitToken = codeTokens.find((token) => token === "\\d");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This test will fail as written. The regex-guide content renders the token as a doubled backslash \d (the article source writes <code>\\d</code>, which a template literal evaluates to backslash-backslash-d), so codeTokens.find((token) => token === "\d") never matches, digitToken is undefined, and expect(digitToken).toBe("\d") throws while the page shows \d. The test's intent (asserting the example demonstrates single-backslash \d matching ASCII digit 5 but not Arabic-Indic ٥) requires the content to render a single backslash; fix the article content to <code>\d</code> in the blog.js template literal (one escaped backslash under the template-literal convention) rather than \\d.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/ui/honest-copy.test.js, line 336:

<comment>This test will fail as written. The regex-guide content renders the token as a doubled backslash `\d` (the article source writes `<code>\\d</code>`, which a template literal evaluates to backslash-backslash-d), so `codeTokens.find((token) => token === "\d")` never matches, `digitToken` is `undefined`, and `expect(digitToken).toBe("\d")` throws while the page shows `\d`. The test's intent (asserting the example demonstrates single-backslash `\d` matching ASCII digit `5` but not Arabic-Indic `٥`) requires the content to render a single backslash; fix the article content to `<code>\d</code>` in the blog.js template literal (one escaped backslash under the template-literal convention) rather than `\\d`.</comment>

<file context>
@@ -303,6 +320,174 @@ describe("retired blog twins", () => {
+    const codeTokens = [...article.content.matchAll(/<code>([^<]+)<\/code>/g)].map(
+      (match) => match[1],
+    );
+    const digitToken = codeTokens.find((token) => token === "\\d");
+    expect(digitToken).toBe("\\d");
+    const digitPattern = new RegExp(`^${digitToken}$`);
</file context>

Comment thread docs/adsense-integration.md Outdated
Comment thread src/utils/ads.js Outdated
Comment thread src/ui/faq-content.js Outdated
Comment thread src/ui/legal-content.js Outdated
Comment thread src/routes/changelog.js Outdated
- run the content-locale generator --check in the unit suite so stale output fails CI
- keep ?lang on FAQ answer links; drop unreachable localized FAQ_CONTENT arrays
- security keeps its detailed, localized response text; contact keeps the generic one
- drop the About count fallback that duplicated data-public-tool-count
- keep the historical changelog entry free of the live tool count
- remove / from manual-unit inventory to match #972 and the Terms copy
- render-level test binds legal ad-scope markup to getAdPolicySnapshot()
- docs: replace the untracked harness reference with a reproducible step

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 11 files (changes from recent commits).

Shadow auto-approve: would not auto-approve because issues were found.

Re-trigger cubic

Comment thread src/ui/honest-copy.test.js Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would not auto-approve. Auto-approval blocked by 1 unresolved issue from previous reviews.

Re-trigger cubic

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant