@theglitchking/hit-em-with-the-docs 2.2.0 → 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 +709 -58
  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 +83 -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 +709 -58
  80. package/dist/core/metadata/schema.d.ts.map +1 -1
  81. package/dist/core/metadata/schema.js +453 -79
  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,24 +1,35 @@
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 metadata schema (22 fields total).
11
+ * Complete metadata schema with all conditional refinements applied.
4
12
  *
5
- * Required fields: title, tier, domains, status, last_updated.
6
- * Plus `version` — required for ALL tiers EXCEPT `tier: "plan"`.
7
- *
8
- * Plans (introduced in 2.2.0 for persistent-planning lg-mode interop) use
9
- * lifecycle status instead of semver. The .refine() below enforces:
10
- * - tier !== 'plan' → version is required
11
- * - tier === 'plan' version is optional (may be absent or supplied)
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)
12
23
  */
13
- export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
24
+ export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
14
25
  title: z.ZodString;
15
- tier: z.ZodEnum<["guide" | "standard" | "example" | "reference" | "admin" | "plan", ...("guide" | "standard" | "example" | "reference" | "admin" | "plan")[]]>;
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")[]]>;
16
27
  domains: z.ZodArray<z.ZodString, "many">;
17
28
  audience: z.ZodDefault<z.ZodArray<z.ZodEnum<["all", "developers", "devops", "admin"]>, "many">>;
18
29
  tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
19
30
  } & {
20
31
  status: z.ZodString;
21
- last_updated: z.ZodString;
32
+ last_updated: z.ZodEffects<z.ZodString, string, unknown>;
22
33
  version: z.ZodOptional<z.ZodString>;
23
34
  } & {
24
35
  purpose: z.ZodOptional<z.ZodString>;
@@ -35,16 +46,56 @@ export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
35
46
  } & {
36
47
  estimated_read_time: z.ZodOptional<z.ZodString>;
37
48
  word_count: z.ZodOptional<z.ZodNumber>;
38
- last_validated: z.ZodOptional<z.ZodString>;
49
+ last_validated: z.ZodOptional<z.ZodEffects<z.ZodString, string, unknown>>;
39
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">>;
40
90
  }, "strip", z.ZodTypeAny, {
41
91
  domains: string[];
42
92
  title: string;
43
- tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan";
93
+ tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | "fact" | "incident-narrative" | "incident-facts";
44
94
  status: string;
45
95
  audience: ("devops" | "admin" | "all" | "developers")[];
46
96
  tags: string[];
47
97
  last_updated: string;
98
+ date?: string | undefined;
48
99
  version?: string | undefined;
49
100
  purpose?: string | undefined;
50
101
  related_docs?: string[] | undefined;
@@ -59,14 +110,38 @@ export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
59
110
  word_count?: number | undefined;
60
111
  last_validated?: string | undefined;
61
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;
62
136
  }, {
63
137
  domains: string[];
64
138
  title: string;
65
- tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan";
139
+ tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | "fact" | "incident-narrative" | "incident-facts";
66
140
  status: string;
67
- last_updated: string;
141
+ date?: unknown;
68
142
  audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
69
143
  tags?: string[] | undefined;
144
+ last_updated?: unknown;
70
145
  version?: string | undefined;
71
146
  purpose?: string | undefined;
72
147
  related_docs?: string[] | undefined;
@@ -79,16 +154,40 @@ export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
79
154
  production_ready?: boolean | undefined;
80
155
  estimated_read_time?: string | undefined;
81
156
  word_count?: number | undefined;
82
- last_validated?: string | undefined;
157
+ last_validated?: unknown;
83
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;
84
182
  }>, {
85
183
  domains: string[];
86
184
  title: string;
87
- tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan";
185
+ tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | "fact" | "incident-narrative" | "incident-facts";
88
186
  status: string;
89
187
  audience: ("devops" | "admin" | "all" | "developers")[];
90
188
  tags: string[];
91
189
  last_updated: string;
190
+ date?: string | undefined;
92
191
  version?: string | undefined;
93
192
  purpose?: string | undefined;
94
193
  related_docs?: string[] | undefined;
@@ -103,14 +202,176 @@ export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
103
202
  word_count?: number | undefined;
104
203
  last_validated?: string | undefined;
105
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;
106
228
  }, {
107
229
  domains: string[];
108
230
  title: string;
109
- tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan";
231
+ tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | "fact" | "incident-narrative" | "incident-facts";
232
+ status: string;
233
+ date?: unknown;
234
+ audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
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";
110
278
  status: string;
279
+ audience: ("devops" | "admin" | "all" | "developers")[];
280
+ tags: string[];
111
281
  last_updated: string;
282
+ date?: string | undefined;
283
+ version?: string | undefined;
284
+ purpose?: string | undefined;
285
+ related_docs?: string[] | undefined;
286
+ load_priority?: number | undefined;
287
+ author?: string | undefined;
288
+ maintainer?: string | undefined;
289
+ review_frequency?: "weekly" | "monthly" | "quarterly" | "annually" | undefined;
290
+ implementation_status?: "planned" | "in_progress" | "complete" | "deprecated" | undefined;
291
+ tested?: boolean | undefined;
292
+ production_ready?: boolean | undefined;
293
+ estimated_read_time?: string | undefined;
294
+ word_count?: number | undefined;
295
+ last_validated?: string | undefined;
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;
112
326
  audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
113
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;
114
375
  version?: string | undefined;
115
376
  purpose?: string | undefined;
116
377
  related_docs?: string[] | undefined;
@@ -125,14 +386,84 @@ export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
125
386
  word_count?: number | undefined;
126
387
  last_validated?: string | undefined;
127
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;
128
458
  }>, {
129
459
  domains: string[];
130
460
  title: string;
131
- tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan";
461
+ tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | "fact" | "incident-narrative" | "incident-facts";
132
462
  status: string;
133
463
  audience: ("devops" | "admin" | "all" | "developers")[];
134
464
  tags: string[];
135
465
  last_updated: string;
466
+ date?: string | undefined;
136
467
  version?: string | undefined;
137
468
  purpose?: string | undefined;
138
469
  related_docs?: string[] | undefined;
@@ -147,14 +478,176 @@ export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
147
478
  word_count?: number | undefined;
148
479
  last_validated?: string | undefined;
149
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;
150
504
  }, {
151
505
  domains: string[];
152
506
  title: string;
153
- tier: "guide" | "standard" | "example" | "reference" | "admin" | "plan";
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";
154
554
  status: string;
555
+ audience: ("devops" | "admin" | "all" | "developers")[];
556
+ tags: string[];
155
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;
156
602
  audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
157
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;
158
651
  version?: string | undefined;
159
652
  purpose?: string | undefined;
160
653
  related_docs?: string[] | undefined;
@@ -169,22 +662,90 @@ export declare const MetadataSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
169
662
  word_count?: number | undefined;
170
663
  last_validated?: string | undefined;
171
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;
172
734
  }>;
173
735
  export type DocumentMetadata = z.infer<typeof MetadataSchema>;
174
736
  /**
175
737
  * Partial schema for documents that may have incomplete metadata.
176
- * Built from the un-refined base so all fields (including version) are
177
- * optional, regardless of tier — this is the schema used by `hewtd fix`
178
- * to identify incomplete docs.
738
+ * Built from the un-refined base so every field is optional regardless of
739
+ * tier — used by `hewtd fix` to identify incomplete docs.
179
740
  */
180
741
  export declare const PartialMetadataSchema: z.ZodObject<{
181
742
  title: z.ZodOptional<z.ZodString>;
182
- tier: z.ZodOptional<z.ZodEnum<["guide" | "standard" | "example" | "reference" | "admin" | "plan", ...("guide" | "standard" | "example" | "reference" | "admin" | "plan")[]]>>;
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")[]]>>;
183
744
  domains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
184
745
  audience: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<["all", "developers", "devops", "admin"]>, "many">>>;
185
746
  tags: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
186
747
  status: z.ZodOptional<z.ZodString>;
187
- last_updated: z.ZodOptional<z.ZodString>;
748
+ last_updated: z.ZodOptional<z.ZodEffects<z.ZodString, string, unknown>>;
188
749
  version: z.ZodOptional<z.ZodOptional<z.ZodString>>;
189
750
  purpose: z.ZodOptional<z.ZodOptional<z.ZodString>>;
190
751
  related_docs: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
@@ -197,13 +758,52 @@ export declare const PartialMetadataSchema: z.ZodObject<{
197
758
  production_ready: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
198
759
  estimated_read_time: z.ZodOptional<z.ZodOptional<z.ZodString>>;
199
760
  word_count: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
200
- last_validated: z.ZodOptional<z.ZodOptional<z.ZodString>>;
761
+ last_validated: z.ZodOptional<z.ZodOptional<z.ZodEffects<z.ZodString, string, unknown>>>;
201
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">>>;
202
801
  }, "strip", z.ZodTypeAny, {
203
802
  domains?: string[] | undefined;
204
803
  title?: string | undefined;
205
- tier?: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | undefined;
804
+ tier?: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | "fact" | "incident-narrative" | "incident-facts" | undefined;
206
805
  status?: string | undefined;
806
+ date?: string | undefined;
207
807
  audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
208
808
  tags?: string[] | undefined;
209
809
  last_updated?: string | undefined;
@@ -221,14 +821,38 @@ export declare const PartialMetadataSchema: z.ZodObject<{
221
821
  word_count?: number | undefined;
222
822
  last_validated?: string | undefined;
223
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;
224
847
  }, {
225
848
  domains?: string[] | undefined;
226
849
  title?: string | undefined;
227
- tier?: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | undefined;
850
+ tier?: "guide" | "standard" | "example" | "reference" | "admin" | "plan" | "fact" | "incident-narrative" | "incident-facts" | undefined;
228
851
  status?: string | undefined;
852
+ date?: unknown;
229
853
  audience?: ("devops" | "admin" | "all" | "developers")[] | undefined;
230
854
  tags?: string[] | undefined;
231
- last_updated?: string | undefined;
855
+ last_updated?: unknown;
232
856
  version?: string | undefined;
233
857
  purpose?: string | undefined;
234
858
  related_docs?: string[] | undefined;
@@ -241,71 +865,98 @@ export declare const PartialMetadataSchema: z.ZodObject<{
241
865
  production_ready?: boolean | undefined;
242
866
  estimated_read_time?: string | undefined;
243
867
  word_count?: number | undefined;
244
- last_validated?: string | undefined;
868
+ last_validated?: unknown;
245
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;
246
893
  }>;
247
894
  export type PartialDocumentMetadata = z.infer<typeof PartialMetadataSchema>;
248
895
  /**
249
- * Required fields that must always be present.
896
+ * Required fields shared across all tiers.
250
897
  *
251
- * Note: `version` is conditionally required — it must be present for ALL
252
- * tiers EXCEPT `tier: "plan"`, where it may be absent (plans use lifecycle
253
- * status instead of semver). The list below preserves the historical
254
- * 6-required-field contract for non-plan docs; for plan-tier docs, the
255
- * effective required list is the first 5 entries (without `version`).
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()`.
256
904
  *
257
- * Use `getMissingRequiredFields(data)` for tier-aware checks rather than
905
+ * Prefer `getMissingRequiredFields(data)` for tier-aware checks rather than
258
906
  * iterating REQUIRED_FIELDS directly.
259
907
  */
260
908
  export declare const REQUIRED_FIELDS: readonly ["title", "tier", "domains", "status", "last_updated", "version"];
261
909
  /**
262
- * 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.
263
914
  */
915
+ declare const TIER_REQUIRED_EXTENSIONS: Partial<Record<Tier, readonly string[]>>;
264
916
  export declare const OPTIONAL_FIELDS_DEFAULTS: Partial<DocumentMetadata>;
265
- /**
266
- * Auto-generated fields that should not be manually edited
267
- */
268
917
  export declare const AUTO_GENERATED_FIELDS: readonly ["estimated_read_time", "word_count", "last_validated", "backlinks"];
269
918
  /**
270
- * 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.
271
922
  */
272
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"];
273
924
  export type MetadataField = (typeof ALL_METADATA_FIELDS)[number];
274
- /**
275
- * Validate metadata against the schema
276
- */
277
925
  export declare function validateMetadata(data: unknown): {
278
926
  valid: boolean;
279
927
  errors: string[];
280
928
  data?: DocumentMetadata;
281
929
  };
282
930
  /**
283
- * 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.
284
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[];
285
941
  export declare function validatePartialMetadata(data: unknown): {
286
942
  valid: boolean;
287
943
  errors: string[];
288
944
  data?: PartialDocumentMetadata;
289
945
  };
290
946
  /**
291
- * Get missing required fields, respecting the tier-conditional `version`
292
- * exception. For `tier: "plan"`, missing `version` is NOT reported as
293
- * missing — plans use lifecycle status, not semver.
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.
294
953
  */
295
954
  export declare function getMissingRequiredFields(data: Record<string, unknown>): string[];
296
- /**
297
- * Get all missing fields (both required and optional)
298
- */
299
955
  export declare function getMissingFields(data: Record<string, unknown>): {
300
956
  required: string[];
301
957
  optional: string[];
302
958
  };
303
- /**
304
- * Calculate metadata completeness percentage
305
- */
306
959
  export declare function calculateMetadataCompleteness(data: Record<string, unknown>): number;
307
- /**
308
- * Get field category
309
- */
310
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, };
311
962
  //# sourceMappingURL=schema.d.ts.map