Skip to content

feat(ids): serialize help-center articles as article_ - #533

Merged
mortondev merged 16 commits into
fix/widget-new-post-openfrom
feat/article-typeid-prefix
Sep 10, 2026
Merged

feat(ids): serialize help-center articles as article_#533
mortondev merged 16 commits into
fix/widget-new-post-openfrom
feat/article-typeid-prefix

Conversation

@mortondev

@mortondev mortondev commented Sep 9, 2026

Copy link
Copy Markdown
Member

Summary

  • Help-center article TypeIDs now serialize as article_… (same UUID as before). createId('kb_article') and Drizzle reads emit the new prefix; table names stay kb_articles.
  • Retired kb_article_… ids are an inbound alias: isValidTypeId, Zod schemas, ensureTypeId, and API/MCP parsers accept them and rewrite to article_….
  • Stacked on fix(widget): honour documented open() deep-links #531 so widget open({ articleId }) and this catalogue change land in order. Retarget to main after fix(widget): honour documented open() deep-links #531 merges.

Test plan

  • open({ articleId: 'article_01h…' }) and open({ articleId: 'kb_article_01h…' }) both load the same article (verified on the fix(widget): honour documented open() deep-links #531 widget; this PR keeps the inbound alias and emits article_)
  • API parseTypeId / ensureTypeId accept both prefixes and rewrite to article_… (ids unit tests)
  • MCP get_details switch handles article and kb_article
  • createId('kb_article') emits article_… (ids unit tests)
  • No SQL migration required (UUID storage unchanged)
  • Historical Copilot kb_article_ citations still join the live article row
  • Deleting an article removes redirect rules stored as kb_article_ or article_

Made with Cursor

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-10T07:30:53.549578Z 8df31fd New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@mortondev
mortondev added this pull request to stack #534 September 9, 2026 23:23
Generate and emit article_ TypeIDs from the same UUID; accept retired
kb_article_ ids as an inbound alias. No database migration — prefixes
are applied at the ORM boundary.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mortondev
mortondev force-pushed the feat/article-typeid-prefix branch from f538b96 to 7012aa6 Compare September 9, 2026 23:24

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7012aa6e43

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/db/src/schema/kb.ts
Comment thread packages/ids/src/prefixes.ts
mortondev and others added 2 commits September 10, 2026 00:35
Keep the article_ catalogue stack on the latest widget open() tip.
Copilot citation joins and redirect-rule cleanup now treat kb_article_
and article_ as the same UUID, so pre-prefix-flip JSON and text targets
are not dropped after emit changes.

Co-authored-by: Cursor <cursoragent@cursor.com>

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b1a091d389

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/web/src/lib/server/domains/analytics/copilot-usage.ts
The Copilot report now rewrites retired prefixes in SQL so one article
cited as both article_ and kb_article_ is ranked and capped as a single
source.

Co-authored-by: Cursor <cursoragent@cursor.com>

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 159bba74d3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/ids/src/core.ts
mortondev and others added 8 commits September 10, 2026 00:56
typeIdSchema now rewrites kb_article_ to article_ so writers cannot
persist the retired prefix, and redirect-rule lists load labels in two
queries instead of one per row.

Co-authored-by: Cursor <cursoragent@cursor.com>
isValidTypeId still accepts kb_article_ as an inbound article id;
the TypeId<'article'> guard only matches the canonical prefix.

Co-authored-by: Cursor <cursoragent@cursor.com>
typeIdSchema now validates and rewrites through isValidTypeId/ensureTypeId,
and isTypeId composes those checks instead of re-parsing.

Co-authored-by: Cursor <cursoragent@cursor.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ea909e90aa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/db/src/schema/kb.ts
mortondev and others added 2 commits September 10, 2026 08:25
Bookmarked kb_article_ editor URLs now redirect to article_, and the
detail query key is the same either way so publish/update cache the
active editor instead of a stale alias key.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mortondev
mortondev merged commit a720add into main Sep 10, 2026
15 checks passed
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