Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/submission-gate/src/duplicates.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type ContentDuplicateSignals = {

Check notice on line 1 in apps/submission-gate/src/duplicates.ts

View check run for this annotation

Gittensory / Gittensory Context

Issue discovery is disabled for this repo

This repo is configured for direct contribution review rather than issue-discovery flow.

Check notice on line 1 in apps/submission-gate/src/duplicates.ts

View check run for this annotation

Gittensory / Gittensory Context

PR author has maintainer association

This PR appears to come from a maintainer-associated account.
filePath: string;
category: string;
slug: string;
Expand Down Expand Up @@ -83,12 +83,14 @@
"repoUrl",
"repositoryUrl",
"sourceUrl",
"websiteUrl",
"download_url",
"github_url",
"package_url",
"repo_url",
"repository_url",
"source_url",
"website_url",
]);
const DOMAIN_ONLY_EXCLUSIONS = new Set([
"github.com",
Expand Down
46 changes: 46 additions & 0 deletions tests/submission-gate-worker.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { afterEach, describe, expect, it, vi } from "vitest";

Check notice on line 1 in tests/submission-gate-worker.test.ts

View check run for this annotation

Gittensory / Gittensory Context

Issue discovery is disabled for this repo

This repo is configured for direct contribution review rather than issue-discovery flow.

Check notice on line 1 in tests/submission-gate-worker.test.ts

View check run for this annotation

Gittensory / Gittensory Context

PR author has maintainer association

This PR appears to come from a maintainer-associated account.
import fs from "node:fs";
import path from "node:path";

Expand Down Expand Up @@ -2762,6 +2762,52 @@
);
});

it("treats same canonical website across different categories as a strict duplicate", () => {
const existingTool = extractContentDuplicateSignals({
filePath: "content/tools/acme-claude.mdx",
content: `---
title: Acme Claude
slug: acme-claude
category: tools
description: Tooling for Acme Claude workflows.
websiteUrl: "https://acme-claude.example/product"
---
`,
});
const candidateMcp = extractContentDuplicateSignals({
filePath: "content/mcp/acme-claude-server.mdx",
content: `---
title: Acme Claude MCP Server
slug: acme-claude-server
category: mcp
description: MCP server for Acme Claude workflows.
websiteUrl: "https://acme-claude.example/product?utm_source=submission"
---
`,
});

expect(
findStrictContentDuplicateMatch(candidateMcp, [existingTool]),
).toMatchObject({
reasons: expect.arrayContaining([
expect.stringContaining(
"same canonical source URL https://acme-claude.example/product across mcp/tools",
),
]),
});
expect(findRelatedContentMatches(candidateMcp, [existingTool])).toEqual(
expect.arrayContaining([
expect.objectContaining({
reasons: expect.arrayContaining([
expect.stringContaining(
"same canonical source URL https://acme-claude.example/product across mcp/tools",
),
]),
}),
]),
);
});

it("treats collection member overlap as related context, not a strict duplicate", () => {
const existingTool = extractContentDuplicateSignals({
filePath: "content/tools/storybook-a11y.mdx",
Expand Down
Loading