@de-otio/bibcheck 0.1.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 (127) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +147 -0
  3. package/dist/cache/fs-cache.d.ts +55 -0
  4. package/dist/cache/fs-cache.d.ts.map +1 -0
  5. package/dist/cache/fs-cache.js +264 -0
  6. package/dist/cache/fs-cache.js.map +1 -0
  7. package/dist/canonical.d.ts +29 -0
  8. package/dist/canonical.d.ts.map +1 -0
  9. package/dist/canonical.js +132 -0
  10. package/dist/canonical.js.map +1 -0
  11. package/dist/check.d.ts +140 -0
  12. package/dist/check.d.ts.map +1 -0
  13. package/dist/check.js +646 -0
  14. package/dist/check.js.map +1 -0
  15. package/dist/cli.d.ts +19 -0
  16. package/dist/cli.d.ts.map +1 -0
  17. package/dist/cli.js +357 -0
  18. package/dist/cli.js.map +1 -0
  19. package/dist/config.d.ts +175 -0
  20. package/dist/config.d.ts.map +1 -0
  21. package/dist/config.js +180 -0
  22. package/dist/config.js.map +1 -0
  23. package/dist/databases/crossref.d.ts +53 -0
  24. package/dist/databases/crossref.d.ts.map +1 -0
  25. package/dist/databases/crossref.js +138 -0
  26. package/dist/databases/crossref.js.map +1 -0
  27. package/dist/databases/index.d.ts +12 -0
  28. package/dist/databases/index.d.ts.map +1 -0
  29. package/dist/databases/index.js +9 -0
  30. package/dist/databases/index.js.map +1 -0
  31. package/dist/databases/openalex.d.ts +29 -0
  32. package/dist/databases/openalex.d.ts.map +1 -0
  33. package/dist/databases/openalex.js +117 -0
  34. package/dist/databases/openalex.js.map +1 -0
  35. package/dist/databases/openlibrary.d.ts +26 -0
  36. package/dist/databases/openlibrary.d.ts.map +1 -0
  37. package/dist/databases/openlibrary.js +79 -0
  38. package/dist/databases/openlibrary.js.map +1 -0
  39. package/dist/databases/worldcat.d.ts +33 -0
  40. package/dist/databases/worldcat.d.ts.map +1 -0
  41. package/dist/databases/worldcat.js +145 -0
  42. package/dist/databases/worldcat.js.map +1 -0
  43. package/dist/doctor.d.ts +44 -0
  44. package/dist/doctor.d.ts.map +1 -0
  45. package/dist/doctor.js +386 -0
  46. package/dist/doctor.js.map +1 -0
  47. package/dist/existence.d.ts +70 -0
  48. package/dist/existence.d.ts.map +1 -0
  49. package/dist/existence.js +308 -0
  50. package/dist/existence.js.map +1 -0
  51. package/dist/http.d.ts +97 -0
  52. package/dist/http.d.ts.map +1 -0
  53. package/dist/http.js +543 -0
  54. package/dist/http.js.map +1 -0
  55. package/dist/identifiers.d.ts +44 -0
  56. package/dist/identifiers.d.ts.map +1 -0
  57. package/dist/identifiers.js +111 -0
  58. package/dist/identifiers.js.map +1 -0
  59. package/dist/index.d.ts +9 -0
  60. package/dist/index.d.ts.map +1 -0
  61. package/dist/index.js +8 -0
  62. package/dist/index.js.map +1 -0
  63. package/dist/linkage.d.ts +29 -0
  64. package/dist/linkage.d.ts.map +1 -0
  65. package/dist/linkage.js +73 -0
  66. package/dist/linkage.js.map +1 -0
  67. package/dist/markdown/blocks.d.ts +19 -0
  68. package/dist/markdown/blocks.d.ts.map +1 -0
  69. package/dist/markdown/blocks.js +69 -0
  70. package/dist/markdown/blocks.js.map +1 -0
  71. package/dist/markdown/citekeys.d.ts +22 -0
  72. package/dist/markdown/citekeys.d.ts.map +1 -0
  73. package/dist/markdown/citekeys.js +100 -0
  74. package/dist/markdown/citekeys.js.map +1 -0
  75. package/dist/markdown/glob.d.ts +18 -0
  76. package/dist/markdown/glob.d.ts.map +1 -0
  77. package/dist/markdown/glob.js +26 -0
  78. package/dist/markdown/glob.js.map +1 -0
  79. package/dist/markdown/prose.d.ts +19 -0
  80. package/dist/markdown/prose.d.ts.map +1 -0
  81. package/dist/markdown/prose.js +81 -0
  82. package/dist/markdown/prose.js.map +1 -0
  83. package/dist/output/json.d.ts +21 -0
  84. package/dist/output/json.d.ts.map +1 -0
  85. package/dist/output/json.js +24 -0
  86. package/dist/output/json.js.map +1 -0
  87. package/dist/output/markdown.d.ts +21 -0
  88. package/dist/output/markdown.d.ts.map +1 -0
  89. package/dist/output/markdown.js +194 -0
  90. package/dist/output/markdown.js.map +1 -0
  91. package/dist/output/sarif.d.ts +31 -0
  92. package/dist/output/sarif.d.ts.map +1 -0
  93. package/dist/output/sarif.js +322 -0
  94. package/dist/output/sarif.js.map +1 -0
  95. package/dist/output/text.d.ts +27 -0
  96. package/dist/output/text.d.ts.map +1 -0
  97. package/dist/output/text.js +212 -0
  98. package/dist/output/text.js.map +1 -0
  99. package/dist/phrases/load.d.ts +34 -0
  100. package/dist/phrases/load.d.ts.map +1 -0
  101. package/dist/phrases/load.js +148 -0
  102. package/dist/phrases/load.js.map +1 -0
  103. package/dist/phrases.d.ts +27 -0
  104. package/dist/phrases.d.ts.map +1 -0
  105. package/dist/phrases.js +116 -0
  106. package/dist/phrases.js.map +1 -0
  107. package/dist/schema/csl.d.ts +429 -0
  108. package/dist/schema/csl.d.ts.map +1 -0
  109. package/dist/schema/csl.js +101 -0
  110. package/dist/schema/csl.js.map +1 -0
  111. package/dist/schema/output.d.ts +1116 -0
  112. package/dist/schema/output.d.ts.map +1 -0
  113. package/dist/schema/output.js +419 -0
  114. package/dist/schema/output.js.map +1 -0
  115. package/dist/suppression.d.ts +106 -0
  116. package/dist/suppression.d.ts.map +1 -0
  117. package/dist/suppression.js +134 -0
  118. package/dist/suppression.js.map +1 -0
  119. package/dist/version.d.ts +11 -0
  120. package/dist/version.d.ts.map +1 -0
  121. package/dist/version.js +14 -0
  122. package/dist/version.js.map +1 -0
  123. package/dist/worklist.d.ts +32 -0
  124. package/dist/worklist.d.ts.map +1 -0
  125. package/dist/worklist.js +211 -0
  126. package/dist/worklist.js.map +1 -0
  127. package/package.json +82 -0
@@ -0,0 +1,1116 @@
1
+ /**
2
+ * bibcheck output JSON schema — the contract consumers (LLM agents, CI tools,
3
+ * editor integrations) read.
4
+ *
5
+ * FROZEN. This schema is the contract every renderer and consumer reads;
6
+ * changes require a surfaced design decision (see tmp/design-review/) and a
7
+ * `SCHEMA_VERSION` bump. Do not edit ad hoc.
8
+ *
9
+ * Versioned independently of the package version via `SCHEMA_VERSION` below.
10
+ * Bumping rules:
11
+ * - Additive changes (new optional fields, new enum members on otherwise-open
12
+ * types) bump the minor part and remain backward-compatible.
13
+ * - Renames, removals, or changed semantics bump the major part; consumers
14
+ * pinning a major version are insulated.
15
+ *
16
+ * 0.3.0 (H2 — reverse-linkage / orphan detection): added the `'orphan'`
17
+ * member to `LinkageStatusSchema` (a bibliography citekey never referenced in
18
+ * any doc — the inverse of `'unresolved'`) and the OPTIONAL `orphanedEntries`
19
+ * summary counter. Orphans are INFORMATIONAL: they are surfaced but MUST NOT
20
+ * gate `bibcheck check` (an uncited bibliography entry is a smell, not proof of
21
+ * fabrication; gating would train users to disable checks). The change is
22
+ * purely additive — the `linkageFailures` invariant counts only `'unresolved'`
23
+ * entries, so orphans (status `'orphan'`) are naturally excluded — and the new
24
+ * summary counter is optional so existing Output builders that do not populate
25
+ * it keep emitting valid documents.
26
+ *
27
+ * 0.2.0 (Phase 5 — hallucination-hardening): added the existence evidence
28
+ * vocabulary (`ExistenceEvidenceSchema`) and verification-boundary fields
29
+ * (`evidence` / `checkedFor` / `notCheckedFor` / `error` on the existence
30
+ * layer); the per-entry `IdentifiersLayerSchema` (local DOI/ISBN/URL
31
+ * well-formedness); the `notFoundInDatabases` + `malformedIdentifiers`
32
+ * summary counters with existence-bucket reconciliation; and the optional
33
+ * `locator` / `authorSuppressed` linkage/worklist fields for the
34
+ * citation-parser swap. The new per-entry/summary fields are presently
35
+ * OPTIONAL so that the v0.1 producer (which does not yet populate them) keeps
36
+ * emitting valid documents; T21/T22/T25 populate them and a follow-up tightens
37
+ * them to required (see the `TODO(T22)` markers below).
38
+ *
39
+ * Authoritative documentation is the Zod schemas in this file. The published
40
+ * JSON Schema in `docs/output-schema.md` (when generated) is derived from
41
+ * these definitions, not maintained by hand.
42
+ */
43
+ import { z } from 'zod';
44
+ /** Current bibcheck output schema version. Independent of the package version. */
45
+ export declare const SCHEMA_VERSION: "0.3.0";
46
+ export declare const ToolInfoSchema: z.ZodObject<{
47
+ name: z.ZodLiteral<"bibcheck">;
48
+ version: z.ZodString;
49
+ }, "strip", z.ZodTypeAny, {
50
+ version: string;
51
+ name: "bibcheck";
52
+ }, {
53
+ version: string;
54
+ name: "bibcheck";
55
+ }>;
56
+ export type ToolInfo = z.infer<typeof ToolInfoSchema>;
57
+ export declare const SummarySchema: z.ZodObject<{
58
+ totalEntries: z.ZodNumber;
59
+ verified: z.ZodNumber;
60
+ metadataMismatches: z.ZodNumber;
61
+ /**
62
+ * Entries confirmed absent from every applicable database (a fabrication
63
+ * signal; gates by default per Q1). NEW in 0.2.0.
64
+ */
65
+ notFoundInDatabases: z.ZodNumber;
66
+ /**
67
+ * Entries with at least one malformed/bad-checksum identifier in the
68
+ * `identifiers` layer (a cheap fabrication signal; gates by default). NEW
69
+ * in 0.2.0.
70
+ */
71
+ malformedIdentifiers: z.ZodNumber;
72
+ unverifiable: z.ZodNumber;
73
+ canonicalIssues: z.ZodNumber;
74
+ linkageFailures: z.ZodNumber;
75
+ phraseFlags: z.ZodNumber;
76
+ worklistItems: z.ZodNumber;
77
+ /**
78
+ * Bibliography entries whose citekey is never referenced in any markdown doc
79
+ * (reverse linkage; the inverse of `linkageFailures`). INFORMATIONAL — an
80
+ * uncited entry is a smell (e.g. an LLM-padded reference list), not proof of
81
+ * fabrication, so it does NOT gate `bibcheck check`. OPTIONAL so the counter
82
+ * is additive: Output builders predating 0.3.0 that omit it stay valid. NEW
83
+ * in 0.3.0.
84
+ */
85
+ orphanedEntries: z.ZodOptional<z.ZodNumber>;
86
+ }, "strip", z.ZodTypeAny, {
87
+ totalEntries: number;
88
+ verified: number;
89
+ metadataMismatches: number;
90
+ notFoundInDatabases: number;
91
+ malformedIdentifiers: number;
92
+ unverifiable: number;
93
+ canonicalIssues: number;
94
+ linkageFailures: number;
95
+ phraseFlags: number;
96
+ worklistItems: number;
97
+ orphanedEntries?: number | undefined;
98
+ }, {
99
+ totalEntries: number;
100
+ verified: number;
101
+ metadataMismatches: number;
102
+ notFoundInDatabases: number;
103
+ malformedIdentifiers: number;
104
+ unverifiable: number;
105
+ canonicalIssues: number;
106
+ linkageFailures: number;
107
+ phraseFlags: number;
108
+ worklistItems: number;
109
+ orphanedEntries?: number | undefined;
110
+ }>;
111
+ export type Summary = z.infer<typeof SummarySchema>;
112
+ export declare const ExistenceCheckSourceSchema: z.ZodEnum<["crossref", "openalex", "openlibrary"]>;
113
+ export type ExistenceCheckSource = z.infer<typeof ExistenceCheckSourceSchema>;
114
+ export declare const ExistenceCheckResultSchema: z.ZodEnum<["no-doi", "found", "not-found", "metadata-mismatch", "error"]>;
115
+ export type ExistenceCheckResult = z.infer<typeof ExistenceCheckResultSchema>;
116
+ export declare const ExistenceCheckSchema: z.ZodObject<{
117
+ source: z.ZodEnum<["crossref", "openalex", "openlibrary"]>;
118
+ result: z.ZodEnum<["no-doi", "found", "not-found", "metadata-mismatch", "error"]>;
119
+ /** Source-specific evidence. Shape varies per source; not strictly typed. */
120
+ evidence: z.ZodNullable<z.ZodUnknown>;
121
+ }, "strip", z.ZodTypeAny, {
122
+ source: "crossref" | "openalex" | "openlibrary";
123
+ result: "error" | "no-doi" | "found" | "not-found" | "metadata-mismatch";
124
+ evidence?: unknown;
125
+ }, {
126
+ source: "crossref" | "openalex" | "openlibrary";
127
+ result: "error" | "no-doi" | "found" | "not-found" | "metadata-mismatch";
128
+ evidence?: unknown;
129
+ }>;
130
+ export type ExistenceCheck = z.infer<typeof ExistenceCheckSchema>;
131
+ export declare const ExistenceStatusSchema: z.ZodEnum<["verified", "metadata-mismatch", "not-found-in-databases", "unverifiable"]>;
132
+ export type ExistenceStatus = z.infer<typeof ExistenceStatusSchema>;
133
+ /**
134
+ * Defined per-entry evidence vocabulary, distinct from the bare `status`
135
+ * rollup, so an LLM-agent consumer cannot read `verified` as "the citation's
136
+ * claim is sound" (Q2). Deliberately discrete — there is NO numeric confidence
137
+ * score anywhere in this schema (barred by the project's "no uncalibrated
138
+ * confidence scores" design default); the vocabulary is the calibrated
139
+ * alternative.
140
+ */
141
+ export declare const ExistenceEvidenceSchema: z.ZodEnum<["exists-metadata-match", "exists-metadata-mismatch", "absent", "unverifiable"]>;
142
+ export type ExistenceEvidence = z.infer<typeof ExistenceEvidenceSchema>;
143
+ /**
144
+ * The verification dimensions bibcheck can report on. Used by the existence
145
+ * layer's `checkedFor` / `notCheckedFor` arrays to state explicitly what was
146
+ * and was NOT checked. `claim-support` (does the source actually support the
147
+ * prose's claim?) is never checked automatically — it is the manual worklist's
148
+ * job — so it always appears in `notCheckedFor` for v0.1.
149
+ */
150
+ export declare const CheckDimensionSchema: z.ZodEnum<["existence", "metadata", "canonical-url", "claim-support"]>;
151
+ export type CheckDimension = z.infer<typeof CheckDimensionSchema>;
152
+ export declare const ExistenceLayerSchema: z.ZodObject<{
153
+ status: z.ZodEnum<["verified", "metadata-mismatch", "not-found-in-databases", "unverifiable"]>;
154
+ /** Defined evidence vocabulary (Q2). NEW in 0.2.0. */
155
+ evidence: z.ZodEnum<["exists-metadata-match", "exists-metadata-mismatch", "absent", "unverifiable"]>;
156
+ /** Dimensions that were checked, e.g. ['existence','metadata']. NEW in 0.2.0. */
157
+ checkedFor: z.ZodArray<z.ZodEnum<["existence", "metadata", "canonical-url", "claim-support"]>, "many">;
158
+ /**
159
+ * Dimensions that were NOT checked. Always includes 'claim-support' for
160
+ * v0.1 (bibcheck never verifies whether the source supports the prose's
161
+ * claim; that is the manual worklist's job). NEW in 0.2.0.
162
+ */
163
+ notCheckedFor: z.ZodArray<z.ZodEnum<["existence", "metadata", "canonical-url", "claim-support"]>, "many">;
164
+ checks: z.ZodArray<z.ZodObject<{
165
+ source: z.ZodEnum<["crossref", "openalex", "openlibrary"]>;
166
+ result: z.ZodEnum<["no-doi", "found", "not-found", "metadata-mismatch", "error"]>;
167
+ /** Source-specific evidence. Shape varies per source; not strictly typed. */
168
+ evidence: z.ZodNullable<z.ZodUnknown>;
169
+ }, "strip", z.ZodTypeAny, {
170
+ source: "crossref" | "openalex" | "openlibrary";
171
+ result: "error" | "no-doi" | "found" | "not-found" | "metadata-mismatch";
172
+ evidence?: unknown;
173
+ }, {
174
+ source: "crossref" | "openalex" | "openlibrary";
175
+ result: "error" | "no-doi" | "found" | "not-found" | "metadata-mismatch";
176
+ evidence?: unknown;
177
+ }>, "many">;
178
+ /**
179
+ * Set when the layer crashed (vs. a clean unverifiable result), so consumers
180
+ * can distinguish "we ran and found nothing applicable" from "we failed to
181
+ * run." NEW in 0.2.0 (also addresses S1). Null when the layer ran cleanly.
182
+ */
183
+ error: z.ZodNullable<z.ZodString>;
184
+ }, "strip", z.ZodTypeAny, {
185
+ error: string | null;
186
+ status: "verified" | "unverifiable" | "metadata-mismatch" | "not-found-in-databases";
187
+ evidence: "unverifiable" | "exists-metadata-match" | "exists-metadata-mismatch" | "absent";
188
+ checkedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
189
+ notCheckedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
190
+ checks: {
191
+ source: "crossref" | "openalex" | "openlibrary";
192
+ result: "error" | "no-doi" | "found" | "not-found" | "metadata-mismatch";
193
+ evidence?: unknown;
194
+ }[];
195
+ }, {
196
+ error: string | null;
197
+ status: "verified" | "unverifiable" | "metadata-mismatch" | "not-found-in-databases";
198
+ evidence: "unverifiable" | "exists-metadata-match" | "exists-metadata-mismatch" | "absent";
199
+ checkedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
200
+ notCheckedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
201
+ checks: {
202
+ source: "crossref" | "openalex" | "openlibrary";
203
+ result: "error" | "no-doi" | "found" | "not-found" | "metadata-mismatch";
204
+ evidence?: unknown;
205
+ }[];
206
+ }>;
207
+ export type ExistenceLayer = z.infer<typeof ExistenceLayerSchema>;
208
+ export declare const IdentifierStatusSchema: z.ZodEnum<["ok", "malformed", "bad-checksum", "not-applicable"]>;
209
+ export type IdentifierStatus = z.infer<typeof IdentifierStatusSchema>;
210
+ export declare const IdentifiersLayerSchema: z.ZodObject<{
211
+ /** 'malformed' if the DOI fails `^10\.\d{4,}/\S+$`. */
212
+ doi: z.ZodEnum<["ok", "malformed", "bad-checksum", "not-applicable"]>;
213
+ /** 'bad-checksum' for a failed ISBN-10/13 check digit; 'malformed' for bad shape. */
214
+ isbn: z.ZodEnum<["ok", "malformed", "bad-checksum", "not-applicable"]>;
215
+ /** 'malformed' if the URL is not a well-formed http/https URL. */
216
+ url: z.ZodEnum<["ok", "malformed", "bad-checksum", "not-applicable"]>;
217
+ }, "strip", z.ZodTypeAny, {
218
+ doi: "ok" | "malformed" | "bad-checksum" | "not-applicable";
219
+ isbn: "ok" | "malformed" | "bad-checksum" | "not-applicable";
220
+ url: "ok" | "malformed" | "bad-checksum" | "not-applicable";
221
+ }, {
222
+ doi: "ok" | "malformed" | "bad-checksum" | "not-applicable";
223
+ isbn: "ok" | "malformed" | "bad-checksum" | "not-applicable";
224
+ url: "ok" | "malformed" | "bad-checksum" | "not-applicable";
225
+ }>;
226
+ export type IdentifiersLayer = z.infer<typeof IdentifiersLayerSchema>;
227
+ export declare const CanonicalStatusSchema: z.ZodEnum<["verified-canonical", "wrong-host", "dead-url", "live-url-not-archived-snapshot", "no-url-on-pre-doi-entry", "not-applicable"]>;
228
+ export type CanonicalStatus = z.infer<typeof CanonicalStatusSchema>;
229
+ export declare const CanonicalLayerSchema: z.ZodObject<{
230
+ status: z.ZodEnum<["verified-canonical", "wrong-host", "dead-url", "live-url-not-archived-snapshot", "no-url-on-pre-doi-entry", "not-applicable"]>;
231
+ url: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
232
+ /** Redirect chain, in order, if HEAD followed redirects. */
233
+ redirectChain: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
234
+ }, "strip", z.ZodTypeAny, {
235
+ status: "dead-url" | "wrong-host" | "not-applicable" | "verified-canonical" | "live-url-not-archived-snapshot" | "no-url-on-pre-doi-entry";
236
+ url: string | null;
237
+ redirectChain?: string[] | undefined;
238
+ }, {
239
+ status: "dead-url" | "wrong-host" | "not-applicable" | "verified-canonical" | "live-url-not-archived-snapshot" | "no-url-on-pre-doi-entry";
240
+ url: string | null;
241
+ redirectChain?: string[] | undefined;
242
+ }>;
243
+ export type CanonicalLayer = z.infer<typeof CanonicalLayerSchema>;
244
+ export declare const EntrySchema: z.ZodObject<{
245
+ citekey: z.ZodString;
246
+ /**
247
+ * Layer 0 local identifier well-formedness (pre-network). Null when not run.
248
+ * NEW in 0.2.0 (Q5 / T21).
249
+ */
250
+ identifiers: z.ZodNullable<z.ZodObject<{
251
+ /** 'malformed' if the DOI fails `^10\.\d{4,}/\S+$`. */
252
+ doi: z.ZodEnum<["ok", "malformed", "bad-checksum", "not-applicable"]>;
253
+ /** 'bad-checksum' for a failed ISBN-10/13 check digit; 'malformed' for bad shape. */
254
+ isbn: z.ZodEnum<["ok", "malformed", "bad-checksum", "not-applicable"]>;
255
+ /** 'malformed' if the URL is not a well-formed http/https URL. */
256
+ url: z.ZodEnum<["ok", "malformed", "bad-checksum", "not-applicable"]>;
257
+ }, "strip", z.ZodTypeAny, {
258
+ doi: "ok" | "malformed" | "bad-checksum" | "not-applicable";
259
+ isbn: "ok" | "malformed" | "bad-checksum" | "not-applicable";
260
+ url: "ok" | "malformed" | "bad-checksum" | "not-applicable";
261
+ }, {
262
+ doi: "ok" | "malformed" | "bad-checksum" | "not-applicable";
263
+ isbn: "ok" | "malformed" | "bad-checksum" | "not-applicable";
264
+ url: "ok" | "malformed" | "bad-checksum" | "not-applicable";
265
+ }>>;
266
+ /** Layer 1 existence findings (commodity layer). Null when not run. */
267
+ existence: z.ZodNullable<z.ZodObject<{
268
+ status: z.ZodEnum<["verified", "metadata-mismatch", "not-found-in-databases", "unverifiable"]>;
269
+ /** Defined evidence vocabulary (Q2). NEW in 0.2.0. */
270
+ evidence: z.ZodEnum<["exists-metadata-match", "exists-metadata-mismatch", "absent", "unverifiable"]>;
271
+ /** Dimensions that were checked, e.g. ['existence','metadata']. NEW in 0.2.0. */
272
+ checkedFor: z.ZodArray<z.ZodEnum<["existence", "metadata", "canonical-url", "claim-support"]>, "many">;
273
+ /**
274
+ * Dimensions that were NOT checked. Always includes 'claim-support' for
275
+ * v0.1 (bibcheck never verifies whether the source supports the prose's
276
+ * claim; that is the manual worklist's job). NEW in 0.2.0.
277
+ */
278
+ notCheckedFor: z.ZodArray<z.ZodEnum<["existence", "metadata", "canonical-url", "claim-support"]>, "many">;
279
+ checks: z.ZodArray<z.ZodObject<{
280
+ source: z.ZodEnum<["crossref", "openalex", "openlibrary"]>;
281
+ result: z.ZodEnum<["no-doi", "found", "not-found", "metadata-mismatch", "error"]>;
282
+ /** Source-specific evidence. Shape varies per source; not strictly typed. */
283
+ evidence: z.ZodNullable<z.ZodUnknown>;
284
+ }, "strip", z.ZodTypeAny, {
285
+ source: "crossref" | "openalex" | "openlibrary";
286
+ result: "error" | "no-doi" | "found" | "not-found" | "metadata-mismatch";
287
+ evidence?: unknown;
288
+ }, {
289
+ source: "crossref" | "openalex" | "openlibrary";
290
+ result: "error" | "no-doi" | "found" | "not-found" | "metadata-mismatch";
291
+ evidence?: unknown;
292
+ }>, "many">;
293
+ /**
294
+ * Set when the layer crashed (vs. a clean unverifiable result), so consumers
295
+ * can distinguish "we ran and found nothing applicable" from "we failed to
296
+ * run." NEW in 0.2.0 (also addresses S1). Null when the layer ran cleanly.
297
+ */
298
+ error: z.ZodNullable<z.ZodString>;
299
+ }, "strip", z.ZodTypeAny, {
300
+ error: string | null;
301
+ status: "verified" | "unverifiable" | "metadata-mismatch" | "not-found-in-databases";
302
+ evidence: "unverifiable" | "exists-metadata-match" | "exists-metadata-mismatch" | "absent";
303
+ checkedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
304
+ notCheckedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
305
+ checks: {
306
+ source: "crossref" | "openalex" | "openlibrary";
307
+ result: "error" | "no-doi" | "found" | "not-found" | "metadata-mismatch";
308
+ evidence?: unknown;
309
+ }[];
310
+ }, {
311
+ error: string | null;
312
+ status: "verified" | "unverifiable" | "metadata-mismatch" | "not-found-in-databases";
313
+ evidence: "unverifiable" | "exists-metadata-match" | "exists-metadata-mismatch" | "absent";
314
+ checkedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
315
+ notCheckedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
316
+ checks: {
317
+ source: "crossref" | "openalex" | "openlibrary";
318
+ result: "error" | "no-doi" | "found" | "not-found" | "metadata-mismatch";
319
+ evidence?: unknown;
320
+ }[];
321
+ }>>;
322
+ /** Layer 1 canonical-edition findings (differentiated layer). Null when not run. */
323
+ canonical: z.ZodNullable<z.ZodObject<{
324
+ status: z.ZodEnum<["verified-canonical", "wrong-host", "dead-url", "live-url-not-archived-snapshot", "no-url-on-pre-doi-entry", "not-applicable"]>;
325
+ url: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
326
+ /** Redirect chain, in order, if HEAD followed redirects. */
327
+ redirectChain: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
328
+ }, "strip", z.ZodTypeAny, {
329
+ status: "dead-url" | "wrong-host" | "not-applicable" | "verified-canonical" | "live-url-not-archived-snapshot" | "no-url-on-pre-doi-entry";
330
+ url: string | null;
331
+ redirectChain?: string[] | undefined;
332
+ }, {
333
+ status: "dead-url" | "wrong-host" | "not-applicable" | "verified-canonical" | "live-url-not-archived-snapshot" | "no-url-on-pre-doi-entry";
334
+ url: string | null;
335
+ redirectChain?: string[] | undefined;
336
+ }>>;
337
+ }, "strip", z.ZodTypeAny, {
338
+ citekey: string;
339
+ existence: {
340
+ error: string | null;
341
+ status: "verified" | "unverifiable" | "metadata-mismatch" | "not-found-in-databases";
342
+ evidence: "unverifiable" | "exists-metadata-match" | "exists-metadata-mismatch" | "absent";
343
+ checkedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
344
+ notCheckedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
345
+ checks: {
346
+ source: "crossref" | "openalex" | "openlibrary";
347
+ result: "error" | "no-doi" | "found" | "not-found" | "metadata-mismatch";
348
+ evidence?: unknown;
349
+ }[];
350
+ } | null;
351
+ identifiers: {
352
+ doi: "ok" | "malformed" | "bad-checksum" | "not-applicable";
353
+ isbn: "ok" | "malformed" | "bad-checksum" | "not-applicable";
354
+ url: "ok" | "malformed" | "bad-checksum" | "not-applicable";
355
+ } | null;
356
+ canonical: {
357
+ status: "dead-url" | "wrong-host" | "not-applicable" | "verified-canonical" | "live-url-not-archived-snapshot" | "no-url-on-pre-doi-entry";
358
+ url: string | null;
359
+ redirectChain?: string[] | undefined;
360
+ } | null;
361
+ }, {
362
+ citekey: string;
363
+ existence: {
364
+ error: string | null;
365
+ status: "verified" | "unverifiable" | "metadata-mismatch" | "not-found-in-databases";
366
+ evidence: "unverifiable" | "exists-metadata-match" | "exists-metadata-mismatch" | "absent";
367
+ checkedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
368
+ notCheckedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
369
+ checks: {
370
+ source: "crossref" | "openalex" | "openlibrary";
371
+ result: "error" | "no-doi" | "found" | "not-found" | "metadata-mismatch";
372
+ evidence?: unknown;
373
+ }[];
374
+ } | null;
375
+ identifiers: {
376
+ doi: "ok" | "malformed" | "bad-checksum" | "not-applicable";
377
+ isbn: "ok" | "malformed" | "bad-checksum" | "not-applicable";
378
+ url: "ok" | "malformed" | "bad-checksum" | "not-applicable";
379
+ } | null;
380
+ canonical: {
381
+ status: "dead-url" | "wrong-host" | "not-applicable" | "verified-canonical" | "live-url-not-archived-snapshot" | "no-url-on-pre-doi-entry";
382
+ url: string | null;
383
+ redirectChain?: string[] | undefined;
384
+ } | null;
385
+ }>;
386
+ export type Entry = z.infer<typeof EntrySchema>;
387
+ /**
388
+ * 'resolved' — citekey appears in prose AND in the bibliography.
389
+ * 'unresolved' — citekey appears in prose but NOT in the bibliography (gates).
390
+ * 'orphan' — citekey appears in the bibliography but is NOT referenced in
391
+ * any prose doc (reverse linkage). INFORMATIONAL; never gates.
392
+ * NEW in 0.3.0.
393
+ */
394
+ export declare const LinkageStatusSchema: z.ZodEnum<["resolved", "unresolved", "orphan"]>;
395
+ export type LinkageStatus = z.infer<typeof LinkageStatusSchema>;
396
+ export declare const LinkageReferenceSchema: z.ZodObject<{
397
+ file: z.ZodString;
398
+ line: z.ZodNumber;
399
+ /** Citation locator, e.g. 'p. 42', 'pp. 33-35'. NEW in 0.2.0 (T25 populates). */
400
+ locator: z.ZodOptional<z.ZodNullable<z.ZodString>>;
401
+ /** True when the citation suppressed the author, e.g. '-@key'. NEW in 0.2.0 (T25). */
402
+ authorSuppressed: z.ZodOptional<z.ZodBoolean>;
403
+ }, "strip", z.ZodTypeAny, {
404
+ file: string;
405
+ line: number;
406
+ locator?: string | null | undefined;
407
+ authorSuppressed?: boolean | undefined;
408
+ }, {
409
+ file: string;
410
+ line: number;
411
+ locator?: string | null | undefined;
412
+ authorSuppressed?: boolean | undefined;
413
+ }>;
414
+ export type LinkageReference = z.infer<typeof LinkageReferenceSchema>;
415
+ export declare const LinkageEntrySchema: z.ZodObject<{
416
+ citekey: z.ZodString;
417
+ status: z.ZodEnum<["resolved", "unresolved", "orphan"]>;
418
+ references: z.ZodArray<z.ZodObject<{
419
+ file: z.ZodString;
420
+ line: z.ZodNumber;
421
+ /** Citation locator, e.g. 'p. 42', 'pp. 33-35'. NEW in 0.2.0 (T25 populates). */
422
+ locator: z.ZodOptional<z.ZodNullable<z.ZodString>>;
423
+ /** True when the citation suppressed the author, e.g. '-@key'. NEW in 0.2.0 (T25). */
424
+ authorSuppressed: z.ZodOptional<z.ZodBoolean>;
425
+ }, "strip", z.ZodTypeAny, {
426
+ file: string;
427
+ line: number;
428
+ locator?: string | null | undefined;
429
+ authorSuppressed?: boolean | undefined;
430
+ }, {
431
+ file: string;
432
+ line: number;
433
+ locator?: string | null | undefined;
434
+ authorSuppressed?: boolean | undefined;
435
+ }>, "many">;
436
+ }, "strip", z.ZodTypeAny, {
437
+ status: "resolved" | "unresolved" | "orphan";
438
+ citekey: string;
439
+ references: {
440
+ file: string;
441
+ line: number;
442
+ locator?: string | null | undefined;
443
+ authorSuppressed?: boolean | undefined;
444
+ }[];
445
+ }, {
446
+ status: "resolved" | "unresolved" | "orphan";
447
+ citekey: string;
448
+ references: {
449
+ file: string;
450
+ line: number;
451
+ locator?: string | null | undefined;
452
+ authorSuppressed?: boolean | undefined;
453
+ }[];
454
+ }>;
455
+ export type LinkageEntry = z.infer<typeof LinkageEntrySchema>;
456
+ export declare const PhraseFlagStatusSchema: z.ZodEnum<["flagged", "acknowledged"]>;
457
+ export type PhraseFlagStatus = z.infer<typeof PhraseFlagStatusSchema>;
458
+ export declare const PhraseFlagSchema: z.ZodObject<{
459
+ status: z.ZodEnum<["flagged", "acknowledged"]>;
460
+ /** Stable key naming the denylist pattern that matched. */
461
+ patternKey: z.ZodString;
462
+ /** Optional project-supplied URL — typically a doc explaining why this phrase is denylisted. */
463
+ referenceUrl: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
464
+ file: z.ZodString;
465
+ line: z.ZodNumber;
466
+ /** The substring of the prose that matched the pattern. */
467
+ matchedText: z.ZodString;
468
+ }, "strip", z.ZodTypeAny, {
469
+ status: "flagged" | "acknowledged";
470
+ file: string;
471
+ line: number;
472
+ patternKey: string;
473
+ referenceUrl: string | null;
474
+ matchedText: string;
475
+ }, {
476
+ status: "flagged" | "acknowledged";
477
+ file: string;
478
+ line: number;
479
+ patternKey: string;
480
+ referenceUrl: string | null;
481
+ matchedText: string;
482
+ }>;
483
+ export type PhraseFlag = z.infer<typeof PhraseFlagSchema>;
484
+ export declare const WorklistItemTypeSchema: z.ZodEnum<["direct-quotation", "paraphrase-with-page-ref", "contested-source-type", "non-canonical-edition"]>;
485
+ export type WorklistItemType = z.infer<typeof WorklistItemTypeSchema>;
486
+ export declare const WorklistItemSchema: z.ZodObject<{
487
+ type: z.ZodEnum<["direct-quotation", "paraphrase-with-page-ref", "contested-source-type", "non-canonical-edition"]>;
488
+ file: z.ZodString;
489
+ line: z.ZodNumber;
490
+ /** The citation invocation in the prose, e.g., `@mill1859onliberty`. */
491
+ citation: z.ZodString;
492
+ /** Excerpt of prose around the citation, for context. */
493
+ snippet: z.ZodString;
494
+ /** Pre-filled URL the human can use to perform the manual check. */
495
+ verificationUrl: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
496
+ /** Human-readable description of what the manual check should establish. */
497
+ recommendedAction: z.ZodString;
498
+ /** Citation locator, e.g. 'p. 42', 'pp. 33-35'. NEW in 0.2.0 (T25 populates). */
499
+ locator: z.ZodOptional<z.ZodNullable<z.ZodString>>;
500
+ }, "strip", z.ZodTypeAny, {
501
+ type: "direct-quotation" | "paraphrase-with-page-ref" | "contested-source-type" | "non-canonical-edition";
502
+ file: string;
503
+ line: number;
504
+ citation: string;
505
+ snippet: string;
506
+ verificationUrl: string | null;
507
+ recommendedAction: string;
508
+ locator?: string | null | undefined;
509
+ }, {
510
+ type: "direct-quotation" | "paraphrase-with-page-ref" | "contested-source-type" | "non-canonical-edition";
511
+ file: string;
512
+ line: number;
513
+ citation: string;
514
+ snippet: string;
515
+ verificationUrl: string | null;
516
+ recommendedAction: string;
517
+ locator?: string | null | undefined;
518
+ }>;
519
+ export type WorklistItem = z.infer<typeof WorklistItemSchema>;
520
+ export declare const OutputSchema: z.ZodEffects<z.ZodObject<{
521
+ schemaVersion: z.ZodString;
522
+ tool: z.ZodObject<{
523
+ name: z.ZodLiteral<"bibcheck">;
524
+ version: z.ZodString;
525
+ }, "strip", z.ZodTypeAny, {
526
+ version: string;
527
+ name: "bibcheck";
528
+ }, {
529
+ version: string;
530
+ name: "bibcheck";
531
+ }>;
532
+ summary: z.ZodObject<{
533
+ totalEntries: z.ZodNumber;
534
+ verified: z.ZodNumber;
535
+ metadataMismatches: z.ZodNumber;
536
+ /**
537
+ * Entries confirmed absent from every applicable database (a fabrication
538
+ * signal; gates by default per Q1). NEW in 0.2.0.
539
+ */
540
+ notFoundInDatabases: z.ZodNumber;
541
+ /**
542
+ * Entries with at least one malformed/bad-checksum identifier in the
543
+ * `identifiers` layer (a cheap fabrication signal; gates by default). NEW
544
+ * in 0.2.0.
545
+ */
546
+ malformedIdentifiers: z.ZodNumber;
547
+ unverifiable: z.ZodNumber;
548
+ canonicalIssues: z.ZodNumber;
549
+ linkageFailures: z.ZodNumber;
550
+ phraseFlags: z.ZodNumber;
551
+ worklistItems: z.ZodNumber;
552
+ /**
553
+ * Bibliography entries whose citekey is never referenced in any markdown doc
554
+ * (reverse linkage; the inverse of `linkageFailures`). INFORMATIONAL — an
555
+ * uncited entry is a smell (e.g. an LLM-padded reference list), not proof of
556
+ * fabrication, so it does NOT gate `bibcheck check`. OPTIONAL so the counter
557
+ * is additive: Output builders predating 0.3.0 that omit it stay valid. NEW
558
+ * in 0.3.0.
559
+ */
560
+ orphanedEntries: z.ZodOptional<z.ZodNumber>;
561
+ }, "strip", z.ZodTypeAny, {
562
+ totalEntries: number;
563
+ verified: number;
564
+ metadataMismatches: number;
565
+ notFoundInDatabases: number;
566
+ malformedIdentifiers: number;
567
+ unverifiable: number;
568
+ canonicalIssues: number;
569
+ linkageFailures: number;
570
+ phraseFlags: number;
571
+ worklistItems: number;
572
+ orphanedEntries?: number | undefined;
573
+ }, {
574
+ totalEntries: number;
575
+ verified: number;
576
+ metadataMismatches: number;
577
+ notFoundInDatabases: number;
578
+ malformedIdentifiers: number;
579
+ unverifiable: number;
580
+ canonicalIssues: number;
581
+ linkageFailures: number;
582
+ phraseFlags: number;
583
+ worklistItems: number;
584
+ orphanedEntries?: number | undefined;
585
+ }>;
586
+ entries: z.ZodArray<z.ZodObject<{
587
+ citekey: z.ZodString;
588
+ /**
589
+ * Layer 0 local identifier well-formedness (pre-network). Null when not run.
590
+ * NEW in 0.2.0 (Q5 / T21).
591
+ */
592
+ identifiers: z.ZodNullable<z.ZodObject<{
593
+ /** 'malformed' if the DOI fails `^10\.\d{4,}/\S+$`. */
594
+ doi: z.ZodEnum<["ok", "malformed", "bad-checksum", "not-applicable"]>;
595
+ /** 'bad-checksum' for a failed ISBN-10/13 check digit; 'malformed' for bad shape. */
596
+ isbn: z.ZodEnum<["ok", "malformed", "bad-checksum", "not-applicable"]>;
597
+ /** 'malformed' if the URL is not a well-formed http/https URL. */
598
+ url: z.ZodEnum<["ok", "malformed", "bad-checksum", "not-applicable"]>;
599
+ }, "strip", z.ZodTypeAny, {
600
+ doi: "ok" | "malformed" | "bad-checksum" | "not-applicable";
601
+ isbn: "ok" | "malformed" | "bad-checksum" | "not-applicable";
602
+ url: "ok" | "malformed" | "bad-checksum" | "not-applicable";
603
+ }, {
604
+ doi: "ok" | "malformed" | "bad-checksum" | "not-applicable";
605
+ isbn: "ok" | "malformed" | "bad-checksum" | "not-applicable";
606
+ url: "ok" | "malformed" | "bad-checksum" | "not-applicable";
607
+ }>>;
608
+ /** Layer 1 existence findings (commodity layer). Null when not run. */
609
+ existence: z.ZodNullable<z.ZodObject<{
610
+ status: z.ZodEnum<["verified", "metadata-mismatch", "not-found-in-databases", "unverifiable"]>;
611
+ /** Defined evidence vocabulary (Q2). NEW in 0.2.0. */
612
+ evidence: z.ZodEnum<["exists-metadata-match", "exists-metadata-mismatch", "absent", "unverifiable"]>;
613
+ /** Dimensions that were checked, e.g. ['existence','metadata']. NEW in 0.2.0. */
614
+ checkedFor: z.ZodArray<z.ZodEnum<["existence", "metadata", "canonical-url", "claim-support"]>, "many">;
615
+ /**
616
+ * Dimensions that were NOT checked. Always includes 'claim-support' for
617
+ * v0.1 (bibcheck never verifies whether the source supports the prose's
618
+ * claim; that is the manual worklist's job). NEW in 0.2.0.
619
+ */
620
+ notCheckedFor: z.ZodArray<z.ZodEnum<["existence", "metadata", "canonical-url", "claim-support"]>, "many">;
621
+ checks: z.ZodArray<z.ZodObject<{
622
+ source: z.ZodEnum<["crossref", "openalex", "openlibrary"]>;
623
+ result: z.ZodEnum<["no-doi", "found", "not-found", "metadata-mismatch", "error"]>;
624
+ /** Source-specific evidence. Shape varies per source; not strictly typed. */
625
+ evidence: z.ZodNullable<z.ZodUnknown>;
626
+ }, "strip", z.ZodTypeAny, {
627
+ source: "crossref" | "openalex" | "openlibrary";
628
+ result: "error" | "no-doi" | "found" | "not-found" | "metadata-mismatch";
629
+ evidence?: unknown;
630
+ }, {
631
+ source: "crossref" | "openalex" | "openlibrary";
632
+ result: "error" | "no-doi" | "found" | "not-found" | "metadata-mismatch";
633
+ evidence?: unknown;
634
+ }>, "many">;
635
+ /**
636
+ * Set when the layer crashed (vs. a clean unverifiable result), so consumers
637
+ * can distinguish "we ran and found nothing applicable" from "we failed to
638
+ * run." NEW in 0.2.0 (also addresses S1). Null when the layer ran cleanly.
639
+ */
640
+ error: z.ZodNullable<z.ZodString>;
641
+ }, "strip", z.ZodTypeAny, {
642
+ error: string | null;
643
+ status: "verified" | "unverifiable" | "metadata-mismatch" | "not-found-in-databases";
644
+ evidence: "unverifiable" | "exists-metadata-match" | "exists-metadata-mismatch" | "absent";
645
+ checkedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
646
+ notCheckedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
647
+ checks: {
648
+ source: "crossref" | "openalex" | "openlibrary";
649
+ result: "error" | "no-doi" | "found" | "not-found" | "metadata-mismatch";
650
+ evidence?: unknown;
651
+ }[];
652
+ }, {
653
+ error: string | null;
654
+ status: "verified" | "unverifiable" | "metadata-mismatch" | "not-found-in-databases";
655
+ evidence: "unverifiable" | "exists-metadata-match" | "exists-metadata-mismatch" | "absent";
656
+ checkedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
657
+ notCheckedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
658
+ checks: {
659
+ source: "crossref" | "openalex" | "openlibrary";
660
+ result: "error" | "no-doi" | "found" | "not-found" | "metadata-mismatch";
661
+ evidence?: unknown;
662
+ }[];
663
+ }>>;
664
+ /** Layer 1 canonical-edition findings (differentiated layer). Null when not run. */
665
+ canonical: z.ZodNullable<z.ZodObject<{
666
+ status: z.ZodEnum<["verified-canonical", "wrong-host", "dead-url", "live-url-not-archived-snapshot", "no-url-on-pre-doi-entry", "not-applicable"]>;
667
+ url: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
668
+ /** Redirect chain, in order, if HEAD followed redirects. */
669
+ redirectChain: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
670
+ }, "strip", z.ZodTypeAny, {
671
+ status: "dead-url" | "wrong-host" | "not-applicable" | "verified-canonical" | "live-url-not-archived-snapshot" | "no-url-on-pre-doi-entry";
672
+ url: string | null;
673
+ redirectChain?: string[] | undefined;
674
+ }, {
675
+ status: "dead-url" | "wrong-host" | "not-applicable" | "verified-canonical" | "live-url-not-archived-snapshot" | "no-url-on-pre-doi-entry";
676
+ url: string | null;
677
+ redirectChain?: string[] | undefined;
678
+ }>>;
679
+ }, "strip", z.ZodTypeAny, {
680
+ citekey: string;
681
+ existence: {
682
+ error: string | null;
683
+ status: "verified" | "unverifiable" | "metadata-mismatch" | "not-found-in-databases";
684
+ evidence: "unverifiable" | "exists-metadata-match" | "exists-metadata-mismatch" | "absent";
685
+ checkedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
686
+ notCheckedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
687
+ checks: {
688
+ source: "crossref" | "openalex" | "openlibrary";
689
+ result: "error" | "no-doi" | "found" | "not-found" | "metadata-mismatch";
690
+ evidence?: unknown;
691
+ }[];
692
+ } | null;
693
+ identifiers: {
694
+ doi: "ok" | "malformed" | "bad-checksum" | "not-applicable";
695
+ isbn: "ok" | "malformed" | "bad-checksum" | "not-applicable";
696
+ url: "ok" | "malformed" | "bad-checksum" | "not-applicable";
697
+ } | null;
698
+ canonical: {
699
+ status: "dead-url" | "wrong-host" | "not-applicable" | "verified-canonical" | "live-url-not-archived-snapshot" | "no-url-on-pre-doi-entry";
700
+ url: string | null;
701
+ redirectChain?: string[] | undefined;
702
+ } | null;
703
+ }, {
704
+ citekey: string;
705
+ existence: {
706
+ error: string | null;
707
+ status: "verified" | "unverifiable" | "metadata-mismatch" | "not-found-in-databases";
708
+ evidence: "unverifiable" | "exists-metadata-match" | "exists-metadata-mismatch" | "absent";
709
+ checkedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
710
+ notCheckedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
711
+ checks: {
712
+ source: "crossref" | "openalex" | "openlibrary";
713
+ result: "error" | "no-doi" | "found" | "not-found" | "metadata-mismatch";
714
+ evidence?: unknown;
715
+ }[];
716
+ } | null;
717
+ identifiers: {
718
+ doi: "ok" | "malformed" | "bad-checksum" | "not-applicable";
719
+ isbn: "ok" | "malformed" | "bad-checksum" | "not-applicable";
720
+ url: "ok" | "malformed" | "bad-checksum" | "not-applicable";
721
+ } | null;
722
+ canonical: {
723
+ status: "dead-url" | "wrong-host" | "not-applicable" | "verified-canonical" | "live-url-not-archived-snapshot" | "no-url-on-pre-doi-entry";
724
+ url: string | null;
725
+ redirectChain?: string[] | undefined;
726
+ } | null;
727
+ }>, "many">;
728
+ linkage: z.ZodArray<z.ZodObject<{
729
+ citekey: z.ZodString;
730
+ status: z.ZodEnum<["resolved", "unresolved", "orphan"]>;
731
+ references: z.ZodArray<z.ZodObject<{
732
+ file: z.ZodString;
733
+ line: z.ZodNumber;
734
+ /** Citation locator, e.g. 'p. 42', 'pp. 33-35'. NEW in 0.2.0 (T25 populates). */
735
+ locator: z.ZodOptional<z.ZodNullable<z.ZodString>>;
736
+ /** True when the citation suppressed the author, e.g. '-@key'. NEW in 0.2.0 (T25). */
737
+ authorSuppressed: z.ZodOptional<z.ZodBoolean>;
738
+ }, "strip", z.ZodTypeAny, {
739
+ file: string;
740
+ line: number;
741
+ locator?: string | null | undefined;
742
+ authorSuppressed?: boolean | undefined;
743
+ }, {
744
+ file: string;
745
+ line: number;
746
+ locator?: string | null | undefined;
747
+ authorSuppressed?: boolean | undefined;
748
+ }>, "many">;
749
+ }, "strip", z.ZodTypeAny, {
750
+ status: "resolved" | "unresolved" | "orphan";
751
+ citekey: string;
752
+ references: {
753
+ file: string;
754
+ line: number;
755
+ locator?: string | null | undefined;
756
+ authorSuppressed?: boolean | undefined;
757
+ }[];
758
+ }, {
759
+ status: "resolved" | "unresolved" | "orphan";
760
+ citekey: string;
761
+ references: {
762
+ file: string;
763
+ line: number;
764
+ locator?: string | null | undefined;
765
+ authorSuppressed?: boolean | undefined;
766
+ }[];
767
+ }>, "many">;
768
+ phraseFlags: z.ZodArray<z.ZodObject<{
769
+ status: z.ZodEnum<["flagged", "acknowledged"]>;
770
+ /** Stable key naming the denylist pattern that matched. */
771
+ patternKey: z.ZodString;
772
+ /** Optional project-supplied URL — typically a doc explaining why this phrase is denylisted. */
773
+ referenceUrl: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
774
+ file: z.ZodString;
775
+ line: z.ZodNumber;
776
+ /** The substring of the prose that matched the pattern. */
777
+ matchedText: z.ZodString;
778
+ }, "strip", z.ZodTypeAny, {
779
+ status: "flagged" | "acknowledged";
780
+ file: string;
781
+ line: number;
782
+ patternKey: string;
783
+ referenceUrl: string | null;
784
+ matchedText: string;
785
+ }, {
786
+ status: "flagged" | "acknowledged";
787
+ file: string;
788
+ line: number;
789
+ patternKey: string;
790
+ referenceUrl: string | null;
791
+ matchedText: string;
792
+ }>, "many">;
793
+ worklist: z.ZodArray<z.ZodObject<{
794
+ type: z.ZodEnum<["direct-quotation", "paraphrase-with-page-ref", "contested-source-type", "non-canonical-edition"]>;
795
+ file: z.ZodString;
796
+ line: z.ZodNumber;
797
+ /** The citation invocation in the prose, e.g., `@mill1859onliberty`. */
798
+ citation: z.ZodString;
799
+ /** Excerpt of prose around the citation, for context. */
800
+ snippet: z.ZodString;
801
+ /** Pre-filled URL the human can use to perform the manual check. */
802
+ verificationUrl: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
803
+ /** Human-readable description of what the manual check should establish. */
804
+ recommendedAction: z.ZodString;
805
+ /** Citation locator, e.g. 'p. 42', 'pp. 33-35'. NEW in 0.2.0 (T25 populates). */
806
+ locator: z.ZodOptional<z.ZodNullable<z.ZodString>>;
807
+ }, "strip", z.ZodTypeAny, {
808
+ type: "direct-quotation" | "paraphrase-with-page-ref" | "contested-source-type" | "non-canonical-edition";
809
+ file: string;
810
+ line: number;
811
+ citation: string;
812
+ snippet: string;
813
+ verificationUrl: string | null;
814
+ recommendedAction: string;
815
+ locator?: string | null | undefined;
816
+ }, {
817
+ type: "direct-quotation" | "paraphrase-with-page-ref" | "contested-source-type" | "non-canonical-edition";
818
+ file: string;
819
+ line: number;
820
+ citation: string;
821
+ snippet: string;
822
+ verificationUrl: string | null;
823
+ recommendedAction: string;
824
+ locator?: string | null | undefined;
825
+ }>, "many">;
826
+ }, "strip", z.ZodTypeAny, {
827
+ entries: {
828
+ citekey: string;
829
+ existence: {
830
+ error: string | null;
831
+ status: "verified" | "unverifiable" | "metadata-mismatch" | "not-found-in-databases";
832
+ evidence: "unverifiable" | "exists-metadata-match" | "exists-metadata-mismatch" | "absent";
833
+ checkedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
834
+ notCheckedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
835
+ checks: {
836
+ source: "crossref" | "openalex" | "openlibrary";
837
+ result: "error" | "no-doi" | "found" | "not-found" | "metadata-mismatch";
838
+ evidence?: unknown;
839
+ }[];
840
+ } | null;
841
+ identifiers: {
842
+ doi: "ok" | "malformed" | "bad-checksum" | "not-applicable";
843
+ isbn: "ok" | "malformed" | "bad-checksum" | "not-applicable";
844
+ url: "ok" | "malformed" | "bad-checksum" | "not-applicable";
845
+ } | null;
846
+ canonical: {
847
+ status: "dead-url" | "wrong-host" | "not-applicable" | "verified-canonical" | "live-url-not-archived-snapshot" | "no-url-on-pre-doi-entry";
848
+ url: string | null;
849
+ redirectChain?: string[] | undefined;
850
+ } | null;
851
+ }[];
852
+ phraseFlags: {
853
+ status: "flagged" | "acknowledged";
854
+ file: string;
855
+ line: number;
856
+ patternKey: string;
857
+ referenceUrl: string | null;
858
+ matchedText: string;
859
+ }[];
860
+ schemaVersion: string;
861
+ tool: {
862
+ version: string;
863
+ name: "bibcheck";
864
+ };
865
+ summary: {
866
+ totalEntries: number;
867
+ verified: number;
868
+ metadataMismatches: number;
869
+ notFoundInDatabases: number;
870
+ malformedIdentifiers: number;
871
+ unverifiable: number;
872
+ canonicalIssues: number;
873
+ linkageFailures: number;
874
+ phraseFlags: number;
875
+ worklistItems: number;
876
+ orphanedEntries?: number | undefined;
877
+ };
878
+ linkage: {
879
+ status: "resolved" | "unresolved" | "orphan";
880
+ citekey: string;
881
+ references: {
882
+ file: string;
883
+ line: number;
884
+ locator?: string | null | undefined;
885
+ authorSuppressed?: boolean | undefined;
886
+ }[];
887
+ }[];
888
+ worklist: {
889
+ type: "direct-quotation" | "paraphrase-with-page-ref" | "contested-source-type" | "non-canonical-edition";
890
+ file: string;
891
+ line: number;
892
+ citation: string;
893
+ snippet: string;
894
+ verificationUrl: string | null;
895
+ recommendedAction: string;
896
+ locator?: string | null | undefined;
897
+ }[];
898
+ }, {
899
+ entries: {
900
+ citekey: string;
901
+ existence: {
902
+ error: string | null;
903
+ status: "verified" | "unverifiable" | "metadata-mismatch" | "not-found-in-databases";
904
+ evidence: "unverifiable" | "exists-metadata-match" | "exists-metadata-mismatch" | "absent";
905
+ checkedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
906
+ notCheckedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
907
+ checks: {
908
+ source: "crossref" | "openalex" | "openlibrary";
909
+ result: "error" | "no-doi" | "found" | "not-found" | "metadata-mismatch";
910
+ evidence?: unknown;
911
+ }[];
912
+ } | null;
913
+ identifiers: {
914
+ doi: "ok" | "malformed" | "bad-checksum" | "not-applicable";
915
+ isbn: "ok" | "malformed" | "bad-checksum" | "not-applicable";
916
+ url: "ok" | "malformed" | "bad-checksum" | "not-applicable";
917
+ } | null;
918
+ canonical: {
919
+ status: "dead-url" | "wrong-host" | "not-applicable" | "verified-canonical" | "live-url-not-archived-snapshot" | "no-url-on-pre-doi-entry";
920
+ url: string | null;
921
+ redirectChain?: string[] | undefined;
922
+ } | null;
923
+ }[];
924
+ phraseFlags: {
925
+ status: "flagged" | "acknowledged";
926
+ file: string;
927
+ line: number;
928
+ patternKey: string;
929
+ referenceUrl: string | null;
930
+ matchedText: string;
931
+ }[];
932
+ schemaVersion: string;
933
+ tool: {
934
+ version: string;
935
+ name: "bibcheck";
936
+ };
937
+ summary: {
938
+ totalEntries: number;
939
+ verified: number;
940
+ metadataMismatches: number;
941
+ notFoundInDatabases: number;
942
+ malformedIdentifiers: number;
943
+ unverifiable: number;
944
+ canonicalIssues: number;
945
+ linkageFailures: number;
946
+ phraseFlags: number;
947
+ worklistItems: number;
948
+ orphanedEntries?: number | undefined;
949
+ };
950
+ linkage: {
951
+ status: "resolved" | "unresolved" | "orphan";
952
+ citekey: string;
953
+ references: {
954
+ file: string;
955
+ line: number;
956
+ locator?: string | null | undefined;
957
+ authorSuppressed?: boolean | undefined;
958
+ }[];
959
+ }[];
960
+ worklist: {
961
+ type: "direct-quotation" | "paraphrase-with-page-ref" | "contested-source-type" | "non-canonical-edition";
962
+ file: string;
963
+ line: number;
964
+ citation: string;
965
+ snippet: string;
966
+ verificationUrl: string | null;
967
+ recommendedAction: string;
968
+ locator?: string | null | undefined;
969
+ }[];
970
+ }>, {
971
+ entries: {
972
+ citekey: string;
973
+ existence: {
974
+ error: string | null;
975
+ status: "verified" | "unverifiable" | "metadata-mismatch" | "not-found-in-databases";
976
+ evidence: "unverifiable" | "exists-metadata-match" | "exists-metadata-mismatch" | "absent";
977
+ checkedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
978
+ notCheckedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
979
+ checks: {
980
+ source: "crossref" | "openalex" | "openlibrary";
981
+ result: "error" | "no-doi" | "found" | "not-found" | "metadata-mismatch";
982
+ evidence?: unknown;
983
+ }[];
984
+ } | null;
985
+ identifiers: {
986
+ doi: "ok" | "malformed" | "bad-checksum" | "not-applicable";
987
+ isbn: "ok" | "malformed" | "bad-checksum" | "not-applicable";
988
+ url: "ok" | "malformed" | "bad-checksum" | "not-applicable";
989
+ } | null;
990
+ canonical: {
991
+ status: "dead-url" | "wrong-host" | "not-applicable" | "verified-canonical" | "live-url-not-archived-snapshot" | "no-url-on-pre-doi-entry";
992
+ url: string | null;
993
+ redirectChain?: string[] | undefined;
994
+ } | null;
995
+ }[];
996
+ phraseFlags: {
997
+ status: "flagged" | "acknowledged";
998
+ file: string;
999
+ line: number;
1000
+ patternKey: string;
1001
+ referenceUrl: string | null;
1002
+ matchedText: string;
1003
+ }[];
1004
+ schemaVersion: string;
1005
+ tool: {
1006
+ version: string;
1007
+ name: "bibcheck";
1008
+ };
1009
+ summary: {
1010
+ totalEntries: number;
1011
+ verified: number;
1012
+ metadataMismatches: number;
1013
+ notFoundInDatabases: number;
1014
+ malformedIdentifiers: number;
1015
+ unverifiable: number;
1016
+ canonicalIssues: number;
1017
+ linkageFailures: number;
1018
+ phraseFlags: number;
1019
+ worklistItems: number;
1020
+ orphanedEntries?: number | undefined;
1021
+ };
1022
+ linkage: {
1023
+ status: "resolved" | "unresolved" | "orphan";
1024
+ citekey: string;
1025
+ references: {
1026
+ file: string;
1027
+ line: number;
1028
+ locator?: string | null | undefined;
1029
+ authorSuppressed?: boolean | undefined;
1030
+ }[];
1031
+ }[];
1032
+ worklist: {
1033
+ type: "direct-quotation" | "paraphrase-with-page-ref" | "contested-source-type" | "non-canonical-edition";
1034
+ file: string;
1035
+ line: number;
1036
+ citation: string;
1037
+ snippet: string;
1038
+ verificationUrl: string | null;
1039
+ recommendedAction: string;
1040
+ locator?: string | null | undefined;
1041
+ }[];
1042
+ }, {
1043
+ entries: {
1044
+ citekey: string;
1045
+ existence: {
1046
+ error: string | null;
1047
+ status: "verified" | "unverifiable" | "metadata-mismatch" | "not-found-in-databases";
1048
+ evidence: "unverifiable" | "exists-metadata-match" | "exists-metadata-mismatch" | "absent";
1049
+ checkedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
1050
+ notCheckedFor: ("existence" | "metadata" | "canonical-url" | "claim-support")[];
1051
+ checks: {
1052
+ source: "crossref" | "openalex" | "openlibrary";
1053
+ result: "error" | "no-doi" | "found" | "not-found" | "metadata-mismatch";
1054
+ evidence?: unknown;
1055
+ }[];
1056
+ } | null;
1057
+ identifiers: {
1058
+ doi: "ok" | "malformed" | "bad-checksum" | "not-applicable";
1059
+ isbn: "ok" | "malformed" | "bad-checksum" | "not-applicable";
1060
+ url: "ok" | "malformed" | "bad-checksum" | "not-applicable";
1061
+ } | null;
1062
+ canonical: {
1063
+ status: "dead-url" | "wrong-host" | "not-applicable" | "verified-canonical" | "live-url-not-archived-snapshot" | "no-url-on-pre-doi-entry";
1064
+ url: string | null;
1065
+ redirectChain?: string[] | undefined;
1066
+ } | null;
1067
+ }[];
1068
+ phraseFlags: {
1069
+ status: "flagged" | "acknowledged";
1070
+ file: string;
1071
+ line: number;
1072
+ patternKey: string;
1073
+ referenceUrl: string | null;
1074
+ matchedText: string;
1075
+ }[];
1076
+ schemaVersion: string;
1077
+ tool: {
1078
+ version: string;
1079
+ name: "bibcheck";
1080
+ };
1081
+ summary: {
1082
+ totalEntries: number;
1083
+ verified: number;
1084
+ metadataMismatches: number;
1085
+ notFoundInDatabases: number;
1086
+ malformedIdentifiers: number;
1087
+ unverifiable: number;
1088
+ canonicalIssues: number;
1089
+ linkageFailures: number;
1090
+ phraseFlags: number;
1091
+ worklistItems: number;
1092
+ orphanedEntries?: number | undefined;
1093
+ };
1094
+ linkage: {
1095
+ status: "resolved" | "unresolved" | "orphan";
1096
+ citekey: string;
1097
+ references: {
1098
+ file: string;
1099
+ line: number;
1100
+ locator?: string | null | undefined;
1101
+ authorSuppressed?: boolean | undefined;
1102
+ }[];
1103
+ }[];
1104
+ worklist: {
1105
+ type: "direct-quotation" | "paraphrase-with-page-ref" | "contested-source-type" | "non-canonical-edition";
1106
+ file: string;
1107
+ line: number;
1108
+ citation: string;
1109
+ snippet: string;
1110
+ verificationUrl: string | null;
1111
+ recommendedAction: string;
1112
+ locator?: string | null | undefined;
1113
+ }[];
1114
+ }>;
1115
+ export type Output = z.infer<typeof OutputSchema>;
1116
+ //# sourceMappingURL=output.d.ts.map