Skip to content

fix(seo): refuse to add a description beside a differently capitalized key - #1981

Merged
jth-nw merged 1 commit into
devfrom
james/describe-key-case
Dec 1, 2026
Merged

jth-nw merged 1 commit into
devfrom
james/describe-key-case

Conversation

@jth-nw

@jth-nw jth-nw commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Problem

A reviewer of the Password Secure 9.2 backfill PR (#1964) found pages with two description keys:

There is now Description and description. Remove the old one (the one with the uppercase character)…

Nine pages in the docs have frontmatter keys with capital letters (Title, Description, Sidebar_position). All nine are in Password Secure 9.2. scripts/seo/describe.mjs only recognized a lowercase description, so it treated them as having none, added a second key, and left both.

Change

setDescription now throws when the frontmatter has a differently capitalized Description key and no lowercase one. The backfill reports the page as left unchanged, with the reason, so its keys can be fixed first. A page with a plain lowercase description is unaffected, including one that also has a stray capitalized key.

The nine pages were already fixed on #1964 as the reviewer asked: one description key, and Title and Sidebar_position lowercased.

Testing

npm run test:scripts passes. A new test covers Description and DESCRIPTION, a lowercase key beside a capitalized one, and a plain page.

I scanned the whole docs set for capitalized title, description, and sidebar_* keys. There are only those nine pages, and #1964 is the only backfill PR that touched them.

🤖 Generated with Claude Code

…d key

A reviewer of the Password Secure 9.2 backfill PR found nine pages whose frontmatter
has capitalized keys (Title, Description, Sidebar_position). The backfill only
recognized a lowercase `description`, so it treated those pages as having none, added a
second key, and left both.

setDescription now throws when a "Description" key with different capitalization is
present and there is no lowercase one. The backfill reports such a page as left
unchanged, with the reason, so its keys can be fixed first. Those nine pages were fixed
by hand on the PR.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Code Review

No correctness or security problems. The change is confined to scripts/seo/describe.mjs and its test. It doesn't touch the build, the KB copy pipeline, Docusaurus config, or workflows. Both callers wrap describePage in try/catch: describe.mjs main() and backfill.mjs. So the new throw becomes a per-page failed result and doesn't abort the run.

Two minor, non-blocking points:

  1. A paid model call is spent before the guard fires. setDescription first runs inside proposeDescription (describe.mjs:266), right after the first client.messages.create returns. Each page with a capitalized key costs one model call before it is rejected. Checking in describePage before proposeDescription would avoid that, next to the existing "no frontmatter" early return. It could also return status: 'skipped' with the same message.
  2. The status in the report doesn't match the PR description. The PR says the backfill reports the page "as left unchanged", but these pages come back as failed, not skipped. That makes backfill.mjs and describe.mjs exit 1, and the summary line counts them as failures. If that's intended, it's fine. Moving the check as in point 1 would make them skipped, like pages with no frontmatter. Note that the summary text currently labels skipped as "(no frontmatter)", so that label would need updating too.

@jth-nw
jth-nw merged commit 16c13d0 into dev Dec 1, 2026
13 checks passed
@jth-nw
jth-nw deleted the james/describe-key-case branch December 1, 2026 15:43

This branch was previously deployed

1 inactive deployment
development — af3fdc0b Deployed Dec 1, 2026 by jth-nw via build-and-deploy #5520
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.

2 participants