paperlint 20.7.0 → 20.9.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 (67) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/dist/adapters/revision-plan/index.d.ts +17 -0
  3. package/dist/adapters/revision-plan/index.d.ts.map +1 -0
  4. package/dist/adapters/revision-plan/index.js +168 -0
  5. package/dist/adapters/revision-plan/index.js.map +1 -0
  6. package/dist/domain/paper-layout.d.ts.map +1 -1
  7. package/dist/domain/paper-layout.js +4 -0
  8. package/dist/domain/paper-layout.js.map +1 -1
  9. package/dist/domain/revision-plan.d.ts +121 -0
  10. package/dist/domain/revision-plan.d.ts.map +1 -0
  11. package/dist/domain/revision-plan.js +15 -0
  12. package/dist/domain/revision-plan.js.map +1 -0
  13. package/dist/ports/revision-plan-codec.d.ts +7 -0
  14. package/dist/ports/revision-plan-codec.d.ts.map +1 -0
  15. package/dist/ports/revision-plan-codec.js +2 -0
  16. package/dist/ports/revision-plan-codec.js.map +1 -0
  17. package/dist/skill-chunks/{chunk-J5XYPERO.js → chunk-FOYA3JCS.js} +0 -6
  18. package/dist/skill-chunks/chunk-KCX34KV4.js +7610 -0
  19. package/dist/skill-chunks/{chunk-WYQTXKNM.js → chunk-KIKDPXE4.js} +2 -2
  20. package/dist/skill-chunks/{chunk-EDHTB7KT.js → chunk-MX3LJNFG.js} +4 -2
  21. package/dist/skill-chunks/chunk-UE2CAVD6.js +34 -0
  22. package/dist/skill-chunks/{chunk-QPWFSYJG.js → chunk-ZWJMR4TF.js} +5 -7
  23. package/dist/skills/paper-pipeline/scripts/revision-plan-core.d.ts +79 -0
  24. package/dist/skills/paper-pipeline/scripts/revision-plan.d.ts +2 -0
  25. package/docs/configuration.md +56 -0
  26. package/docs/layout.md +1 -0
  27. package/docs/rules/paper/allowed-files-only.md +1 -0
  28. package/package.json +2 -1
  29. package/scripts/bundle-skills.ts +1 -0
  30. package/scripts/revision-plan-schema.test.ts +39 -0
  31. package/scripts/revision-plan-schema.ts +17 -0
  32. package/skills/argument-arc/scripts/headings.js +3 -2
  33. package/skills/cold-read-diff/scripts/cold-read.js +3 -2
  34. package/skills/find-venue/SKILL.md +3 -2
  35. package/skills/find-venue/SKILL.md.spec.ts +2 -1
  36. package/skills/harden-paper/SKILL.md +5 -1
  37. package/skills/harden-paper/SKILL.md.spec.ts +4 -0
  38. package/skills/paper-pipeline/SKILL.md +29 -4
  39. package/skills/paper-pipeline/SKILL.md.spec.ts +28 -3
  40. package/skills/paper-pipeline/revision-plan.schema.json +619 -0
  41. package/skills/paper-pipeline/scripts/README.md +6 -5
  42. package/skills/paper-pipeline/scripts/extract-ref-facts.js +4 -3
  43. package/skills/paper-pipeline/scripts/revision-plan-core.js +194 -0
  44. package/skills/paper-pipeline/scripts/revision-plan-core.ts +286 -0
  45. package/skills/paper-pipeline/scripts/revision-plan.js +462 -0
  46. package/skills/paper-pipeline/scripts/revision-plan.test.ts +386 -0
  47. package/skills/paper-pipeline/scripts/revision-plan.ts +21 -0
  48. package/skills/paper-status/SKILL.md +2 -1
  49. package/skills/paper-status/SKILL.md.spec.ts +1 -0
  50. package/skills/pc-panel-review/SKILL.md +5 -2
  51. package/skills/pc-panel-review/SKILL.md.spec.ts +4 -1
  52. package/skills/pc-panel-review/pc-panel-review.harness.ts +122 -0
  53. package/skills/pc-panel-review/scripts/prior-reviews.js +11 -7031
  54. package/skills/study-accepted-papers/SKILL.md +5 -2
  55. package/skills/study-accepted-papers/SKILL.md.spec.ts +4 -1
  56. package/skills/study-accepted-papers/scripts/corpus-licences.js +1 -1
  57. package/skills/tighten-paper/SKILL.md +3 -2
  58. package/skills/tighten-paper/SKILL.md.spec.ts +2 -1
  59. package/skills/verify-citations/scripts/bib-authors.js +4 -3
  60. package/skills/verify-citations/scripts/verify-cites.js +4 -3
  61. package/src/adapters/revision-plan/index.test.ts +207 -0
  62. package/src/adapters/revision-plan/index.ts +236 -0
  63. package/src/adapters/revision-plan/schema.test.ts +69 -0
  64. package/src/domain/paper-layout.test.ts +1 -0
  65. package/src/domain/paper-layout.ts +4 -0
  66. package/src/domain/revision-plan.ts +127 -0
  67. package/src/ports/revision-plan-codec.ts +7 -0
@@ -0,0 +1,127 @@
1
+ /**
2
+ * A PAPER'S REVISION PLAN — `<paper>/revision-plan.json` (#502): for the current cycle, which accepted
3
+ * papers the paper is held against, whether new evidence is still being gathered, and the closed list
4
+ * of what remains before it is submitted. "Done" is the list, not a reader's or a skill's bar: a
5
+ * review finding outside it is a proposal until the author adds a row.
6
+ *
7
+ * The text is checked once, where it enters: `RevisionPlanCodec` (`src/ports/revision-plan-codec.ts`),
8
+ * whose adapter holds the zod schema of this shape. Only the codec mints a `RevisionPlan`, so a value
9
+ * built by hand can hold what the schema refuses (a `done` row with no evidence, two rows with one id).
10
+ * Every object is strict: a misspelt key is a finding, not a field nobody reads.
11
+ *
12
+ * What the shape cannot hold, by construction:
13
+ * - a `done` row without `evidence`, a `dropped` row without `reason` and `kind`;
14
+ * - a bar that claims to be measured without naming the corpus and at least one edition;
15
+ * - "no bar" without saying why; a `proxy` without what it stands in for;
16
+ * - `enough` measured without a date and the file that decided it;
17
+ * - a row with no origin, or no date it was added.
18
+ * What needs the disk or the settings (the cycle is the current one, the corpus and each named file
19
+ * exist, a finding exists in its review, a rule id is shipped) is a rule's, not this type's.
20
+ */
21
+ import type { CycleId } from "./cycle.ts";
22
+
23
+ export const REVISION_PLAN = "revision-plan.json";
24
+
25
+ /** A row's id, `R1`, `R2`, …: unique in the file, so a review finding can name it. */
26
+ export const ROW_ID_PATTERN = /^R[1-9][0-9]*$/u;
27
+
28
+ /** A rule's id as `paperlint lint` reports it: `<plugin>/<rule>`. */
29
+ export const RULE_ID_PATTERN = /^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/u;
30
+
31
+ /** Which accepted papers the paper is held against. A measured bar IS a corpus: there is no `measured: true`. */
32
+ export type Bar =
33
+ | {
34
+ readonly kind: "corpus";
35
+ /** The venue corpus's series: its folder under `<papers-root>/venues/`. */
36
+ readonly series: string;
37
+ readonly editions: readonly [number, ...number[]];
38
+ }
39
+ | {
40
+ /** Another venue's corpus, labelled as a stand-in. */
41
+ readonly kind: "proxy";
42
+ readonly series: string;
43
+ readonly stands_in_for: string;
44
+ }
45
+ | { readonly kind: "none"; readonly why: string };
46
+
47
+ /** Whether new evidence is still being gathered. `enough` closes the evidence, not the text (#504). */
48
+ export type Measurement =
49
+ | { readonly kind: "open" }
50
+ | {
51
+ readonly kind: "enough";
52
+ readonly since: string;
53
+ /** The paper's file, relative to the paper folder, whose reading decided it. */
54
+ readonly evidence: string;
55
+ };
56
+
57
+ /** Where a row came from: one closed set, so a row cannot arrive from nowhere. */
58
+ export type RowSource =
59
+ | { readonly kind: "author" }
60
+ /** A fact of the venue's preset: its template, a required section. */
61
+ | { readonly kind: "venue" }
62
+ /** A finding of a review file, relative to the paper folder (`reviews/*.md`), by its id. */
63
+ | {
64
+ readonly kind: "finding";
65
+ readonly file: string;
66
+ readonly finding: string | number;
67
+ }
68
+ /** The points of a reviewed rejection, from that cycle. */
69
+ | { readonly kind: "prior-reviews"; readonly cycle: CycleId };
70
+
71
+ /** Why a dropped row is not done: decided against, or a known cost the paper is submitted with. */
72
+ export const DROP_KINDS = ["not-doing", "accepted-cap"] as const;
73
+ export type DropKind = (typeof DROP_KINDS)[number];
74
+
75
+ /** What every row carries. */
76
+ interface RowBase {
77
+ readonly id: string;
78
+ readonly what: string;
79
+ readonly from: RowSource;
80
+ /** The day the row was added: a row added after `written` is growth the plan's reader sees. */
81
+ readonly added: string;
82
+ }
83
+
84
+ /** How a row stands: open, closed with evidence, dropped with a reason, or closed when a rule falls silent. */
85
+ export type Row = RowBase &
86
+ (
87
+ | { readonly state: "todo" | "doing" }
88
+ | { readonly state: "done"; readonly evidence: string }
89
+ | {
90
+ readonly state: "dropped";
91
+ readonly reason: string;
92
+ readonly kind: DropKind;
93
+ }
94
+ | { readonly state: "by-rule"; readonly rule: string }
95
+ );
96
+
97
+ export const ROW_STATES = [
98
+ "todo",
99
+ "doing",
100
+ "done",
101
+ "dropped",
102
+ "by-rule",
103
+ ] as const satisfies readonly Row["state"][];
104
+
105
+ export interface RevisionPlan {
106
+ /** The cycle the plan is for (`cycles[].id` in the paper's `paperlint.json`). */
107
+ readonly cycle: CycleId;
108
+ /** The day the plan was written. */
109
+ readonly written: string;
110
+ readonly bar: Bar;
111
+ readonly measurement: Measurement;
112
+ /** The closed list: a row is added only by an edit to this file. */
113
+ readonly remaining: readonly Row[];
114
+ }
115
+
116
+ /** A field of the plan, as the path of keys and indexes from its top. */
117
+ export type PlanPath = readonly (string | number)[];
118
+
119
+ /** Why the text is not a plan, at the field the reason is about. */
120
+ export interface PlanProblem {
121
+ readonly path: PlanPath;
122
+ readonly message: string;
123
+ }
124
+
125
+ export type ParsedPlan =
126
+ | { readonly ok: true; readonly plan: RevisionPlan }
127
+ | { readonly ok: false; readonly problems: readonly PlanProblem[] };
@@ -0,0 +1,7 @@
1
+ /** How a revision plan's text becomes a plan: parsed once, at the boundary (src/domain/revision-plan.ts). */
2
+ import type { ParsedPlan } from "../domain/revision-plan.ts";
3
+
4
+ export interface RevisionPlanCodec {
5
+ /** `revision-plan.json`'s text → the plan, or every reason it is not one, each at its field. */
6
+ readonly parse: (text: string) => ParsedPlan;
7
+ }