@fenglimg/fabric-shared 2.0.0-rc.1 → 2.0.0-rc.11
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.
- package/dist/chunk-NNDFOOBO.js +626 -0
- package/dist/{chunk-KHIM6MWS.js → chunk-W4TKEXRG.js} +133 -15
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/index.d.ts +2610 -735
- package/dist/index.js +355 -37
- package/dist/schemas/api-contracts.d.ts +684 -103
- package/dist/schemas/api-contracts.js +39 -13
- package/dist/types/index.d.ts +14 -6
- package/package.json +1 -1
- package/dist/chunk-HACPXMLL.js +0 -314
package/dist/index.js
CHANGED
|
@@ -6,33 +6,46 @@ import {
|
|
|
6
6
|
enMessages,
|
|
7
7
|
normalizeLocale,
|
|
8
8
|
zhCNMessages
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-W4TKEXRG.js";
|
|
10
10
|
import {
|
|
11
|
+
FabExtractKnowledgeInputSchema,
|
|
12
|
+
FabExtractKnowledgeInputShape,
|
|
13
|
+
FabExtractKnowledgeOutputSchema,
|
|
14
|
+
FabReviewInputSchema,
|
|
15
|
+
FabReviewInputShape,
|
|
16
|
+
FabReviewOutputSchema,
|
|
17
|
+
FabReviewOutputShape,
|
|
11
18
|
KNOWLEDGE_TYPE_CODES,
|
|
12
19
|
KnowledgeEntryFrontmatterSchema,
|
|
13
20
|
KnowledgeTypeSchema,
|
|
14
21
|
LayerSchema,
|
|
15
22
|
MaturitySchema,
|
|
23
|
+
PROPOSED_REASON_DESCRIPTIONS,
|
|
24
|
+
ProposedReasonSchema,
|
|
16
25
|
StableIdSchema,
|
|
17
26
|
annotateIntentRequestSchema,
|
|
27
|
+
fabExtractKnowledgeAnnotations,
|
|
28
|
+
fabReviewAnnotations,
|
|
18
29
|
formatKnowledgeId,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
30
|
+
getKnowledgeAnnotations,
|
|
31
|
+
getKnowledgeInputSchema,
|
|
32
|
+
getKnowledgeOutputSchema,
|
|
22
33
|
historyStateQuerySchema,
|
|
23
34
|
humanLockApproveRequestSchema,
|
|
24
35
|
humanLockFileParamsSchema,
|
|
36
|
+
knowledgeSectionsAnnotations,
|
|
37
|
+
knowledgeSectionsInputSchema,
|
|
38
|
+
knowledgeSectionsOutputSchema,
|
|
25
39
|
ledgerQuerySchema,
|
|
26
40
|
ledgerSourceSchema,
|
|
27
41
|
parseKnowledgeId,
|
|
28
42
|
planContextAnnotations,
|
|
43
|
+
planContextHintNarrowEntrySchema,
|
|
44
|
+
planContextHintOutputSchema,
|
|
29
45
|
planContextInputSchema,
|
|
30
46
|
planContextOutputSchema,
|
|
31
|
-
ruleSectionsAnnotations,
|
|
32
|
-
ruleSectionsInputSchema,
|
|
33
|
-
ruleSectionsOutputSchema,
|
|
34
47
|
structuredWarningSchema
|
|
35
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-NNDFOOBO.js";
|
|
36
49
|
import "./chunk-LXNCAKJZ.js";
|
|
37
50
|
|
|
38
51
|
// src/schemas/agents-meta.ts
|
|
@@ -59,7 +72,13 @@ var ruleDescriptionSchema = z.object({
|
|
|
59
72
|
layer_reason: z.string().optional(),
|
|
60
73
|
created_at: z.string().optional(),
|
|
61
74
|
// v2/rc.2: flat flow-style YAML array; populated by init-scan from forensic tech stack and editable by user. Used by rc.3 review skill for tag-filter search.
|
|
62
|
-
tags: z.array(z.string()).default([]).optional()
|
|
75
|
+
tags: z.array(z.string()).default([]).optional(),
|
|
76
|
+
// v2.0-rc.5 (C1): relevance scope/paths drive plan-context-hint narrowing.
|
|
77
|
+
// Defaults applied so existing entries lacking these fields parse cleanly:
|
|
78
|
+
// relevance_scope → 'broad' (always-surface, safe default)
|
|
79
|
+
// relevance_paths → [] (no path anchors)
|
|
80
|
+
relevance_scope: z.enum(["narrow", "broad"]).default("broad"),
|
|
81
|
+
relevance_paths: z.array(z.string()).default([])
|
|
63
82
|
}).strict();
|
|
64
83
|
var ruleDescriptionIndexItemSchema = z.object({
|
|
65
84
|
stable_id: z.string(),
|
|
@@ -72,11 +91,6 @@ var agentsMetaNodeBaseSchema = z.object({
|
|
|
72
91
|
file: z.string(),
|
|
73
92
|
content_ref: z.string().optional(),
|
|
74
93
|
scope_glob: z.string(),
|
|
75
|
-
deps: z.array(z.string()),
|
|
76
|
-
priority: z.enum(["high", "medium", "low"]),
|
|
77
|
-
level: agentsLayerSchema.optional(),
|
|
78
|
-
layer: agentsLayerSchema,
|
|
79
|
-
topology_type: agentsTopologyTypeSchema,
|
|
80
94
|
hash: z.string(),
|
|
81
95
|
stable_id: z.string().optional(),
|
|
82
96
|
identity_source: agentsIdentitySourceSchema.optional(),
|
|
@@ -86,7 +100,7 @@ var agentsMetaNodeBaseSchema = z.object({
|
|
|
86
100
|
}).optional(),
|
|
87
101
|
description: ruleDescriptionSchema.optional(),
|
|
88
102
|
sections: z.array(z.string()).optional()
|
|
89
|
-
});
|
|
103
|
+
}).passthrough();
|
|
90
104
|
var agentsMetaNodeSchema = z.preprocess((value) => {
|
|
91
105
|
if (!isRecord(value) || typeof value.file !== "string") {
|
|
92
106
|
return value;
|
|
@@ -205,11 +219,11 @@ function isRecord(value) {
|
|
|
205
219
|
return typeof value === "object" && value !== null;
|
|
206
220
|
}
|
|
207
221
|
|
|
208
|
-
// src/schemas/
|
|
222
|
+
// src/schemas/knowledge-test-index.ts
|
|
209
223
|
import { z as z2 } from "zod";
|
|
210
|
-
var
|
|
224
|
+
var KNOWLEDGE_TEST_INDEX_SCHEMA_VERSION = 1;
|
|
211
225
|
var hashSchema = z2.string().min(1);
|
|
212
|
-
var
|
|
226
|
+
var knowledgeTestLinkSchema = z2.object({
|
|
213
227
|
rule_stable_id: z2.string().min(1),
|
|
214
228
|
rule_file: z2.string().min(1),
|
|
215
229
|
rule_hash: hashSchema,
|
|
@@ -219,20 +233,20 @@ var ruleTestLinkSchema = z2.object({
|
|
|
219
233
|
previous_test_hash: hashSchema.optional(),
|
|
220
234
|
annotation_line: z2.number().int().positive()
|
|
221
235
|
}).strict();
|
|
222
|
-
var
|
|
236
|
+
var knowledgeTestOrphanAnnotationSchema = z2.object({
|
|
223
237
|
rule_stable_id: z2.string().min(1),
|
|
224
238
|
test_file: z2.string().min(1),
|
|
225
239
|
test_hash: hashSchema,
|
|
226
240
|
previous_test_hash: hashSchema.optional(),
|
|
227
241
|
annotation_line: z2.number().int().positive()
|
|
228
242
|
}).strict();
|
|
229
|
-
var
|
|
230
|
-
schema_version: z2.literal(
|
|
243
|
+
var knowledgeTestIndexSchema = z2.object({
|
|
244
|
+
schema_version: z2.literal(KNOWLEDGE_TEST_INDEX_SCHEMA_VERSION),
|
|
231
245
|
generated_at: z2.string().datetime({ offset: true }),
|
|
232
246
|
revision: z2.string().min(1).optional(),
|
|
233
247
|
previous_revision: z2.string().min(1).optional(),
|
|
234
|
-
links: z2.array(
|
|
235
|
-
orphan_annotations: z2.array(
|
|
248
|
+
links: z2.array(knowledgeTestLinkSchema),
|
|
249
|
+
orphan_annotations: z2.array(knowledgeTestOrphanAnnotationSchema)
|
|
236
250
|
}).strict();
|
|
237
251
|
|
|
238
252
|
// src/schemas/ledger-entry.ts
|
|
@@ -292,13 +306,132 @@ var mcpPayloadLimitsSchema = z5.object({
|
|
|
292
306
|
warnBytes: z5.number().int().positive().optional(),
|
|
293
307
|
hardBytes: z5.number().int().positive().optional()
|
|
294
308
|
}).optional();
|
|
309
|
+
var knowledgeLanguageSchema = z5.enum(["match-existing", "zh-CN", "en"]);
|
|
310
|
+
var defaultLayerFilterSchema = z5.enum(["team", "personal", "both"]);
|
|
295
311
|
var fabricConfigSchema = z5.object({
|
|
296
312
|
clientPaths: clientPathsSchema.optional(),
|
|
297
313
|
externalFixturePath: z5.string().optional(),
|
|
298
314
|
scanIgnores: z5.array(z5.string()).optional(),
|
|
299
315
|
auditMode: auditModeSchema.optional(),
|
|
300
316
|
audit_mode: auditModeSchema.optional(),
|
|
301
|
-
mcpPayloadLimits: mcpPayloadLimitsSchema
|
|
317
|
+
mcpPayloadLimits: mcpPayloadLimitsSchema,
|
|
318
|
+
// Backward-compat: both fields are optional with defaults so existing
|
|
319
|
+
// fabric-config.json files (pre-grill-followup) parse unchanged. The default
|
|
320
|
+
// values themselves are load-bearing — see docs/data-schema.md.
|
|
321
|
+
knowledge_language: knowledgeLanguageSchema.optional().default("match-existing"),
|
|
322
|
+
default_layer_filter: defaultLayerFilterSchema.optional().default("both"),
|
|
323
|
+
// Cooldown for the fabric-hint Stop hook (formerly archive-hint, renamed in
|
|
324
|
+
// rc.5 TASK-010). After ANY of the three signals (archive / review / import)
|
|
325
|
+
// fires, that signal stays silent for this many hours regardless of state
|
|
326
|
+
// drift — purely a reminder throttle. Default 12 means "at most twice per
|
|
327
|
+
// day if the user keeps ignoring it." Set to 24 to align with the archive
|
|
328
|
+
// trigger threshold. The legacy `archive_hint_` key is retained for backward
|
|
329
|
+
// compat with existing user fabric-config.json files.
|
|
330
|
+
archive_hint_cooldown_hours: z5.number().int().positive().optional().default(12),
|
|
331
|
+
// Underseed-node threshold for the fabric-hint Stop hook's import signal
|
|
332
|
+
// (rc.5 TASK-010). When the canonical knowledge node count is strictly less
|
|
333
|
+
// than this value AND a successful `init_scan_completed` event happened at
|
|
334
|
+
// least 24h ago AND no `knowledge_proposed` event has fired in the last 24h,
|
|
335
|
+
// the hook recommends running the fabric-import skill. Default 10 reflects
|
|
336
|
+
// the rule-of-thumb that a workspace with fewer than ten knowledge entries
|
|
337
|
+
// is below the floor for plan_context retrieval to be meaningful. Also
|
|
338
|
+
// consumed by `doctor` lint #22 (knowledge_underseeded).
|
|
339
|
+
underseed_node_threshold: z5.number().int().positive().optional().default(10),
|
|
340
|
+
// Edit-count threshold for the fabric-hint Stop hook's Signal A
|
|
341
|
+
// (rc.6 TASK-022 / E5). Signal A fires when EITHER (a) >=24h have elapsed
|
|
342
|
+
// since the last `knowledge_proposed` event, OR (b) >=archive_edit_threshold
|
|
343
|
+
// PreToolUse fires have been recorded in `.fabric/.cache/edit-counter` since
|
|
344
|
+
// the last `knowledge_proposed` event. The edit-counter sidecar is populated
|
|
345
|
+
// by the rc.6 PreToolUse hook (TASK-020 / E4) — one ISO-8601 line per fire.
|
|
346
|
+
// Default 20 reflects the rule-of-thumb "after ~20 Edit/Write operations
|
|
347
|
+
// there is probably something worth archiving"; lowered values nag more
|
|
348
|
+
// aggressively, higher values rely on the 24h fallback. Missing or absent
|
|
349
|
+
// edit-counter file degrades safely to the 24h-only path.
|
|
350
|
+
archive_edit_threshold: z5.number().int().positive().optional().default(20),
|
|
351
|
+
// rc.7 T7: hours-since-last-knowledge_proposed cutoff for Signal A's
|
|
352
|
+
// time branch. Was hardcoded as 24 in fabric-hint.cjs's THRESHOLD_HOURS;
|
|
353
|
+
// externalized so chatty workspaces can lower the bar and quiet ones can
|
|
354
|
+
// raise it. Default 24 preserves rc.6 behavior. See docs/configuration.md.
|
|
355
|
+
archive_hint_hours: z5.number().int().positive().optional().default(24),
|
|
356
|
+
// rc.7 T7: pending-count cutoff for Signal B (review skill). Was
|
|
357
|
+
// hardcoded as 10 in fabric-hint.cjs's THRESHOLD_PENDING_COUNT.
|
|
358
|
+
// Default 10 preserves rc.6 behavior. See docs/configuration.md for
|
|
359
|
+
// small/medium/large repo recommendations.
|
|
360
|
+
review_hint_pending_count: z5.number().int().positive().optional().default(10),
|
|
361
|
+
// rc.7 T7: pending-age cutoff (in days) for Signal B (review skill).
|
|
362
|
+
// Was hardcoded as 7 in fabric-hint.cjs's THRESHOLD_PENDING_AGE_DAYS.
|
|
363
|
+
// Default 7 preserves rc.6 behavior. See docs/configuration.md.
|
|
364
|
+
review_hint_pending_age_days: z5.number().int().positive().optional().default(7),
|
|
365
|
+
// rc.7 T7 + T10 pre-wiring: days-since-last-doctor cutoff for the future
|
|
366
|
+
// Signal D (maintenance hint). T10 will consume this to decide when the
|
|
367
|
+
// fabric-hint Stop hook surfaces a "run `fabric doctor`" reminder.
|
|
368
|
+
// Default 14 reflects a fortnightly cadence — long enough to avoid nag,
|
|
369
|
+
// short enough to catch index drift before it compounds.
|
|
370
|
+
maintenance_hint_days: z5.number().int().positive().optional().default(14),
|
|
371
|
+
// rc.7 T7 + T10 pre-wiring: cooldown between Signal D reminders, in
|
|
372
|
+
// days. Once Signal D fires, it stays silent for this many days even if
|
|
373
|
+
// the user doesn't run doctor. Default 7 keeps the reminder weekly at
|
|
374
|
+
// worst — pairing 14d trigger + 7d cooldown means at most ~2 reminders
|
|
375
|
+
// per month for a workspace that ignores them.
|
|
376
|
+
maintenance_hint_cooldown_days: z5.number().int().positive().optional().default(7),
|
|
377
|
+
// rc.9+ (skill-contract-fix B1): first-run import window in months. The
|
|
378
|
+
// `fabric-import` skill scans this many months of git history on the very
|
|
379
|
+
// first invocation (when no prior `import_run_completed` event exists).
|
|
380
|
+
// Default 60 (~5 years) captures the bulk of a mature repo's signal in
|
|
381
|
+
// one pass; small / fresh repos can lower to 12-24 with no loss.
|
|
382
|
+
import_window_first_run_months: z5.number().int().min(1).optional().default(60),
|
|
383
|
+
// rc.9+ (skill-contract-fix B1): rerun import window in months. After
|
|
384
|
+
// the first successful import, subsequent runs only scan this many
|
|
385
|
+
// recent months — assumed everything older has already been crystallized
|
|
386
|
+
// into pending or canonical knowledge. Default 2 keeps incremental cost
|
|
387
|
+
// low; raise to 6 if the workspace pauses fabric-import for long stretches.
|
|
388
|
+
import_window_rerun_months: z5.number().int().min(1).optional().default(2),
|
|
389
|
+
// rc.9+ (skill-contract-fix B1): hard cap on pending entries produced
|
|
390
|
+
// per fabric-import invocation. Prevents one run from dumping hundreds
|
|
391
|
+
// of proposals when a backfill window is wide open. Default 10 matches
|
|
392
|
+
// the rule-of-thumb "human can triage ~10 pending entries in one
|
|
393
|
+
// review pass." Range 1-50.
|
|
394
|
+
import_max_pending_per_run: z5.number().int().min(1).max(50).optional().default(10),
|
|
395
|
+
// rc.9+ (skill-contract-fix B1): hard cap on commits scanned per
|
|
396
|
+
// fabric-import invocation. Bounds runtime on monorepos with high
|
|
397
|
+
// commit velocity. Default 500 covers ~2 months of typical churn;
|
|
398
|
+
// range 50-2000. Hitting the cap mid-window is logged but non-fatal.
|
|
399
|
+
import_max_commits_scan: z5.number().int().min(50).max(2e3).optional().default(500),
|
|
400
|
+
// rc.9+ (skill-contract-fix B1): canonical-node count above which
|
|
401
|
+
// fabric-import's pre-flight should warn / suggest review instead of
|
|
402
|
+
// proceeding. A workspace with 50+ canonical entries usually benefits
|
|
403
|
+
// more from `fabric-review` to consolidate than from importing more.
|
|
404
|
+
// Default 50; raise to 100+ for large polyglot repos.
|
|
405
|
+
import_skip_canonical_threshold: z5.number().int().positive().optional().default(50),
|
|
406
|
+
// rc.9+ (skill-contract-fix B1): max candidate entries surfaced per
|
|
407
|
+
// fabric-archive batch (one invocation of the skill). Pagination knob
|
|
408
|
+
// for the archive UI flow. Default 8 keeps each batch reviewable in
|
|
409
|
+
// one sitting; raise for large repos with high archive throughput.
|
|
410
|
+
archive_max_candidates_per_batch: z5.number().int().positive().optional().default(8),
|
|
411
|
+
// rc.9+ (skill-contract-fix B1): max recently-touched paths included
|
|
412
|
+
// in fabric-archive's "relevant context" lookup. Limits the size of
|
|
413
|
+
// the path-relevance digest the skill emits when ranking candidates.
|
|
414
|
+
// Default 20; large repos with deep directory fan-out can raise to
|
|
415
|
+
// 50+ if archive candidates feel under-contextualized.
|
|
416
|
+
archive_max_recent_paths: z5.number().int().positive().optional().default(20),
|
|
417
|
+
// rc.9+ (skill-contract-fix B1): max prior fabric-archive sessions
|
|
418
|
+
// summarised in the digest the skill loads on start. Prevents the
|
|
419
|
+
// digest from ballooning past the model context budget on workspaces
|
|
420
|
+
// that have archived repeatedly. Default 10; lower if context pressure
|
|
421
|
+
// bites, raise if you want longer-range archive trend visibility.
|
|
422
|
+
archive_digest_max_sessions: z5.number().int().positive().optional().default(10),
|
|
423
|
+
// rc.9+ (skill-contract-fix B1): max review results returned per
|
|
424
|
+
// topic when `fabric-review` clusters pending entries. Pagination
|
|
425
|
+
// knob analogous to archive_max_candidates_per_batch but scoped to
|
|
426
|
+
// each topic cluster. Default 8; raise to 15-20 for large repos
|
|
427
|
+
// where each topic legitimately groups many pending entries.
|
|
428
|
+
review_topic_result_cap: z5.number().int().positive().optional().default(8),
|
|
429
|
+
// rc.9+ (skill-contract-fix B1): age threshold (in days) above which
|
|
430
|
+
// a pending entry is considered "stale" by fabric-review and surfaced
|
|
431
|
+
// for explicit resolve-or-drop decision. Default 14; tighter than the
|
|
432
|
+
// 7d Signal-B trigger because review specifically targets the long
|
|
433
|
+
// tail. Large repos with slower cadence can raise to 30.
|
|
434
|
+
review_stale_pending_days: z5.number().int().positive().optional().default(14)
|
|
302
435
|
});
|
|
303
436
|
|
|
304
437
|
// src/schemas/forensic-report.ts
|
|
@@ -569,7 +702,7 @@ var metaReconciledOnStartupEventSchema = z9.object({
|
|
|
569
702
|
event_type: z9.literal("meta_reconciled_on_startup"),
|
|
570
703
|
reconciled_files: z9.array(z9.string()),
|
|
571
704
|
duration_ms: z9.number().int().nonnegative(),
|
|
572
|
-
source: z9.literal("
|
|
705
|
+
source: z9.literal("reconcileKnowledge")
|
|
573
706
|
});
|
|
574
707
|
var metaReconciledEventSchema = z9.object({
|
|
575
708
|
...eventLedgerEnvelopeSchema,
|
|
@@ -577,7 +710,7 @@ var metaReconciledEventSchema = z9.object({
|
|
|
577
710
|
reconciled_files: z9.array(z9.string()),
|
|
578
711
|
duration_ms: z9.number().int().nonnegative(),
|
|
579
712
|
trigger: z9.enum(["doctor", "manual"]),
|
|
580
|
-
source: z9.literal("
|
|
713
|
+
source: z9.literal("reconcileKnowledge")
|
|
581
714
|
});
|
|
582
715
|
var claudeSkillPathMigratedEventSchema = z9.object({
|
|
583
716
|
...eventLedgerEnvelopeSchema,
|
|
@@ -604,6 +737,132 @@ var initScanCompletedEventSchema = z9.object({
|
|
|
604
737
|
duration_ms: z9.number().int().nonnegative(),
|
|
605
738
|
source: z9.enum(["init", "scan", "doctor_fix"]).optional()
|
|
606
739
|
});
|
|
740
|
+
var knowledgeProposedEventSchema = z9.object({
|
|
741
|
+
...eventLedgerEnvelopeSchema,
|
|
742
|
+
event_type: z9.literal("knowledge_proposed"),
|
|
743
|
+
stable_id: z9.string().optional(),
|
|
744
|
+
timestamp: z9.string().datetime(),
|
|
745
|
+
reason: z9.string().optional()
|
|
746
|
+
});
|
|
747
|
+
var knowledgePromoteStartedEventSchema = z9.object({
|
|
748
|
+
...eventLedgerEnvelopeSchema,
|
|
749
|
+
event_type: z9.literal("knowledge_promote_started"),
|
|
750
|
+
stable_id: z9.string().optional(),
|
|
751
|
+
timestamp: z9.string().datetime(),
|
|
752
|
+
reason: z9.string().optional()
|
|
753
|
+
});
|
|
754
|
+
var knowledgePromotedEventSchema = z9.object({
|
|
755
|
+
...eventLedgerEnvelopeSchema,
|
|
756
|
+
event_type: z9.literal("knowledge_promoted"),
|
|
757
|
+
stable_id: z9.string().optional(),
|
|
758
|
+
timestamp: z9.string().datetime(),
|
|
759
|
+
reason: z9.string().optional()
|
|
760
|
+
});
|
|
761
|
+
var knowledgePromoteFailedEventSchema = z9.object({
|
|
762
|
+
...eventLedgerEnvelopeSchema,
|
|
763
|
+
event_type: z9.literal("knowledge_promote_failed"),
|
|
764
|
+
stable_id: z9.string().optional(),
|
|
765
|
+
timestamp: z9.string().datetime(),
|
|
766
|
+
reason: z9.string()
|
|
767
|
+
});
|
|
768
|
+
var knowledgeLayerChangedEventSchema = z9.object({
|
|
769
|
+
...eventLedgerEnvelopeSchema,
|
|
770
|
+
event_type: z9.literal("knowledge_layer_changed"),
|
|
771
|
+
stable_id: z9.string().optional(),
|
|
772
|
+
timestamp: z9.string().datetime(),
|
|
773
|
+
reason: z9.string().optional(),
|
|
774
|
+
from_layer: z9.enum(["team", "personal"]),
|
|
775
|
+
to_layer: z9.enum(["team", "personal"])
|
|
776
|
+
});
|
|
777
|
+
var knowledgeSlugRenamedEventSchema = z9.object({
|
|
778
|
+
...eventLedgerEnvelopeSchema,
|
|
779
|
+
event_type: z9.literal("knowledge_slug_renamed"),
|
|
780
|
+
stable_id: z9.string().optional(),
|
|
781
|
+
timestamp: z9.string().datetime(),
|
|
782
|
+
reason: z9.string().optional(),
|
|
783
|
+
from_slug: z9.string(),
|
|
784
|
+
to_slug: z9.string()
|
|
785
|
+
});
|
|
786
|
+
var knowledgeDemotedEventSchema = z9.object({
|
|
787
|
+
...eventLedgerEnvelopeSchema,
|
|
788
|
+
event_type: z9.literal("knowledge_demoted"),
|
|
789
|
+
stable_id: z9.string().optional(),
|
|
790
|
+
timestamp: z9.string().datetime(),
|
|
791
|
+
reason: z9.string().optional()
|
|
792
|
+
});
|
|
793
|
+
var knowledgeArchivedEventSchema = z9.object({
|
|
794
|
+
...eventLedgerEnvelopeSchema,
|
|
795
|
+
event_type: z9.literal("knowledge_archived"),
|
|
796
|
+
stable_id: z9.string().optional(),
|
|
797
|
+
timestamp: z9.string().datetime(),
|
|
798
|
+
reason: z9.string().optional()
|
|
799
|
+
});
|
|
800
|
+
var knowledgeArchiveAttemptedEventSchema = z9.object({
|
|
801
|
+
...eventLedgerEnvelopeSchema,
|
|
802
|
+
event_type: z9.literal("knowledge_archive_attempted"),
|
|
803
|
+
stable_id: z9.string().optional(),
|
|
804
|
+
timestamp: z9.string().datetime(),
|
|
805
|
+
reason: z9.string().optional()
|
|
806
|
+
});
|
|
807
|
+
var knowledgeDeferredEventSchema = z9.object({
|
|
808
|
+
...eventLedgerEnvelopeSchema,
|
|
809
|
+
event_type: z9.literal("knowledge_deferred"),
|
|
810
|
+
stable_id: z9.string().optional(),
|
|
811
|
+
timestamp: z9.string().datetime(),
|
|
812
|
+
reason: z9.string().optional(),
|
|
813
|
+
until: z9.string().datetime().optional()
|
|
814
|
+
});
|
|
815
|
+
var knowledgeRejectedEventSchema = z9.object({
|
|
816
|
+
...eventLedgerEnvelopeSchema,
|
|
817
|
+
event_type: z9.literal("knowledge_rejected"),
|
|
818
|
+
stable_id: z9.string().optional(),
|
|
819
|
+
timestamp: z9.string().datetime(),
|
|
820
|
+
reason: z9.string()
|
|
821
|
+
});
|
|
822
|
+
var knowledgeConsumedEventSchema = z9.object({
|
|
823
|
+
...eventLedgerEnvelopeSchema,
|
|
824
|
+
event_type: z9.literal("knowledge_consumed"),
|
|
825
|
+
stable_id: z9.string(),
|
|
826
|
+
consumed_at: z9.string().datetime(),
|
|
827
|
+
client_hash: z9.string()
|
|
828
|
+
});
|
|
829
|
+
var knowledgeScopeDegradedEventSchema = z9.object({
|
|
830
|
+
...eventLedgerEnvelopeSchema,
|
|
831
|
+
event_type: z9.literal("knowledge_scope_degraded"),
|
|
832
|
+
stable_id: z9.string(),
|
|
833
|
+
timestamp: z9.string().datetime(),
|
|
834
|
+
from_scope: z9.enum(["narrow", "broad"]),
|
|
835
|
+
to_scope: z9.enum(["narrow", "broad"]),
|
|
836
|
+
reason: z9.string()
|
|
837
|
+
});
|
|
838
|
+
var doctorRunEventSchema = z9.object({
|
|
839
|
+
...eventLedgerEnvelopeSchema,
|
|
840
|
+
event_type: z9.literal("doctor_run"),
|
|
841
|
+
mode: z9.enum(["lint", "apply-lint"]),
|
|
842
|
+
issues: z9.number().int().nonnegative(),
|
|
843
|
+
mutations: z9.number().int().nonnegative().optional(),
|
|
844
|
+
timestamp: z9.string().datetime()
|
|
845
|
+
});
|
|
846
|
+
var knowledgePathDangledEventSchema = z9.object({
|
|
847
|
+
...eventLedgerEnvelopeSchema,
|
|
848
|
+
event_type: z9.literal("knowledge_path_dangled"),
|
|
849
|
+
stable_id: z9.string(),
|
|
850
|
+
removed_glob: z9.string()
|
|
851
|
+
});
|
|
852
|
+
var relevanceMigrationRunEventSchema = z9.object({
|
|
853
|
+
...eventLedgerEnvelopeSchema,
|
|
854
|
+
event_type: z9.literal("relevance_migration_run"),
|
|
855
|
+
timestamp: z9.string().datetime(),
|
|
856
|
+
scanned_count: z9.number().int().nonnegative(),
|
|
857
|
+
touched_count: z9.number().int().nonnegative()
|
|
858
|
+
});
|
|
859
|
+
var pendingAutoArchivedEventSchema = z9.object({
|
|
860
|
+
...eventLedgerEnvelopeSchema,
|
|
861
|
+
event_type: z9.literal("pending_auto_archived"),
|
|
862
|
+
pending_path: z9.string(),
|
|
863
|
+
archived_to: z9.string(),
|
|
864
|
+
reason: z9.string()
|
|
865
|
+
});
|
|
607
866
|
var eventLedgerEventSchema = z9.discriminatedUnion("event_type", [
|
|
608
867
|
knowledgeContextPlannedEventSchema,
|
|
609
868
|
knowledgeSelectionEventSchema,
|
|
@@ -619,20 +878,56 @@ var eventLedgerEventSchema = z9.discriminatedUnion("event_type", [
|
|
|
619
878
|
claudeSkillPathMigratedEventSchema,
|
|
620
879
|
claudeHookPathMigratedEventSchema,
|
|
621
880
|
codexSkillPathMigratedEventSchema,
|
|
622
|
-
initScanCompletedEventSchema
|
|
881
|
+
initScanCompletedEventSchema,
|
|
882
|
+
// v2.0 rc.2 grill-followup TASK-004: knowledge.* lifecycle pre-registration
|
|
883
|
+
knowledgeProposedEventSchema,
|
|
884
|
+
knowledgePromoteStartedEventSchema,
|
|
885
|
+
knowledgePromotedEventSchema,
|
|
886
|
+
knowledgePromoteFailedEventSchema,
|
|
887
|
+
knowledgeLayerChangedEventSchema,
|
|
888
|
+
knowledgeSlugRenamedEventSchema,
|
|
889
|
+
knowledgeDemotedEventSchema,
|
|
890
|
+
knowledgeArchivedEventSchema,
|
|
891
|
+
knowledgeArchiveAttemptedEventSchema,
|
|
892
|
+
knowledgeDeferredEventSchema,
|
|
893
|
+
knowledgeRejectedEventSchema,
|
|
894
|
+
// v2.0 rc.5 TASK-014: knowledge_consumed (consumption tracking)
|
|
895
|
+
knowledgeConsumedEventSchema,
|
|
896
|
+
// v2.0 rc.5 TASK-012 (C3): knowledge_scope_degraded — narrow→broad auto-degrade
|
|
897
|
+
knowledgeScopeDegradedEventSchema,
|
|
898
|
+
// v2.0 rc.5 TASK-009 (B2): pending_auto_archived — doctor --apply-lint moves
|
|
899
|
+
// pending entries >30d old into the .archive/pending/ subtree.
|
|
900
|
+
pendingAutoArchivedEventSchema,
|
|
901
|
+
// v2.0 rc.5 TASK-013 (C4): knowledge_path_dangled — emitted by doctor lint
|
|
902
|
+
// #24 when a glob in relevance_paths resolves to zero filesystem matches.
|
|
903
|
+
knowledgePathDangledEventSchema,
|
|
904
|
+
// v2.0.0-rc.7 T10: doctor_run — emitted by `fabric doctor` to drive Signal D.
|
|
905
|
+
doctorRunEventSchema,
|
|
906
|
+
// v2.0.0-rc.9 TASK-003 (A3): relevance_migration_run — emitted by
|
|
907
|
+
// `doctor --apply-lint` after the lint #26 frontmatter back-fill pass.
|
|
908
|
+
relevanceMigrationRunEventSchema
|
|
623
909
|
]);
|
|
624
910
|
export {
|
|
625
911
|
AGENTS_META_IDENTITY_SOURCES,
|
|
626
912
|
AGENTS_META_LAYERS,
|
|
627
913
|
AGENTS_META_TOPOLOGY_TYPES,
|
|
628
914
|
AgentsMetaCountersSchema,
|
|
915
|
+
FabExtractKnowledgeInputSchema,
|
|
916
|
+
FabExtractKnowledgeInputShape,
|
|
917
|
+
FabExtractKnowledgeOutputSchema,
|
|
918
|
+
FabReviewInputSchema,
|
|
919
|
+
FabReviewInputShape,
|
|
920
|
+
FabReviewOutputSchema,
|
|
921
|
+
FabReviewOutputShape,
|
|
922
|
+
KNOWLEDGE_TEST_INDEX_SCHEMA_VERSION,
|
|
629
923
|
KNOWLEDGE_TYPE_CODES,
|
|
630
924
|
KnowledgeEntryFrontmatterSchema,
|
|
631
925
|
KnowledgeTypeSchema,
|
|
632
926
|
LayerSchema,
|
|
633
927
|
MaturitySchema,
|
|
928
|
+
PROPOSED_REASON_DESCRIPTIONS,
|
|
634
929
|
PROTECTED_TOKENS,
|
|
635
|
-
|
|
930
|
+
ProposedReasonSchema,
|
|
636
931
|
StableIdSchema,
|
|
637
932
|
agentsIdentitySourceSchema,
|
|
638
933
|
agentsLayerSchema,
|
|
@@ -650,17 +945,21 @@ export {
|
|
|
650
945
|
codexSkillPathMigratedEventSchema,
|
|
651
946
|
createTranslator,
|
|
652
947
|
defaultAgentsMetaCounters,
|
|
948
|
+
defaultLayerFilterSchema,
|
|
653
949
|
defaultMessages,
|
|
654
950
|
deriveAgentsMetaIdentitySource,
|
|
655
951
|
deriveAgentsMetaLayer,
|
|
656
952
|
deriveAgentsMetaStableId,
|
|
657
953
|
deriveAgentsMetaTopologyType,
|
|
658
954
|
detectNodeLocale,
|
|
955
|
+
doctorRunEventSchema,
|
|
659
956
|
driftDetectedEventSchema,
|
|
660
957
|
editIntentCheckedEventSchema,
|
|
661
958
|
enMessages,
|
|
662
959
|
eventLedgerEventSchema,
|
|
663
960
|
eventLedgerTruncatedEventSchema,
|
|
961
|
+
fabExtractKnowledgeAnnotations,
|
|
962
|
+
fabReviewAnnotations,
|
|
664
963
|
fabricConfigSchema,
|
|
665
964
|
fabricEventSchema,
|
|
666
965
|
forensicAssertionCoverageSchema,
|
|
@@ -674,9 +973,9 @@ export {
|
|
|
674
973
|
forensicSamplingBudgetSchema,
|
|
675
974
|
forensicTopologySchema,
|
|
676
975
|
formatKnowledgeId,
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
976
|
+
getKnowledgeAnnotations,
|
|
977
|
+
getKnowledgeInputSchema,
|
|
978
|
+
getKnowledgeOutputSchema,
|
|
680
979
|
historyStateQuerySchema,
|
|
681
980
|
humanLedgerEntrySchema,
|
|
682
981
|
humanLockApproveRequestSchema,
|
|
@@ -692,10 +991,31 @@ export {
|
|
|
692
991
|
initContextSourceEvidenceSchema,
|
|
693
992
|
initScanCompletedEventSchema,
|
|
694
993
|
isKnowledgeStableId,
|
|
994
|
+
knowledgeArchiveAttemptedEventSchema,
|
|
995
|
+
knowledgeArchivedEventSchema,
|
|
996
|
+
knowledgeConsumedEventSchema,
|
|
695
997
|
knowledgeContextPlannedEventSchema,
|
|
998
|
+
knowledgeDeferredEventSchema,
|
|
999
|
+
knowledgeDemotedEventSchema,
|
|
696
1000
|
knowledgeDriftDetectedEventSchema,
|
|
1001
|
+
knowledgeLanguageSchema,
|
|
1002
|
+
knowledgeLayerChangedEventSchema,
|
|
1003
|
+
knowledgePathDangledEventSchema,
|
|
1004
|
+
knowledgePromoteFailedEventSchema,
|
|
1005
|
+
knowledgePromoteStartedEventSchema,
|
|
1006
|
+
knowledgePromotedEventSchema,
|
|
1007
|
+
knowledgeProposedEventSchema,
|
|
1008
|
+
knowledgeRejectedEventSchema,
|
|
1009
|
+
knowledgeScopeDegradedEventSchema,
|
|
1010
|
+
knowledgeSectionsAnnotations,
|
|
697
1011
|
knowledgeSectionsFetchedEventSchema,
|
|
1012
|
+
knowledgeSectionsInputSchema,
|
|
1013
|
+
knowledgeSectionsOutputSchema,
|
|
698
1014
|
knowledgeSelectionEventSchema,
|
|
1015
|
+
knowledgeSlugRenamedEventSchema,
|
|
1016
|
+
knowledgeTestIndexSchema,
|
|
1017
|
+
knowledgeTestLinkSchema,
|
|
1018
|
+
knowledgeTestOrphanAnnotationSchema,
|
|
699
1019
|
ledgerAppendedEventSchema,
|
|
700
1020
|
ledgerEntrySchema,
|
|
701
1021
|
ledgerQuerySchema,
|
|
@@ -710,18 +1030,16 @@ export {
|
|
|
710
1030
|
metaUpdatedEventSchema,
|
|
711
1031
|
normalizeLocale,
|
|
712
1032
|
parseKnowledgeId,
|
|
1033
|
+
pendingAutoArchivedEventSchema,
|
|
713
1034
|
planContextAnnotations,
|
|
1035
|
+
planContextHintNarrowEntrySchema,
|
|
1036
|
+
planContextHintOutputSchema,
|
|
714
1037
|
planContextInputSchema,
|
|
715
1038
|
planContextOutputSchema,
|
|
716
1039
|
reapplyCompletedEventSchema,
|
|
1040
|
+
relevanceMigrationRunEventSchema,
|
|
717
1041
|
ruleDescriptionIndexItemSchema,
|
|
718
1042
|
ruleDescriptionSchema,
|
|
719
|
-
ruleSectionsAnnotations,
|
|
720
|
-
ruleSectionsInputSchema,
|
|
721
|
-
ruleSectionsOutputSchema,
|
|
722
|
-
ruleTestIndexSchema,
|
|
723
|
-
ruleTestLinkSchema,
|
|
724
|
-
ruleTestOrphanAnnotationSchema,
|
|
725
1043
|
structuredWarningSchema,
|
|
726
1044
|
withDerivedAgentsMetaNodeDefaults,
|
|
727
1045
|
zhCNMessages
|