diff --git a/docs/promotion-outreach.md b/docs/promotion-outreach.md
index d0eaaba..1be0b28 100644
--- a/docs/promotion-outreach.md
+++ b/docs/promotion-outreach.md
@@ -28,7 +28,7 @@
引文雷达把这些变成自动检查——上传 DOCX(或粘贴文本),**全部处理在你的
浏览器里完成,论文不上传任何服务器**。
-- 编号一致性:缺失、重复、跳号、首次引用顺序(GB/T 7714—2025 表4/9.2.1.1)
+- 编号一致性:缺失、重复、跳号、首次引用顺序(GB/T 7714—2025 第 9.2.1/9.2.2 条)
- 著录格式:网页/数据集/预印本缺引用日期和 URL、学位论文缺授予单位、
标准缺编号、页码连接符——**附修改前后对照,一键复制**
- 双版本:2015 / 2025 分别适用,类型代码按版本区分(DS/PP 为 2025 新增)
diff --git a/package.json b/package.json
index 05b7b8c..d072d5e 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "reference-radar",
"private": true,
- "version": "1.1.2",
+ "version": "1.2.0",
"description": "Free, open-source, local-first citation & reference checker for academic papers (GB/T 7714—2015/2025)",
"type": "module",
"license": "MIT",
diff --git a/patches/vitest@5.0.5.patch b/patches/vitest@5.0.5.patch
new file mode 100644
index 0000000..7d78103
--- /dev/null
+++ b/patches/vitest@5.0.5.patch
@@ -0,0 +1,21 @@
+diff --git a/dist/chunks/index.1TqnEahn.js b/dist/chunks/index.1TqnEahn.js
+--- a/dist/chunks/index.1TqnEahn.js
++++ b/dist/chunks/index.1TqnEahn.js
+@@ -5140,7 +5140,7 @@
+ RunnerState["STOPPED"] = "stopped";
+ return RunnerState;
+ }(RunnerState || {});
+-const START_TIMEOUT = 6e4;
++const START_TIMEOUT = 18e4;
+ const STOP_TIMEOUT = 6e4;
+ /** @experimental */
+ class PoolRunner {
+@@ -5844,7 +5844,7 @@
+ }
+ }
+
+-const WORKER_START_TIMEOUT = 9e4;
++const WORKER_START_TIMEOUT = 3e5;
+ class Pool {
+ options;
+ logger;
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 26c9cd2..0dc49a9 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -7,6 +7,9 @@ settings:
overrides:
minimatch@<11.0.1: '>=11.0.1'
+patchedDependencies:
+ vitest@5.0.5: 1b35152eab5d6b6792c761b14caee3ee83b96cea7a2d65362cdb00534e689870
+
importers:
.:
@@ -83,7 +86,7 @@ importers:
version: 7.3.7(@types/node@26.6.6)
vitest:
specifier: ^5.0.5
- version: 5.0.5(@types/node@26.6.6)(jsdom@27.4.0)(vite@7.3.7(@types/node@26.6.6))
+ version: 5.0.5(patch_hash=1b35152eab5d6b6792c761b14caee3ee83b96cea7a2d65362cdb00534e689870)(@types/node@26.6.6)(jsdom@27.4.0)(vite@7.3.7(@types/node@26.6.6))
packages:
@@ -2866,7 +2869,7 @@ snapshots:
'@types/node': 26.6.6
fsevents: 2.3.3
- vitest@5.0.5(@types/node@26.6.6)(jsdom@27.4.0)(vite@7.3.7(@types/node@26.6.6)):
+ vitest@5.0.5(patch_hash=1b35152eab5d6b6792c761b14caee3ee83b96cea7a2d65362cdb00534e689870)(@types/node@26.6.6)(jsdom@27.4.0)(vite@7.3.7(@types/node@26.6.6)):
dependencies:
'@types/chai': 5.2.3
'@vitest/mocker': 5.0.5(vite@7.3.7(@types/node@26.6.6))
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index 04162d0..db346c1 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -2,3 +2,5 @@ allowBuilds:
esbuild: true
overrides:
"minimatch@<11.0.1": ">=11.0.1"
+patchedDependencies:
+ vitest@5.0.5: patches/vitest@5.0.5.patch
diff --git a/public/sw.js b/public/sw.js
index 93f12ef..df222bb 100644
--- a/public/sw.js
+++ b/public/sw.js
@@ -6,7 +6,7 @@
* - Never caches user documents or analysis results — everything the user
* uploads stays in memory only.
*/
-const VERSION = "rr-v1.1.2";
+const VERSION = "rr-v1.2.0";
const PRECACHE = `${VERSION}-precache`;
const RUNTIME = `${VERSION}-runtime`;
diff --git a/src/app/App.tsx b/src/app/App.tsx
index 9fcdfb5..84828a2 100644
--- a/src/app/App.tsx
+++ b/src/app/App.tsx
@@ -29,6 +29,7 @@ function SwBanner(): React.ReactNode {
export default function App(): React.ReactNode {
const [session, setSession] = useState<{
result: AnalysisResult;
+ previousResult?: AnalysisResult;
fileName: string;
bytes?: Uint8Array;
} | null>(null);
@@ -44,8 +45,15 @@ export default function App(): React.ReactNode {
result={session.result}
fileName={session.fileName}
sourceBytes={session.bytes}
+ previousResult={session.previousResult}
onHome={() => setSession(null)}
- onResult={(result, fileName) => setSession((s) => ({ ...s!, result, fileName }))}
+ onResult={(result, fileName) =>
+ setSession((s) =>
+ s && s.fileName === fileName
+ ? { ...s, previousResult: s.result, result, fileName }
+ : { result, fileName, bytes: s?.bytes }
+ )
+ }
/>
)}
diff --git a/src/app/ComparisonCard.tsx b/src/app/ComparisonCard.tsx
new file mode 100644
index 0000000..9b04615
--- /dev/null
+++ b/src/app/ComparisonCard.tsx
@@ -0,0 +1,45 @@
+import { useState } from "react";
+import { comparisonSummary, type RunComparison } from "../core/compare";
+
+/** Compact, dismissible comparison of the current run against the previous one. */
+export default function ComparisonCard({ comparison }: { comparison: RunComparison }): React.ReactNode {
+ const [open, setOpen] = useState(false);
+
+ return (
+
+
+ {open && (
+
+
+
已消失 {comparison.resolved.length}
+ {comparison.resolved.slice(0, 8).map((i) => (
+
{i.detail}
+ ))}
+
+
+
新出现 {comparison.introduced.length}
+ {comparison.introduced.slice(0, 8).map((i) => (
+
{i.detail}
+ ))}
+
+
+
仍然存在 {comparison.persistent.length}
+ {comparison.persistent.slice(0, 8).map((i) => (
+
{i.detail}
+ ))}
+
+
匹配依据:规则编号与结论文本完全一致;定位可能移动。仅本次会话内存中比较。
+
+ )}
+
+ );
+}
diff --git a/src/app/Home.tsx b/src/app/Home.tsx
index 897e6b0..d049150 100644
--- a/src/app/Home.tsx
+++ b/src/app/Home.tsx
@@ -1,7 +1,7 @@
import { useCallback, useRef, useState } from "react";
import { useApp } from "./AppContext";
import { useAnalysisRunner } from "./use-analysis";
-import { buildSampleDocx, SAMPLE_FILE_NAME } from "./sample-doc";
+import { buildSampleDocx, buildErrorSampleDocx, buildFormatSampleDocx, SAMPLE_FILE_NAME, SAMPLE_ERROR_FILE_NAME, SAMPLE_FORMAT_FILE_NAME } from "./sample-doc";
import type { AnalysisResult } from "../core/types";
import { GithubIcon, RadarLogo, ShieldIcon } from "./icons";
@@ -147,6 +147,26 @@ export default function Home({ onResult }: HomeProps): React.ReactNode {
+
+
diff --git a/src/app/Workbench.tsx b/src/app/Workbench.tsx
index 774046f..f7b1ac9 100644
--- a/src/app/Workbench.tsx
+++ b/src/app/Workbench.tsx
@@ -6,6 +6,8 @@ import IssuesPanel from "./IssuesPanel";
import ScopePanel from "./ScopePanel";
import GraphView from "./GraphView";
import type { PdfModule } from "./report-pdf";
+import { compareRuns } from "../core/compare";
+import ComparisonCard from "./ComparisonCard";
import { analyze } from "./worker-client";
import { errorToKey } from "./use-analysis";
@@ -29,13 +31,15 @@ interface WorkbenchProps {
fileName: string;
/** Original DOCX bytes (kept in memory only, never persisted) for re-analysis. */
sourceBytes?: Uint8Array;
+ /** Previous analysis, when this result is a re-check of the same file. */
+ previousResult?: AnalysisResult;
onHome: () => void;
onResult: (r: AnalysisResult, fileName: string) => void;
}
type RightTab = "issues" | "graph" | "scope";
-export default function Workbench({ result, fileName, sourceBytes, onHome, onResult }: WorkbenchProps): React.ReactNode {
+export default function Workbench({ result, fileName, sourceBytes, previousResult, onHome, onResult }: WorkbenchProps): React.ReactNode {
const { tr, locale, setLocale, theme, toggleTheme } = useApp();
const [tab, setTab] = useState("issues");
const [filter, setFilter] = useState("all");
@@ -121,6 +125,11 @@ export default function Workbench({ result, fileName, sourceBytes, onHome, onRes
}
}, [result, fileName, locale]);
+ const comparison = useMemo(
+ () => (previousResult ? compareRuns(previousResult, result) : null),
+ [previousResult, result]
+ );
+
const headingBlocks = useMemo(
() => result.blocks.filter((b) => b.kind === "heading" && b.headingLevel !== undefined && b.headingLevel <= 3),
[result.blocks]
@@ -289,6 +298,9 @@ export default function Workbench({ result, fileName, sourceBytes, onHome, onRes
))}
+ {tab === "issues" && comparison && (
+
+ )}
{tab === "issues" && (
{
+ it("sample A (correct paper) has zero deterministic errors", () => {
+ const r = analyzeDocx(buildSampleDocx(), "sA.docx", { version: "2025" });
+ expect(r.stats.errorCount).toBe(0);
+ expect(r.stats.warningCount).toBe(0);
+ });
+
+ it("sample B (citation errors) reports missing ref + duplicate + order", () => {
+ const r = analyzeDocx(buildErrorSampleDocx(), "sB.docx", { version: "2025" });
+ expect(r.stats.errorCount).toBeGreaterThanOrEqual(3);
+ expect(r.issues.some((i) => i.ruleId === "RR-CIT-001")).toBe(true);
+ expect(r.issues.some((i) => i.ruleId === "RR-REF-002")).toBe(true);
+ expect(r.issues.some((i) => i.ruleId === "RR-CIT-004")).toBe(true);
+ });
+
+ it("sample C (format issues) offers mechanical fix previews", () => {
+ const r = analyzeDocx(buildFormatSampleDocx(), "sC.docx", { version: "2025" });
+ expect(r.issues.some((i) => i.ruleId === "RR-FMT-011" && i.fixPreview)).toBe(true);
+ expect(r.issues.some((i) => i.ruleId === "RR-FMT-017" && i.fixPreview)).toBe(true);
+ });
+});
diff --git a/src/core/compare.test.ts b/src/core/compare.test.ts
new file mode 100644
index 0000000..0e86809
--- /dev/null
+++ b/src/core/compare.test.ts
@@ -0,0 +1,89 @@
+import { describe, expect, it } from "vitest";
+import { compareRuns, comparisonSummary } from "./compare";
+import type { AnalysisResult, Issue } from "./types";
+
+function issue(ruleId: string, detail: string, severity: Issue["severity"] = "error"): Issue {
+ return {
+ id: `iss-${ruleId}-${detail}`,
+ ruleId,
+ standardVersion: "2025",
+ category: "citation-reference-consistency",
+ severity: severity as Issue["severity"],
+ messageKey: "issue.test",
+ detail,
+ anchors: [],
+ source: { clause: "9.2.1.1", summary: "test", status: "verified-official" },
+ confidence: "high",
+ requiresManualCheck: false,
+ relatedIds: [],
+ };
+}
+
+function result(issues: Issue[], version: "2015" | "2025" = "2025"): AnalysisResult {
+ return {
+ fileName: "t.docx",
+ analyzedAt: new Date().toISOString(),
+ version,
+ blocks: [],
+ citations: [],
+ references: [],
+ relations: [],
+ issues,
+ stats: {
+ blockCount: 0,
+ citationCount: 0,
+ citationMarkerCount: 0,
+ distinctCitedNumbers: 0,
+ referenceCount: 0,
+ rulesRun: [],
+ errorCount: issues.filter((i) => i.severity === "error").length,
+ warningCount: 0,
+ reviewCount: 0,
+ infoCount: 0,
+ },
+ scope: { analyzedContainers: [], excludedNotes: [], referenceSectionDetected: false },
+ parseWarnings: [],
+ };
+}
+
+describe("run comparison", () => {
+ it("classifies resolved / introduced / persistent findings", () => {
+ const prev = result([issue("RR-CIT-001", "missing [5]"), issue("RR-REF-002", "dup [2]"), issue("RR-REF-011", "uncited [3]", "info")]);
+ const curr = result([issue("RR-REF-002", "dup [2]"), issue("RR-CIT-004", "order violation")]);
+ const c = compareRuns(prev, curr);
+ expect(c.resolved.map((i) => i.detail)).toEqual(["missing [5]", "uncited [3]"]);
+ expect(c.introduced.map((i) => i.detail)).toEqual(["order violation"]);
+ expect(c.persistent.map((i) => i.detail)).toEqual(["dup [2]"]);
+ });
+
+ it("flags a version mismatch between runs", () => {
+ const c = compareRuns(result([]), result([], "2015" as const));
+ expect(c.versionMismatch).toBe(true);
+ expect(comparisonSummary(c)).toContain("不同标准版本");
+ });
+
+ it("summary text counts", () => {
+ const c = compareRuns(
+ result([issue("RR-CIT-001", "missing [5]")]),
+ result([])
+ );
+ expect(comparisonSummary(c)).toBe("已消失 1 · 新出现 0 · 仍然存在 0");
+ });
+
+ it("empty runs compare cleanly", () => {
+ const c = compareRuns(result([]), result([]));
+ expect(c.persistent).toHaveLength(0);
+ expect(comparisonSummary(c)).toBe("已消失 0 · 新出现 0 · 仍然存在 0");
+ });
+
+ it("same issue in both runs matches despite shifting anchor text (id excluded)", () => {
+ // anchor shift changes nothing: ids are regenerated per run but excluded
+ const prev = result([issue("RR-CIT-001", "missing [5]")]);
+ prev.issues[0]!.anchors = [{ containerId: "old", containerKind: "body", paragraphId: "old-p", blockIndex: 3, charStart: 0, charEnd: 3, text: "[5]" }];
+ const curr = result([issue("RR-CIT-001", "missing [5]")]);
+ curr.issues[0]!.anchors = [{ containerId: "new", containerKind: "body", paragraphId: "new-p", blockIndex: 7, charStart: 2, charEnd: 5, text: "[5]" }];
+ const c = compareRuns(prev, curr);
+ expect(c.persistent).toHaveLength(1);
+ expect(c.resolved).toHaveLength(0);
+ });
+});
diff --git a/src/core/compare.ts b/src/core/compare.ts
new file mode 100644
index 0000000..8b20552
--- /dev/null
+++ b/src/core/compare.ts
@@ -0,0 +1,53 @@
+/**
+ * Simple, honest comparison between two analysis runs (V1.2).
+ *
+ * Matching key: ruleId + exact detail text. Details are deterministic
+ * message strings, so equal signatures mean the same finding; anchors may
+ * shift between runs and are deliberately excluded from matching.
+ *
+ * This is an in-memory, single-session comparison. Nothing is persisted.
+ */
+import type { AnalysisResult, Issue } from "./types";
+
+export interface RunComparison {
+ /** Findings present in the previous run but gone from the new one. */
+ resolved: Issue[];
+ /** Findings present in the new run but absent before. */
+ introduced: Issue[];
+ /** Findings present in both runs. */
+ persistent: Issue[];
+ /** True when the two runs used different standard versions (comparing across versions is misleading). */
+ versionMismatch: boolean;
+}
+
+const signature = (i: Issue): string => `${i.ruleId}|${i.detail}`;
+
+export function compareRuns(previous: AnalysisResult, current: AnalysisResult): RunComparison {
+ const prev = new Map(previous.issues.map((i) => [signature(i), i]));
+ const curr = new Map(current.issues.map((i) => [signature(i), i]));
+
+ const resolved: Issue[] = [];
+ const persistent: Issue[] = [];
+ for (const [sig, issue] of prev) {
+ if (curr.has(sig)) persistent.push(issue);
+ else resolved.push(issue);
+ }
+ const introduced = [...curr.values()].filter((i) => !prev.has(signature(i)));
+
+ return {
+ resolved,
+ introduced,
+ persistent,
+ versionMismatch: previous.version !== current.version,
+ };
+}
+
+export function comparisonSummary(c: RunComparison): string {
+ const parts = [
+ `已消失 ${c.resolved.length}`,
+ `新出现 ${c.introduced.length}`,
+ `仍然存在 ${c.persistent.length}`,
+ ];
+ if (c.versionMismatch) parts.push("⚠ 两次检查使用了不同标准版本,比较仅供参考");
+ return parts.join(" · ");
+}
diff --git a/src/core/golden/golden.test.ts b/src/core/golden/golden.test.ts
index 85b4806..bf7d080 100644
--- a/src/core/golden/golden.test.ts
+++ b/src/core/golden/golden.test.ts
@@ -47,8 +47,9 @@ describe("golden samples (hand-authored expectations)", () => {
});
describe("hostile inputs (must fail safely with actionable codes)", () => {
- for (const s of HOSTILE_SAMPLES) {
- it(`${s.id} ${s.title}`, () => {
+ // These tests deliberately inflate large payloads to prove the caps reject
+ // them — under a loaded machine the 64 MB inflate can exceed the 5 s default.
+ it.each(HOSTILE_SAMPLES)("$id $title", (s) => {
if (s.throwsCode) {
expect(() => analyzeDocx(s.bytes(), `${s.id}.docx`, { version: "2025" })).toThrowError(
expect.objectContaining({ code: s.throwsCode }) as Error
@@ -57,8 +58,7 @@ describe("hostile inputs (must fail safely with actionable codes)", () => {
// G18e: malformed XML throws a generic, readable Error (not a crash).
expect(() => analyzeDocx(s.bytes(), `${s.id}.docx`, { version: "2025" })).toThrowError(/document\.xml/);
}
- });
- }
+ }, 60000);
it("DocxLimitsError carries a user-facing code", () => {
const e = new DocxLimitsError("zip-bomb", "test");
diff --git a/src/core/references/detect.ts b/src/core/references/detect.ts
index fc1d284..c26464a 100644
--- a/src/core/references/detect.ts
+++ b/src/core/references/detect.ts
@@ -77,6 +77,11 @@ export function detectReferenceSection(blocks: DocBlock[]): ReferenceSection | u
runLen = 0;
}
}
+ // A suffix run of >=2 entries at the very end of the input is accepted in
+ // paste mode, where users legitimately paste short lists.
+ if (runLen >= 2 && runStart >= 0 && runStart + runLen === blocks.length) {
+ return { startIndex: runStart, endIndex: regionEnd(blocks, runStart - 1), evidence: "entries-run" };
+ }
if (runLen >= 3 && runStart >= 0) {
return { startIndex: runStart, endIndex: regionEnd(blocks, runStart - 1), evidence: "entries-run" };
}
diff --git a/src/core/rules/definitions.ts b/src/core/rules/definitions.ts
index 2f35a54..dccea9d 100644
--- a/src/core/rules/definitions.ts
+++ b/src/core/rules/definitions.ts
@@ -1292,6 +1292,9 @@ export const RULES: RuleDefinition[] = [
explanation: "列出了但从未被正文引用的文献。这是提示信息;是否删除取决于论文写作要求。",
check: (ctx) => {
if (!ctx.scope.referenceSectionDetected) return [];
+ // Reference-list-only input (paste mode without body text): "uncited"
+ // cannot be judged — suppress instead of flagging every entry (V1.1.2).
+ if (ctx.scope.bodyless) return [];
const cited = new Set(ctx.relations.map((rel) => rel.number));
const drafts: IssueDraft[] = [];
for (const r of ctx.references) {
diff --git a/src/core/text-analysis.test.ts b/src/core/text-analysis.test.ts
new file mode 100644
index 0000000..e71d2db
--- /dev/null
+++ b/src/core/text-analysis.test.ts
@@ -0,0 +1,45 @@
+/**
+ * V1.2 regressions for reference-list-only (paste) mode.
+ *
+ * Goal: with a pasted reference list and no body text, list-internal checks
+ * (gaps, duplicates, list order, format) still run, but body-dependent
+ * conclusions (uncited entries, citation order) must be suppressed.
+ */
+import { describe, expect, it } from "vitest";
+import { analyzeText } from "./text-analysis";
+
+const REFS = "参考文献\n[1] 张三. 文献一[J]. 学报, 2020, 1(1): 1-9.\n[3] 李四. 文献二[M]. 出版社, 2021.";
+
+describe("paste mode (reference-list-only)", () => {
+ it("does not flag every entry as uncited when no body text exists", () => {
+ const r = analyzeText(REFS, "paste.docx", { version: "2025" });
+ expect(r.references.length).toBe(2);
+ expect(r.scope.bodyless).toBe(true);
+ expect(r.issues.filter((i) => i.ruleId === "RR-REF-011")).toEqual([]);
+ });
+
+ it("still runs list-internal checks: the gap at [2] is reported", () => {
+ const r = analyzeText(REFS, "paste.docx", { version: "2025" });
+ expect(r.issues.some((i) => i.ruleId === "RR-REF-003" && i.detail.includes("2"))).toBe(true);
+ });
+
+ it("discloses the disabled checks in the scope notes", () => {
+ const r = analyzeText(REFS, "paste.docx", { version: "2025" });
+ const notes = r.scope.excludedNotes.join(" ");
+ expect(notes).toContain("引用顺序");
+ expect(notes).toContain("未被正文引用");
+ });
+
+ it("keeps body-dependent checks when the paste DOES contain citations", () => {
+ const withBody = "正文引用[1]与[2]。\n参考文献\n[1] 甲. 文一[J]. 学报, 2020.\n[2] 乙. 文二[J]. 学报, 2021.";
+ const r = analyzeText(withBody, "paste2.docx", { version: "2025" });
+ expect(r.scope.bodyless).toBe(false);
+ expect(r.issues.some((i) => i.ruleId === "RR-REF-011")).toBe(false); // all cited
+ });
+
+ it("flags missing numbers and cites correctly when body citations exist", () => {
+ const withBody = "正文引用[1]与[3]。\n参考文献\n[1] 甲. 文一[J]. 学报, 2020.";
+ const r = analyzeText(withBody, "paste3.docx", { version: "2025" });
+ expect(r.issues.some((i) => i.ruleId === "RR-CIT-001")).toBe(true);
+ });
+});
diff --git a/src/core/text-analysis.ts b/src/core/text-analysis.ts
index 5840081..172f136 100644
--- a/src/core/text-analysis.ts
+++ b/src/core/text-analysis.ts
@@ -15,7 +15,11 @@ export function analyzeText(text: string, fileName: string, options: { version:
for (const [i, line] of lines.entries()) {
const trimmed = line.trim();
if (!trimmed) continue;
- const isHeading = /^(第[一二三四五六七八九十\d]+[章节部分]|[一二三四五六七八九十][、.]|\d+(\.\d+)*\s+\S)/.test(trimmed) && trimmed.length < 40;
+ const isHeading =
+ (/^(第[一二三四五六七八九十\d]+[章节部分]|[一二三四五六七八九十][、.]|\d+(\.\d+)*\s+\S)/.test(trimmed) && trimmed.length < 40) ||
+ // Standalone reference-section titles are structural headings even when
+ // they don't match the numbered-heading shapes above.
+ /^(参\s*考\s*文\s*献[::]?|references?[::]?|bibliography[::]?)$/i.test(trimmed);
blocks.push({
id: `text:p${i}`,
kind: isHeading ? "heading" : "paragraph",
@@ -39,10 +43,20 @@ export function analyzeText(text: string, fileName: string, options: { version:
}
const relations = buildRelations(citations, references);
+ // Paste mode with a reference list but no in-text citations: body-dependent
+ // conclusions (uncited entries, citation order) must not be reported.
+ const bodyless = citations.length === 0;
const scope: AnalysisScope = {
+ bodyless,
analyzedContainers: ["body"] as ContainerKind[],
excludedNotes: [
"粘贴文本模式:无脚注、尾注、表格或域信息可分析。/ Pasted-text mode: no footnotes, tables or field data available.",
+ ...(bodyless
+ ? [
+ "未检测到正文引文标记:『未被正文引用』与『引用顺序』类检查已停用(仅参考文献列表模式下无法可靠判断)。/ " +
+ "No in-text citation markers detected: uncited-entry and citation-order checks are disabled in reference-list-only mode.",
+ ]
+ : []),
],
referenceSectionDetected: !!section,
referenceSectionTitle: section?.title,
diff --git a/src/core/types.ts b/src/core/types.ts
index 206198a..df4ee77 100644
--- a/src/core/types.ts
+++ b/src/core/types.ts
@@ -313,6 +313,12 @@ export interface RuleDefinition {
}
export interface AnalysisScope {
+ /**
+ * True when the analysis has no usable in-text citations (e.g. a pasted
+ * reference list without body text). Uncited-entry and citation-order
+ * checks that require body context are suppressed in this mode.
+ */
+ bodyless?: boolean;
/** Which containers were actually analyzed. */
analyzedContainers: ContainerKind[];
/** Explicit statements about what was NOT analyzed. */
diff --git a/src/design/components.css b/src/design/components.css
index 46cfaf8..3940f80 100644
--- a/src/design/components.css
+++ b/src/design/components.css
@@ -820,3 +820,34 @@ body {
.rr-group > .rr-issue:last-child {
border-bottom: none;
}
+
+/* run comparison */
+.rr-compare {
+ border: 1px solid var(--rr-border);
+ border-radius: var(--rr-radius-m);
+ margin-bottom: var(--rr-space-3);
+ background: var(--rr-primary-soft);
+}
+.rr-compare__summary {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ width: 100%;
+ padding: 8px 12px;
+ border: none;
+ background: none;
+ font: inherit;
+ font-size: 13px;
+ cursor: pointer;
+ text-align: left;
+}
+.rr-compare__title { font-weight: 700; }
+.rr-compare__counts { color: var(--rr-text-muted); flex: 1; }
+.rr-compare__toggle { color: var(--rr-text-muted); }
+.rr-compare__body { padding: 4px 12px 10px; display: flex; flex-direction: column; gap: 8px; }
+.rr-compare__section { font-size: 12.5px; display: flex; flex-direction: column; gap: 2px; }
+.rr-compare__line { color: var(--rr-text-muted); overflow-wrap: anywhere; }
+.rr-compare__resolved { color: var(--rr-ok); }
+.rr-compare__introduced { color: var(--rr-danger); }
+.rr-compare__persistent { color: var(--rr-text-muted); }
+.rr-compare__note { font-size: 11px; color: var(--rr-text-muted); border-top: 1px dashed var(--rr-border); padding-top: 6px; }