@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<["guide" | "standard" | "example" | "reference" | "admin", ...("guide" | "standard" | "example" | "reference" | "admin")[]]>;
26
+ tier: z.ZodEnum<["guide" | "standard" | "example" | "reference" | "admin" | "plan" | "fact" | "incident-narrative" | "incident-facts", ...("guide" | "standard" | "example" | "reference" | "admin" | "plan" | "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,66 +46,707 @@ 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?: "low" | "medium" | "high" | "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?: "low" | "medium" | "high" | "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: "guide" | "standard" | "example" | "reference" | "admin";
36
- status: "draft" | "active" | "deprecated" | "archived";
93
+ tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | "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
+ date?: string | undefined;
99
+ version?: string | undefined;
41
100
  purpose?: string | undefined;
42
101
  related_docs?: string[] | undefined;
43
102
  load_priority?: number | undefined;
44
103
  author?: string | undefined;
45
104
  maintainer?: string | undefined;
46
105
  review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
47
- implementation_status?: "deprecated" | "planned" | "in_progress" | "complete" | undefined;
106
+ implementation_status?: "planned" | "in_progress" | "complete" | "deprecated" | undefined;
48
107
  tested?: boolean | undefined;
49
108
  production_ready?: boolean | undefined;
50
109
  estimated_read_time?: string | undefined;
51
110
  word_count?: number | undefined;
52
111
  last_validated?: string | undefined;
53
112
  backlinks?: string[] | undefined;
113
+ id?: string | undefined;
114
+ confidence?: string | undefined;
115
+ last_verified?: string | undefined;
116
+ verify_command?: string | undefined;
117
+ provenance?: string[] | undefined;
118
+ sources?: string[] | undefined;
119
+ invalidated_by?: string[] | undefined;
120
+ working_dir?: string | undefined;
121
+ severity?: string | undefined;
122
+ resolution_status?: string | undefined;
123
+ components?: string[] | undefined;
124
+ incident_id?: string | undefined;
125
+ produced?: string[] | undefined;
126
+ strengthened?: string[] | undefined;
127
+ weakened?: string[] | undefined;
128
+ symptoms?: {
129
+ severity?: "low" | "medium" | "high" | "critical" | undefined;
130
+ alert_name?: string | undefined;
131
+ user_phrase?: string | string[] | undefined;
132
+ error_pattern?: string | undefined;
133
+ target?: string | undefined;
134
+ cites?: string[] | undefined;
135
+ }[] | undefined;
54
136
  }, {
55
137
  domains: string[];
56
138
  title: string;
57
- tier: "guide" | "standard" | "example" | "reference" | "admin";
58
- status: "draft" | "active" | "deprecated" | "archived";
139
+ tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | "fact" | "incident-narrative" | "incident-facts";
140
+ status: string;
141
+ date?: unknown;
142
+ audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
143
+ tags?: string[] | undefined;
144
+ last_updated?: unknown;
145
+ version?: string | undefined;
146
+ purpose?: string | undefined;
147
+ related_docs?: string[] | undefined;
148
+ load_priority?: number | undefined;
149
+ author?: string | undefined;
150
+ maintainer?: string | undefined;
151
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
152
+ implementation_status?: "planned" | "in_progress" | "complete" | "deprecated" | undefined;
153
+ tested?: boolean | undefined;
154
+ production_ready?: boolean | undefined;
155
+ estimated_read_time?: string | undefined;
156
+ word_count?: number | undefined;
157
+ last_validated?: unknown;
158
+ backlinks?: string[] | undefined;
159
+ id?: string | undefined;
160
+ confidence?: string | undefined;
161
+ last_verified?: unknown;
162
+ verify_command?: string | undefined;
163
+ provenance?: string[] | undefined;
164
+ sources?: string[] | undefined;
165
+ invalidated_by?: string[] | undefined;
166
+ working_dir?: string | undefined;
167
+ severity?: string | undefined;
168
+ resolution_status?: string | undefined;
169
+ components?: string[] | undefined;
170
+ incident_id?: string | undefined;
171
+ produced?: string[] | undefined;
172
+ strengthened?: string[] | undefined;
173
+ weakened?: string[] | undefined;
174
+ symptoms?: {
175
+ severity?: "low" | "medium" | "high" | "critical" | undefined;
176
+ alert_name?: string | undefined;
177
+ user_phrase?: string | string[] | undefined;
178
+ error_pattern?: string | undefined;
179
+ target?: string | undefined;
180
+ cites?: string[] | undefined;
181
+ }[] | undefined;
182
+ }>, {
183
+ domains: string[];
184
+ title: string;
185
+ tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | "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
+ date?: string | undefined;
191
+ version?: string | undefined;
192
+ purpose?: string | undefined;
193
+ related_docs?: string[] | undefined;
194
+ load_priority?: number | undefined;
195
+ author?: string | undefined;
196
+ maintainer?: string | undefined;
197
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
198
+ implementation_status?: "planned" | "in_progress" | "complete" | "deprecated" | undefined;
199
+ tested?: boolean | undefined;
200
+ production_ready?: boolean | undefined;
201
+ estimated_read_time?: string | undefined;
202
+ word_count?: number | undefined;
203
+ last_validated?: string | undefined;
204
+ backlinks?: string[] | undefined;
205
+ id?: string | undefined;
206
+ confidence?: string | undefined;
207
+ last_verified?: string | undefined;
208
+ verify_command?: string | undefined;
209
+ provenance?: string[] | undefined;
210
+ sources?: string[] | undefined;
211
+ invalidated_by?: string[] | undefined;
212
+ working_dir?: string | undefined;
213
+ severity?: string | undefined;
214
+ resolution_status?: string | undefined;
215
+ components?: string[] | undefined;
216
+ incident_id?: string | undefined;
217
+ produced?: string[] | undefined;
218
+ strengthened?: string[] | undefined;
219
+ weakened?: string[] | undefined;
220
+ symptoms?: {
221
+ severity?: "low" | "medium" | "high" | "critical" | undefined;
222
+ alert_name?: string | undefined;
223
+ user_phrase?: string | string[] | undefined;
224
+ error_pattern?: string | undefined;
225
+ target?: string | undefined;
226
+ cites?: string[] | undefined;
227
+ }[] | undefined;
228
+ }, {
229
+ domains: string[];
230
+ title: string;
231
+ tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | "fact" | "incident-narrative" | "incident-facts";
232
+ status: string;
233
+ date?: unknown;
61
234
  audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
62
235
  tags?: string[] | undefined;
236
+ last_updated?: unknown;
237
+ version?: string | undefined;
238
+ purpose?: string | undefined;
239
+ related_docs?: string[] | undefined;
240
+ load_priority?: number | undefined;
241
+ author?: string | undefined;
242
+ maintainer?: string | undefined;
243
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
244
+ implementation_status?: "planned" | "in_progress" | "complete" | "deprecated" | undefined;
245
+ tested?: boolean | undefined;
246
+ production_ready?: boolean | undefined;
247
+ estimated_read_time?: string | undefined;
248
+ word_count?: number | undefined;
249
+ last_validated?: unknown;
250
+ backlinks?: string[] | undefined;
251
+ id?: string | undefined;
252
+ confidence?: string | undefined;
253
+ last_verified?: unknown;
254
+ verify_command?: string | undefined;
255
+ provenance?: string[] | undefined;
256
+ sources?: string[] | undefined;
257
+ invalidated_by?: string[] | undefined;
258
+ working_dir?: string | undefined;
259
+ severity?: string | undefined;
260
+ resolution_status?: string | undefined;
261
+ components?: string[] | undefined;
262
+ incident_id?: string | undefined;
263
+ produced?: string[] | undefined;
264
+ strengthened?: string[] | undefined;
265
+ weakened?: string[] | undefined;
266
+ symptoms?: {
267
+ severity?: "low" | "medium" | "high" | "critical" | undefined;
268
+ alert_name?: string | undefined;
269
+ user_phrase?: string | string[] | undefined;
270
+ error_pattern?: string | undefined;
271
+ target?: string | undefined;
272
+ cites?: string[] | undefined;
273
+ }[] | undefined;
274
+ }>, {
275
+ domains: string[];
276
+ title: string;
277
+ tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | "fact" | "incident-narrative" | "incident-facts";
278
+ status: string;
279
+ audience: ("devops" | "admin" | "all" | "developers")[];
280
+ tags: string[];
281
+ last_updated: string;
282
+ date?: string | undefined;
283
+ version?: string | undefined;
63
284
  purpose?: string | undefined;
64
285
  related_docs?: string[] | undefined;
65
286
  load_priority?: number | undefined;
66
287
  author?: string | undefined;
67
288
  maintainer?: string | undefined;
68
289
  review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
69
- implementation_status?: "deprecated" | "planned" | "in_progress" | "complete" | undefined;
290
+ implementation_status?: "planned" | "in_progress" | "complete" | "deprecated" | undefined;
70
291
  tested?: boolean | undefined;
71
292
  production_ready?: boolean | undefined;
72
293
  estimated_read_time?: string | undefined;
73
294
  word_count?: number | undefined;
74
295
  last_validated?: string | undefined;
75
296
  backlinks?: string[] | undefined;
297
+ id?: string | undefined;
298
+ confidence?: string | undefined;
299
+ last_verified?: string | undefined;
300
+ verify_command?: string | undefined;
301
+ provenance?: string[] | undefined;
302
+ sources?: string[] | undefined;
303
+ invalidated_by?: string[] | undefined;
304
+ working_dir?: string | undefined;
305
+ severity?: string | undefined;
306
+ resolution_status?: string | undefined;
307
+ components?: string[] | undefined;
308
+ incident_id?: string | undefined;
309
+ produced?: string[] | undefined;
310
+ strengthened?: string[] | undefined;
311
+ weakened?: string[] | undefined;
312
+ symptoms?: {
313
+ severity?: "low" | "medium" | "high" | "critical" | undefined;
314
+ alert_name?: string | undefined;
315
+ user_phrase?: string | string[] | undefined;
316
+ error_pattern?: string | undefined;
317
+ target?: string | undefined;
318
+ cites?: string[] | undefined;
319
+ }[] | undefined;
320
+ }, {
321
+ domains: string[];
322
+ title: string;
323
+ tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | "fact" | "incident-narrative" | "incident-facts";
324
+ status: string;
325
+ date?: unknown;
326
+ audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
327
+ tags?: string[] | undefined;
328
+ last_updated?: unknown;
329
+ version?: string | undefined;
330
+ purpose?: string | undefined;
331
+ related_docs?: string[] | undefined;
332
+ load_priority?: number | undefined;
333
+ author?: string | undefined;
334
+ maintainer?: string | undefined;
335
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
336
+ implementation_status?: "planned" | "in_progress" | "complete" | "deprecated" | undefined;
337
+ tested?: boolean | undefined;
338
+ production_ready?: boolean | undefined;
339
+ estimated_read_time?: string | undefined;
340
+ word_count?: number | undefined;
341
+ last_validated?: unknown;
342
+ backlinks?: string[] | undefined;
343
+ id?: string | undefined;
344
+ confidence?: string | undefined;
345
+ last_verified?: unknown;
346
+ verify_command?: string | undefined;
347
+ provenance?: string[] | undefined;
348
+ sources?: string[] | undefined;
349
+ invalidated_by?: string[] | undefined;
350
+ working_dir?: string | undefined;
351
+ severity?: string | undefined;
352
+ resolution_status?: string | undefined;
353
+ components?: string[] | undefined;
354
+ incident_id?: string | undefined;
355
+ produced?: string[] | undefined;
356
+ strengthened?: string[] | undefined;
357
+ weakened?: string[] | undefined;
358
+ symptoms?: {
359
+ severity?: "low" | "medium" | "high" | "critical" | undefined;
360
+ alert_name?: string | undefined;
361
+ user_phrase?: string | string[] | undefined;
362
+ error_pattern?: string | undefined;
363
+ target?: string | undefined;
364
+ cites?: string[] | undefined;
365
+ }[] | undefined;
366
+ }>, {
367
+ domains: string[];
368
+ title: string;
369
+ tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | "fact" | "incident-narrative" | "incident-facts";
370
+ status: string;
371
+ audience: ("devops" | "admin" | "all" | "developers")[];
372
+ tags: string[];
373
+ last_updated: string;
374
+ date?: string | undefined;
375
+ version?: string | undefined;
376
+ purpose?: string | undefined;
377
+ related_docs?: string[] | undefined;
378
+ load_priority?: number | undefined;
379
+ author?: string | undefined;
380
+ maintainer?: string | undefined;
381
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
382
+ implementation_status?: "planned" | "in_progress" | "complete" | "deprecated" | undefined;
383
+ tested?: boolean | undefined;
384
+ production_ready?: boolean | undefined;
385
+ estimated_read_time?: string | undefined;
386
+ word_count?: number | undefined;
387
+ last_validated?: string | undefined;
388
+ backlinks?: string[] | undefined;
389
+ id?: string | undefined;
390
+ confidence?: string | undefined;
391
+ last_verified?: string | undefined;
392
+ verify_command?: string | undefined;
393
+ provenance?: string[] | undefined;
394
+ sources?: string[] | undefined;
395
+ invalidated_by?: string[] | undefined;
396
+ working_dir?: string | undefined;
397
+ severity?: string | undefined;
398
+ resolution_status?: string | undefined;
399
+ components?: string[] | undefined;
400
+ incident_id?: string | undefined;
401
+ produced?: string[] | undefined;
402
+ strengthened?: string[] | undefined;
403
+ weakened?: string[] | undefined;
404
+ symptoms?: {
405
+ severity?: "low" | "medium" | "high" | "critical" | undefined;
406
+ alert_name?: string | undefined;
407
+ user_phrase?: string | string[] | undefined;
408
+ error_pattern?: string | undefined;
409
+ target?: string | undefined;
410
+ cites?: string[] | undefined;
411
+ }[] | undefined;
412
+ }, {
413
+ domains: string[];
414
+ title: string;
415
+ tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | "fact" | "incident-narrative" | "incident-facts";
416
+ status: string;
417
+ date?: unknown;
418
+ audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
419
+ tags?: string[] | undefined;
420
+ last_updated?: unknown;
421
+ version?: string | undefined;
422
+ purpose?: string | undefined;
423
+ related_docs?: string[] | undefined;
424
+ load_priority?: number | undefined;
425
+ author?: string | undefined;
426
+ maintainer?: string | undefined;
427
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
428
+ implementation_status?: "planned" | "in_progress" | "complete" | "deprecated" | undefined;
429
+ tested?: boolean | undefined;
430
+ production_ready?: boolean | undefined;
431
+ estimated_read_time?: string | undefined;
432
+ word_count?: number | undefined;
433
+ last_validated?: unknown;
434
+ backlinks?: string[] | undefined;
435
+ id?: string | undefined;
436
+ confidence?: string | undefined;
437
+ last_verified?: unknown;
438
+ verify_command?: string | undefined;
439
+ provenance?: string[] | undefined;
440
+ sources?: string[] | undefined;
441
+ invalidated_by?: string[] | undefined;
442
+ working_dir?: string | undefined;
443
+ severity?: string | undefined;
444
+ resolution_status?: string | undefined;
445
+ components?: string[] | undefined;
446
+ incident_id?: string | undefined;
447
+ produced?: string[] | undefined;
448
+ strengthened?: string[] | undefined;
449
+ weakened?: string[] | undefined;
450
+ symptoms?: {
451
+ severity?: "low" | "medium" | "high" | "critical" | undefined;
452
+ alert_name?: string | undefined;
453
+ user_phrase?: string | string[] | undefined;
454
+ error_pattern?: string | undefined;
455
+ target?: string | undefined;
456
+ cites?: string[] | undefined;
457
+ }[] | undefined;
458
+ }>, {
459
+ domains: string[];
460
+ title: string;
461
+ tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | "fact" | "incident-narrative" | "incident-facts";
462
+ status: string;
463
+ audience: ("devops" | "admin" | "all" | "developers")[];
464
+ tags: string[];
465
+ last_updated: string;
466
+ date?: string | undefined;
467
+ version?: string | undefined;
468
+ purpose?: string | undefined;
469
+ related_docs?: string[] | undefined;
470
+ load_priority?: number | undefined;
471
+ author?: string | undefined;
472
+ maintainer?: string | undefined;
473
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
474
+ implementation_status?: "planned" | "in_progress" | "complete" | "deprecated" | undefined;
475
+ tested?: boolean | undefined;
476
+ production_ready?: boolean | undefined;
477
+ estimated_read_time?: string | undefined;
478
+ word_count?: number | undefined;
479
+ last_validated?: string | undefined;
480
+ backlinks?: string[] | undefined;
481
+ id?: string | undefined;
482
+ confidence?: string | undefined;
483
+ last_verified?: string | undefined;
484
+ verify_command?: string | undefined;
485
+ provenance?: string[] | undefined;
486
+ sources?: string[] | undefined;
487
+ invalidated_by?: string[] | undefined;
488
+ working_dir?: string | undefined;
489
+ severity?: string | undefined;
490
+ resolution_status?: string | undefined;
491
+ components?: string[] | undefined;
492
+ incident_id?: string | undefined;
493
+ produced?: string[] | undefined;
494
+ strengthened?: string[] | undefined;
495
+ weakened?: string[] | undefined;
496
+ symptoms?: {
497
+ severity?: "low" | "medium" | "high" | "critical" | undefined;
498
+ alert_name?: string | undefined;
499
+ user_phrase?: string | string[] | undefined;
500
+ error_pattern?: string | undefined;
501
+ target?: string | undefined;
502
+ cites?: string[] | undefined;
503
+ }[] | undefined;
504
+ }, {
505
+ domains: string[];
506
+ title: string;
507
+ tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | "fact" | "incident-narrative" | "incident-facts";
508
+ status: string;
509
+ date?: unknown;
510
+ audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
511
+ tags?: string[] | undefined;
512
+ last_updated?: unknown;
513
+ version?: string | undefined;
514
+ purpose?: string | undefined;
515
+ related_docs?: string[] | undefined;
516
+ load_priority?: number | undefined;
517
+ author?: string | undefined;
518
+ maintainer?: string | undefined;
519
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
520
+ implementation_status?: "planned" | "in_progress" | "complete" | "deprecated" | undefined;
521
+ tested?: boolean | undefined;
522
+ production_ready?: boolean | undefined;
523
+ estimated_read_time?: string | undefined;
524
+ word_count?: number | undefined;
525
+ last_validated?: unknown;
526
+ backlinks?: string[] | undefined;
527
+ id?: string | undefined;
528
+ confidence?: string | undefined;
529
+ last_verified?: unknown;
530
+ verify_command?: string | undefined;
531
+ provenance?: string[] | undefined;
532
+ sources?: string[] | undefined;
533
+ invalidated_by?: string[] | undefined;
534
+ working_dir?: string | undefined;
535
+ severity?: string | undefined;
536
+ resolution_status?: string | undefined;
537
+ components?: string[] | undefined;
538
+ incident_id?: string | undefined;
539
+ produced?: string[] | undefined;
540
+ strengthened?: string[] | undefined;
541
+ weakened?: string[] | undefined;
542
+ symptoms?: {
543
+ severity?: "low" | "medium" | "high" | "critical" | undefined;
544
+ alert_name?: string | undefined;
545
+ user_phrase?: string | string[] | undefined;
546
+ error_pattern?: string | undefined;
547
+ target?: string | undefined;
548
+ cites?: string[] | undefined;
549
+ }[] | undefined;
550
+ }>, {
551
+ domains: string[];
552
+ title: string;
553
+ tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | "fact" | "incident-narrative" | "incident-facts";
554
+ status: string;
555
+ audience: ("devops" | "admin" | "all" | "developers")[];
556
+ tags: string[];
557
+ last_updated: string;
558
+ date?: string | undefined;
559
+ version?: string | undefined;
560
+ purpose?: string | undefined;
561
+ related_docs?: string[] | undefined;
562
+ load_priority?: number | undefined;
563
+ author?: string | undefined;
564
+ maintainer?: string | undefined;
565
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
566
+ implementation_status?: "planned" | "in_progress" | "complete" | "deprecated" | undefined;
567
+ tested?: boolean | undefined;
568
+ production_ready?: boolean | undefined;
569
+ estimated_read_time?: string | undefined;
570
+ word_count?: number | undefined;
571
+ last_validated?: string | undefined;
572
+ backlinks?: string[] | undefined;
573
+ id?: string | undefined;
574
+ confidence?: string | undefined;
575
+ last_verified?: string | undefined;
576
+ verify_command?: string | undefined;
577
+ provenance?: string[] | undefined;
578
+ sources?: string[] | undefined;
579
+ invalidated_by?: string[] | undefined;
580
+ working_dir?: string | undefined;
581
+ severity?: string | undefined;
582
+ resolution_status?: string | undefined;
583
+ components?: string[] | undefined;
584
+ incident_id?: string | undefined;
585
+ produced?: string[] | undefined;
586
+ strengthened?: string[] | undefined;
587
+ weakened?: string[] | undefined;
588
+ symptoms?: {
589
+ severity?: "low" | "medium" | "high" | "critical" | undefined;
590
+ alert_name?: string | undefined;
591
+ user_phrase?: string | string[] | undefined;
592
+ error_pattern?: string | undefined;
593
+ target?: string | undefined;
594
+ cites?: string[] | undefined;
595
+ }[] | undefined;
596
+ }, {
597
+ domains: string[];
598
+ title: string;
599
+ tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | "fact" | "incident-narrative" | "incident-facts";
600
+ status: string;
601
+ date?: unknown;
602
+ audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
603
+ tags?: string[] | undefined;
604
+ last_updated?: unknown;
605
+ version?: string | undefined;
606
+ purpose?: string | undefined;
607
+ related_docs?: string[] | undefined;
608
+ load_priority?: number | undefined;
609
+ author?: string | undefined;
610
+ maintainer?: string | undefined;
611
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
612
+ implementation_status?: "planned" | "in_progress" | "complete" | "deprecated" | undefined;
613
+ tested?: boolean | undefined;
614
+ production_ready?: boolean | undefined;
615
+ estimated_read_time?: string | undefined;
616
+ word_count?: number | undefined;
617
+ last_validated?: unknown;
618
+ backlinks?: string[] | undefined;
619
+ id?: string | undefined;
620
+ confidence?: string | undefined;
621
+ last_verified?: unknown;
622
+ verify_command?: string | undefined;
623
+ provenance?: string[] | undefined;
624
+ sources?: string[] | undefined;
625
+ invalidated_by?: string[] | undefined;
626
+ working_dir?: string | undefined;
627
+ severity?: string | undefined;
628
+ resolution_status?: string | undefined;
629
+ components?: string[] | undefined;
630
+ incident_id?: string | undefined;
631
+ produced?: string[] | undefined;
632
+ strengthened?: string[] | undefined;
633
+ weakened?: string[] | undefined;
634
+ symptoms?: {
635
+ severity?: "low" | "medium" | "high" | "critical" | undefined;
636
+ alert_name?: string | undefined;
637
+ user_phrase?: string | string[] | undefined;
638
+ error_pattern?: string | undefined;
639
+ target?: string | undefined;
640
+ cites?: string[] | undefined;
641
+ }[] | undefined;
642
+ }>, {
643
+ domains: string[];
644
+ title: string;
645
+ tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | "fact" | "incident-narrative" | "incident-facts";
646
+ status: string;
647
+ audience: ("devops" | "admin" | "all" | "developers")[];
648
+ tags: string[];
649
+ last_updated: string;
650
+ date?: string | undefined;
651
+ version?: string | undefined;
652
+ purpose?: string | undefined;
653
+ related_docs?: string[] | undefined;
654
+ load_priority?: number | undefined;
655
+ author?: string | undefined;
656
+ maintainer?: string | undefined;
657
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
658
+ implementation_status?: "planned" | "in_progress" | "complete" | "deprecated" | undefined;
659
+ tested?: boolean | undefined;
660
+ production_ready?: boolean | undefined;
661
+ estimated_read_time?: string | undefined;
662
+ word_count?: number | undefined;
663
+ last_validated?: string | undefined;
664
+ backlinks?: string[] | undefined;
665
+ id?: string | undefined;
666
+ confidence?: string | undefined;
667
+ last_verified?: string | undefined;
668
+ verify_command?: string | undefined;
669
+ provenance?: string[] | undefined;
670
+ sources?: string[] | undefined;
671
+ invalidated_by?: string[] | undefined;
672
+ working_dir?: string | undefined;
673
+ severity?: string | undefined;
674
+ resolution_status?: string | undefined;
675
+ components?: string[] | undefined;
676
+ incident_id?: string | undefined;
677
+ produced?: string[] | undefined;
678
+ strengthened?: string[] | undefined;
679
+ weakened?: string[] | undefined;
680
+ symptoms?: {
681
+ severity?: "low" | "medium" | "high" | "critical" | undefined;
682
+ alert_name?: string | undefined;
683
+ user_phrase?: string | string[] | undefined;
684
+ error_pattern?: string | undefined;
685
+ target?: string | undefined;
686
+ cites?: string[] | undefined;
687
+ }[] | undefined;
688
+ }, {
689
+ domains: string[];
690
+ title: string;
691
+ tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | "fact" | "incident-narrative" | "incident-facts";
692
+ status: string;
693
+ date?: unknown;
694
+ audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
695
+ tags?: string[] | undefined;
696
+ last_updated?: unknown;
697
+ version?: string | undefined;
698
+ purpose?: string | undefined;
699
+ related_docs?: string[] | undefined;
700
+ load_priority?: number | undefined;
701
+ author?: string | undefined;
702
+ maintainer?: string | undefined;
703
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
704
+ implementation_status?: "planned" | "in_progress" | "complete" | "deprecated" | undefined;
705
+ tested?: boolean | undefined;
706
+ production_ready?: boolean | undefined;
707
+ estimated_read_time?: string | undefined;
708
+ word_count?: number | undefined;
709
+ last_validated?: unknown;
710
+ backlinks?: string[] | undefined;
711
+ id?: string | undefined;
712
+ confidence?: string | undefined;
713
+ last_verified?: unknown;
714
+ verify_command?: string | undefined;
715
+ provenance?: string[] | undefined;
716
+ sources?: string[] | undefined;
717
+ invalidated_by?: string[] | undefined;
718
+ working_dir?: string | undefined;
719
+ severity?: string | undefined;
720
+ resolution_status?: string | undefined;
721
+ components?: string[] | undefined;
722
+ incident_id?: string | undefined;
723
+ produced?: string[] | undefined;
724
+ strengthened?: string[] | undefined;
725
+ weakened?: string[] | undefined;
726
+ symptoms?: {
727
+ severity?: "low" | "medium" | "high" | "critical" | undefined;
728
+ alert_name?: string | undefined;
729
+ user_phrase?: string | string[] | undefined;
730
+ error_pattern?: string | undefined;
731
+ target?: string | undefined;
732
+ cites?: string[] | undefined;
733
+ }[] | 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<["guide" | "standard" | "example" | "reference" | "admin", ...("guide" | "standard" | "example" | "reference" | "admin")[]]>>;
743
+ tier: z.ZodOptional<z.ZodEnum<["guide" | "standard" | "example" | "reference" | "admin" | "plan" | "fact" | "incident-narrative" | "incident-facts", ...("guide" | "standard" | "example" | "reference" | "admin" | "plan" | "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,52 @@ 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?: "low" | "medium" | "high" | "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?: "low" | "medium" | "high" | "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;
105
803
  title?: string | undefined;
106
- tier?: "guide" | "standard" | "example" | "reference" | "admin" | undefined;
107
- status?: "draft" | "active" | "deprecated" | "archived" | undefined;
804
+ tier?: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | "fact" | "incident-narrative" | "incident-facts" | undefined;
805
+ status?: string | undefined;
806
+ date?: string | undefined;
108
807
  audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
109
808
  tags?: string[] | undefined;
110
809
  last_updated?: string | undefined;
@@ -115,21 +814,45 @@ export declare const PartialMetadataSchema: z.ZodObject<{
115
814
  author?: string | undefined;
116
815
  maintainer?: string | undefined;
117
816
  review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
118
- implementation_status?: "deprecated" | "planned" | "in_progress" | "complete" | undefined;
817
+ implementation_status?: "planned" | "in_progress" | "complete" | "deprecated" | undefined;
119
818
  tested?: boolean | undefined;
120
819
  production_ready?: boolean | undefined;
121
820
  estimated_read_time?: string | undefined;
122
821
  word_count?: number | undefined;
123
822
  last_validated?: string | undefined;
124
823
  backlinks?: string[] | undefined;
824
+ id?: string | undefined;
825
+ confidence?: string | undefined;
826
+ last_verified?: string | undefined;
827
+ verify_command?: string | undefined;
828
+ provenance?: string[] | undefined;
829
+ sources?: string[] | undefined;
830
+ invalidated_by?: string[] | undefined;
831
+ working_dir?: string | undefined;
832
+ severity?: string | undefined;
833
+ resolution_status?: string | undefined;
834
+ components?: string[] | undefined;
835
+ incident_id?: string | undefined;
836
+ produced?: string[] | undefined;
837
+ strengthened?: string[] | undefined;
838
+ weakened?: string[] | undefined;
839
+ symptoms?: {
840
+ severity?: "low" | "medium" | "high" | "critical" | undefined;
841
+ alert_name?: string | undefined;
842
+ user_phrase?: string | string[] | undefined;
843
+ error_pattern?: string | undefined;
844
+ target?: string | undefined;
845
+ cites?: string[] | undefined;
846
+ }[] | undefined;
125
847
  }, {
126
848
  domains?: string[] | undefined;
127
849
  title?: string | undefined;
128
- tier?: "guide" | "standard" | "example" | "reference" | "admin" | undefined;
129
- status?: "draft" | "active" | "deprecated" | "archived" | undefined;
850
+ tier?: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | "fact" | "incident-narrative" | "incident-facts" | undefined;
851
+ status?: string | undefined;
852
+ date?: unknown;
130
853
  audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
131
854
  tags?: string[] | undefined;
132
- last_updated?: string | undefined;
855
+ last_updated?: unknown;
133
856
  version?: string | undefined;
134
857
  purpose?: string | undefined;
135
858
  related_docs?: string[] | undefined;
@@ -137,65 +860,103 @@ export declare const PartialMetadataSchema: z.ZodObject<{
137
860
  author?: string | undefined;
138
861
  maintainer?: string | undefined;
139
862
  review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
140
- implementation_status?: "deprecated" | "planned" | "in_progress" | "complete" | undefined;
863
+ implementation_status?: "planned" | "in_progress" | "complete" | "deprecated" | undefined;
141
864
  tested?: boolean | undefined;
142
865
  production_ready?: boolean | undefined;
143
866
  estimated_read_time?: string | undefined;
144
867
  word_count?: number | undefined;
145
- last_validated?: string | undefined;
868
+ last_validated?: unknown;
146
869
  backlinks?: string[] | undefined;
870
+ id?: string | undefined;
871
+ confidence?: string | undefined;
872
+ last_verified?: unknown;
873
+ verify_command?: string | undefined;
874
+ provenance?: string[] | undefined;
875
+ sources?: string[] | undefined;
876
+ invalidated_by?: string[] | undefined;
877
+ working_dir?: string | undefined;
878
+ severity?: string | undefined;
879
+ resolution_status?: string | undefined;
880
+ components?: string[] | undefined;
881
+ incident_id?: string | undefined;
882
+ produced?: string[] | undefined;
883
+ strengthened?: string[] | undefined;
884
+ weakened?: string[] | undefined;
885
+ symptoms?: {
886
+ severity?: "low" | "medium" | "high" | "critical" | undefined;
887
+ alert_name?: string | undefined;
888
+ user_phrase?: string | string[] | undefined;
889
+ error_pattern?: string | undefined;
890
+ target?: string | undefined;
891
+ cites?: string[] | undefined;
892
+ }[] | 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