paperlint 19.0.1 → 19.0.3

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 (93) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CLAUDE.md +2 -2
  3. package/dist/CLAUDE.md.spec.d.ts.map +1 -1
  4. package/dist/CLAUDE.md.spec.js +7 -1
  5. package/dist/CLAUDE.md.spec.js.map +1 -1
  6. package/dist/cli.d.ts +2 -21
  7. package/dist/cli.d.ts.map +1 -1
  8. package/dist/cli.js +46 -98
  9. package/dist/cli.js.map +1 -1
  10. package/dist/doctor.d.ts +8 -10
  11. package/dist/doctor.d.ts.map +1 -1
  12. package/dist/doctor.js +27 -37
  13. package/dist/doctor.js.map +1 -1
  14. package/dist/folder-layout-hook.js +1 -1
  15. package/dist/hooks-notice.d.ts +9 -1
  16. package/dist/hooks-notice.d.ts.map +1 -1
  17. package/dist/hooks-notice.js +16 -18
  18. package/dist/hooks-notice.js.map +1 -1
  19. package/dist/hooks-settings.d.ts +1 -1
  20. package/dist/hooks-settings.js +1 -1
  21. package/dist/init.d.ts +1 -1
  22. package/dist/init.js +5 -5
  23. package/dist/lib/paper-config.d.ts +4 -9
  24. package/dist/lib/paper-config.d.ts.map +1 -1
  25. package/dist/lib/paper-config.js +4 -9
  26. package/dist/lib/paper-config.js.map +1 -1
  27. package/dist/papers-roots.d.ts +19 -0
  28. package/dist/papers-roots.d.ts.map +1 -0
  29. package/dist/papers-roots.js +42 -0
  30. package/dist/papers-roots.js.map +1 -0
  31. package/dist/retired-hooks.d.ts +6 -0
  32. package/dist/retired-hooks.d.ts.map +1 -0
  33. package/dist/retired-hooks.js +34 -0
  34. package/dist/retired-hooks.js.map +1 -0
  35. package/dist/skill-chunks/chunk-C2G5EK7S.js +579 -0
  36. package/dist/skill-chunks/{chunk-UL4INX2P.js → chunk-L3NJUJUP.js} +446 -446
  37. package/dist/skill-chunks/{chunk-EOVEVX67.js → chunk-X4VKG4KT.js} +1 -1
  38. package/dist/types.d.ts +1 -1
  39. package/docs/install.md +12 -14
  40. package/docs/layout.md +2 -5
  41. package/docs/rules/paper/allowed-files-only.md +1 -2
  42. package/docs/testing.md +1 -1
  43. package/eslint.config.mjs +1 -1
  44. package/lib/paper-config.harness.mjs +4 -8
  45. package/lib/paper-config.ts +4 -9
  46. package/package.json +2 -3
  47. package/plugin/hooks/hooks.json +0 -22
  48. package/scripts/coverage-config.test.ts +0 -1
  49. package/scripts/eslint-file-length.mjs +0 -1
  50. package/skills/argument-arc/scripts/headings.js +2 -2
  51. package/skills/build-label-page/scripts/label-page.js +125 -125
  52. package/skills/cold-read-diff/scripts/cold-read.js +11 -11
  53. package/skills/paper-pipeline/scripts/extract-ref-facts.js +3 -3
  54. package/skills/paper-status/SKILL.md +1 -2
  55. package/skills/paper-status/SKILL.md.spec.ts +0 -1
  56. package/skills/pc-panel-review/scripts/prior-reviews.js +1 -1
  57. package/skills/verify-citations/scripts/bib-authors.js +3 -3
  58. package/skills/verify-citations/scripts/verify-cites.js +3 -3
  59. package/src/CLAUDE.md +16 -1
  60. package/src/CLAUDE.md.spec.ts +12 -1
  61. package/src/cli.harness.mjs +16 -80
  62. package/src/cli.test.ts +6 -36
  63. package/src/cli.ts +49 -145
  64. package/src/doctor.harness.mjs +17 -59
  65. package/src/doctor.test.ts +1 -1
  66. package/src/doctor.ts +26 -41
  67. package/src/domain/paper-folder.test.ts +1 -1
  68. package/src/folder-layout-hook.ts +1 -1
  69. package/src/hooks-notice.test.ts +21 -74
  70. package/src/hooks-notice.ts +37 -18
  71. package/src/hooks-settings.harness.ts +27 -29
  72. package/src/hooks-settings.ts +1 -1
  73. package/src/in-process-hooks.test.ts +18 -0
  74. package/src/init.ts +5 -5
  75. package/src/lint-edited-site-example.test.ts +0 -3
  76. package/src/papers-roots.test.ts +56 -0
  77. package/src/papers-roots.ts +56 -0
  78. package/src/retired-hooks.test.ts +155 -0
  79. package/src/retired-hooks.ts +41 -0
  80. package/src/types.ts +1 -1
  81. package/dist/skill-chunks/chunk-GRSXIWYF.js +0 -352
  82. package/hooks/CLAUDE.md +0 -34
  83. package/hooks/CLAUDE.md.spec.ts +0 -30
  84. package/hooks/hooks.harness.ts +0 -704
  85. package/hooks/paper-edit-guard.hook.d.mts +0 -12
  86. package/hooks/paper-edit-guard.hook.mjs +0 -443
  87. package/hooks/paper-edit-guard.test.ts +0 -66
  88. package/hooks/paper-skills-nudge.hook.d.mts +0 -22
  89. package/hooks/paper-skills-nudge.hook.mjs +0 -199
  90. package/hooks/paper-skills-nudge.test.ts +0 -122
  91. package/hooks/paper-status-gates.hook.mjs +0 -158
  92. package/hooks/paper-status-gates.sh +0 -93
  93. package/hooks/paper-status-gates.test.ts +0 -101
@@ -0,0 +1,155 @@
1
+ /**
2
+ * A hook an earlier paperlint shipped and this one removed, still wired by an old `init`: both halves.
3
+ * It runs nothing and says nothing on each call, while an unknown name still fails; the once-per-version
4
+ * notice and `paperlint doctor` name it with the remedy; a project without one hears neither.
5
+ */
6
+ import assert from "node:assert/strict";
7
+ import { readFileSync } from "node:fs";
8
+ import { join } from "node:path";
9
+ import { test } from "vitest";
10
+ import { z } from "zod";
11
+ import { useTempDir, writeTree } from "../test/support.ts";
12
+ import { runHook } from "./cli.ts";
13
+ import { doctor } from "./doctor.ts";
14
+ import { WIRING_FILE } from "./hooks-settings.ts";
15
+ import type { ClaudeCode } from "./ports/claude-code.ts";
16
+ import { RETIRED_HOOKS, retiredWired } from "./retired-hooks.ts";
17
+
18
+ const root = useTempDir("retired-hooks-");
19
+
20
+ const Command = z.looseObject({ command: z.string() });
21
+ const Wiring = z.object({
22
+ hooks: z.record(
23
+ z.string(),
24
+ z.array(z.looseObject({ hooks: z.array(Command) })),
25
+ ),
26
+ });
27
+ const shipped = Wiring.parse(JSON.parse(readFileSync(WIRING_FILE, "utf8")));
28
+
29
+ /** The shipped wiring, plus one entry for `retired` in the spelling `init` wrote, when given. */
30
+ const settings = (retired?: string): string => {
31
+ const command = shipped.hooks["PostToolUse"]?.[0]?.hooks[0]?.command ?? "";
32
+ const stale = command.replace(/hook \S+$/, `hook ${retired ?? ""}`);
33
+ const pre = shipped.hooks["PreToolUse"] ?? [];
34
+ return JSON.stringify({
35
+ hooks: {
36
+ ...shipped.hooks,
37
+ PreToolUse:
38
+ retired === undefined
39
+ ? pre
40
+ : [
41
+ ...pre,
42
+ { matcher: "Bash", hooks: [{ type: "command", command: stale }] },
43
+ ],
44
+ },
45
+ });
46
+ };
47
+
48
+ const project = (name: string, retired?: string): string => {
49
+ const dir = join(root, name);
50
+ writeTree(dir, {
51
+ "package.json": "{}\n",
52
+ "papers/p/PIPELINE-STATUS.md": "# status\n",
53
+ "papers/p/paper.tex":
54
+ "\\documentclass{article}\n\\begin{document}\nFine.\n\\end{document}\n",
55
+ ".claude/settings.json": settings(retired),
56
+ });
57
+ return dir;
58
+ };
59
+
60
+ const PLUGIN_OFF: ClaudeCode = {
61
+ present: () => true,
62
+ plugin: () => ({ enabled: false, version: null }),
63
+ enable: () => ({ ok: false, reason: "not in this test" }),
64
+ };
65
+
66
+ /** `paperlint hook <name>` in-process on an Edit of the paper's file. */
67
+ async function hook(name: string, dir: string) {
68
+ const out: string[] = [];
69
+ const err: string[] = [];
70
+ const code = await runHook(name, {
71
+ stdin: () =>
72
+ JSON.stringify({
73
+ tool_name: "Edit",
74
+ tool_input: {
75
+ file_path: join(dir, "papers/p/paper.tex"),
76
+ new_string: "Fine.",
77
+ },
78
+ }),
79
+ out: (t) => void out.push(t),
80
+ err: (m: string) => void err.push(m),
81
+ projectDir: dir,
82
+ claude: PLUGIN_OFF,
83
+ version: "9.9.9",
84
+ });
85
+ return { code, out: out.join(""), err };
86
+ }
87
+
88
+ /** `paperlint doctor` on `dir`: its exit code, and whether it named `name`. */
89
+ const checked = (dir: string, name: string) => {
90
+ const lines: string[] = [];
91
+ const code = doctor({
92
+ log: (l: string) => void lines.push(l),
93
+ cwd: dir,
94
+ run: () => ({ status: 0 }),
95
+ });
96
+ return { code, named: lines.join("\n").includes(name) };
97
+ };
98
+
99
+ test("a retired hook still wired runs nothing and says nothing; an unknown name still fails", async () => {
100
+ const dir = project("run");
101
+ const quiet = { code: 0, out: "", err: [] };
102
+ assert.ok(RETIRED_HOOKS.length > 0);
103
+ assert.deepEqual(
104
+ await Promise.all(RETIRED_HOOKS.map((name) => hook(name, dir))),
105
+ RETIRED_HOOKS.map(() => quiet),
106
+ );
107
+ const unknown = await hook("no-such-hook", dir);
108
+ assert.equal(unknown.code, 1);
109
+ assert.match(unknown.err.join("\n"), /unknown hook `no-such-hook`/);
110
+ });
111
+
112
+ test("a retired hook left in the settings: the notice names it with the init remedy and doctor fails on it; without one, both stay quiet", async () => {
113
+ const retired = RETIRED_HOOKS[0] ?? "";
114
+ const stale = project("stale", retired);
115
+ const said = await hook("lint-edited", stale);
116
+ assert.ok(said.out.includes(retired), said.out);
117
+ assert.match(said.out, /npx paperlint init/);
118
+ assert.deepEqual(checked(stale, retired), { code: 2, named: true });
119
+
120
+ const clean = project("clean");
121
+ assert.deepEqual(
122
+ [await hook("lint-edited", clean), checked(clean, retired)],
123
+ [
124
+ { code: 0, out: "", err: [] },
125
+ { code: 0, named: false },
126
+ ],
127
+ );
128
+ });
129
+
130
+ test("retiredWired reads only paperlint's own runs: another command is not one, a file that does not parse names none", () => {
131
+ const retired = RETIRED_HOOKS[0] ?? "";
132
+ const at = (name: string, text: string): string => {
133
+ const dir = join(root, name);
134
+ writeTree(dir, { ".claude/settings.json": text });
135
+ return dir;
136
+ };
137
+ const other = JSON.stringify({
138
+ hooks: {
139
+ PreToolUse: [
140
+ {
141
+ matcher: "Bash",
142
+ hooks: [{ type: "command", command: `echo hook ${retired}` }],
143
+ },
144
+ ],
145
+ },
146
+ });
147
+ assert.deepEqual(
148
+ [
149
+ retiredWired(project("listed", retired)),
150
+ retiredWired(at("other", other)),
151
+ retiredWired(at("broken", "{")),
152
+ ],
153
+ [[retired], [], []],
154
+ );
155
+ });
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Hooks an earlier paperlint shipped and this one does not. `paperlint init` writes the hook entries
3
+ * into `.claude/settings.json` once, and an upgrade does not run it again, so a project keeps calling
4
+ * a removed hook on every tool call. Running `init` again rewrites every entry it wrote, which drops
5
+ * them (measured on 2026-11-23); until then `paperlint hook <name>` runs nothing for these names and
6
+ * exits 0, and `paperlint doctor` and the once-per-version notice name them.
7
+ *
8
+ * A name is added here in the release that removes the hook, and is never taken out.
9
+ */
10
+ import {
11
+ SETTINGS_PATH,
12
+ commandsIn,
13
+ hookRun,
14
+ readSettings,
15
+ } from "./hooks-settings.ts";
16
+
17
+ export const RETIRED_HOOKS: readonly string[] = [
18
+ "paper-status-gates",
19
+ "paper-edit-guard",
20
+ "paper-skills-nudge",
21
+ ];
22
+
23
+ /** The retired hooks the project's settings still run, in any spelling, each once; none when the file does not parse. */
24
+ export function retiredWired(root: string): readonly string[] {
25
+ const read = readSettings(root);
26
+ if (read.status === "unparsable") return [];
27
+ const names = commandsIn(read.settings).flatMap(({ command }) => {
28
+ const run = hookRun(command);
29
+ return run !== null && RETIRED_HOOKS.includes(run.name) ? [run.name] : [];
30
+ });
31
+ return [...new Set(names)];
32
+ }
33
+
34
+ /** What `paperlint doctor` prints under its hooks section for them; nothing when none is wired. */
35
+ export const retiredLines = (retired: readonly string[]): readonly string[] =>
36
+ retired.length === 0
37
+ ? []
38
+ : [
39
+ ` ⚠ retired — still wired, but this paperlint no longer ships: ${retired.join(", ")}`,
40
+ ` they run nothing now; \`npx paperlint init\` removes the entries it wrote, delete any others from ${SETTINGS_PATH}`,
41
+ ];
package/src/types.ts CHANGED
@@ -12,7 +12,7 @@ import type { RuleBlock } from "./rules-config.ts";
12
12
  */
13
13
  export interface PaperlintConfig {
14
14
  /** The paper director(ies), relative to the project root. Default `papers`. The field name is
15
- * `PAPERS_DIR_FIELD` in lib/paper-config.mjs; code reads it through `papersDirOf()` in cli.ts.
15
+ * `PAPERS_DIR_FIELD` in lib/paper-config.mjs; code reads it through `papersRoots()` in src/papers-roots.ts.
16
16
  * As written in the file: `toPaths` turns a string or a list of strings into directories, and
17
17
  * reads anything else as none. */
18
18
  papersDir?: unknown;
@@ -1,352 +0,0 @@
1
- import { createRequire as __plCreateRequire } from "node:module";
2
- import { fileURLToPath as __plFileURLToPath } from "node:url";
3
- import { dirname as __plDirname } from "node:path";
4
- const require = __plCreateRequire(import.meta.url);
5
- const __filename = __plFileURLToPath(import.meta.url);
6
- const __dirname = __plDirname(__filename);
7
-
8
- // node_modules/remeda/dist/lazyDataLastImpl--3B10z3s.js
9
- function e(e7, t23, n22) {
10
- let r7 = (n23) => e7(n23, ...t23);
11
- return n22 === void 0 ? r7 : Object.assign(r7, { lazy: n22, lazyArgs: t23 });
12
- }
13
-
14
- // node_modules/remeda/dist/purry.js
15
- function t(t23, n22, r7) {
16
- let i4 = t23.length - n22.length;
17
- if (i4 === 0) return t23(...n22);
18
- if (i4 === 1) return e(t23, n22, r7);
19
- throw Error(`Wrong number of arguments`);
20
- }
21
-
22
- // node_modules/remeda/dist/chunk.js
23
- function t2(...t23) {
24
- return t(n, t23);
25
- }
26
- function n(e7, t23) {
27
- if (t23 < 1) throw RangeError(`chunk: A chunk size of '${t23.toString()}' would result in an infinite array`);
28
- if (e7.length === 0) return [];
29
- if (t23 >= e7.length) return [[...e7]];
30
- let n22 = Math.ceil(e7.length / t23), r7 = Array(n22);
31
- if (t23 === 1) for (let [t24, n23] of e7.entries()) r7[t24] = [n23];
32
- else for (let i4 = 0; i4 < n22; i4 += 1) {
33
- let n23 = i4 * t23;
34
- r7[i4] = e7.slice(n23, n23 + t23);
35
- }
36
- return r7;
37
- }
38
-
39
- // node_modules/remeda/dist/last.js
40
- function t3(...t23) {
41
- return t(n2, t23);
42
- }
43
- var n2 = (e7) => e7.at(-1);
44
-
45
- // node_modules/remeda/dist/countBy.js
46
- function t4(...t23) {
47
- return t(n3, t23);
48
- }
49
- var n3 = (e7, t23) => {
50
- let n22 = /* @__PURE__ */ new Map();
51
- for (let [r7, i4] of e7.entries()) {
52
- let a3 = t23(i4, r7, e7);
53
- if (a3 !== void 0) {
54
- let e8 = n22.get(a3);
55
- e8 === void 0 ? n22.set(a3, 1) : n22.set(a3, e8 + 1);
56
- }
57
- }
58
- return Object.fromEntries(n22);
59
- };
60
-
61
- // node_modules/remeda/dist/utilityEvaluators-IxVD3t2o.js
62
- var e2 = { done: true, hasNext: false };
63
- var t5 = { done: false, hasNext: false };
64
- var n4 = () => e2;
65
-
66
- // node_modules/remeda/dist/pipe.js
67
- function t6(e7, ...t23) {
68
- let i4 = e7, o = t23.map((e8) => `lazy` in e8 ? { lazyEvaluator: e8.lazy(...e8.lazyArgs), isSingle: e8.lazy.single ?? false, index: 0, items: [] } : void 0), s = 0;
69
- for (; s < t23.length; ) {
70
- if (o[s] === void 0 || !a(i4)) {
71
- let e9 = t23[s];
72
- i4 = e9(i4), s += 1;
73
- continue;
74
- }
75
- let e8 = n5(o, s), c = r(i4, e8), { isSingle: l } = e8.at(-1);
76
- i4 = l ? c[0] : c, s += e8.length;
77
- }
78
- return i4;
79
- }
80
- function n5(e7, t23) {
81
- let n22 = [];
82
- for (let r7 = t23; r7 < e7.length; r7++) {
83
- let t24 = e7[r7];
84
- if (t24 === void 0 || (n22.push(t24), t24.isSingle)) break;
85
- }
86
- return n22;
87
- }
88
- function r(e7, t23) {
89
- let n22 = [];
90
- for (let r7 of e7) if (i(r7, n22, t23)) break;
91
- return n22;
92
- }
93
- function i(t23, n22, r7) {
94
- if (r7.length === 0) return n22.push(t23), false;
95
- let a3 = t23, o = t5, s = false;
96
- for (let [e7, { items: t24, lazyEvaluator: c }] of r7.entries()) if (t24.push(a3), o = c(a3, t24.length - 1, t24), o.done && (s = true), o.hasNext) {
97
- if (o.hasMany ?? false) {
98
- for (let t25 of o.next) if (i(t25, n22, r7.slice(e7 + 1))) return true;
99
- return s;
100
- }
101
- a3 = o.next;
102
- } else break;
103
- return o.hasNext && n22.push(a3), s;
104
- }
105
- function a(e7) {
106
- return typeof e7 == `string` || typeof e7 == `object` && !!e7 && Symbol.iterator in e7;
107
- }
108
-
109
- // node_modules/remeda/dist/purryFromLazy-BoPMn2L_.js
110
- function t7(t23, n22) {
111
- let r7 = n22.length - t23.length;
112
- if (r7 === 1) {
113
- let [r8, ...i4] = n22;
114
- return t6(r8, { lazy: t23, lazyArgs: i4 });
115
- }
116
- if (r7 === 0) {
117
- let r8 = { lazy: t23, lazyArgs: n22 };
118
- return Object.assign((t24) => t6(t24, r8), r8);
119
- }
120
- throw Error(`Wrong number of arguments`);
121
- }
122
-
123
- // node_modules/remeda/dist/hasAtLeast.js
124
- function t8(...t23) {
125
- return t(n6, t23);
126
- }
127
- var n6 = (e7, t23) => e7.length >= t23;
128
-
129
- // node_modules/remeda/dist/purryOrderRules-ufWoj2V5.js
130
- var e3 = { asc: (e7, t23) => e7 > t23, desc: (e7, t23) => e7 < t23 };
131
- function t9(e7, t23) {
132
- let [n22, ...a3] = t23;
133
- if (!i2(n22)) return e7(n22, r2(...a3));
134
- let o = r2(n22, ...a3);
135
- return (t24) => e7(t24, o);
136
- }
137
- function r2(t23, n22, ...i4) {
138
- let a3 = typeof t23 == `function` ? t23 : t23[0], o = typeof t23 == `function` ? `asc` : t23[1], s = e3[o], c = n22 === void 0 ? void 0 : r2(n22, ...i4);
139
- return (e7, t24) => {
140
- let n23 = a3(e7), r7 = a3(t24);
141
- return s(n23, r7) ? 1 : s(r7, n23) ? -1 : c?.(e7, t24) ?? 0;
142
- };
143
- }
144
- function i2(t23) {
145
- if (a2(t23)) return true;
146
- if (typeof t23 != `object` || !Array.isArray(t23)) return false;
147
- let [n22, r7, ...i4] = t23;
148
- return a2(n22) && typeof r7 == `string` && Object.hasOwn(e3, r7) && i4.length === 0;
149
- }
150
- var a2 = (e7) => typeof e7 == `function` && e7.length === 1;
151
-
152
- // node_modules/remeda/dist/entries.js
153
- function t10(...t23) {
154
- return t(Object.entries, t23);
155
- }
156
-
157
- // node_modules/remeda/dist/flatMap.js
158
- function t11(...t23) {
159
- return t(n7, t23, r3);
160
- }
161
- var n7 = (e7, t23) => e7.flatMap(t23);
162
- var r3 = (e7) => (t23, n22, r7) => {
163
- let i4 = e7(t23, n22, r7);
164
- return Array.isArray(i4) ? { done: false, hasNext: true, hasMany: true, next: i4 } : { done: false, hasNext: true, next: i4 };
165
- };
166
-
167
- // node_modules/remeda/dist/forEachObj.js
168
- function t12(...t23) {
169
- return t(n8, t23);
170
- }
171
- function n8(e7, t23) {
172
- for (let [n22, r7] of Object.entries(e7)) t23(r7, n22, e7);
173
- return e7;
174
- }
175
-
176
- // node_modules/remeda/dist/fromKeys.js
177
- function t13(...t23) {
178
- return t(n9, t23);
179
- }
180
- function n9(e7, t23) {
181
- let n22 = {};
182
- for (let [r7, i4] of e7.entries()) n22[i4] = t23(i4, r7, e7);
183
- return n22;
184
- }
185
-
186
- // node_modules/remeda/dist/indexBy.js
187
- function t14(...t23) {
188
- return t(n10, t23);
189
- }
190
- function n10(e7, t23) {
191
- let n22 = {};
192
- for (let [r7, i4] of e7.entries()) {
193
- let a3 = t23(i4, r7, e7);
194
- n22[a3] = i4;
195
- }
196
- return n22;
197
- }
198
-
199
- // node_modules/remeda/dist/isDefined.js
200
- function e4(e7) {
201
- return e7 !== void 0;
202
- }
203
-
204
- // node_modules/remeda/dist/isIncludedIn.js
205
- function e5(e7, t23) {
206
- if (t23 === void 0) {
207
- let t24 = new Set(e7);
208
- return (e8) => t24.has(e8);
209
- }
210
- return t23.includes(e7);
211
- }
212
-
213
- // node_modules/remeda/dist/mapKeys.js
214
- function t15(...t23) {
215
- return t(n11, t23);
216
- }
217
- function n11(e7, t23) {
218
- let n22 = {};
219
- for (let [r7, i4] of Object.entries(e7)) {
220
- let a3 = t23(r7, i4, e7);
221
- n22[a3] = i4;
222
- }
223
- return n22;
224
- }
225
-
226
- // node_modules/remeda/dist/mapValues.js
227
- function t16(...t23) {
228
- return t(n12, t23);
229
- }
230
- function n12(e7, t23) {
231
- let n22 = {};
232
- for (let [r7, i4] of Object.entries(e7)) n22[r7] = t23(i4, r7, e7);
233
- return n22;
234
- }
235
-
236
- // node_modules/remeda/dist/mapWithFeedback.js
237
- function t17(...t23) {
238
- return t7(n13, t23);
239
- }
240
- var n13 = (e7, t23) => {
241
- let n22 = t23;
242
- return (t24, r7, i4) => (n22 = e7(n22, t24, r7, i4), { done: false, hasNext: true, next: n22 });
243
- };
244
-
245
- // node_modules/remeda/dist/omit.js
246
- function n14(...t23) {
247
- return t(r4, t23);
248
- }
249
- function r4(e7, n22) {
250
- if (!t8(n22, 1)) return { ...e7 };
251
- if (!t8(n22, 2)) {
252
- let { [n22[0]]: t23, ...r8 } = e7;
253
- return r8;
254
- }
255
- let r7 = { ...e7 };
256
- for (let e8 of n22) delete r7[e8];
257
- return r7;
258
- }
259
-
260
- // node_modules/remeda/dist/once.js
261
- function e6(e7) {
262
- let t23 = false, n22;
263
- return () => (t23 ||= (n22 = e7(), true), n22);
264
- }
265
-
266
- // node_modules/remeda/dist/only.js
267
- function t18(...t23) {
268
- return t(n15, t23);
269
- }
270
- var n15 = (e7) => e7.length === 1 ? e7[0] : void 0;
271
-
272
- // node_modules/remeda/dist/pick.js
273
- function t19(...t23) {
274
- return t(n16, t23);
275
- }
276
- function n16(e7, t23) {
277
- let n22 = {};
278
- for (let r7 of t23) r7 in e7 && (n22[r7] = e7[r7]);
279
- return n22;
280
- }
281
-
282
- // node_modules/remeda/dist/pickBy.js
283
- function t20(...t23) {
284
- return t(n17, t23);
285
- }
286
- function n17(e7, t23) {
287
- let n22 = {};
288
- for (let [r7, i4] of Object.entries(e7)) t23(i4, r7, e7) && (n22[r7] = i4);
289
- return n22;
290
- }
291
-
292
- // node_modules/remeda/dist/pullObject.js
293
- function t21(...t23) {
294
- return t(n18, t23);
295
- }
296
- function n18(e7, t23, n22) {
297
- let r7 = {};
298
- for (let [i4, a3] of e7.entries()) {
299
- let o = t23(a3, i4, e7);
300
- r7[o] = n22(a3, i4, e7);
301
- }
302
- return r7;
303
- }
304
-
305
- // node_modules/remeda/dist/sortBy.js
306
- function t22(...t23) {
307
- return t9(n19, t23);
308
- }
309
- var n19 = (e7, t23) => [...e7].sort(t23);
310
-
311
- // node_modules/remeda/dist/unique.js
312
- function n20(...e7) {
313
- return t7(r5, e7);
314
- }
315
- function r5() {
316
- let t23 = /* @__PURE__ */ new Set();
317
- return (n22) => t23.has(n22) ? t5 : (t23.add(n22), { done: false, hasNext: true, next: n22 });
318
- }
319
-
320
- // node_modules/remeda/dist/zip.js
321
- function n21(...t23) {
322
- return t(r6, t23, i3);
323
- }
324
- var r6 = (e7, t23) => e7.length < t23.length ? e7.map((e8, n22) => [e8, t23[n22]]) : t23.map((t24, n22) => [e7[n22], t24]);
325
- var i3 = (e7) => e7.length === 0 ? n4 : (t23, n22) => ({ hasNext: true, next: [t23, e7[n22]], done: n22 >= e7.length - 1 });
326
-
327
- export {
328
- t2 as t,
329
- t4 as t2,
330
- t6 as t3,
331
- t8 as t4,
332
- t10 as t5,
333
- t11 as t6,
334
- t12 as t7,
335
- t13 as t8,
336
- t14 as t9,
337
- e4 as e,
338
- e5 as e2,
339
- t3 as t10,
340
- t15 as t11,
341
- t16 as t12,
342
- t17 as t13,
343
- n14 as n,
344
- e6 as e3,
345
- t18 as t14,
346
- t19 as t15,
347
- t20 as t16,
348
- t21 as t17,
349
- t22 as t18,
350
- n20 as n2,
351
- n21 as n3
352
- };
package/hooks/CLAUDE.md DELETED
@@ -1,34 +0,0 @@
1
- <!-- vigiles:sha256:9ad080d516729f5e compiled from hooks/CLAUDE.md.spec.ts -->
2
-
3
- # CLAUDE.md
4
-
5
- ## `hooks/`
6
-
7
- The hooks this package ships into a consumer's Claude Code session. Loaded when working under
8
- `hooks/`. Every shipped hook is run in both halves, firing and silent, by `hooks/hooks.harness.ts`.
9
-
10
- A bug here does not break this repository; it breaks somebody else's whole session. The Bash gate
11
- fails closed, so a hook that cannot read its config denies every command, including the one that
12
- would undo it.
13
-
14
- ## Rules
15
-
16
- ### Ship Hook Mjs Never Hook Ts
17
-
18
- **Guidance only** — A `.ts` hook inside `node_modules` fails to load and blocks every Bash command. Rejected, so not proposed again: a `.hook.ts` twin compiled to the `.mjs` (a twin drifts from its build, and nothing would notice), and a thin `.hook.ts` in the consumer importing the logic from here (`vigiles compile` refuses the import, so the hook can never be re-stamped, and the runtime fails closed on the stale stamp). [Measurements](https://github.com/zernie/paperlint/blob/b4a3dc3a81d436186f41db2d69b65fd93f1af3b6/CLAUDE.md#L272-L357).
19
-
20
- ### No Sibling Imports
21
-
22
- **Guidance only** — A shipped hook cannot import a sibling module. The papers-root resolver is repeated in each hook, and `hooks.harness.ts` compares the copies.
23
-
24
- ### No Import Shaped Text
25
-
26
- **Guidance only** — `checkHookImports` (run by `hooks.harness.ts`) is a text regex. Describe a forbidden import in words; never write one, not even in a comment.
27
-
28
- ### One Wiring File
29
-
30
- **Guidance only** — The wiring is `plugin/hooks/hooks.json`. The Claude Code plugin ships it as its hooks, and `paperlint init` without the plugin merges it into the consumer's `.claude/settings.json`; there is no second copy.
31
-
32
- ### Vigiles Moves With The Consumer
33
-
34
- **Guidance only** — `vigiles` moves with the consumer's pin, in one pass. A major mismatch makes `PreToolUse` refuse every command. `npm ls vigiles` compares what is installed with the manifest, not with the registry; Dependabot (`.github/dependabot.yml`) carries the registry half.
@@ -1,30 +0,0 @@
1
- // Compiled to hooks/CLAUDE.md by `npx vigiles compile`. Edit THIS file, never the markdown.
2
- import { file, guidance, instructionFile, prose } from "vigiles/spec";
3
-
4
- export default instructionFile({
5
- sections: {
6
- "`hooks/`": prose`The hooks this package ships into a consumer's Claude Code session. Loaded when working under
7
- \`hooks/\`. Every shipped hook is run in both halves, firing and silent, by ${file("hooks/hooks.harness.ts")}.
8
-
9
- A bug here does not break this repository; it breaks somebody else's whole session. The Bash gate
10
- fails closed, so a hook that cannot read its config denies every command, including the one that
11
- would undo it.`,
12
- },
13
- rules: {
14
- "ship-hook-mjs-never-hook-ts": guidance(
15
- "A `.ts` hook inside `node_modules` fails to load and blocks every Bash command. Rejected, so not proposed again: a `.hook.ts` twin compiled to the `.mjs` (a twin drifts from its build, and nothing would notice), and a thin `.hook.ts` in the consumer importing the logic from here (`vigiles compile` refuses the import, so the hook can never be re-stamped, and the runtime fails closed on the stale stamp). [Measurements](https://github.com/zernie/paperlint/blob/b4a3dc3a81d436186f41db2d69b65fd93f1af3b6/CLAUDE.md#L272-L357).",
16
- ),
17
- "no-sibling-imports": guidance(
18
- "A shipped hook cannot import a sibling module. The papers-root resolver is repeated in each hook, and `hooks.harness.ts` compares the copies.",
19
- ),
20
- "no-import-shaped-text": guidance(
21
- "`checkHookImports` (run by `hooks.harness.ts`) is a text regex. Describe a forbidden import in words; never write one, not even in a comment.",
22
- ),
23
- "one-wiring-file": guidance(
24
- "The wiring is `plugin/hooks/hooks.json`. The Claude Code plugin ships it as its hooks, and `paperlint init` without the plugin merges it into the consumer's `.claude/settings.json`; there is no second copy.",
25
- ),
26
- "vigiles-moves-with-the-consumer": guidance(
27
- "`vigiles` moves with the consumer's pin, in one pass. A major mismatch makes `PreToolUse` refuse every command. `npm ls vigiles` compares what is installed with the manifest, not with the registry; Dependabot (`.github/dependabot.yml`) carries the registry half.",
28
- ),
29
- },
30
- });