@theglitchking/hit-em-with-the-docs 2.1.1 → 2.3.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 (112) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +5 -0
  4. package/commands/audit-facts.md +25 -0
  5. package/commands/cite.md +17 -0
  6. package/commands/extract-facts.md +66 -0
  7. package/commands/find-citers.md +16 -0
  8. package/commands/help.md +86 -0
  9. package/commands/migrate-incident.md +18 -0
  10. package/dist/action/core/audit/auditor.d.ts +14 -0
  11. package/dist/action/core/audit/auditor.d.ts.map +1 -1
  12. package/dist/action/core/domains/classifier.d.ts +15 -1
  13. package/dist/action/core/domains/classifier.d.ts.map +1 -1
  14. package/dist/action/core/knowledge-base/audit.d.ts +67 -0
  15. package/dist/action/core/knowledge-base/audit.d.ts.map +1 -0
  16. package/dist/action/core/knowledge-base/cite.d.ts +41 -0
  17. package/dist/action/core/knowledge-base/cite.d.ts.map +1 -0
  18. package/dist/action/core/knowledge-base/citers.d.ts +119 -0
  19. package/dist/action/core/knowledge-base/citers.d.ts.map +1 -0
  20. package/dist/action/core/knowledge-base/extract.d.ts +61 -0
  21. package/dist/action/core/knowledge-base/extract.d.ts.map +1 -0
  22. package/dist/action/core/knowledge-base/migrate.d.ts +33 -0
  23. package/dist/action/core/knowledge-base/migrate.d.ts.map +1 -0
  24. package/dist/action/core/maintain/orchestrator.d.ts.map +1 -1
  25. package/dist/action/core/metadata/errors.d.ts +62 -0
  26. package/dist/action/core/metadata/errors.d.ts.map +1 -0
  27. package/dist/action/core/metadata/schema.d.ts +810 -49
  28. package/dist/action/core/metadata/schema.d.ts.map +1 -1
  29. package/dist/action/generators/facts-index.d.ts +27 -0
  30. package/dist/action/generators/facts-index.d.ts.map +1 -0
  31. package/dist/action/generators/incidents-index.d.ts +21 -0
  32. package/dist/action/generators/incidents-index.d.ts.map +1 -0
  33. package/dist/action/generators/symptoms-index.d.ts +20 -0
  34. package/dist/action/generators/symptoms-index.d.ts.map +1 -0
  35. package/dist/action/generators/table.d.ts +8 -0
  36. package/dist/action/generators/table.d.ts.map +1 -0
  37. package/dist/action/index.d.ts +7 -0
  38. package/dist/action/index.d.ts.map +1 -1
  39. package/dist/action/index.js +4 -4
  40. package/dist/action/utils/config.d.ts +99 -0
  41. package/dist/action/utils/config.d.ts.map +1 -0
  42. package/dist/cli/index.js +248 -1
  43. package/dist/cli/index.js.map +1 -1
  44. package/dist/core/audit/auditor.d.ts +14 -0
  45. package/dist/core/audit/auditor.d.ts.map +1 -1
  46. package/dist/core/audit/auditor.js +19 -3
  47. package/dist/core/audit/auditor.js.map +1 -1
  48. package/dist/core/domains/classifier.d.ts +15 -1
  49. package/dist/core/domains/classifier.d.ts.map +1 -1
  50. package/dist/core/domains/classifier.js +100 -1
  51. package/dist/core/domains/classifier.js.map +1 -1
  52. package/dist/core/knowledge-base/audit.d.ts +67 -0
  53. package/dist/core/knowledge-base/audit.d.ts.map +1 -0
  54. package/dist/core/knowledge-base/audit.js +158 -0
  55. package/dist/core/knowledge-base/audit.js.map +1 -0
  56. package/dist/core/knowledge-base/cite.d.ts +41 -0
  57. package/dist/core/knowledge-base/cite.d.ts.map +1 -0
  58. package/dist/core/knowledge-base/cite.js +82 -0
  59. package/dist/core/knowledge-base/cite.js.map +1 -0
  60. package/dist/core/knowledge-base/citers.d.ts +119 -0
  61. package/dist/core/knowledge-base/citers.d.ts.map +1 -0
  62. package/dist/core/knowledge-base/citers.js +249 -0
  63. package/dist/core/knowledge-base/citers.js.map +1 -0
  64. package/dist/core/knowledge-base/extract.d.ts +61 -0
  65. package/dist/core/knowledge-base/extract.d.ts.map +1 -0
  66. package/dist/core/knowledge-base/extract.js +132 -0
  67. package/dist/core/knowledge-base/extract.js.map +1 -0
  68. package/dist/core/knowledge-base/migrate.d.ts +33 -0
  69. package/dist/core/knowledge-base/migrate.d.ts.map +1 -0
  70. package/dist/core/knowledge-base/migrate.js +112 -0
  71. package/dist/core/knowledge-base/migrate.js.map +1 -0
  72. package/dist/core/maintain/orchestrator.d.ts.map +1 -1
  73. package/dist/core/maintain/orchestrator.js +48 -1
  74. package/dist/core/maintain/orchestrator.js.map +1 -1
  75. package/dist/core/metadata/errors.d.ts +62 -0
  76. package/dist/core/metadata/errors.d.ts.map +1 -0
  77. package/dist/core/metadata/errors.js +95 -0
  78. package/dist/core/metadata/errors.js.map +1 -0
  79. package/dist/core/metadata/schema.d.ts +806 -45
  80. package/dist/core/metadata/schema.d.ts.map +1 -1
  81. package/dist/core/metadata/schema.js +472 -42
  82. package/dist/core/metadata/schema.js.map +1 -1
  83. package/dist/generators/facts-index.d.ts +27 -0
  84. package/dist/generators/facts-index.d.ts.map +1 -0
  85. package/dist/generators/facts-index.js +111 -0
  86. package/dist/generators/facts-index.js.map +1 -0
  87. package/dist/generators/incidents-index.d.ts +21 -0
  88. package/dist/generators/incidents-index.d.ts.map +1 -0
  89. package/dist/generators/incidents-index.js +79 -0
  90. package/dist/generators/incidents-index.js.map +1 -0
  91. package/dist/generators/symptoms-index.d.ts +20 -0
  92. package/dist/generators/symptoms-index.d.ts.map +1 -0
  93. package/dist/generators/symptoms-index.js +123 -0
  94. package/dist/generators/symptoms-index.js.map +1 -0
  95. package/dist/generators/table.d.ts +8 -0
  96. package/dist/generators/table.d.ts.map +1 -0
  97. package/dist/generators/table.js +23 -0
  98. package/dist/generators/table.js.map +1 -0
  99. package/dist/index.d.ts +7 -0
  100. package/dist/index.d.ts.map +1 -1
  101. package/dist/index.js +8 -0
  102. package/dist/index.js.map +1 -1
  103. package/dist/utils/config.d.ts +99 -0
  104. package/dist/utils/config.d.ts.map +1 -0
  105. package/dist/utils/config.js +95 -0
  106. package/dist/utils/config.js.map +1 -0
  107. package/package.json +1 -1
  108. package/templates/knowledge-base/README.md +31 -0
  109. package/templates/knowledge-base/fact.template.md +44 -0
  110. package/templates/knowledge-base/incident-facts.template.md +31 -0
  111. package/templates/knowledge-base/incident-narrative.template.md +50 -0
  112. package/templates/knowledge-base/playbook-symptoms.template.md +74 -0
@@ -1,17 +1,36 @@
1
1
  import { z } from 'zod';
2
+ import { LIFECYCLE_TRACKED_TIERS, isLifecycleTrackedTier, type Tier } from '../domains/classifier.js';
3
+ import { type KbErrorCode } from './errors.js';
4
+ declare const DOC_STATUS_VALUES: readonly ["draft", "active", "deprecated", "archived"];
5
+ declare const FACT_CONFIDENCE_VALUES: readonly ["high", "medium", "low", "hypothesis"];
6
+ declare const INCIDENT_SEVERITY_VALUES: readonly ["low", "medium", "high", "critical"];
7
+ declare const INCIDENT_RESOLUTION_VALUES: readonly ["resolved", "partial", "open", "planned"];
8
+ declare const KEBAB_SLUG_RE: RegExp;
9
+ declare const INCIDENT_ID_RE: RegExp;
2
10
  /**
3
- * Complete 22-field metadata schema
11
+ * Complete metadata schema with all conditional refinements applied.
12
+ *
13
+ * Required fields by tier:
14
+ * - Non-lifecycle-tracked (guide/standard/example/reference/admin):
15
+ * title, tier, domains, status (enum), last_updated, version
16
+ * - plan: title, tier, domains, status, last_updated (no version)
17
+ * - fact: title, tier, domains, status, last_updated, id, confidence,
18
+ * last_verified, provenance (no version)
19
+ * - incident-narrative: title, tier, domains, status, last_updated,
20
+ * id, date, severity, resolution_status, components (no version)
21
+ * - incident-facts: title, tier, domains, status, last_updated,
22
+ * incident_id, produced (no version)
4
23
  */
5
- export declare const MetadataSchema: z.ZodObject<{
24
+ export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
6
25
  title: z.ZodString;
7
- tier: z.ZodEnum<["standard" | "guide" | "admin" | "example" | "reference", ...("standard" | "guide" | "admin" | "example" | "reference")[]]>;
26
+ tier: z.ZodEnum<["standard" | "guide" | "admin" | "plan" | "example" | "reference" | "fact" | "incident-narrative" | "incident-facts", ...("standard" | "guide" | "admin" | "plan" | "example" | "reference" | "fact" | "incident-narrative" | "incident-facts")[]]>;
8
27
  domains: z.ZodArray<z.ZodString, "many">;
9
28
  audience: z.ZodDefault<z.ZodArray<z.ZodEnum<["all", "developers", "devops", "admin"]>, "many">>;
10
29
  tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
11
30
  } & {
12
- status: z.ZodEnum<["draft", "active", "deprecated", "archived"]>;
13
- last_updated: z.ZodString;
14
- version: z.ZodString;
31
+ status: z.ZodString;
32
+ last_updated: z.ZodEffects<z.ZodString, string, unknown>;
33
+ version: z.ZodOptional<z.ZodString>;
15
34
  } & {
16
35
  purpose: z.ZodOptional<z.ZodString>;
17
36
  related_docs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -27,17 +46,71 @@ export declare const MetadataSchema: z.ZodObject<{
27
46
  } & {
28
47
  estimated_read_time: z.ZodOptional<z.ZodString>;
29
48
  word_count: z.ZodOptional<z.ZodNumber>;
30
- last_validated: z.ZodOptional<z.ZodString>;
49
+ last_validated: z.ZodOptional<z.ZodEffects<z.ZodString, string, unknown>>;
31
50
  backlinks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
51
+ } & {
52
+ id: z.ZodOptional<z.ZodString>;
53
+ confidence: z.ZodOptional<z.ZodString>;
54
+ last_verified: z.ZodOptional<z.ZodEffects<z.ZodString, string, unknown>>;
55
+ verify_command: z.ZodOptional<z.ZodString>;
56
+ provenance: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
57
+ sources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
58
+ invalidated_by: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
59
+ working_dir: z.ZodOptional<z.ZodString>;
60
+ date: z.ZodOptional<z.ZodEffects<z.ZodString, string, unknown>>;
61
+ severity: z.ZodOptional<z.ZodString>;
62
+ resolution_status: z.ZodOptional<z.ZodString>;
63
+ components: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
64
+ incident_id: z.ZodOptional<z.ZodString>;
65
+ produced: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
66
+ strengthened: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
67
+ weakened: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
68
+ symptoms: z.ZodOptional<z.ZodArray<z.ZodObject<{
69
+ alert_name: z.ZodOptional<z.ZodString>;
70
+ user_phrase: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
71
+ error_pattern: z.ZodOptional<z.ZodString>;
72
+ severity: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
73
+ target: z.ZodOptional<z.ZodString>;
74
+ cites: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
75
+ }, "strip", z.ZodTypeAny, {
76
+ severity?: "high" | "medium" | "low" | "critical" | undefined;
77
+ alert_name?: string | undefined;
78
+ user_phrase?: string | string[] | undefined;
79
+ error_pattern?: string | undefined;
80
+ target?: string | undefined;
81
+ cites?: string[] | undefined;
82
+ }, {
83
+ severity?: "high" | "medium" | "low" | "critical" | undefined;
84
+ alert_name?: string | undefined;
85
+ user_phrase?: string | string[] | undefined;
86
+ error_pattern?: string | undefined;
87
+ target?: string | undefined;
88
+ cites?: string[] | undefined;
89
+ }>, "many">>;
32
90
  }, "strip", z.ZodTypeAny, {
33
91
  domains: string[];
34
92
  title: string;
35
- tier: "standard" | "guide" | "admin" | "example" | "reference";
36
- status: "draft" | "active" | "deprecated" | "archived";
93
+ tier: "standard" | "guide" | "admin" | "plan" | "example" | "reference" | "fact" | "incident-narrative" | "incident-facts";
94
+ status: string;
37
95
  audience: ("devops" | "admin" | "all" | "developers")[];
38
96
  tags: string[];
39
97
  last_updated: string;
40
- version: string;
98
+ confidence?: string | undefined;
99
+ provenance?: string[] | undefined;
100
+ severity?: string | undefined;
101
+ symptoms?: {
102
+ severity?: "high" | "medium" | "low" | "critical" | undefined;
103
+ alert_name?: string | undefined;
104
+ user_phrase?: string | string[] | undefined;
105
+ error_pattern?: string | undefined;
106
+ target?: string | undefined;
107
+ cites?: string[] | undefined;
108
+ }[] | undefined;
109
+ produced?: string[] | undefined;
110
+ strengthened?: string[] | undefined;
111
+ weakened?: string[] | undefined;
112
+ date?: string | undefined;
113
+ version?: string | undefined;
41
114
  purpose?: string | undefined;
42
115
  related_docs?: string[] | undefined;
43
116
  load_priority?: number | undefined;
@@ -51,15 +124,177 @@ export declare const MetadataSchema: z.ZodObject<{
51
124
  word_count?: number | undefined;
52
125
  last_validated?: string | undefined;
53
126
  backlinks?: string[] | undefined;
127
+ id?: string | undefined;
128
+ last_verified?: string | undefined;
129
+ verify_command?: string | undefined;
130
+ sources?: string[] | undefined;
131
+ invalidated_by?: string[] | undefined;
132
+ working_dir?: string | undefined;
133
+ resolution_status?: string | undefined;
134
+ components?: string[] | undefined;
135
+ incident_id?: string | undefined;
54
136
  }, {
55
137
  domains: string[];
56
138
  title: string;
57
- tier: "standard" | "guide" | "admin" | "example" | "reference";
58
- status: "draft" | "active" | "deprecated" | "archived";
139
+ tier: "standard" | "guide" | "admin" | "plan" | "example" | "reference" | "fact" | "incident-narrative" | "incident-facts";
140
+ status: string;
141
+ confidence?: string | undefined;
142
+ provenance?: string[] | undefined;
143
+ severity?: string | undefined;
144
+ symptoms?: {
145
+ severity?: "high" | "medium" | "low" | "critical" | undefined;
146
+ alert_name?: string | undefined;
147
+ user_phrase?: string | string[] | undefined;
148
+ error_pattern?: string | undefined;
149
+ target?: string | undefined;
150
+ cites?: string[] | undefined;
151
+ }[] | undefined;
152
+ produced?: string[] | undefined;
153
+ strengthened?: string[] | undefined;
154
+ weakened?: string[] | undefined;
155
+ date?: unknown;
156
+ audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
157
+ tags?: string[] | undefined;
158
+ last_updated?: unknown;
159
+ version?: string | undefined;
160
+ purpose?: string | undefined;
161
+ related_docs?: string[] | undefined;
162
+ load_priority?: number | undefined;
163
+ author?: string | undefined;
164
+ maintainer?: string | undefined;
165
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
166
+ implementation_status?: "complete" | "deprecated" | "planned" | "in_progress" | undefined;
167
+ tested?: boolean | undefined;
168
+ production_ready?: boolean | undefined;
169
+ estimated_read_time?: string | undefined;
170
+ word_count?: number | undefined;
171
+ last_validated?: unknown;
172
+ backlinks?: string[] | undefined;
173
+ id?: string | undefined;
174
+ last_verified?: unknown;
175
+ verify_command?: string | undefined;
176
+ sources?: string[] | undefined;
177
+ invalidated_by?: string[] | undefined;
178
+ working_dir?: string | undefined;
179
+ resolution_status?: string | undefined;
180
+ components?: string[] | undefined;
181
+ incident_id?: string | undefined;
182
+ }>, {
183
+ domains: string[];
184
+ title: string;
185
+ tier: "standard" | "guide" | "admin" | "plan" | "example" | "reference" | "fact" | "incident-narrative" | "incident-facts";
186
+ status: string;
187
+ audience: ("devops" | "admin" | "all" | "developers")[];
188
+ tags: string[];
59
189
  last_updated: string;
60
- version: string;
190
+ confidence?: string | undefined;
191
+ provenance?: string[] | undefined;
192
+ severity?: string | undefined;
193
+ symptoms?: {
194
+ severity?: "high" | "medium" | "low" | "critical" | undefined;
195
+ alert_name?: string | undefined;
196
+ user_phrase?: string | string[] | undefined;
197
+ error_pattern?: string | undefined;
198
+ target?: string | undefined;
199
+ cites?: string[] | undefined;
200
+ }[] | undefined;
201
+ produced?: string[] | undefined;
202
+ strengthened?: string[] | undefined;
203
+ weakened?: string[] | undefined;
204
+ date?: string | undefined;
205
+ version?: string | undefined;
206
+ purpose?: string | undefined;
207
+ related_docs?: string[] | undefined;
208
+ load_priority?: number | undefined;
209
+ author?: string | undefined;
210
+ maintainer?: string | undefined;
211
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
212
+ implementation_status?: "complete" | "deprecated" | "planned" | "in_progress" | undefined;
213
+ tested?: boolean | undefined;
214
+ production_ready?: boolean | undefined;
215
+ estimated_read_time?: string | undefined;
216
+ word_count?: number | undefined;
217
+ last_validated?: string | undefined;
218
+ backlinks?: string[] | undefined;
219
+ id?: string | undefined;
220
+ last_verified?: string | undefined;
221
+ verify_command?: string | undefined;
222
+ sources?: string[] | undefined;
223
+ invalidated_by?: string[] | undefined;
224
+ working_dir?: string | undefined;
225
+ resolution_status?: string | undefined;
226
+ components?: string[] | undefined;
227
+ incident_id?: string | undefined;
228
+ }, {
229
+ domains: string[];
230
+ title: string;
231
+ tier: "standard" | "guide" | "admin" | "plan" | "example" | "reference" | "fact" | "incident-narrative" | "incident-facts";
232
+ status: string;
233
+ confidence?: string | undefined;
234
+ provenance?: string[] | undefined;
235
+ severity?: string | undefined;
236
+ symptoms?: {
237
+ severity?: "high" | "medium" | "low" | "critical" | undefined;
238
+ alert_name?: string | undefined;
239
+ user_phrase?: string | string[] | undefined;
240
+ error_pattern?: string | undefined;
241
+ target?: string | undefined;
242
+ cites?: string[] | undefined;
243
+ }[] | undefined;
244
+ produced?: string[] | undefined;
245
+ strengthened?: string[] | undefined;
246
+ weakened?: string[] | undefined;
247
+ date?: unknown;
61
248
  audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
62
249
  tags?: string[] | undefined;
250
+ last_updated?: unknown;
251
+ version?: string | undefined;
252
+ purpose?: string | undefined;
253
+ related_docs?: string[] | undefined;
254
+ load_priority?: number | undefined;
255
+ author?: string | undefined;
256
+ maintainer?: string | undefined;
257
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
258
+ implementation_status?: "complete" | "deprecated" | "planned" | "in_progress" | undefined;
259
+ tested?: boolean | undefined;
260
+ production_ready?: boolean | undefined;
261
+ estimated_read_time?: string | undefined;
262
+ word_count?: number | undefined;
263
+ last_validated?: unknown;
264
+ backlinks?: string[] | undefined;
265
+ id?: string | undefined;
266
+ last_verified?: unknown;
267
+ verify_command?: string | undefined;
268
+ sources?: string[] | undefined;
269
+ invalidated_by?: string[] | undefined;
270
+ working_dir?: string | undefined;
271
+ resolution_status?: string | undefined;
272
+ components?: string[] | undefined;
273
+ incident_id?: string | undefined;
274
+ }>, {
275
+ domains: string[];
276
+ title: string;
277
+ tier: "standard" | "guide" | "admin" | "plan" | "example" | "reference" | "fact" | "incident-narrative" | "incident-facts";
278
+ status: string;
279
+ audience: ("devops" | "admin" | "all" | "developers")[];
280
+ tags: string[];
281
+ last_updated: string;
282
+ confidence?: string | undefined;
283
+ provenance?: string[] | undefined;
284
+ severity?: string | undefined;
285
+ symptoms?: {
286
+ severity?: "high" | "medium" | "low" | "critical" | undefined;
287
+ alert_name?: string | undefined;
288
+ user_phrase?: string | string[] | undefined;
289
+ error_pattern?: string | undefined;
290
+ target?: string | undefined;
291
+ cites?: string[] | undefined;
292
+ }[] | undefined;
293
+ produced?: string[] | undefined;
294
+ strengthened?: string[] | undefined;
295
+ weakened?: string[] | undefined;
296
+ date?: string | undefined;
297
+ version?: string | undefined;
63
298
  purpose?: string | undefined;
64
299
  related_docs?: string[] | undefined;
65
300
  load_priority?: number | undefined;
@@ -73,20 +308,445 @@ export declare const MetadataSchema: z.ZodObject<{
73
308
  word_count?: number | undefined;
74
309
  last_validated?: string | undefined;
75
310
  backlinks?: string[] | undefined;
311
+ id?: string | undefined;
312
+ last_verified?: string | undefined;
313
+ verify_command?: string | undefined;
314
+ sources?: string[] | undefined;
315
+ invalidated_by?: string[] | undefined;
316
+ working_dir?: string | undefined;
317
+ resolution_status?: string | undefined;
318
+ components?: string[] | undefined;
319
+ incident_id?: string | undefined;
320
+ }, {
321
+ domains: string[];
322
+ title: string;
323
+ tier: "standard" | "guide" | "admin" | "plan" | "example" | "reference" | "fact" | "incident-narrative" | "incident-facts";
324
+ status: string;
325
+ confidence?: string | undefined;
326
+ provenance?: string[] | undefined;
327
+ severity?: string | undefined;
328
+ symptoms?: {
329
+ severity?: "high" | "medium" | "low" | "critical" | undefined;
330
+ alert_name?: string | undefined;
331
+ user_phrase?: string | string[] | undefined;
332
+ error_pattern?: string | undefined;
333
+ target?: string | undefined;
334
+ cites?: string[] | undefined;
335
+ }[] | undefined;
336
+ produced?: string[] | undefined;
337
+ strengthened?: string[] | undefined;
338
+ weakened?: string[] | undefined;
339
+ date?: unknown;
340
+ audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
341
+ tags?: string[] | undefined;
342
+ last_updated?: unknown;
343
+ version?: string | undefined;
344
+ purpose?: string | undefined;
345
+ related_docs?: string[] | undefined;
346
+ load_priority?: number | undefined;
347
+ author?: string | undefined;
348
+ maintainer?: string | undefined;
349
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
350
+ implementation_status?: "complete" | "deprecated" | "planned" | "in_progress" | undefined;
351
+ tested?: boolean | undefined;
352
+ production_ready?: boolean | undefined;
353
+ estimated_read_time?: string | undefined;
354
+ word_count?: number | undefined;
355
+ last_validated?: unknown;
356
+ backlinks?: string[] | undefined;
357
+ id?: string | undefined;
358
+ last_verified?: unknown;
359
+ verify_command?: string | undefined;
360
+ sources?: string[] | undefined;
361
+ invalidated_by?: string[] | undefined;
362
+ working_dir?: string | undefined;
363
+ resolution_status?: string | undefined;
364
+ components?: string[] | undefined;
365
+ incident_id?: string | undefined;
366
+ }>, {
367
+ domains: string[];
368
+ title: string;
369
+ tier: "standard" | "guide" | "admin" | "plan" | "example" | "reference" | "fact" | "incident-narrative" | "incident-facts";
370
+ status: string;
371
+ audience: ("devops" | "admin" | "all" | "developers")[];
372
+ tags: string[];
373
+ last_updated: string;
374
+ confidence?: string | undefined;
375
+ provenance?: string[] | undefined;
376
+ severity?: string | undefined;
377
+ symptoms?: {
378
+ severity?: "high" | "medium" | "low" | "critical" | undefined;
379
+ alert_name?: string | undefined;
380
+ user_phrase?: string | string[] | undefined;
381
+ error_pattern?: string | undefined;
382
+ target?: string | undefined;
383
+ cites?: string[] | undefined;
384
+ }[] | undefined;
385
+ produced?: string[] | undefined;
386
+ strengthened?: string[] | undefined;
387
+ weakened?: string[] | undefined;
388
+ date?: string | undefined;
389
+ version?: string | undefined;
390
+ purpose?: string | undefined;
391
+ related_docs?: string[] | undefined;
392
+ load_priority?: number | undefined;
393
+ author?: string | undefined;
394
+ maintainer?: string | undefined;
395
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
396
+ implementation_status?: "complete" | "deprecated" | "planned" | "in_progress" | undefined;
397
+ tested?: boolean | undefined;
398
+ production_ready?: boolean | undefined;
399
+ estimated_read_time?: string | undefined;
400
+ word_count?: number | undefined;
401
+ last_validated?: string | undefined;
402
+ backlinks?: string[] | undefined;
403
+ id?: string | undefined;
404
+ last_verified?: string | undefined;
405
+ verify_command?: string | undefined;
406
+ sources?: string[] | undefined;
407
+ invalidated_by?: string[] | undefined;
408
+ working_dir?: string | undefined;
409
+ resolution_status?: string | undefined;
410
+ components?: string[] | undefined;
411
+ incident_id?: string | undefined;
412
+ }, {
413
+ domains: string[];
414
+ title: string;
415
+ tier: "standard" | "guide" | "admin" | "plan" | "example" | "reference" | "fact" | "incident-narrative" | "incident-facts";
416
+ status: string;
417
+ confidence?: string | undefined;
418
+ provenance?: string[] | undefined;
419
+ severity?: string | undefined;
420
+ symptoms?: {
421
+ severity?: "high" | "medium" | "low" | "critical" | undefined;
422
+ alert_name?: string | undefined;
423
+ user_phrase?: string | string[] | undefined;
424
+ error_pattern?: string | undefined;
425
+ target?: string | undefined;
426
+ cites?: string[] | undefined;
427
+ }[] | undefined;
428
+ produced?: string[] | undefined;
429
+ strengthened?: string[] | undefined;
430
+ weakened?: string[] | undefined;
431
+ date?: unknown;
432
+ audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
433
+ tags?: string[] | undefined;
434
+ last_updated?: unknown;
435
+ version?: string | undefined;
436
+ purpose?: string | undefined;
437
+ related_docs?: string[] | undefined;
438
+ load_priority?: number | undefined;
439
+ author?: string | undefined;
440
+ maintainer?: string | undefined;
441
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
442
+ implementation_status?: "complete" | "deprecated" | "planned" | "in_progress" | undefined;
443
+ tested?: boolean | undefined;
444
+ production_ready?: boolean | undefined;
445
+ estimated_read_time?: string | undefined;
446
+ word_count?: number | undefined;
447
+ last_validated?: unknown;
448
+ backlinks?: string[] | undefined;
449
+ id?: string | undefined;
450
+ last_verified?: unknown;
451
+ verify_command?: string | undefined;
452
+ sources?: string[] | undefined;
453
+ invalidated_by?: string[] | undefined;
454
+ working_dir?: string | undefined;
455
+ resolution_status?: string | undefined;
456
+ components?: string[] | undefined;
457
+ incident_id?: string | undefined;
458
+ }>, {
459
+ domains: string[];
460
+ title: string;
461
+ tier: "standard" | "guide" | "admin" | "plan" | "example" | "reference" | "fact" | "incident-narrative" | "incident-facts";
462
+ status: string;
463
+ audience: ("devops" | "admin" | "all" | "developers")[];
464
+ tags: string[];
465
+ last_updated: string;
466
+ confidence?: string | undefined;
467
+ provenance?: string[] | undefined;
468
+ severity?: string | undefined;
469
+ symptoms?: {
470
+ severity?: "high" | "medium" | "low" | "critical" | undefined;
471
+ alert_name?: string | undefined;
472
+ user_phrase?: string | string[] | undefined;
473
+ error_pattern?: string | undefined;
474
+ target?: string | undefined;
475
+ cites?: string[] | undefined;
476
+ }[] | undefined;
477
+ produced?: string[] | undefined;
478
+ strengthened?: string[] | undefined;
479
+ weakened?: string[] | undefined;
480
+ date?: string | undefined;
481
+ version?: string | undefined;
482
+ purpose?: string | undefined;
483
+ related_docs?: string[] | undefined;
484
+ load_priority?: number | undefined;
485
+ author?: string | undefined;
486
+ maintainer?: string | undefined;
487
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
488
+ implementation_status?: "complete" | "deprecated" | "planned" | "in_progress" | undefined;
489
+ tested?: boolean | undefined;
490
+ production_ready?: boolean | undefined;
491
+ estimated_read_time?: string | undefined;
492
+ word_count?: number | undefined;
493
+ last_validated?: string | undefined;
494
+ backlinks?: string[] | undefined;
495
+ id?: string | undefined;
496
+ last_verified?: string | undefined;
497
+ verify_command?: string | undefined;
498
+ sources?: string[] | undefined;
499
+ invalidated_by?: string[] | undefined;
500
+ working_dir?: string | undefined;
501
+ resolution_status?: string | undefined;
502
+ components?: string[] | undefined;
503
+ incident_id?: string | undefined;
504
+ }, {
505
+ domains: string[];
506
+ title: string;
507
+ tier: "standard" | "guide" | "admin" | "plan" | "example" | "reference" | "fact" | "incident-narrative" | "incident-facts";
508
+ status: string;
509
+ confidence?: string | undefined;
510
+ provenance?: string[] | undefined;
511
+ severity?: string | undefined;
512
+ symptoms?: {
513
+ severity?: "high" | "medium" | "low" | "critical" | undefined;
514
+ alert_name?: string | undefined;
515
+ user_phrase?: string | string[] | undefined;
516
+ error_pattern?: string | undefined;
517
+ target?: string | undefined;
518
+ cites?: string[] | undefined;
519
+ }[] | undefined;
520
+ produced?: string[] | undefined;
521
+ strengthened?: string[] | undefined;
522
+ weakened?: string[] | undefined;
523
+ date?: unknown;
524
+ audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
525
+ tags?: string[] | undefined;
526
+ last_updated?: unknown;
527
+ version?: string | undefined;
528
+ purpose?: string | undefined;
529
+ related_docs?: string[] | undefined;
530
+ load_priority?: number | undefined;
531
+ author?: string | undefined;
532
+ maintainer?: string | undefined;
533
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
534
+ implementation_status?: "complete" | "deprecated" | "planned" | "in_progress" | undefined;
535
+ tested?: boolean | undefined;
536
+ production_ready?: boolean | undefined;
537
+ estimated_read_time?: string | undefined;
538
+ word_count?: number | undefined;
539
+ last_validated?: unknown;
540
+ backlinks?: string[] | undefined;
541
+ id?: string | undefined;
542
+ last_verified?: unknown;
543
+ verify_command?: string | undefined;
544
+ sources?: string[] | undefined;
545
+ invalidated_by?: string[] | undefined;
546
+ working_dir?: string | undefined;
547
+ resolution_status?: string | undefined;
548
+ components?: string[] | undefined;
549
+ incident_id?: string | undefined;
550
+ }>, {
551
+ domains: string[];
552
+ title: string;
553
+ tier: "standard" | "guide" | "admin" | "plan" | "example" | "reference" | "fact" | "incident-narrative" | "incident-facts";
554
+ status: string;
555
+ audience: ("devops" | "admin" | "all" | "developers")[];
556
+ tags: string[];
557
+ last_updated: string;
558
+ confidence?: string | undefined;
559
+ provenance?: string[] | undefined;
560
+ severity?: string | undefined;
561
+ symptoms?: {
562
+ severity?: "high" | "medium" | "low" | "critical" | undefined;
563
+ alert_name?: string | undefined;
564
+ user_phrase?: string | string[] | undefined;
565
+ error_pattern?: string | undefined;
566
+ target?: string | undefined;
567
+ cites?: string[] | undefined;
568
+ }[] | undefined;
569
+ produced?: string[] | undefined;
570
+ strengthened?: string[] | undefined;
571
+ weakened?: string[] | undefined;
572
+ date?: string | undefined;
573
+ version?: string | undefined;
574
+ purpose?: string | undefined;
575
+ related_docs?: string[] | undefined;
576
+ load_priority?: number | undefined;
577
+ author?: string | undefined;
578
+ maintainer?: string | undefined;
579
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
580
+ implementation_status?: "complete" | "deprecated" | "planned" | "in_progress" | undefined;
581
+ tested?: boolean | undefined;
582
+ production_ready?: boolean | undefined;
583
+ estimated_read_time?: string | undefined;
584
+ word_count?: number | undefined;
585
+ last_validated?: string | undefined;
586
+ backlinks?: string[] | undefined;
587
+ id?: string | undefined;
588
+ last_verified?: string | undefined;
589
+ verify_command?: string | undefined;
590
+ sources?: string[] | undefined;
591
+ invalidated_by?: string[] | undefined;
592
+ working_dir?: string | undefined;
593
+ resolution_status?: string | undefined;
594
+ components?: string[] | undefined;
595
+ incident_id?: string | undefined;
596
+ }, {
597
+ domains: string[];
598
+ title: string;
599
+ tier: "standard" | "guide" | "admin" | "plan" | "example" | "reference" | "fact" | "incident-narrative" | "incident-facts";
600
+ status: string;
601
+ confidence?: string | undefined;
602
+ provenance?: string[] | undefined;
603
+ severity?: string | undefined;
604
+ symptoms?: {
605
+ severity?: "high" | "medium" | "low" | "critical" | undefined;
606
+ alert_name?: string | undefined;
607
+ user_phrase?: string | string[] | undefined;
608
+ error_pattern?: string | undefined;
609
+ target?: string | undefined;
610
+ cites?: string[] | undefined;
611
+ }[] | undefined;
612
+ produced?: string[] | undefined;
613
+ strengthened?: string[] | undefined;
614
+ weakened?: string[] | undefined;
615
+ date?: unknown;
616
+ audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
617
+ tags?: string[] | undefined;
618
+ last_updated?: unknown;
619
+ version?: string | undefined;
620
+ purpose?: string | undefined;
621
+ related_docs?: string[] | undefined;
622
+ load_priority?: number | undefined;
623
+ author?: string | undefined;
624
+ maintainer?: string | undefined;
625
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
626
+ implementation_status?: "complete" | "deprecated" | "planned" | "in_progress" | undefined;
627
+ tested?: boolean | undefined;
628
+ production_ready?: boolean | undefined;
629
+ estimated_read_time?: string | undefined;
630
+ word_count?: number | undefined;
631
+ last_validated?: unknown;
632
+ backlinks?: string[] | undefined;
633
+ id?: string | undefined;
634
+ last_verified?: unknown;
635
+ verify_command?: string | undefined;
636
+ sources?: string[] | undefined;
637
+ invalidated_by?: string[] | undefined;
638
+ working_dir?: string | undefined;
639
+ resolution_status?: string | undefined;
640
+ components?: string[] | undefined;
641
+ incident_id?: string | undefined;
642
+ }>, {
643
+ domains: string[];
644
+ title: string;
645
+ tier: "standard" | "guide" | "admin" | "plan" | "example" | "reference" | "fact" | "incident-narrative" | "incident-facts";
646
+ status: string;
647
+ audience: ("devops" | "admin" | "all" | "developers")[];
648
+ tags: string[];
649
+ last_updated: string;
650
+ confidence?: string | undefined;
651
+ provenance?: string[] | undefined;
652
+ severity?: string | undefined;
653
+ symptoms?: {
654
+ severity?: "high" | "medium" | "low" | "critical" | undefined;
655
+ alert_name?: string | undefined;
656
+ user_phrase?: string | string[] | undefined;
657
+ error_pattern?: string | undefined;
658
+ target?: string | undefined;
659
+ cites?: string[] | undefined;
660
+ }[] | undefined;
661
+ produced?: string[] | undefined;
662
+ strengthened?: string[] | undefined;
663
+ weakened?: string[] | undefined;
664
+ date?: string | undefined;
665
+ version?: string | undefined;
666
+ purpose?: string | undefined;
667
+ related_docs?: string[] | undefined;
668
+ load_priority?: number | undefined;
669
+ author?: string | undefined;
670
+ maintainer?: string | undefined;
671
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
672
+ implementation_status?: "complete" | "deprecated" | "planned" | "in_progress" | undefined;
673
+ tested?: boolean | undefined;
674
+ production_ready?: boolean | undefined;
675
+ estimated_read_time?: string | undefined;
676
+ word_count?: number | undefined;
677
+ last_validated?: string | undefined;
678
+ backlinks?: string[] | undefined;
679
+ id?: string | undefined;
680
+ last_verified?: string | undefined;
681
+ verify_command?: string | undefined;
682
+ sources?: string[] | undefined;
683
+ invalidated_by?: string[] | undefined;
684
+ working_dir?: string | undefined;
685
+ resolution_status?: string | undefined;
686
+ components?: string[] | undefined;
687
+ incident_id?: string | undefined;
688
+ }, {
689
+ domains: string[];
690
+ title: string;
691
+ tier: "standard" | "guide" | "admin" | "plan" | "example" | "reference" | "fact" | "incident-narrative" | "incident-facts";
692
+ status: string;
693
+ confidence?: string | undefined;
694
+ provenance?: string[] | undefined;
695
+ severity?: string | undefined;
696
+ symptoms?: {
697
+ severity?: "high" | "medium" | "low" | "critical" | undefined;
698
+ alert_name?: string | undefined;
699
+ user_phrase?: string | string[] | undefined;
700
+ error_pattern?: string | undefined;
701
+ target?: string | undefined;
702
+ cites?: string[] | undefined;
703
+ }[] | undefined;
704
+ produced?: string[] | undefined;
705
+ strengthened?: string[] | undefined;
706
+ weakened?: string[] | undefined;
707
+ date?: unknown;
708
+ audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
709
+ tags?: string[] | undefined;
710
+ last_updated?: unknown;
711
+ version?: string | undefined;
712
+ purpose?: string | undefined;
713
+ related_docs?: string[] | undefined;
714
+ load_priority?: number | undefined;
715
+ author?: string | undefined;
716
+ maintainer?: string | undefined;
717
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
718
+ implementation_status?: "complete" | "deprecated" | "planned" | "in_progress" | undefined;
719
+ tested?: boolean | undefined;
720
+ production_ready?: boolean | undefined;
721
+ estimated_read_time?: string | undefined;
722
+ word_count?: number | undefined;
723
+ last_validated?: unknown;
724
+ backlinks?: string[] | undefined;
725
+ id?: string | undefined;
726
+ last_verified?: unknown;
727
+ verify_command?: string | undefined;
728
+ sources?: string[] | undefined;
729
+ invalidated_by?: string[] | undefined;
730
+ working_dir?: string | undefined;
731
+ resolution_status?: string | undefined;
732
+ components?: string[] | undefined;
733
+ incident_id?: string | undefined;
76
734
  }>;
77
735
  export type DocumentMetadata = z.infer<typeof MetadataSchema>;
78
736
  /**
79
- * Partial schema for documents that may have incomplete metadata
737
+ * Partial schema for documents that may have incomplete metadata.
738
+ * Built from the un-refined base so every field is optional regardless of
739
+ * tier — used by `hewtd fix` to identify incomplete docs.
80
740
  */
81
741
  export declare const PartialMetadataSchema: z.ZodObject<{
82
742
  title: z.ZodOptional<z.ZodString>;
83
- tier: z.ZodOptional<z.ZodEnum<["standard" | "guide" | "admin" | "example" | "reference", ...("standard" | "guide" | "admin" | "example" | "reference")[]]>>;
743
+ tier: z.ZodOptional<z.ZodEnum<["standard" | "guide" | "admin" | "plan" | "example" | "reference" | "fact" | "incident-narrative" | "incident-facts", ...("standard" | "guide" | "admin" | "plan" | "example" | "reference" | "fact" | "incident-narrative" | "incident-facts")[]]>>;
84
744
  domains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
85
745
  audience: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<["all", "developers", "devops", "admin"]>, "many">>>;
86
746
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
87
- status: z.ZodOptional<z.ZodEnum<["draft", "active", "deprecated", "archived"]>>;
88
- last_updated: z.ZodOptional<z.ZodString>;
89
- version: z.ZodOptional<z.ZodString>;
747
+ status: z.ZodOptional<z.ZodString>;
748
+ last_updated: z.ZodOptional<z.ZodEffects<z.ZodString, string, unknown>>;
749
+ version: z.ZodOptional<z.ZodOptional<z.ZodString>>;
90
750
  purpose: z.ZodOptional<z.ZodOptional<z.ZodString>>;
91
751
  related_docs: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
92
752
  load_priority: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
@@ -98,13 +758,66 @@ export declare const PartialMetadataSchema: z.ZodObject<{
98
758
  production_ready: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
99
759
  estimated_read_time: z.ZodOptional<z.ZodOptional<z.ZodString>>;
100
760
  word_count: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
101
- last_validated: z.ZodOptional<z.ZodOptional<z.ZodString>>;
761
+ last_validated: z.ZodOptional<z.ZodOptional<z.ZodEffects<z.ZodString, string, unknown>>>;
102
762
  backlinks: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
763
+ id: z.ZodOptional<z.ZodOptional<z.ZodString>>;
764
+ confidence: z.ZodOptional<z.ZodOptional<z.ZodString>>;
765
+ last_verified: z.ZodOptional<z.ZodOptional<z.ZodEffects<z.ZodString, string, unknown>>>;
766
+ verify_command: z.ZodOptional<z.ZodOptional<z.ZodString>>;
767
+ provenance: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
768
+ sources: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
769
+ invalidated_by: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
770
+ working_dir: z.ZodOptional<z.ZodOptional<z.ZodString>>;
771
+ date: z.ZodOptional<z.ZodOptional<z.ZodEffects<z.ZodString, string, unknown>>>;
772
+ severity: z.ZodOptional<z.ZodOptional<z.ZodString>>;
773
+ resolution_status: z.ZodOptional<z.ZodOptional<z.ZodString>>;
774
+ components: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
775
+ incident_id: z.ZodOptional<z.ZodOptional<z.ZodString>>;
776
+ produced: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
777
+ strengthened: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
778
+ weakened: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
779
+ symptoms: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
780
+ alert_name: z.ZodOptional<z.ZodString>;
781
+ user_phrase: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
782
+ error_pattern: z.ZodOptional<z.ZodString>;
783
+ severity: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
784
+ target: z.ZodOptional<z.ZodString>;
785
+ cites: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
786
+ }, "strip", z.ZodTypeAny, {
787
+ severity?: "high" | "medium" | "low" | "critical" | undefined;
788
+ alert_name?: string | undefined;
789
+ user_phrase?: string | string[] | undefined;
790
+ error_pattern?: string | undefined;
791
+ target?: string | undefined;
792
+ cites?: string[] | undefined;
793
+ }, {
794
+ severity?: "high" | "medium" | "low" | "critical" | undefined;
795
+ alert_name?: string | undefined;
796
+ user_phrase?: string | string[] | undefined;
797
+ error_pattern?: string | undefined;
798
+ target?: string | undefined;
799
+ cites?: string[] | undefined;
800
+ }>, "many">>>;
103
801
  }, "strip", z.ZodTypeAny, {
104
802
  domains?: string[] | undefined;
803
+ confidence?: string | undefined;
804
+ provenance?: string[] | undefined;
805
+ severity?: string | undefined;
806
+ symptoms?: {
807
+ severity?: "high" | "medium" | "low" | "critical" | undefined;
808
+ alert_name?: string | undefined;
809
+ user_phrase?: string | string[] | undefined;
810
+ error_pattern?: string | undefined;
811
+ target?: string | undefined;
812
+ cites?: string[] | undefined;
813
+ }[] | undefined;
814
+ produced?: string[] | undefined;
815
+ strengthened?: string[] | undefined;
816
+ weakened?: string[] | undefined;
105
817
  title?: string | undefined;
106
- tier?: "standard" | "guide" | "admin" | "example" | "reference" | undefined;
107
- status?: "draft" | "active" | "deprecated" | "archived" | undefined;
818
+ tier?: "standard" | "guide" | "admin" | "plan" | "example" | "reference" | "fact" | "incident-narrative" | "incident-facts" | undefined;
819
+ status?: string | undefined;
820
+ date?: string | undefined;
108
821
  audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
109
822
  tags?: string[] | undefined;
110
823
  last_updated?: string | undefined;
@@ -122,14 +835,38 @@ export declare const PartialMetadataSchema: z.ZodObject<{
122
835
  word_count?: number | undefined;
123
836
  last_validated?: string | undefined;
124
837
  backlinks?: string[] | undefined;
838
+ id?: string | undefined;
839
+ last_verified?: string | undefined;
840
+ verify_command?: string | undefined;
841
+ sources?: string[] | undefined;
842
+ invalidated_by?: string[] | undefined;
843
+ working_dir?: string | undefined;
844
+ resolution_status?: string | undefined;
845
+ components?: string[] | undefined;
846
+ incident_id?: string | undefined;
125
847
  }, {
126
848
  domains?: string[] | undefined;
849
+ confidence?: string | undefined;
850
+ provenance?: string[] | undefined;
851
+ severity?: string | undefined;
852
+ symptoms?: {
853
+ severity?: "high" | "medium" | "low" | "critical" | undefined;
854
+ alert_name?: string | undefined;
855
+ user_phrase?: string | string[] | undefined;
856
+ error_pattern?: string | undefined;
857
+ target?: string | undefined;
858
+ cites?: string[] | undefined;
859
+ }[] | undefined;
860
+ produced?: string[] | undefined;
861
+ strengthened?: string[] | undefined;
862
+ weakened?: string[] | undefined;
127
863
  title?: string | undefined;
128
- tier?: "standard" | "guide" | "admin" | "example" | "reference" | undefined;
129
- status?: "draft" | "active" | "deprecated" | "archived" | undefined;
864
+ tier?: "standard" | "guide" | "admin" | "plan" | "example" | "reference" | "fact" | "incident-narrative" | "incident-facts" | undefined;
865
+ status?: string | undefined;
866
+ date?: unknown;
130
867
  audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
131
868
  tags?: string[] | undefined;
132
- last_updated?: string | undefined;
869
+ last_updated?: unknown;
133
870
  version?: string | undefined;
134
871
  purpose?: string | undefined;
135
872
  related_docs?: string[] | undefined;
@@ -142,60 +879,84 @@ export declare const PartialMetadataSchema: z.ZodObject<{
142
879
  production_ready?: boolean | undefined;
143
880
  estimated_read_time?: string | undefined;
144
881
  word_count?: number | undefined;
145
- last_validated?: string | undefined;
882
+ last_validated?: unknown;
146
883
  backlinks?: string[] | undefined;
884
+ id?: string | undefined;
885
+ last_verified?: unknown;
886
+ verify_command?: string | undefined;
887
+ sources?: string[] | undefined;
888
+ invalidated_by?: string[] | undefined;
889
+ working_dir?: string | undefined;
890
+ resolution_status?: string | undefined;
891
+ components?: string[] | undefined;
892
+ incident_id?: string | undefined;
147
893
  }>;
148
894
  export type PartialDocumentMetadata = z.infer<typeof PartialMetadataSchema>;
149
895
  /**
150
- * Required fields that must always be present
896
+ * Required fields shared across all tiers.
897
+ *
898
+ * Note: `version` is conditionally required — it must be present for all
899
+ * tiers NOT in LIFECYCLE_TRACKED_TIERS. The list below preserves the
900
+ * historical 6-required-field contract for non-lifecycle docs; for lifecycle-
901
+ * tracked docs (plan/fact/incident-narrative/incident-facts), `version` is
902
+ * dropped and the per-tier extension fields are added by
903
+ * `getRequiredFieldsForTier()`.
904
+ *
905
+ * Prefer `getMissingRequiredFields(data)` for tier-aware checks rather than
906
+ * iterating REQUIRED_FIELDS directly.
151
907
  */
152
908
  export declare const REQUIRED_FIELDS: readonly ["title", "tier", "domains", "status", "last_updated", "version"];
153
909
  /**
154
- * Optional fields with their default values
910
+ * Tier-specific required-field extensions for lifecycle-tracked tiers.
911
+ *
912
+ * For each tier, these fields are required IN ADDITION to the universal
913
+ * five (title, tier, domains, status, last_updated). `version` is excluded.
155
914
  */
915
+ declare const TIER_REQUIRED_EXTENSIONS: Partial<Record<Tier, readonly string[]>>;
156
916
  export declare const OPTIONAL_FIELDS_DEFAULTS: Partial<DocumentMetadata>;
157
- /**
158
- * Auto-generated fields that should not be manually edited
159
- */
160
917
  export declare const AUTO_GENERATED_FIELDS: readonly ["estimated_read_time", "word_count", "last_validated", "backlinks"];
161
918
  /**
162
- * All 22 field names
919
+ * All 22 universal field names (unchanged from 2.2.0). The 2.3.0 knowledge-
920
+ * base extension fields (id, confidence, etc.) are intentionally NOT in this
921
+ * list — they apply per-tier and would skew completeness calc on non-KB docs.
163
922
  */
164
923
  export declare const ALL_METADATA_FIELDS: readonly ["title", "tier", "domains", "audience", "tags", "status", "last_updated", "version", "purpose", "related_docs", "load_priority", "author", "maintainer", "review_frequency", "implementation_status", "tested", "production_ready", "estimated_read_time", "word_count", "last_validated", "backlinks"];
165
924
  export type MetadataField = (typeof ALL_METADATA_FIELDS)[number];
166
- /**
167
- * Validate metadata against the schema
168
- */
169
925
  export declare function validateMetadata(data: unknown): {
170
926
  valid: boolean;
171
927
  errors: string[];
172
928
  data?: DocumentMetadata;
173
929
  };
174
930
  /**
175
- * Validate partial metadata (for documents being fixed)
931
+ * Coded error produced by `validateKnowledgeBaseFields()`. The auditor maps
932
+ * these to `AuditIssue` entries with `code` populated, so CI tooling can
933
+ * switch on specific violation kinds without substring-matching prose.
176
934
  */
935
+ export interface KbValidationError {
936
+ code: KbErrorCode;
937
+ message: string;
938
+ path: string;
939
+ }
940
+ export declare function validateKnowledgeBaseFields(data: Record<string, unknown>): KbValidationError[];
177
941
  export declare function validatePartialMetadata(data: unknown): {
178
942
  valid: boolean;
179
943
  errors: string[];
180
944
  data?: PartialDocumentMetadata;
181
945
  };
182
946
  /**
183
- * Get missing required fields
947
+ * Get missing required fields, respecting both the version-exemption for
948
+ * lifecycle-tracked tiers AND the tier-specific extension requirements.
949
+ *
950
+ * - For non-lifecycle tiers: REQUIRED_FIELDS (all six, including version).
951
+ * - For lifecycle-tracked tiers: REQUIRED_FIELDS minus 'version', plus
952
+ * any tier-specific extensions from TIER_REQUIRED_EXTENSIONS.
184
953
  */
185
954
  export declare function getMissingRequiredFields(data: Record<string, unknown>): string[];
186
- /**
187
- * Get all missing fields (both required and optional)
188
- */
189
955
  export declare function getMissingFields(data: Record<string, unknown>): {
190
956
  required: string[];
191
957
  optional: string[];
192
958
  };
193
- /**
194
- * Calculate metadata completeness percentage
195
- */
196
959
  export declare function calculateMetadataCompleteness(data: Record<string, unknown>): number;
197
- /**
198
- * Get field category
199
- */
200
960
  export declare function getFieldCategory(field: MetadataField): 'core' | 'status' | 'discovery' | 'ownership' | 'implementation' | 'auto';
961
+ export { LIFECYCLE_TRACKED_TIERS, isLifecycleTrackedTier, DOC_STATUS_VALUES, FACT_CONFIDENCE_VALUES, INCIDENT_SEVERITY_VALUES, INCIDENT_RESOLUTION_VALUES, KEBAB_SLUG_RE, INCIDENT_ID_RE, TIER_REQUIRED_EXTENSIONS, };
201
962
  //# sourceMappingURL=schema.d.ts.map