From eaa8b461468e47741f0b81eae75e85737333a721 Mon Sep 17 00:00:00 2001 From: PerfectPan <24316656+PerfectPan@users.noreply.github.com> Date: Wed, 18 Nov 2026 21:14:22 +0800 Subject: [PATCH] ci(checks): run duplicate detection in verify Run the zero-threshold duplicate check alongside the existing local and PR checks. Update both assertions that pin the shared verify command. Generated with Codex Co-Authored-By: Codex --- AGENTS.md | 5 ++++- CLAUDE.md | 2 ++ CONTRIBUTING.md | 5 ++++- README.md | 4 +++- docs/architecture/technology-decisions.md | 3 ++- package.json | 2 +- tests/repo/ci-harness.test.ts | 4 +++- tests/repo/package-bin.test.ts | 4 +++- 8 files changed, 22 insertions(+), 7 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 8a00d2e..48b1272 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -10,7 +10,7 @@ This repository is a local TypeScript CLI plus portable Codex skills. Treat ever - Do not commit `.env`, `.state/`, build output, local logs, tokens, temporary workspaces, or machine-specific paths. - Do not add private tokens, internal hostnames, private repository names, or personal filesystem paths. - Use `rg` for searches when available. -- Run `pnpm verify` before claiming a change is ready (`test:layout` + `vp check` + tests + `tsc` build + package check). Prefer `vp` for lint/fmt/test when Vite+ is installed (`pnpm exec vp …`). +- Run `pnpm verify` before claiming a change is ready (`test:layout` + `vp check` + duplicates + tests + `tsc` build + package check). Prefer `vp` for lint/fmt/test when Vite+ is installed (`pnpm exec vp …`). - Do not claim implementation work is complete until the relevant commands pass, or until skipped commands are explained with concrete blockers. - Update tests and documentation when behavior changes. - `feeds.json` is the repository-maintained RSS subscription list. Update it through `rss-summary feeds ...` when possible and include intentional feed changes in the pull request. @@ -35,6 +35,9 @@ gh repo-checks pr-body pr-body.md pnpm fmt pnpm lint +pnpm duplicates # Fails on any reported duplicate. +pnpm duplicates:audit # Reports duplicates without failing on findings. + # Full local gate: pnpm verify diff --git a/CLAUDE.md b/CLAUDE.md index 6adaf43..9bd37f7 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -28,6 +28,8 @@ Useful focused commands: ```bash pnpm test pnpm typecheck +pnpm duplicates # Fails on any reported duplicate. +pnpm duplicates:audit # Reports duplicates without failing on findings. pnpm build ``` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 71af987..53d5727 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -51,7 +51,10 @@ gh repo-checks pr-body pr-body.md pnpm fmt pnpm lint -# Full local gate (test layout + vp check + tests + build + package check): +pnpm duplicates # Fails on any reported duplicate. +pnpm duplicates:audit # Reports duplicates without failing on findings. + +# Full local gate (test layout + vp check + duplicates + tests + build + package check): pnpm verify # Coverage: diff --git a/README.md b/README.md index 70fbdd7..ee1c9ee 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,9 @@ rss-summary runs show ## Development ```bash -pnpm verify # test:layout + check + test + build + package:check +pnpm verify # test:layout + check + duplicates + test + build + package:check +pnpm duplicates # 检出任何一处重复都会失败。 +pnpm duplicates:audit # 只生成报告,发现重复也不会拦截。 ``` `main` 受保护。在功能分支上改,开 PR,等 `Verify` + `Coverage` 通过后再合并。 diff --git a/docs/architecture/technology-decisions.md b/docs/architecture/technology-decisions.md index 857f6e4..354a2ca 100644 --- a/docs/architecture/technology-decisions.md +++ b/docs/architecture/technology-decisions.md @@ -81,6 +81,7 @@ Alternatives considered and rejected: - **Oxfmt** via `vp fmt` / included in `vp check`. - Import direction is enforced by the architecture test (`scripts/architecture/boundaries.ts` + `tests/repo/architecture.test.ts`, zero violations), not by lint rules. - `pnpm verify` runs `pnpm check` (`vp check`) after `test:layout`. +- The next step, `pnpm duplicates`, fails on any reported duplicate. Run `pnpm duplicates:audit` separately for a report without failing on findings. ## CI Gates @@ -88,7 +89,7 @@ Alternatives considered and rejected: | Job | Command | Fails when | | --- | --- | --- | -| `Verify` | `pnpm verify` | layout mismatch, check (fmt/lint/type) failure, test failure, build failure, or packed-package check failure | +| `Verify` | `pnpm verify` | layout mismatch, check (fmt/lint/type) failure, any reported duplicate, test failure, build failure, or packed-package check failure | | `Coverage` | `pnpm test:layout && pnpm test:coverage` | missing sibling tests or coverage below the thresholds in `vite.config.ts` | Both jobs are intended to be required checks in the branch protection rule for `main` (configure in GitHub → Settings → Branches → Branch protection rules; this cannot be expressed in the workflow file itself). diff --git a/package.json b/package.json index 5ca8a1f..133007b 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "test:coverage": "vp test run --coverage", "test:layout": "node scripts/check-test-layout.mjs", "typecheck": "tsc --noEmit", - "verify": "pnpm test:layout && pnpm check && pnpm test && pnpm build && pnpm package:check" + "verify": "pnpm test:layout && pnpm check && pnpm duplicates && pnpm test && pnpm build && pnpm package:check" }, "devDependencies": { "@rivus/agent": "0.18.0", diff --git a/tests/repo/ci-harness.test.ts b/tests/repo/ci-harness.test.ts index b9236f7..88acb82 100644 --- a/tests/repo/ci-harness.test.ts +++ b/tests/repo/ci-harness.test.ts @@ -8,7 +8,9 @@ describe("CI harness", () => { scripts?: Record; }; - expect(pkg.scripts?.verify).toBe("pnpm test:layout && pnpm check && pnpm test && pnpm build && pnpm package:check"); + expect(pkg.scripts?.verify).toBe( + "pnpm test:layout && pnpm check && pnpm duplicates && pnpm test && pnpm build && pnpm package:check" + ); expect(pkg.scripts?.check).toBe("vp check"); expect(pkg.scripts?.lint).toBe("vp lint"); expect(pkg.scripts?.test).toBe("vp test run"); diff --git a/tests/repo/package-bin.test.ts b/tests/repo/package-bin.test.ts index 70e89fd..8d7e449 100644 --- a/tests/repo/package-bin.test.ts +++ b/tests/repo/package-bin.test.ts @@ -54,7 +54,9 @@ describe("package CLI metadata", () => { ]); expect(pkg.scripts?.build).toBe("tsc -p tsconfig.build.json"); expect(pkg.scripts?.["package:check"]).toBe("node scripts/check-package.mjs"); - expect(pkg.scripts?.verify).toBe("pnpm test:layout && pnpm check && pnpm test && pnpm build && pnpm package:check"); + expect(pkg.scripts?.verify).toBe( + "pnpm test:layout && pnpm check && pnpm duplicates && pnpm test && pnpm build && pnpm package:check" + ); expect(buildConfig.compilerOptions?.declaration).toBe(true); });