paperlint 10.4.1 → 11.0.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 (131) hide show
  1. package/.github/workflows/deadlines.yml +27 -7
  2. package/README.md +16 -15
  3. package/dist/adapters/hotcrp/index.d.ts +6 -4
  4. package/dist/adapters/hotcrp/index.d.ts.map +1 -1
  5. package/dist/adapters/hotcrp/index.js +6 -4
  6. package/dist/adapters/hotcrp/index.js.map +1 -1
  7. package/dist/adapters/hotcrp/portal.io.d.ts +3 -1
  8. package/dist/adapters/hotcrp/portal.io.d.ts.map +1 -1
  9. package/dist/adapters/hotcrp/portal.io.js +36 -11
  10. package/dist/adapters/hotcrp/portal.io.js.map +1 -1
  11. package/dist/adapters/hotcrp/response.d.ts +6 -1
  12. package/dist/adapters/hotcrp/response.d.ts.map +1 -1
  13. package/dist/adapters/hotcrp/response.js +17 -0
  14. package/dist/adapters/hotcrp/response.js.map +1 -1
  15. package/dist/adapters/hotcrp/site.d.ts +9 -0
  16. package/dist/adapters/hotcrp/site.d.ts.map +1 -0
  17. package/dist/adapters/hotcrp/site.js +22 -0
  18. package/dist/adapters/hotcrp/site.js.map +1 -0
  19. package/dist/adapters/hotcrp/token.d.ts +13 -0
  20. package/dist/adapters/hotcrp/token.d.ts.map +1 -0
  21. package/dist/adapters/hotcrp/token.js +48 -0
  22. package/dist/adapters/hotcrp/token.js.map +1 -0
  23. package/dist/adapters/latex/abstract.d.ts +22 -0
  24. package/dist/adapters/latex/abstract.d.ts.map +1 -0
  25. package/dist/adapters/latex/abstract.js +187 -0
  26. package/dist/adapters/latex/abstract.js.map +1 -0
  27. package/dist/adapters/latex/headings.d.ts +6 -0
  28. package/dist/adapters/latex/headings.d.ts.map +1 -1
  29. package/dist/adapters/latex/headings.js +5 -4
  30. package/dist/adapters/latex/headings.js.map +1 -1
  31. package/dist/adapters/latex/index.d.ts.map +1 -1
  32. package/dist/adapters/latex/index.js +2 -0
  33. package/dist/adapters/latex/index.js.map +1 -1
  34. package/dist/adapters/latex/parse.d.ts +15 -0
  35. package/dist/adapters/latex/parse.d.ts.map +1 -1
  36. package/dist/adapters/latex/parse.js +58 -1
  37. package/dist/adapters/latex/parse.js.map +1 -1
  38. package/dist/cli.d.ts.map +1 -1
  39. package/dist/cli.js +20 -8
  40. package/dist/cli.js.map +1 -1
  41. package/dist/cycle-rules.d.ts.map +1 -1
  42. package/dist/cycle-rules.js +3 -4
  43. package/dist/cycle-rules.js.map +1 -1
  44. package/dist/domain/deadline.d.ts +8 -1
  45. package/dist/domain/deadline.d.ts.map +1 -1
  46. package/dist/domain/deadline.js +26 -12
  47. package/dist/domain/deadline.js.map +1 -1
  48. package/dist/domain/portal-token.d.ts +44 -0
  49. package/dist/domain/portal-token.d.ts.map +1 -0
  50. package/dist/domain/portal-token.js +32 -0
  51. package/dist/domain/portal-token.js.map +1 -0
  52. package/dist/domain/submission.d.ts +30 -0
  53. package/dist/domain/submission.d.ts.map +1 -1
  54. package/dist/domain/submission.js +68 -0
  55. package/dist/domain/submission.js.map +1 -1
  56. package/dist/lib/paper-config.d.ts +1 -1
  57. package/dist/lib/paper-config.d.ts.map +1 -1
  58. package/dist/lib/paper-config.js +6 -4
  59. package/dist/lib/paper-config.js.map +1 -1
  60. package/dist/paper-settings.d.ts +3 -1
  61. package/dist/paper-settings.d.ts.map +1 -1
  62. package/dist/paper-settings.js +11 -5
  63. package/dist/paper-settings.js.map +1 -1
  64. package/dist/ports/latex.d.ts +23 -0
  65. package/dist/ports/latex.d.ts.map +1 -1
  66. package/dist/ports/submission-portal.d.ts +39 -2
  67. package/dist/ports/submission-portal.d.ts.map +1 -1
  68. package/dist/ports/venue-deadlines.d.ts +1 -1
  69. package/dist/submission.d.ts +49 -11
  70. package/dist/submission.d.ts.map +1 -1
  71. package/dist/submission.js +332 -44
  72. package/dist/submission.js.map +1 -1
  73. package/docs/configuration.md +2 -1
  74. package/docs/rules/cycle/record.md +9 -6
  75. package/docs/submission.md +47 -48
  76. package/eslint.config.mjs +3 -0
  77. package/lib/paper-config.ts +7 -4
  78. package/package.json +6 -1
  79. package/presets/msr.jsonc +9 -7
  80. package/presets/msr.md +14 -10
  81. package/scripts/check.ts +1 -1
  82. package/scripts/refresh-deadlines/compare.test.ts +75 -0
  83. package/scripts/refresh-deadlines/compare.ts +101 -0
  84. package/scripts/refresh-deadlines/main.test.ts +140 -0
  85. package/scripts/refresh-deadlines/main.ts +56 -0
  86. package/scripts/refresh-deadlines/refresh.test.ts +287 -0
  87. package/scripts/refresh-deadlines/refresh.ts +183 -0
  88. package/skills/submission-portal/SKILL.md +60 -44
  89. package/skills/submission-portal/SKILL.md.spec.ts +62 -43
  90. package/skills/submission-portal/submission-portal.test.ts +4 -73
  91. package/src/adapters/hotcrp/cassette/README.md +4 -4
  92. package/src/adapters/hotcrp/cassette/deadlines-msr2027.html +9 -9
  93. package/src/adapters/hotcrp/deadlines.io.test.ts +2 -2
  94. package/src/adapters/hotcrp/deadlines.test.ts +3 -3
  95. package/src/adapters/hotcrp/index.ts +15 -3
  96. package/src/adapters/hotcrp/portal.io.ts +61 -17
  97. package/src/adapters/hotcrp/portal.test.ts +105 -1
  98. package/src/adapters/hotcrp/response.ts +21 -0
  99. package/src/adapters/hotcrp/site.ts +34 -0
  100. package/src/adapters/hotcrp/token.test.ts +69 -0
  101. package/src/adapters/hotcrp/token.ts +51 -0
  102. package/src/adapters/latex/abstract.test.ts +280 -0
  103. package/src/adapters/latex/abstract.ts +272 -0
  104. package/src/adapters/latex/headings.ts +5 -4
  105. package/src/adapters/latex/index.test.ts +31 -1
  106. package/src/adapters/latex/index.ts +2 -0
  107. package/src/adapters/latex/parse.ts +64 -3
  108. package/src/cli.test.ts +20 -8
  109. package/src/cli.ts +22 -13
  110. package/src/cycle-rules.test.ts +6 -6
  111. package/src/cycle-rules.ts +7 -4
  112. package/src/domain/deadline.test.ts +31 -2
  113. package/src/domain/deadline.ts +42 -16
  114. package/src/domain/portal-token.test.ts +55 -0
  115. package/src/domain/portal-token.ts +63 -0
  116. package/src/domain/submission.test.ts +88 -0
  117. package/src/domain/submission.ts +99 -0
  118. package/src/new-paper.test.ts +1 -0
  119. package/src/paper-settings.test.ts +20 -0
  120. package/src/paper-settings.ts +17 -5
  121. package/src/ports/latex.ts +25 -0
  122. package/src/ports/submission-portal.ts +43 -1
  123. package/src/ports/venue-deadlines.ts +1 -1
  124. package/src/presets.test.ts +8 -5
  125. package/src/submission-new.test.ts +569 -0
  126. package/src/submission-show.test.ts +210 -0
  127. package/src/submission-update.test.ts +160 -0
  128. package/src/submission.test.ts +140 -518
  129. package/src/submission.ts +494 -61
  130. package/scripts/refresh-deadlines.test.ts +0 -431
  131. package/scripts/refresh-deadlines.ts +0 -387
@@ -3,6 +3,7 @@
3
3
  * parser. The one implementation is `src/adapters/latex/` (unified-latex); `src/cli.ts` wires it.
4
4
  */
5
5
  import type { Include } from "../domain/paper-source.ts";
6
+ import type { Result } from "../domain/result.ts";
6
7
  import type {
7
8
  ClassLine,
8
9
  DocumentClass,
@@ -25,6 +26,24 @@ export interface Filecontents {
25
26
  readonly body: Span;
26
27
  }
27
28
 
29
+ /** Why a source's abstract cannot be read as plain text. */
30
+ export type AbstractProblem =
31
+ | { readonly kind: "none" }
32
+ | {
33
+ readonly kind: "unreadable";
34
+ /** What it is, in words: `\toolname, which no \newcommand … defines`. */
35
+ readonly what: string;
36
+ /** Its offset in the source. */
37
+ readonly at: number;
38
+ }
39
+ | {
40
+ /** A macro the abstract uses that the source defines more than once: which one TeX uses is not guessed. */
41
+ readonly kind: "redefined";
42
+ readonly name: string;
43
+ /** Each definition's offset in the source, in order. */
44
+ readonly at: readonly number[];
45
+ };
46
+
28
47
  export interface LatexReader {
29
48
  /** The source's `\documentclass`, as one of its states. */
30
49
  readonly documentClass: (src: string) => ClassLine;
@@ -74,4 +93,10 @@ export interface LatexReader {
74
93
  src: string,
75
94
  jobname: string,
76
95
  ) => readonly Filecontents[];
96
+ /**
97
+ * The body of `src`'s `abstract` environment as one paragraph of plain text — the author's
98
+ * argument-less macros expanded, TeX's dashes and quotes, citations and comments dropped — or
99
+ * what stops it, with its offset in `src`.
100
+ */
101
+ readonly abstractText: (src: string) => Result<string, AbstractProblem>;
77
102
  }
@@ -1,10 +1,13 @@
1
1
  /**
2
2
  * A conference portal holding a paper's submission — the port `paperlint submission` talks through.
3
- * Shaped by what the command needs (read one submission, send one change), not by any portal's API;
3
+ * Shaped by what the command needs (read one submission, send one change, create one), not by any
4
+ * portal's API;
4
5
  * one adapter per portal kind (`src/adapters/hotcrp/`).
5
6
  */
6
7
  import type { Result } from "../domain/result.ts";
7
8
  import type {
9
+ CreateOutcome,
10
+ NewSubmission,
8
11
  PortalFailure,
9
12
  SubmissionChange,
10
13
  SubmissionView,
@@ -23,4 +26,43 @@ export interface SubmissionPortal {
23
26
  change: SubmissionChange,
24
27
  o: { readonly save: boolean },
25
28
  ): Promise<Result<UpdateOutcome, PortalFailure>>;
29
+ /**
30
+ * Create a submission. Without `save` the portal only checks it (a dry run), keeps nothing and
31
+ * chooses no id; with it, the outcome carries the id the portal chose.
32
+ */
33
+ create(
34
+ paper: NewSubmission,
35
+ o: { readonly save: boolean },
36
+ ): Promise<Result<CreateOutcome, PortalFailure>>;
37
+ }
38
+
39
+ /** How an author makes a token for a portal site, in the words the command prints. */
40
+ export interface CredentialHelp {
41
+ /** The site's page where tokens are made. */
42
+ readonly page: string;
43
+ /** Where that page is in the site's menus. */
44
+ readonly where: string;
45
+ /** The permissions to give the token, per subcommand. */
46
+ readonly scopes: string;
47
+ }
48
+
49
+ /**
50
+ * A portal site before any token — what the command needs to find one, to say how to make one, and
51
+ * to say what is left to do on the site — and the portal itself once there is a token. One adapter
52
+ * per portal kind supplies it; the app prints what it returns.
53
+ */
54
+ export interface PortalSite {
55
+ /** The environment variable this site's token is read from. */
56
+ readonly tokenVariable: string;
57
+ /** The site-less variable no longer read: named when still set, never used. */
58
+ readonly siteLessVariable: string;
59
+ /** The shape of a site's variable, for a message about another site's. */
60
+ readonly variablePattern: string;
61
+ readonly credentials: CredentialHelp;
62
+ /** What `submission new` does not send: done on the site by the author. */
63
+ readonly siteOnly: readonly string[];
64
+ /** A submission's page on the site; null: the one just created, before it has a number. */
65
+ readonly submissionPage: (id: number | null) => string;
66
+ /** The portal, read and changed with `token`. */
67
+ readonly connect: (token: string) => SubmissionPortal;
26
68
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * A venue's deadlines as its portal publishes them — the port the scheduled refresh of the shipped
3
- * presets reads through (`scripts/refresh-deadlines.ts`). Shaped by what the refresh needs (the
3
+ * presets reads through (`scripts/refresh-deadlines/`). Shaped by what the refresh needs (the
4
4
  * portal's deadlines, once), not by any portal's page; one adapter per portal kind
5
5
  * (`src/adapters/hotcrp/`).
6
6
  */
@@ -103,23 +103,26 @@ describe("shipped presets: paperlint:msr", () => {
103
103
  kind: "hotcrp",
104
104
  url: "https://msr2027.hotcrp.com",
105
105
  });
106
- // The portal's deadlines, read 2026-10-05 off cassette/deadlines-msr2027.html's page.
106
+ // The portal's deadlines, read 2026-10-19 18:05 UTC off https://msr2027.hotcrp.com/deadlines:
107
+ // «Wednesday Oct 21, 2026, 7:59:59 AM EDT» (`"sub":1792583999`) and «Saturday Oct 24, 2026,
108
+ // 7:59:59 AM EDT» (#235).
107
109
  expect(r.value.deadlines).toEqual([
108
110
  {
109
111
  what: "submission",
110
- at: "2026-10-20T04:00:00Z",
112
+ at: "2026-10-21T11:59:59Z",
111
113
  source: "portal",
112
114
  url: "https://msr2027.hotcrp.com/deadlines",
113
- read: "2026-10-05",
115
+ read: "2026-10-19",
114
116
  },
115
117
  {
116
118
  what: "resubmission",
117
- at: "2026-10-23T04:00:00Z",
119
+ at: "2026-10-24T11:59:59Z",
118
120
  source: "portal",
119
121
  url: "https://msr2027.hotcrp.com/deadlines",
120
- read: "2026-10-05",
122
+ read: "2026-10-19",
121
123
  },
122
124
  ]);
125
+ expect(Date.parse("2026-10-21T11:59:59Z") / 1000).toBe(1792583999);
123
126
  // No rule turned on: the IEEE capitalization rule has not been read and quoted.
124
127
  expect(r.value.rules).toEqual({});
125
128
  expect(r.value.registerAnchors).toEqual([]);