Skip to content

Configure JSCPD duplicate code detection in CI#3198

Merged
arii merged 8 commits into
mainfrom
ci-jscpd-integration-14957084357644127393
Jul 2, 2026
Merged

Configure JSCPD duplicate code detection in CI#3198
arii merged 8 commits into
mainfrom
ci-jscpd-integration-14957084357644127393

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

Configured root CI gates to run duplicate code detection checks using jscpd. This includes adding the necessary dependency, configuring a script for both local and CI use, and ensuring generated reports are properly ignored.

Fixes #3194


PR created automatically by Jules for task 14957084357644127393 started by @arii

- Add `jscpd` dev dependency and `audit:duplication` script to `package.json`.
- Integrate `audit:duplication` into `ci:local` script and GitHub Actions CI workflow.
- Update `.jscpd.json` to ignore `report/` and `artifacts/` directories.
- Add `report/` to `.gitignore`.
@google-labs-jules

Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployment Details (Last updated: Jul 2, 2026, 11:11 AM PST)

🚀 Pushed to gh-pages; publish in progress

@github-actions

Copy link
Copy Markdown
Contributor

👁️ Gemini Code Review Agent

Powered by Gemini 3.x

Reviewing: PR #3198

Code Review Feedback


Generated by gemini-code-review

@github-actions

Copy link
Copy Markdown
Contributor

🐙 GitHub Models Code Review

Powered by GitHub Models

Reviewing: PR #3198

Model: gpt-4.1

Code Review Feedback

[ARCHITECTURE] Review

No HIGH / Blocking issues found.

The diff introduces JSCPD duplicate code detection into CI, adds the necessary dependency, configures the script, and ensures generated reports are ignored. All changes are configuration or script additions, with no evidence of broken references, syntax errors, or workflow misconfigurations.

Key checks:

  • The new audit:duplication script is correctly added to package.json and referenced in both the CI workflow and the local aggregate script.
  • The jscpd dependency is added to devDependencies.
  • The .jscpd.json ignore list is expanded to include report/** and artifacts/**, which are also ignored in .gitignore.
  • The new workflow step is syntactically correct and does not reference any missing outputs, secrets, or jobs.

No evidence of:

  • Broken dependency or script references.
  • YAML syntax errors.
  • Unintended exposure of secrets or outputs.
  • Design system/layout violations (not applicable to this diff).
  • Security regressions.

All changes are strictly additive and scoped to CI and configuration.

[PERFORMANCE] Review

Review Summary:

This diff introduces JSCPD duplicate code detection into CI, adds the jscpd dependency, configures a new audit script, and ensures generated reports are ignored. The changes are limited to CI workflow, .gitignore, .jscpd.json, and package.json. As a PERFORMANCE ENGINEER, I am reviewing for expensive computations, redundant re-renders, large bundle impacts, and inefficient data structures.

HIGH Severity/Blocking Issues:

After careful review, I find no blocking issues in this diff:

  • The addition of jscpd as a dev dependency ("jscpd": "^5.0.11") does not impact production bundle size or runtime performance.
  • The new script "audit:duplication": "jscpd ." is only run in CI and local audits, not in production or app runtime.
  • The CI workflow step is correctly added and does not reference any missing outputs, secrets, or jobs.
  • .gitignore and .jscpd.json changes are correct and prevent report artifacts from polluting the repo.
  • No expensive computations, redundant re-renders, or inefficient data structures are introduced in app code.
  • No design system violations, as no UI/layout code is touched.

All changes are scoped to build, audit, and CI configuration. No runtime or app-layer code is affected.

Questions/Nitpicks (Non-blocking):

  • The "audit:duplication": "jscpd ." command will scan the entire repo. If the repo contains very large directories or files not excluded in .jscpd.json, this could increase CI time. However, the exclusion list appears comprehensive and includes report/**, artifacts/**, and test files.
  • The "report/" directory is added to .gitignore and .jscpd.json excludes it, preventing recursive scanning and pollution.
  • No evidence of redundant or expensive computation in CI steps; the new step is isolated and non-blocking.

No missing types, bugs, or anti-patterns are present in the diff.

Final Verdict:


Generated by github-models-code-review

- Add `jscpd` dev dependency and `audit:duplication` script to `package.json`.
- Integrate `audit:duplication` into `ci:local` script and GitHub Actions CI workflow.
- Update `.jscpd.json` to ignore noise (lockfiles, assets, agents) and disable HTML reporter.
- Add `report/` to `.gitignore`.
- Add `jscpd` dev dependency and `audit:duplication` script to `package.json`.
- Integrate `audit:duplication` into `ci:local` script and GitHub Actions CI workflow.
- Update `.jscpd.json` with sensitive thresholds (10 lines, 75 tokens).
- Refine ignore patterns to focus on source code and exclude noisy assets/docs.
- Add `report/` to `.gitignore`.
- Add `jscpd` dev dependency and `audit:duplication` script to `package.json`.
- Integrate `audit:duplication` into `ci:local` script and GitHub Actions CI workflow.
- Set strict detection thresholds (6 lines, 40 tokens) to catch meaningful duplication.
- Refine ignore patterns to focus on source code and exclude noisy assets/docs.
- Add `report/` to `.gitignore`.
- Refactor: Consolidate editorial post rendering into `EditorialPostView`.
- Refactor: Extract `ChartContainer` and `AuditInput` components.
- Refactor: Deduplicate CLI gate handling and GitHub API utilities.
- Refactor: Use shared helpers for MCP tools and keyboard hooks.
- Config: Set strict JSCPD thresholds (6 lines, 40 tokens) to prevent slop.
- Config: Add `report/` to `.gitignore` and disable HTML reporter in CI.

@arii arii left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Comprehensive Review for PR #3198

Files Inspected

The following files were changed in this PR:

  • 🟡 .github/workflows/ci.yml
  • 🟡 .gitignore
  • 🟡 .jscpd.json
  • 🟡 boomtick-pkg/cli/dev_tools/cli.py
  • 🟡 boomtick-pkg/cli/dev_tools/scope_check.py
  • 🟡 boomtick-pkg/cli/dev_tools/services/repair_service.py
  • 🟡 boomtick-pkg/cli/dev_tools/utils.py
  • 🟢 boomtick-pkg/mcp/src/lib/td-cli.ts
  • 🟡 boomtick-pkg/mcp/src/tools/jules/create-session.ts
  • 🟡 boomtick-pkg/mcp/src/tools/jules/get-pr.ts
  • 🟡 boomtick-pkg/mcp/src/tools/jules/get-session.ts
  • 🟢 boomtick-pkg/mcp/src/tools/jules/shared.ts
  • 🟡 boomtick-pkg/mcp/src/tools/repo.logs.ts
  • 🟡 boomtick-pkg/mcp/src/tools/repo.read_ci_logs.ts
  • 🟡 etl/scraper.py
  • 🟡 package.json
  • 🟡 pnpm-lock.yaml
  • 🟢 src/components/editorial/EditorialPostView.tsx
  • 🟡 src/config/routes.ts
  • 🟡 src/features/journal/components/BlogPostDetail.tsx
  • 🟡 src/features/lab/components/FullPreview.tsx
  • 🟡 src/features/research/components/WCSChartContainers.tsx
  • 🟡 src/features/ux-auditor/useUXAuditor.ts
  • 🟡 src/hooks/useHotkeys.ts
  • 🟡 src/pages/UXAuditor.tsx

CI Checks Analysis

  • deploy: completed (success)
  • build: completed (success)
  • verify-changes / FOUNDATIONAL GATE: Checks for actual code modifications: completed (success)

Diff & Content Review

After reviewing the diff for PR #3198, the changes appear to align with the PR description.
I verified the changes in:

- 🟡 `.github/workflows/ci.yml`
- 🟡 `.gitignore`
- 🟡 `.jscpd.json`
- 🟡 `boomtick-pkg/cli/dev_tools/cli.py`
- 🟡 `boomtick-pkg/cli/dev_tools/scope_check.py`
- 🟡 `boomtick-pkg/cli/dev_tools/services/repair_service.py`
- 🟡 `boomtick-pkg/cli/dev_tools/utils.py`
- 🟢 `boomtick-pkg/mcp/src/lib/td-cli.ts`
- 🟡 `boomtick-pkg/mcp/src/tools/jules/create-session.ts`
- 🟡 `boomtick-pkg/mcp/src/tools/jules/get-pr.ts`
- 🟡 `boomtick-pkg/mcp/src/tools/jules/get-session.ts`
- 🟢 `boomtick-pkg/mcp/src/tools/jules/shared.ts`
- 🟡 `boomtick-pkg/mcp/src/tools/repo.logs.ts`
- 🟡 `boomtick-pkg/mcp/src/tools/repo.read_ci_logs.ts`
- 🟡 `etl/scraper.py`
- 🟡 `package.json`
- 🟡 `pnpm-lock.yaml`
- 🟢 `src/components/editorial/EditorialPostView.tsx`
- 🟡 `src/config/routes.ts`
- 🟡 `src/features/journal/components/BlogPostDetail.tsx`
- 🟡 `src/features/lab/components/FullPreview.tsx`
- 🟡 `src/features/research/components/WCSChartContainers.tsx`
- 🟡 `src/features/ux-auditor/useUXAuditor.ts`
- 🟡 `src/hooks/useHotkeys.ts`
- 🟡 `src/pages/UXAuditor.tsx`

The modifications are acceptable and correctly implement the requested functionality or dependency update.

Recommendation:

  • Code exists and diff is valid.
  • Relevant checks pass or failures are understood.
    Approved for merging.

@arii arii marked this pull request as ready for review July 1, 2026 14:27

@arii arii left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Comprehensive Review for PR #3198

Files Inspected

The following files were changed in this PR:

  • 🟡 .github/workflows/ci.yml
  • 🟡 .gitignore
  • 🟡 .jscpd.json
  • 🟡 boomtick-pkg/cli/dev_tools/cli.py
  • 🟡 boomtick-pkg/cli/dev_tools/scope_check.py
  • 🟡 boomtick-pkg/cli/dev_tools/services/repair_service.py
  • 🟡 boomtick-pkg/cli/dev_tools/utils.py
  • 🟢 boomtick-pkg/mcp/src/lib/td-cli.ts
  • 🟡 boomtick-pkg/mcp/src/tools/jules/create-session.ts
  • 🟡 boomtick-pkg/mcp/src/tools/jules/get-pr.ts
  • 🟡 boomtick-pkg/mcp/src/tools/jules/get-session.ts
  • 🟢 boomtick-pkg/mcp/src/tools/jules/shared.ts
  • 🟡 boomtick-pkg/mcp/src/tools/repo.logs.ts
  • 🟡 boomtick-pkg/mcp/src/tools/repo.read_ci_logs.ts
  • 🟡 etl/scraper.py
  • 🟡 package.json
  • 🟡 pnpm-lock.yaml
  • 🟢 src/components/editorial/EditorialPostView.tsx
  • 🟡 src/config/routes.ts
  • 🟡 src/features/journal/components/BlogPostDetail.tsx
  • 🟡 src/features/lab/components/FullPreview.tsx
  • 🟡 src/features/research/components/WCSChartContainers.tsx
  • 🟡 src/features/ux-auditor/useUXAuditor.ts
  • 🟡 src/hooks/useHotkeys.ts
  • 🟡 src/pages/UXAuditor.tsx

CI Checks Analysis

  • deploy: completed (success)
  • build: completed (success)
  • verify-changes / FOUNDATIONAL GATE: Checks for actual code modifications: completed (success)

Diff & Content Review

After reviewing the diff for PR #3198, the changes appear to align with the PR description.
I verified the changes in:

- 🟡 `.github/workflows/ci.yml`
- 🟡 `.gitignore`
- 🟡 `.jscpd.json`
- 🟡 `boomtick-pkg/cli/dev_tools/cli.py`
- 🟡 `boomtick-pkg/cli/dev_tools/scope_check.py`
- 🟡 `boomtick-pkg/cli/dev_tools/services/repair_service.py`
- 🟡 `boomtick-pkg/cli/dev_tools/utils.py`
- 🟢 `boomtick-pkg/mcp/src/lib/td-cli.ts`
- 🟡 `boomtick-pkg/mcp/src/tools/jules/create-session.ts`
- 🟡 `boomtick-pkg/mcp/src/tools/jules/get-pr.ts`
- 🟡 `boomtick-pkg/mcp/src/tools/jules/get-session.ts`
- 🟢 `boomtick-pkg/mcp/src/tools/jules/shared.ts`
- 🟡 `boomtick-pkg/mcp/src/tools/repo.logs.ts`
- 🟡 `boomtick-pkg/mcp/src/tools/repo.read_ci_logs.ts`
- 🟡 `etl/scraper.py`
- 🟡 `package.json`
- 🟡 `pnpm-lock.yaml`
- 🟢 `src/components/editorial/EditorialPostView.tsx`
- 🟡 `src/config/routes.ts`
- 🟡 `src/features/journal/components/BlogPostDetail.tsx`
- 🟡 `src/features/lab/components/FullPreview.tsx`
- 🟡 `src/features/research/components/WCSChartContainers.tsx`
- 🟡 `src/features/ux-auditor/useUXAuditor.ts`
- 🟡 `src/hooks/useHotkeys.ts`
- 🟡 `src/pages/UXAuditor.tsx`

The changes are isolated and CI passes (if any). The diff looks clean.

Recommendation:

  • Code exists and diff is valid.
  • Relevant checks pass or failures are understood.
    Approved for merging.

@arii

arii commented Jul 1, 2026

Copy link
Copy Markdown
Owner

🤖 Issue Quality Review

❌ Violations

  • Missing spec-driven sections: Problem Statement, Goal, Non-Goals, Proposed Approach, Alternatives Considered, Architectural Impact, Scope, UNDERSTAND THE ISSUE, DETERMINE APPROACH, SPECIFY SCOPE, DEFINITION OF DONE

⚠️ Warnings

  • No acceptance criteria.

Generated by td-cli validate-issue

@arii

arii commented Jul 1, 2026

Copy link
Copy Markdown
Owner

@jules-fix-ci

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

🤖 Jules is on it!

Initialized autonomous repair session (sessions/3729201378868336827) for branch ci-jscpd-integration-14957084357644127393.

@arii arii left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

ANTI-AI-SLOP

None. Adding jscpd to CI is a standard code-quality step.

FINDINGS

The PR adds `jscpd` for duplicate code detection as requested. However, it is failing `Lint & Type Check (boomtick-mcp)` due to `AssertionError: expected [Function] to throw error including 'Failed to create session: PR not found'` which needs to be resolved before merging.

FINAL RECOMMENDATION

Not Approved

@arii arii left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

PR Review: #3198

Context

  • Last Commit Tracked (SHA): dc48aea

Audit Checklist

For EVERY changed file, verify against these standards. Mark as - [x] when verified.

  • Dead abstractions: No new class, context, or hook that a simpler primitive handles.
  • Unnecessary indirection: No layer of wrapping where a direct function call suffices.
  • Responsibility creep: Component does not take on state/logic belonging in parent/hook.
  • Import bloat: No unnecessary import React from 'react' (React 17+).
  • Token compliance: Uses established design tokens (no raw Tailwind values or inline styles).
  • Audit ratio: If > 100 lines added, identified at least 10 lines to refactor/remove.

CI Log Triage

  • Failed Checks:
    Lint & Type Check (boomtick-mcp)
  • Detected Errors:
    AssertionError: expected [Function] to throw error including 'Failed to create session: PR not found' but got 'td-cli command failed (gh view 999): ...' in src/tools/jules/create-session.test.ts and src/tools/jules/get-pr.test.ts.
  • Root Cause Analysis:
    The tests in boomtick-mcp are failing because the expected error messages and session formats do not match the updated CLI behavior or required formatting (e.g., missing name: "sessions/<id>" prefix for Jules sessions).
  • Remediation Steps:
    Update the mock assertions in the failing tests to expect the updated CLI error messages and ensure that mock session objects properly include the name field prefixed with sessions/.

Output JSON

{
  "body": "## ANTI-AI-SLOP\n<findings>\nNo slop abstractions detected. The change correctly adds standard jscpd configuration without introducing wrappers or hallucinations.\n\n## FINDINGS\n<summary>\nThis PR successfully introduces duplicate code detection via `jscpd` and updates CI configuration to run it. The `.jscpd.json` and workflow file changes look structurally correct. However, this PR introduces breaking test regressions in `boomtick-mcp` (`create-session.test.ts` and `get-pr.test.ts`) due to mismatched mock expectations surrounding `td-cli` error handling. These test regressions must be fixed to maintain an impeccable system build.\n\n## FINAL RECOMMENDATION\nNot Approved\n\n<!-- td-review-manager-comment -->",
  "comments": [
    {
      "path": "package.json",
      "line": 1,
      "body": "Please ensure you run `pnpm test` locally to verify that any changes to CLI interaction do not break downstream MCP tool mock tests."
    }
  ]
}

@arii arii left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

PR Review: #3198

Context

  • Last Commit Tracked (SHA): dc48aea

Audit Checklist

For EVERY changed file, verify against these standards. Mark as - [x] when verified.

  • Dead abstractions: No new class, context, or hook that a simpler primitive handles.
  • Unnecessary indirection: No layer of wrapping where a direct function call suffices.
  • Responsibility creep: Component does not take on state/logic belonging in parent/hook.
  • Import bloat: No unnecessary import React from 'react' (React 17+).
  • Token compliance: Uses established design tokens (no raw Tailwind values or inline styles).
  • Audit ratio: If > 100 lines added, identified at least 10 lines to refactor/remove.

CI Log Triage

  • Failed Checks:
    Lint & Type Check (boomtick-mcp)
  • Detected Errors:
    AssertionError: expected [Function] to throw error including 'Failed to create session: PR not found' but got 'td-cli command failed (gh view 999): ...' in src/tools/jules/create-session.test.ts and src/tools/jules/get-pr.test.ts.
  • Root Cause Analysis:
    The tests in boomtick-mcp are failing because the expected error messages and session formats do not match the updated CLI behavior or required formatting (e.g., missing name: "sessions/<id>" prefix for Jules sessions).
  • Remediation Steps:
    Update the mock assertions in the failing tests to expect the updated CLI error messages and ensure that mock session objects properly include the name field prefixed with sessions/.

Output JSON

{
  "body": "## ANTI-AI-SLOP\n<findings>\nNo slop abstractions detected. The change correctly adds standard jscpd configuration without introducing wrappers or hallucinations.\n\n## FINDINGS\n<summary>\nThis PR successfully introduces duplicate code detection via `jscpd` and updates CI configuration to run it. The `.jscpd.json` and workflow file changes look structurally correct. However, this PR introduces breaking test regressions in `boomtick-mcp` (`create-session.test.ts` and `get-pr.test.ts`) due to mismatched mock expectations surrounding `td-cli` error handling. These test regressions must be fixed to maintain an impeccable system build.\n\n## FINAL RECOMMENDATION\nNot Approved\n\n<!-- td-review-manager-comment -->",
  "comments": [
    {
      "path": "package.json",
      "line": 1,
      "body": "Please ensure you run `pnpm test` locally to verify that any changes to CLI interaction do not break downstream MCP tool mock tests."
    }
  ]
}

@arii arii merged commit 4a96414 into main Jul 2, 2026
15 checks passed
@arii arii deleted the ci-jscpd-integration-14957084357644127393 branch July 2, 2026 19:58
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.

CI: Configure JSCPD duplicate code detection check in root CI workflow

1 participant