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