paperlint 18.6.0 → 18.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/.claude-plugin/marketplace.json +11 -0
  2. package/.claude-plugin/plugin.json +7 -0
  3. package/CLAUDE.md +3 -3
  4. package/CONTRIBUTING.md +5 -2
  5. package/README.md +6 -6
  6. package/dist/adapters/clack/index.d.ts +3 -0
  7. package/dist/adapters/clack/index.d.ts.map +1 -0
  8. package/dist/adapters/clack/index.js +3 -0
  9. package/dist/adapters/clack/index.js.map +1 -0
  10. package/dist/adapters/clack/prompts.io.d.ts +8 -0
  11. package/dist/adapters/clack/prompts.io.d.ts.map +1 -0
  12. package/dist/adapters/clack/prompts.io.js +20 -0
  13. package/dist/adapters/clack/prompts.io.js.map +1 -0
  14. package/dist/adapters/claude-code/claude.io.d.ts +13 -0
  15. package/dist/adapters/claude-code/claude.io.d.ts.map +1 -0
  16. package/dist/adapters/claude-code/claude.io.js +68 -0
  17. package/dist/adapters/claude-code/claude.io.js.map +1 -0
  18. package/dist/adapters/claude-code/index.d.ts +4 -0
  19. package/dist/adapters/claude-code/index.d.ts.map +1 -0
  20. package/dist/adapters/claude-code/index.js +4 -0
  21. package/dist/adapters/claude-code/index.js.map +1 -0
  22. package/dist/adapters/claude-code/plugin.d.ts +19 -0
  23. package/dist/adapters/claude-code/plugin.d.ts.map +1 -0
  24. package/dist/adapters/claude-code/plugin.js +66 -0
  25. package/dist/adapters/claude-code/plugin.js.map +1 -0
  26. package/dist/adapters/package-manager/index.d.ts +4 -0
  27. package/dist/adapters/package-manager/index.d.ts.map +1 -0
  28. package/dist/adapters/package-manager/index.js +4 -0
  29. package/dist/adapters/package-manager/index.js.map +1 -0
  30. package/dist/adapters/package-manager/install.io.d.ts +3 -0
  31. package/dist/adapters/package-manager/install.io.d.ts.map +1 -0
  32. package/dist/adapters/package-manager/install.io.js +23 -0
  33. package/dist/adapters/package-manager/install.io.js.map +1 -0
  34. package/dist/adapters/package-manager/manager.d.ts +13 -0
  35. package/dist/adapters/package-manager/manager.d.ts.map +1 -0
  36. package/dist/adapters/package-manager/manager.js +22 -0
  37. package/dist/adapters/package-manager/manager.js.map +1 -0
  38. package/dist/adapters/study-registry/index.d.ts +2 -2
  39. package/dist/cli.d.ts +9 -1
  40. package/dist/cli.d.ts.map +1 -1
  41. package/dist/cli.js +73 -13
  42. package/dist/cli.js.map +1 -1
  43. package/dist/doctor-plugin.d.ts +23 -0
  44. package/dist/doctor-plugin.d.ts.map +1 -0
  45. package/dist/doctor-plugin.js +56 -0
  46. package/dist/doctor-plugin.js.map +1 -0
  47. package/dist/doctor.d.ts +6 -1
  48. package/dist/doctor.d.ts.map +1 -1
  49. package/dist/doctor.js +69 -26
  50. package/dist/doctor.js.map +1 -1
  51. package/dist/hooks-settings.d.ts +18 -0
  52. package/dist/hooks-settings.d.ts.map +1 -1
  53. package/dist/hooks-settings.js +25 -0
  54. package/dist/hooks-settings.js.map +1 -1
  55. package/dist/init.d.ts +47 -16
  56. package/dist/init.d.ts.map +1 -1
  57. package/dist/init.js +231 -86
  58. package/dist/init.js.map +1 -1
  59. package/dist/link-skills.d.ts +15 -0
  60. package/dist/link-skills.d.ts.map +1 -1
  61. package/dist/link-skills.js +18 -1
  62. package/dist/link-skills.js.map +1 -1
  63. package/dist/plugin-offer.d.ts +73 -0
  64. package/dist/plugin-offer.d.ts.map +1 -0
  65. package/dist/plugin-offer.js +96 -0
  66. package/dist/plugin-offer.js.map +1 -0
  67. package/dist/ports/claude-code.d.ts +31 -0
  68. package/dist/ports/claude-code.d.ts.map +1 -0
  69. package/dist/ports/claude-code.js +2 -0
  70. package/dist/ports/claude-code.js.map +1 -0
  71. package/dist/ports/project-install.d.ts +19 -0
  72. package/dist/ports/project-install.d.ts.map +1 -0
  73. package/dist/ports/project-install.js +2 -0
  74. package/dist/ports/project-install.js.map +1 -0
  75. package/dist/ports/prompts.d.ts +31 -0
  76. package/dist/ports/prompts.d.ts.map +1 -0
  77. package/dist/ports/prompts.js +2 -0
  78. package/dist/ports/prompts.js.map +1 -0
  79. package/dist/self-install.d.ts +65 -0
  80. package/dist/self-install.d.ts.map +1 -0
  81. package/dist/self-install.js +145 -0
  82. package/dist/self-install.js.map +1 -0
  83. package/dist/skill-chunks/chunk-65X5HVIJ.js +26462 -0
  84. package/dist/skill-chunks/chunk-6NU6CXUS.js +258 -0
  85. package/dist/skill-chunks/chunk-GRSXIWYF.js +352 -0
  86. package/dist/skill-chunks/chunk-IREAROCV.js +84 -0
  87. package/dist/skill-chunks/chunk-KWK6RT4T.js +24267 -0
  88. package/dist/skill-chunks/chunk-NPQVDEE4.js +19681 -0
  89. package/dist/skill-chunks/chunk-PJ4KNV4J.js +45 -0
  90. package/dist/skill-chunks/dist-UPCJMLBM.js +385 -0
  91. package/dist/skill-chunks/pdfjs-LUMEFOH2.js +39518 -0
  92. package/dist/types.d.ts +4 -0
  93. package/dist/types.d.ts.map +1 -1
  94. package/docs/e2e.md +10 -0
  95. package/docs/install.md +88 -29
  96. package/docs/prior-art/README.md +2 -0
  97. package/docs/prior-art/one-command-install.md +33 -0
  98. package/docs/prior-art/prompt-libraries.md +32 -0
  99. package/eslint.config.mjs +1 -0
  100. package/hooks/CLAUDE.md +2 -2
  101. package/hooks/CLAUDE.md.spec.ts +1 -1
  102. package/lib/skill-checks.mjs +13 -6
  103. package/lib/skill-checks.test.mjs +28 -15
  104. package/lib/skill-corpus.mjs +5 -2
  105. package/package.json +8 -3
  106. package/plugin/CLAUDE.md +22 -14
  107. package/plugin/CLAUDE.md.spec.ts +20 -12
  108. package/scripts/bundle-skills.test.ts +226 -0
  109. package/scripts/bundle-skills.ts +304 -0
  110. package/scripts/plugin-version.test.ts +80 -0
  111. package/scripts/plugin-version.ts +58 -0
  112. package/skills/CLAUDE.md +2 -2
  113. package/skills/CLAUDE.md.spec.ts +1 -1
  114. package/skills/argument-arc/SKILL.md +2 -2
  115. package/skills/argument-arc/SKILL.md.spec.ts +1 -1
  116. package/skills/argument-arc/scripts/headings.js +57 -13
  117. package/skills/build-label-page/scripts/label-page.js +2005 -93
  118. package/skills/cold-read-diff/scripts/cold-read.js +221 -14
  119. package/skills/label-agent-runs/scripts/labels.js +272 -348
  120. package/skills/paper-pipeline/references/anonymization.md +4 -3
  121. package/skills/paper-pipeline/scripts/extract-ref-facts.js +304 -0
  122. package/skills/pc-panel-review/scripts/prior-reviews.js +7244 -12
  123. package/skills/run-agent-grid/scripts/grid-guard.js +562 -627
  124. package/skills/submit-paper/SKILL.md +5 -4
  125. package/skills/submit-paper/SKILL.md.spec.ts +4 -3
  126. package/skills/submit-paper/check-deanon.sh +17 -2
  127. package/skills/submit-paper/check-deanon.test.ts +141 -0
  128. package/skills/verify-citations/SKILL.md +9 -9
  129. package/skills/verify-citations/SKILL.md.spec.ts +8 -8
  130. package/skills/verify-citations/scripts/bib-authors.js +228 -0
  131. package/skills/verify-citations/scripts/verify-cites.js +816 -0
  132. package/src/adapters/clack/index.ts +2 -0
  133. package/src/adapters/clack/prompts.io.ts +35 -0
  134. package/src/adapters/clack/prompts.test.ts +58 -0
  135. package/src/adapters/claude-code/claude.io.ts +103 -0
  136. package/src/adapters/claude-code/index.test.ts +233 -0
  137. package/src/adapters/claude-code/index.ts +11 -0
  138. package/src/adapters/claude-code/plugin.ts +82 -0
  139. package/src/adapters/package-manager/index.test.ts +67 -0
  140. package/src/adapters/package-manager/index.ts +3 -0
  141. package/src/adapters/package-manager/install.io.ts +27 -0
  142. package/src/adapters/package-manager/manager.ts +33 -0
  143. package/src/cli.harness.mjs +47 -26
  144. package/src/cli.test.ts +179 -2
  145. package/src/cli.ts +130 -10
  146. package/src/doctor-plugin.test.ts +103 -0
  147. package/src/doctor-plugin.ts +83 -0
  148. package/src/doctor.test.ts +111 -2
  149. package/src/doctor.ts +83 -32
  150. package/src/hooks-notice.test.ts +82 -0
  151. package/src/hooks-settings.ts +49 -0
  152. package/src/init-plugin.test.ts +178 -0
  153. package/src/init.test.ts +138 -27
  154. package/src/init.ts +341 -124
  155. package/src/link-skills.test.ts +34 -1
  156. package/src/link-skills.ts +34 -0
  157. package/src/parse-args.test.ts +2 -0
  158. package/src/plugin-offer.test.ts +276 -0
  159. package/src/plugin-offer.ts +160 -0
  160. package/src/ports/claude-code.ts +30 -0
  161. package/src/ports/project-install.ts +18 -0
  162. package/src/ports/prompts.ts +27 -0
  163. package/src/self-install.test.ts +267 -0
  164. package/src/self-install.ts +224 -0
  165. package/src/types.ts +4 -0
@@ -4,7 +4,7 @@ description: "End-to-end playbook for submitting a peer-reviewed paper to a doub
4
4
  allowed-tools: [Read, Write, Edit, Grep, Glob, Bash, WebSearch, WebFetch, Skill]
5
5
  ---
6
6
 
7
- <!-- vigiles:sha256:567ef8c125d44ebd compiled from skills/submit-paper/SKILL.md.spec.ts -->
7
+ <!-- vigiles:sha256:04205ded068d1947 compiled from skills/submit-paper/SKILL.md.spec.ts -->
8
8
 
9
9
  # submit-paper — get a reviewed paper from "done" to "ready for review"
10
10
 
@@ -55,10 +55,11 @@ never find it.
55
55
  **MECHANICAL GATE (run it, don't eyeball) — greps the PDF text + every artifact file + inside any
56
56
  `*.zip` for the identity deny-list, exit non-zero on a hit:**
57
57
  ```
58
- bash .claude/skills/submit-paper/check-deanon.sh <paper-dir> [pdf=paper.pdf]
58
+ bash ${CLAUDE_SKILL_DIR}/check-deanon.sh <paper-dir> [pdf=paper.pdf]
59
59
  ```
60
- Must PASS (exit 0) for a double-blind submission. Deny-list: `.claude/skills/submit-paper/deanon-denylist.txt`
61
- (edit as handles/repos change). It guards the
60
+ Must PASS (exit 0) for a double-blind submission. Deny-list: your project's
61
+ `.paperlint/deanon-denylist.txt`, one extended regex per line (edit as handles/repos change); it is
62
+ yours, so it lives in your repository, not in the package. It guards the
62
63
  single highest reject-vector (an artifact README naming real maintainers/repos is invisible to a
63
64
  paper-only read). Only run it on *double-blind* papers — a de-anonymized single-blind PDF is supposed
64
65
  to carry your name and will (correctly) fail. Canonical deny-list rationale → `paper-pipeline/references/anonymization.md`.
@@ -74,10 +74,11 @@ never find it.
74
74
  **MECHANICAL GATE (run it, don't eyeball) — greps the PDF text + every artifact file + inside any
75
75
  \`*.zip\` for the identity deny-list, exit non-zero on a hit:**
76
76
  \`\`\`
77
- bash .claude/skills/submit-paper/check-deanon.sh <paper-dir> [pdf=paper.pdf]
77
+ bash \${CLAUDE_SKILL_DIR}/check-deanon.sh <paper-dir> [pdf=paper.pdf]
78
78
  \`\`\`
79
- Must PASS (exit 0) for a double-blind submission. Deny-list: \`.claude/skills/submit-paper/deanon-denylist.txt\`
80
- (edit as handles/repos change). It guards the
79
+ Must PASS (exit 0) for a double-blind submission. Deny-list: your project's
80
+ \`.paperlint/deanon-denylist.txt\`, one extended regex per line (edit as handles/repos change); it is
81
+ yours, so it lives in your repository, not in the package. It guards the
81
82
  single highest reject-vector (an artifact README naming real maintainers/repos is invisible to a
82
83
  paper-only read). Only run it on *double-blind* papers — a de-anonymized single-blind PDF is supposed
83
84
  to carry your name and will (correctly) fail. Canonical deny-list rationale → \`paper-pipeline/references/anonymization.md\`.
@@ -8,7 +8,7 @@
8
8
  # every artifact file (including inside artifact.zip) so "anonymized" is a checked
9
9
  # fact. Sibling to render-paper/check-render.sh. Spirit: prose isn't policy.
10
10
  #
11
- # Usage: check-deanon.sh <paper-dir> [pdf=paper.pdf] [denylist=<skill>/deanon-denylist.txt]
11
+ # Usage: check-deanon.sh <paper-dir> [pdf=paper.pdf] [denylist=<project>/.paperlint/deanon-denylist.txt]
12
12
  # It auto-scans, in <paper-dir>: the PDF text, everything under artifact/ (if present),
13
13
  # and the contents of any *.zip (artifact bundles). Pass extra paths after the
14
14
  # denylist arg to scan additional dirs/zips.
@@ -22,11 +22,26 @@ set -uo pipefail
22
22
  DIR="${1:?usage: check-deanon.sh <paper-dir> [pdf=paper.pdf] [denylist=...] [extra-paths...]}"
23
23
  PDF="${2:-paper.pdf}"
24
24
  SKILL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
25
- DENY="${3:-$SKILL_DIR/deanon-denylist.txt}"
25
+ NAMED_DENY="${3:-}"
26
26
  shift $(( $# >= 3 ? 3 : $# ))
27
27
  EXTRA=("$@")
28
28
 
29
29
  [ -d "$DIR" ] || { echo "FAIL: no dir $DIR"; exit 2; }
30
+
31
+ # The deny-list is the AUTHOR's data, so it lives in their project, never in this package: under
32
+ # the Claude Code plugin this script runs from the plugin's own folder. The project is
33
+ # $CLAUDE_PROJECT_DIR, else the git repository that holds <paper-dir>. Order: the list named as
34
+ # the third argument, then <project>/.paperlint/deanon-denylist.txt, then a list beside this
35
+ # script (the older place, when the skill was linked into .claude/skills/).
36
+ ROOT="${CLAUDE_PROJECT_DIR:-$(git -C "$DIR" rev-parse --show-toplevel 2>/dev/null || true)}"
37
+ PROJECT_DENY="${ROOT:-<project>}/.paperlint/deanon-denylist.txt"
38
+ if [ -n "$NAMED_DENY" ]; then DENY="$NAMED_DENY"
39
+ elif [ -n "$ROOT" ] && [ -f "$PROJECT_DENY" ]; then DENY="$PROJECT_DENY"
40
+ elif [ -f "$SKILL_DIR/deanon-denylist.txt" ]; then DENY="$SKILL_DIR/deanon-denylist.txt"
41
+ else
42
+ echo "FAIL: no deny-list. Write your identifiers, one extended regex per line, to $PROJECT_DENY"
43
+ exit 2
44
+ fi
30
45
  [ -f "$DENY" ] || { echo "FAIL: no deny-list $DENY"; exit 2; }
31
46
 
32
47
  # Build the active pattern (strip comments/blanks).
@@ -0,0 +1,141 @@
1
+ /**
2
+ * `check-deanon.sh`, the double-blind gate: where it finds the author's deny-list, and both halves
3
+ * of the scan. The deny-list is the author's data, so it lives in their project
4
+ * (`.paperlint/deanon-denylist.txt`), never in the package: under the Claude Code plugin the
5
+ * script runs from the plugin's own folder, where no list of the author's can be.
6
+ */
7
+ import { spawnSync } from "node:child_process";
8
+ import {
9
+ copyFileSync,
10
+ mkdirSync,
11
+ mkdtempSync,
12
+ realpathSync,
13
+ rmSync,
14
+ writeFileSync,
15
+ } from "node:fs";
16
+ import { tmpdir } from "node:os";
17
+ import { dirname, join } from "node:path";
18
+ import { fileURLToPath } from "node:url";
19
+ import { afterEach, describe, expect, it } from "vitest";
20
+
21
+ const SCRIPT = join(dirname(fileURLToPath(import.meta.url)), "check-deanon.sh");
22
+ const made: string[] = [];
23
+ afterEach(() => {
24
+ made.splice(0).forEach((d) => {
25
+ rmSync(d, { recursive: true, force: true });
26
+ });
27
+ });
28
+
29
+ /** A project with one paper whose artifact README says `readme`. */
30
+ const project = (readme: string): { root: string; paper: string } => {
31
+ const root = realpathSync(mkdtempSync(join(tmpdir(), "deanon-")));
32
+ made.push(root);
33
+ const paper = join(root, "papers", "p");
34
+ mkdirSync(join(paper, "artifact"), { recursive: true });
35
+ writeFileSync(join(paper, "artifact", "README.md"), `${readme}\n`);
36
+ return { root, paper };
37
+ };
38
+
39
+ const denyList = (path: string): string => {
40
+ mkdirSync(dirname(path), { recursive: true });
41
+ writeFileSync(path, "# my identifiers\nQuillfeather\n");
42
+ return path;
43
+ };
44
+
45
+ /** Runs the gate with no `CLAUDE_PROJECT_DIR` unless `env` sets one. */
46
+ const run = (
47
+ args: readonly string[],
48
+ {
49
+ script = SCRIPT,
50
+ env = {},
51
+ }: { script?: string; env?: Record<string, string> } = {},
52
+ ) => {
53
+ const inherited = Object.fromEntries(
54
+ Object.entries(process.env).filter(([k]) => k !== "CLAUDE_PROJECT_DIR"),
55
+ );
56
+ const r = spawnSync("bash", [script, ...args], {
57
+ encoding: "utf8",
58
+ cwd: tmpdir(),
59
+ env: { ...inherited, ...env },
60
+ });
61
+ return { status: r.status, stdout: r.stdout };
62
+ };
63
+
64
+ const leak = (paper: string): string =>
65
+ [
66
+ `== check-deanon: ${paper} (pdf=paper.pdf, 1 patterns) ==`,
67
+ ` WARN: ${paper}/paper.pdf not found — PDF not scanned`,
68
+ ` LEAK artifact/README.md:1:by Quillfeather`,
69
+ `-- summary: 1 identifier hit(s) across PDF + artifact + zip`,
70
+ `FAIL: de-anonymization leak(s) above — scrub before submitting double-blind.`,
71
+ ``,
72
+ ].join("\n");
73
+
74
+ describe("check-deanon.sh — where the deny-list comes from", () => {
75
+ it("reads the project's .paperlint/deanon-denylist.txt, the project being CLAUDE_PROJECT_DIR", () => {
76
+ const { root, paper } = project("by Quillfeather");
77
+ denyList(join(root, ".paperlint", "deanon-denylist.txt"));
78
+ expect(run([paper], { env: { CLAUDE_PROJECT_DIR: root } })).toEqual({
79
+ status: 1,
80
+ stdout: leak(paper),
81
+ });
82
+ });
83
+
84
+ it("without CLAUDE_PROJECT_DIR, the project is the git repository that holds the paper", () => {
85
+ const { root, paper } = project("by Quillfeather");
86
+ spawnSync("git", ["init", "-q", root]);
87
+ denyList(join(root, ".paperlint", "deanon-denylist.txt"));
88
+ expect(run([paper])).toEqual({ status: 1, stdout: leak(paper) });
89
+ });
90
+
91
+ it("a deny-list named as the third argument wins over the project's", () => {
92
+ const { root, paper } = project("by Quillfeather");
93
+ mkdirSync(join(root, ".paperlint"));
94
+ writeFileSync(join(root, ".paperlint", "deanon-denylist.txt"), "Nobody\n");
95
+ const named = denyList(join(root, "mine.txt"));
96
+ expect(
97
+ run([paper, "paper.pdf", named], { env: { CLAUDE_PROJECT_DIR: root } }),
98
+ ).toEqual({ status: 1, stdout: leak(paper) });
99
+ });
100
+
101
+ it("a list beside the script, the older place, is still read when the project has none", () => {
102
+ const { root, paper } = project("by Quillfeather");
103
+ const skill = join(root, ".claude", "skills", "submit-paper");
104
+ mkdirSync(skill, { recursive: true });
105
+ copyFileSync(SCRIPT, join(skill, "check-deanon.sh"));
106
+ denyList(join(skill, "deanon-denylist.txt"));
107
+ expect(
108
+ run([paper], {
109
+ script: join(skill, "check-deanon.sh"),
110
+ env: { CLAUDE_PROJECT_DIR: root },
111
+ }),
112
+ ).toEqual({ status: 1, stdout: leak(paper) });
113
+ });
114
+
115
+ it("no deny-list anywhere: exit 2, naming the file to write", () => {
116
+ const { root, paper } = project("by Quillfeather");
117
+ expect(run([paper], { env: { CLAUDE_PROJECT_DIR: root } })).toEqual({
118
+ status: 2,
119
+ stdout:
120
+ `FAIL: no deny-list. Write your identifiers, one extended regex per line, to ` +
121
+ `${root}/.paperlint/deanon-denylist.txt\n`,
122
+ });
123
+ });
124
+ });
125
+
126
+ describe("check-deanon.sh — both halves of the scan", () => {
127
+ it("a clean artifact passes", () => {
128
+ const { root, paper } = project("by Anonymous");
129
+ denyList(join(root, ".paperlint", "deanon-denylist.txt"));
130
+ expect(run([paper], { env: { CLAUDE_PROJECT_DIR: root } })).toEqual({
131
+ status: 0,
132
+ stdout: [
133
+ `== check-deanon: ${paper} (pdf=paper.pdf, 1 patterns) ==`,
134
+ ` WARN: ${paper}/paper.pdf not found — PDF not scanned`,
135
+ `-- summary: 0 identifier hit(s) across PDF + artifact + zip`,
136
+ `PASS: no author-identifying strings found. Safe for double-blind.`,
137
+ ``,
138
+ ].join("\n"),
139
+ });
140
+ });
141
+ });
@@ -4,7 +4,7 @@ description: Verify every citation is a real work with correct metadata, and tha
4
4
  allowed-tools: [Read, Write, Edit, Grep, Glob, Bash, WebSearch, WebFetch, Agent]
5
5
  ---
6
6
 
7
- <!-- vigiles:sha256:25a05cd3468a3a26 compiled from skills/verify-citations/SKILL.md.spec.ts -->
7
+ <!-- vigiles:sha256:660c7457aab73a4e compiled from skills/verify-citations/SKILL.md.spec.ts -->
8
8
 
9
9
  # verify-citations — every cite real, the delta explicit
10
10
 
@@ -109,10 +109,10 @@ paper.
109
109
 
110
110
  **How to run.**
111
111
  ```
112
- node scripts/verify-cites.mjs cites.json # JSON array of {id,doi?,arxiv?,title?,year?,cve?,commit?}
113
- node scripts/verify-cites.mjs refs.bib # best-effort .bib extraction
114
- cat cites.json | node scripts/verify-cites.mjs -
115
- node scripts/verify-cites.mjs cites.json --offline # no network (everything degrades to unresolvable)
112
+ node ${CLAUDE_SKILL_DIR}/scripts/verify-cites.js cites.json # JSON array of {id,doi?,arxiv?,title?,year?,cve?,commit?}
113
+ node ${CLAUDE_SKILL_DIR}/scripts/verify-cites.js refs.bib # best-effort .bib extraction
114
+ cat cites.json | node ${CLAUDE_SKILL_DIR}/scripts/verify-cites.js -
115
+ node ${CLAUDE_SKILL_DIR}/scripts/verify-cites.js cites.json --offline # no network (everything degrades to unresolvable)
116
116
  ```
117
117
  It prints per-cite `{id, verdict, reason, matched_db, matched_title?, flags?}` + a summary, and **exits 1 iff
118
118
  any `false` (fabrication)** — `unresolvable` alone is advisory and does NOT fail the gate, matching the
@@ -146,8 +146,8 @@ The three defects that found it: `docs/design/verify-citations-history.md` in th
146
146
 
147
147
  **How to run.**
148
148
  ```
149
- node scripts/bib-authors.mjs <paper-dir> # the databases bibtex opened in the last build; or a .bib, or a .tex
150
- node scripts/bib-authors.mjs <paper-dir> --json
149
+ node ${CLAUDE_SKILL_DIR}/scripts/bib-authors.js <paper-dir> # the databases bibtex opened in the last build; or a .bib, or a .tex
150
+ node ${CLAUDE_SKILL_DIR}/scripts/bib-authors.js <paper-dir> --json
151
151
  ```
152
152
  Exits **1** on any author-set or author-order disagreement, **0** when clean, **2** on usage/IO error. A paper
153
153
  directory or a `.tex` is read through the build's record (`_build/sources.json`): a paper that was never built,
@@ -200,8 +200,8 @@ Run both; neither replaces the other.
200
200
 
201
201
  ```
202
202
  # 1. measure: parse the bibliography bibtex opened (build the paper first), ask CrossRef/arXiv, write _build/refs.facts.json
203
- node .claude/skills/paper-pipeline/scripts/extract-ref-facts.mjs <paper-dir>
204
- node .claude/skills/paper-pipeline/scripts/extract-ref-facts.mjs <paper-dir> --offline # cached responses only
203
+ node ${CLAUDE_SKILL_DIR}/../paper-pipeline/scripts/extract-ref-facts.js <paper-dir>
204
+ node ${CLAUDE_SKILL_DIR}/../paper-pipeline/scripts/extract-ref-facts.js <paper-dir> --offline # cached responses only
205
205
 
206
206
  # 2. judge: rules over those facts — severity from the config, positions, disable-with-reason
207
207
  npx eslint --no-config-lookup --config eslint.config.mjs "<paper-dir>/_build/refs.facts.json"
@@ -124,10 +124,10 @@ paper.
124
124
 
125
125
  **How to run.**
126
126
  \`\`\`
127
- node scripts/verify-cites.mjs cites.json # JSON array of {id,doi?,arxiv?,title?,year?,cve?,commit?}
128
- node scripts/verify-cites.mjs refs.bib # best-effort .bib extraction
129
- cat cites.json | node scripts/verify-cites.mjs -
130
- node scripts/verify-cites.mjs cites.json --offline # no network (everything degrades to unresolvable)
127
+ node \${CLAUDE_SKILL_DIR}/scripts/verify-cites.js cites.json # JSON array of {id,doi?,arxiv?,title?,year?,cve?,commit?}
128
+ node \${CLAUDE_SKILL_DIR}/scripts/verify-cites.js refs.bib # best-effort .bib extraction
129
+ cat cites.json | node \${CLAUDE_SKILL_DIR}/scripts/verify-cites.js -
130
+ node \${CLAUDE_SKILL_DIR}/scripts/verify-cites.js cites.json --offline # no network (everything degrades to unresolvable)
131
131
  \`\`\`
132
132
  It prints per-cite \`{id, verdict, reason, matched_db, matched_title?, flags?}\` + a summary, and **exits 1 iff
133
133
  any \`false\` (fabrication)** — \`unresolvable\` alone is advisory and does NOT fail the gate, matching the
@@ -161,8 +161,8 @@ The three defects that found it: \`docs/design/verify-citations-history.md\` in
161
161
 
162
162
  **How to run.**
163
163
  \`\`\`
164
- node scripts/bib-authors.mjs <paper-dir> # the databases bibtex opened in the last build; or a .bib, or a .tex
165
- node scripts/bib-authors.mjs <paper-dir> --json
164
+ node \${CLAUDE_SKILL_DIR}/scripts/bib-authors.js <paper-dir> # the databases bibtex opened in the last build; or a .bib, or a .tex
165
+ node \${CLAUDE_SKILL_DIR}/scripts/bib-authors.js <paper-dir> --json
166
166
  \`\`\`
167
167
  Exits **1** on any author-set or author-order disagreement, **0** when clean, **2** on usage/IO error. A paper
168
168
  directory or a \`.tex\` is read through the build's record (\`_build/sources.json\`): a paper that was never built,
@@ -215,8 +215,8 @@ Run both; neither replaces the other.
215
215
 
216
216
  \`\`\`
217
217
  # 1. measure: parse the bibliography bibtex opened (build the paper first), ask CrossRef/arXiv, write _build/refs.facts.json
218
- node .claude/skills/paper-pipeline/scripts/extract-ref-facts.mjs <paper-dir>
219
- node .claude/skills/paper-pipeline/scripts/extract-ref-facts.mjs <paper-dir> --offline # cached responses only
218
+ node \${CLAUDE_SKILL_DIR}/../paper-pipeline/scripts/extract-ref-facts.js <paper-dir>
219
+ node \${CLAUDE_SKILL_DIR}/../paper-pipeline/scripts/extract-ref-facts.js <paper-dir> --offline # cached responses only
220
220
 
221
221
  # 2. judge: rules over those facts — severity from the config, positions, disable-with-reason
222
222
  npx eslint --no-config-lookup --config eslint.config.mjs "<paper-dir>/_build/refs.facts.json"
@@ -0,0 +1,228 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __plCreateRequire } from "node:module";
3
+ import { fileURLToPath as __plFileURLToPath } from "node:url";
4
+ import { dirname as __plDirname } from "node:path";
5
+ const require = __plCreateRequire(import.meta.url);
6
+ const __filename = __plFileURLToPath(import.meta.url);
7
+ const __dirname = __plDirname(__filename);
8
+ import {
9
+ bibReader,
10
+ bibliographyAt,
11
+ bibliographyUnreadWhy,
12
+ isMain
13
+ } from "../../../dist/skill-chunks/chunk-KWK6RT4T.js";
14
+ import {
15
+ latexReader,
16
+ sourcesCodec
17
+ } from "../../../dist/skill-chunks/chunk-65X5HVIJ.js";
18
+ import "../../../dist/skill-chunks/chunk-IREAROCV.js";
19
+ import {
20
+ absolutePath,
21
+ nodeFiles
22
+ } from "../../../dist/skill-chunks/chunk-6NU6CXUS.js";
23
+ import "../../../dist/skill-chunks/chunk-GRSXIWYF.js";
24
+ import "../../../dist/skill-chunks/chunk-NPQVDEE4.js";
25
+ import "../../../dist/skill-chunks/chunk-PJ4KNV4J.js";
26
+
27
+ // skills/verify-citations/scripts/bib-authors.mjs
28
+ import { resolve } from "node:path";
29
+ var DBLP = "https://dblp.org/search/publ/api";
30
+ var DEPS = {
31
+ files: nodeFiles,
32
+ codec: sourcesCodec,
33
+ latex: latexReader,
34
+ bib: bibReader
35
+ };
36
+ function bibliographyFrom(target) {
37
+ const r = bibliographyAt(absolutePath(resolve(target)), DEPS);
38
+ if (!r.ok) die(bibliographyUnreadWhy(r.error));
39
+ const { texts } = r.value;
40
+ return { files: [...new Set(texts.map((x) => x.path))], texts };
41
+ }
42
+ var writtenName = (n) => n.name ?? [[n.prefix, n.lastName].filter(Boolean).join(" "), n.firstName].filter(Boolean).join(", ");
43
+ function authorEntries(entries) {
44
+ return entries.map((e) => ({
45
+ type: e.type,
46
+ key: e.key,
47
+ author: (e.names.author ?? []).map(writtenName).join(" and "),
48
+ title: e.fields.title ?? "",
49
+ booktitle: e.fields.booktitle ?? "",
50
+ journal: e.fields.journal ?? ""
51
+ }));
52
+ }
53
+ var DEACCENT = (s) => s.normalize("NFD").replace(/[̀-ͯ]/g, "").replace(/[{}\\'`"^~]/g, "");
54
+ function surnames(authorField) {
55
+ if (!authorField) return [];
56
+ return DEACCENT(authorField).split(/\s+and\s+/i).map((p) => p.trim()).filter(Boolean).map((p) => {
57
+ const familyPart = p.includes(",") ? p.split(",")[0] : p;
58
+ const last = familyPart.trim().split(/\s+/).slice(-1)[0] || "";
59
+ return last.trim().toLowerCase().replace(/[.\s-]+$/, "");
60
+ }).filter((s) => s && s !== "others");
61
+ }
62
+ var truncated = (authorField) => /\band\s+others\b/i.test(authorField);
63
+ function claimsPublished(e) {
64
+ const venue = `${e.booktitle} ${e.journal}`.trim();
65
+ if (!venue) return false;
66
+ return !/^\s*arxiv\b|arxiv preprint|\bcorr\b/i.test(venue);
67
+ }
68
+ async function dblpHits(title) {
69
+ const url = `${DBLP}/?q=${encodeURIComponent(title)}&format=json&h=6`;
70
+ const res = await fetch(url, {
71
+ headers: { "User-Agent": "bib-authors/1.0 (paper QA)" },
72
+ signal: AbortSignal.timeout(15e3)
73
+ });
74
+ if (res.status === 429)
75
+ throw Object.assign(new Error("DBLP 429"), { retryable: true });
76
+ if (!res.ok) throw new Error(`DBLP ${res.status}`);
77
+ const hits = (await res.json())?.result?.hits?.hit ?? [];
78
+ return hits.map((h) => {
79
+ const a = h.info?.authors?.author;
80
+ const list = a ? Array.isArray(a) ? a : [a] : [];
81
+ return {
82
+ venue: h.info?.venue ?? "",
83
+ year: h.info?.year ?? "",
84
+ type: h.info?.type ?? "",
85
+ title: h.info?.title ?? "",
86
+ // DBLP disambiguates people as "Mostafa Dehghani 0001" — the digits are not a name.
87
+ authors: list.map((p) => String(p.text).replace(/\s+\d{4}$/, ""))
88
+ };
89
+ });
90
+ }
91
+ var isPreprintRecord = (h) => /^corr$/i.test(h.venue) || /informal/i.test(h.type);
92
+ var looseTitle = (s) => DEACCENT(s).toLowerCase().replace(/[^a-z0-9]+/g, "");
93
+ function compare(ourSurnames, theirSurnames) {
94
+ const missing = theirSurnames.filter((x) => !ourSurnames.includes(x));
95
+ const extra = ourSurnames.filter((x) => !theirSurnames.includes(x));
96
+ const orderDiffers = missing.length === 0 && extra.length === 0 && ourSurnames.join("|") !== theirSurnames.join("|");
97
+ return { missing, extra, orderDiffers };
98
+ }
99
+ async function checkAuthors(parsed, {
100
+ lookup = dblpHits,
101
+ pause = (ms) => new Promise((r) => {
102
+ setTimeout(r, ms);
103
+ })
104
+ } = {}) {
105
+ const findings = [];
106
+ const skipped = [];
107
+ const unchecked = [];
108
+ const matched = [];
109
+ const entries = parsed.filter((e) => e.title && e.author);
110
+ for (const e of entries) {
111
+ if (!claimsPublished(e)) continue;
112
+ if (truncated(e.author)) {
113
+ skipped.push({
114
+ key: e.key,
115
+ why: "author list ends in `and others` \u2014 completeness not checkable"
116
+ });
117
+ continue;
118
+ }
119
+ let hits = null;
120
+ for (let attempt = 0; attempt < 3 && hits === null; attempt++) {
121
+ try {
122
+ hits = await lookup(e.title.replace(/[{}]/g, ""));
123
+ } catch (err) {
124
+ const last = attempt === 2;
125
+ if (last)
126
+ unchecked.push({
127
+ key: e.key,
128
+ why: `DBLP lookup failed: ${err.message}`
129
+ });
130
+ else await pause(1500 * (attempt + 1));
131
+ }
132
+ }
133
+ if (hits === null) continue;
134
+ const want = looseTitle(e.title);
135
+ const same = hits.filter((h) => looseTitle(h.title) === want);
136
+ const rec = same.find((h) => !isPreprintRecord(h));
137
+ if (!rec) {
138
+ skipped.push({
139
+ key: e.key,
140
+ why: same.length ? "only a preprint record on DBLP" : "no DBLP title match"
141
+ });
142
+ continue;
143
+ }
144
+ const ours = surnames(e.author);
145
+ const theirs = surnames(rec.authors.join(" and "));
146
+ const d = compare(ours, theirs);
147
+ if (!(d.missing.length || d.extra.length || d.orderDiffers))
148
+ matched.push(e.key);
149
+ else {
150
+ findings.push({
151
+ key: e.key,
152
+ venue: `${rec.venue} ${rec.year}`.trim(),
153
+ ours,
154
+ theirs,
155
+ ...d
156
+ });
157
+ }
158
+ await pause(900);
159
+ }
160
+ return { findings, skipped, unchecked, matched };
161
+ }
162
+ function die(msg) {
163
+ console.error(`bib-authors: ${msg}`);
164
+ process.exit(2);
165
+ }
166
+ async function main() {
167
+ const args = process.argv.slice(2).filter((a) => a !== "--json");
168
+ const asJson = process.argv.includes("--json");
169
+ if (!args[0])
170
+ die("usage: bib-authors.mjs <paper-dir|file.bib|file.tex> [--json]");
171
+ const { files, texts } = bibliographyFrom(args[0]);
172
+ const file = files.join(", ");
173
+ const parsed = texts.flatMap((t) => authorEntries(t.entries));
174
+ const entries = parsed.filter((e) => e.title && e.author);
175
+ const { findings, skipped, unchecked } = await checkAuthors(parsed);
176
+ if (asJson) {
177
+ console.log(
178
+ JSON.stringify(
179
+ {
180
+ file: files[0],
181
+ files,
182
+ entries: entries.length,
183
+ findings,
184
+ skipped,
185
+ unchecked
186
+ },
187
+ null,
188
+ 2
189
+ )
190
+ );
191
+ } else {
192
+ console.log(`== bib-authors: ${file} ==`);
193
+ for (const f of findings) {
194
+ console.log(`
195
+ \u{1F534} ${f.key} (DBLP: ${f.venue})`);
196
+ if (f.missing.length)
197
+ console.log(` MISSING from ours : ${f.missing.join(", ")}`);
198
+ if (f.extra.length)
199
+ console.log(` EXTRA in ours : ${f.extra.join(", ")}`);
200
+ if (f.orderDiffers) {
201
+ console.log(` ORDER differs`);
202
+ console.log(` ours : ${f.ours.join(" > ")}`);
203
+ console.log(` DBLP : ${f.theirs.join(" > ")}`);
204
+ }
205
+ }
206
+ for (const s of skipped) console.log(` \xB7 n/a ${s.key} \u2014 ${s.why}`);
207
+ for (const u of unchecked)
208
+ console.log(` \u26A0\uFE0F NOT CHECKED ${u.key} \u2014 ${u.why}`);
209
+ console.log(
210
+ `
211
+ -- ${entries.length} entries \xB7 ${findings.length} difference(s) \xB7 ${skipped.length} not applicable \xB7 ${unchecked.length} NOT CHECKED`
212
+ );
213
+ console.log(
214
+ findings.length ? "FAIL: our author list disagrees with the version we claim to cite." : unchecked.length ? `PARTIAL: no disagreement among the entries reached, but ${unchecked.length} could not be checked \u2014 this is NOT a pass.` : "PASS: no author-list disagreement."
215
+ );
216
+ }
217
+ process.exit(findings.length ? 1 : unchecked.length ? 2 : 0);
218
+ }
219
+ if (isMain(import.meta.url)) await main();
220
+ export {
221
+ authorEntries,
222
+ checkAuthors,
223
+ claimsPublished,
224
+ compare,
225
+ dblpHits,
226
+ surnames,
227
+ truncated
228
+ };