@fenglimg/fabric-shared 2.0.0-rc.23 → 2.0.0-rc.25
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-GDYPVGWT.js → chunk-3RSYWMQU.js} +57 -1
- package/dist/{chunk-IP6VWOVE.js → chunk-4OQXR6JW.js} +31 -1
- package/dist/{chunk-GYIALPMW.js → chunk-AFUQKKGR.js} +96 -0
- package/dist/i18n/index.js +1 -1
- package/dist/index.d.ts +241 -15
- package/dist/index.js +139 -13
- package/dist/schemas/api-contracts.d.ts +203 -1
- package/dist/schemas/api-contracts.js +7 -1
- package/dist/templates/bootstrap-canonical.d.ts +2 -2
- package/dist/templates/bootstrap-canonical.js +1 -1
- package/package.json +1 -1
|
@@ -84,7 +84,9 @@ var planContextInputSchema = z2.object({
|
|
|
84
84
|
detected_entities: z2.record(z2.array(z2.string())).optional().describe("Optional path-keyed detected entities for the requirement profile"),
|
|
85
85
|
client_hash: z2.string().optional().describe("Revision hash from a prior fab_plan_context response; enables stale detection"),
|
|
86
86
|
correlation_id: z2.string().optional().describe("Optional caller-provided correlation id for Event Ledger records"),
|
|
87
|
-
session_id: z2.string().optional().describe(
|
|
87
|
+
session_id: z2.string().optional().describe(
|
|
88
|
+
"Recommended: pass the current client session id (Claude Code: $session_id; Codex: corresponding identifier) \u2014 enables cross-session debt tracking in fab doctor and accurate archive-hint cross-session count. Falls back gracefully if omitted."
|
|
89
|
+
),
|
|
88
90
|
// v2.0-rc.5 A3 (TASK-007): `include_deprecated` removed — it was a no-op
|
|
89
91
|
// placeholder (MaturitySchema has no `deprecated` value). When the maturity
|
|
90
92
|
// enum widens we re-introduce the flag as part of that protocol bump.
|
|
@@ -526,6 +528,57 @@ var fabReviewAnnotations = {
|
|
|
526
528
|
openWorldHint: false,
|
|
527
529
|
title: "Review pending knowledge entries"
|
|
528
530
|
};
|
|
531
|
+
var citeContractMetricsSchema = z2.object({
|
|
532
|
+
decisions_cited: z2.number().int().nonnegative(),
|
|
533
|
+
pitfalls_cited: z2.number().int().nonnegative(),
|
|
534
|
+
contract_with: z2.number().int().nonnegative(),
|
|
535
|
+
contract_missing: z2.number().int().nonnegative(),
|
|
536
|
+
hard_violated: z2.number().int().nonnegative(),
|
|
537
|
+
cite_id_unresolved: z2.number().int().nonnegative(),
|
|
538
|
+
skip_count: z2.record(z2.string(), z2.number().int().nonnegative())
|
|
539
|
+
});
|
|
540
|
+
var citeLayerTypeBreakdownSchema = z2.object({
|
|
541
|
+
team: z2.record(z2.string(), z2.number().int().nonnegative()),
|
|
542
|
+
personal: z2.record(z2.string(), z2.number().int().nonnegative())
|
|
543
|
+
});
|
|
544
|
+
var citeCoverageReportSchema = z2.object({
|
|
545
|
+
status: z2.enum(["ok", "skipped"]),
|
|
546
|
+
marker_ts: z2.number().int().nonnegative(),
|
|
547
|
+
marker_emitted_now: z2.boolean(),
|
|
548
|
+
since_ts: z2.number().int().nonnegative(),
|
|
549
|
+
client_filter: z2.enum(["cc", "codex", "cursor", "all"]),
|
|
550
|
+
// v2.0.0-rc.24 TASK-08: layer filter discriminator. Optional so pre-TASK-10
|
|
551
|
+
// CLI callers (which never set the flag) still parse. Defaults to "all" at
|
|
552
|
+
// the service layer.
|
|
553
|
+
layer_filter: z2.enum(["team", "personal", "all"]).optional(),
|
|
554
|
+
metrics: z2.object({
|
|
555
|
+
edits_touched: z2.number().int().nonnegative(),
|
|
556
|
+
qualifying_cites: z2.number().int().nonnegative(),
|
|
557
|
+
recalled_unverified: z2.number().int().nonnegative(),
|
|
558
|
+
expected_but_missed: z2.number().int().nonnegative(),
|
|
559
|
+
total_turns: z2.number().int().nonnegative()
|
|
560
|
+
}),
|
|
561
|
+
per_client: z2.record(
|
|
562
|
+
z2.string(),
|
|
563
|
+
z2.object({
|
|
564
|
+
edits_touched: z2.number().int().nonnegative().optional(),
|
|
565
|
+
qualifying_cites: z2.number().int().nonnegative().optional(),
|
|
566
|
+
recalled_unverified: z2.number().int().nonnegative().optional(),
|
|
567
|
+
expected_but_missed: z2.number().int().nonnegative().optional(),
|
|
568
|
+
total_turns: z2.number().int().nonnegative().optional()
|
|
569
|
+
})
|
|
570
|
+
).optional(),
|
|
571
|
+
dismissed_reason_histogram: z2.record(z2.string(), z2.number().int().nonnegative()).optional(),
|
|
572
|
+
none_reason_histogram: z2.record(z2.string(), z2.number().int().nonnegative()).optional(),
|
|
573
|
+
// v2.0.0-rc.24 TASK-08: contract-policy audit metrics. Status discriminates
|
|
574
|
+
// populated vs degraded modes. contract_metrics + per_layer_type are emitted
|
|
575
|
+
// (zeroed) in degraded modes so the renderer iterates one stable shape.
|
|
576
|
+
contract_metrics_status: z2.enum(["ok", "skipped:bootstrap_drift", "awaiting_marker"]).optional(),
|
|
577
|
+
contract_metrics: citeContractMetricsSchema.optional(),
|
|
578
|
+
per_layer_type: citeLayerTypeBreakdownSchema.optional(),
|
|
579
|
+
contract_marker_ts: z2.number().int().nonnegative().optional(),
|
|
580
|
+
generated_at: z2.string()
|
|
581
|
+
});
|
|
529
582
|
var ledgerSourceSchema = z2.enum(["ai", "human"]);
|
|
530
583
|
var timestampFilterSchema = z2.preprocess((value) => {
|
|
531
584
|
if (value === void 0 || value === null || value === "") {
|
|
@@ -654,6 +707,9 @@ export {
|
|
|
654
707
|
FabReviewOutputSchema,
|
|
655
708
|
FabReviewOutputShape,
|
|
656
709
|
fabReviewAnnotations,
|
|
710
|
+
citeContractMetricsSchema,
|
|
711
|
+
citeLayerTypeBreakdownSchema,
|
|
712
|
+
citeCoverageReportSchema,
|
|
657
713
|
ledgerSourceSchema,
|
|
658
714
|
ledgerQuerySchema,
|
|
659
715
|
historyStateQuerySchema,
|
|
@@ -14,15 +14,45 @@ var BOOTSTRAP_CANONICAL = `# Fabric Bootstrap
|
|
|
14
14
|
- **\`.fabric/agents.meta.json\` \u4E25\u7981\u624B\u52A8\u7F16\u8F91**;engine \u4F1A\u81EA\u52A8\u540C\u6B65\u6D3E\u751F\u72B6\u6001,\u663E\u5F0F reconcile \u8DD1 \`fab doctor --fix\`\u3002
|
|
15
15
|
|
|
16
16
|
## \u77E5\u8BC6\u5E93(KB)
|
|
17
|
-
- **Discovery**:SessionStart hook \u5217 broad-scoped \u6761\u76EE;edit \u6587\u4EF6\u65F6 PreToolUse hook \u53EF\u80FD\u89E6\u53D1 narrow hint\u3002
|
|
17
|
+
- **Discovery**:SessionStart hook \u5217 broad-scoped \u6761\u76EE(\u542B personal layer \`KP-*\` \u6761\u76EE,\u5F15\u7528\u65B9\u5F0F\u76F8\u540C);edit \u6587\u4EF6\u65F6 PreToolUse hook \u53EF\u80FD\u89E6\u53D1 narrow hint\u3002
|
|
18
18
|
- **Usage**:\u4E24\u6B65\u5F0F\u2014\u2014\`fab_plan_context(paths=[...])\` \u8FD4\u56DE \`selection_token\` + \u5019\u9009 entries,\u518D \`fab_get_knowledge_sections({ selection_token, ai_selected_stable_ids: [<id>...] })\` \u62C9\u5168\u6587;\`selection_token\` \u5FC5\u987B\u6765\u81EA\u6700\u8FD1\u4E00\u6B21 \`fab_plan_context\`,\u4E0D\u53EF\u51ED\u7A7A\u7F16\u9020\u3002
|
|
19
|
+
- **session_id**: \u8C03\u7528 \`fab_plan_context\` \u65F6, \u52A1\u5FC5\u628A\u5F53\u524D client session id \u4F5C\u4E3A \`session_id\` \u53C2\u6570\u4F20\u5165(Claude Code \u7684 session id \u5728 stdin payload \u4E2D, Codex \u7684\u5BF9\u5E94 identifier \u540C\u7406)\u3002\u8FD9\u80FD\u8BA9 \`fab doctor --archive-history\` \u4E0E archive-hint hook \u51C6\u786E\u8BC6\u522B\u8DE8\u4F1A\u8BDD debt \u72B6\u6001\u3002
|
|
19
20
|
- **Write flows**:\`fabric-archive\` / \`fabric-review\` / \`fabric-import\` \u4E09\u4E2A Skills\u3002
|
|
20
21
|
- **Language**:\u6E32\u67D3\u6309 \`.fabric/fabric-config.json\` \u7684 \`fabric_language\` \u5B57\u6BB5\u3002
|
|
21
22
|
|
|
23
|
+
## Self-archive policy
|
|
24
|
+
|
|
25
|
+
- **\u89E6\u53D1**: \u672C\u4F1A\u8BDD\u51FA\u73B0\u4EE5\u4E0B\u4EFB\u4E00\u4FE1\u53F7, \u5728\u8BE5 turn \u56DE\u590D\u672B\u5C3E\u81EA\u4E3B\u8C03\u7528 \`fabric-archive\` skill (E3-strong mode):
|
|
26
|
+
1. **Normative \u8BED\u8A00** \u2014 \u7528\u6237\u6D88\u606F\u51FA\u73B0 \`\u4EE5\u540E\` / \`always\` / \`never\` / \`from now on\` / \`\u4E0B\u6B21\u6CE8\u610F\` / \`\u8BB0\u4E00\u4E0B\` / \`\u6C38\u8FDC\u4E0D\u8981\`
|
|
27
|
+
2. **Wrong-turn-and-revert** \u2014 AI \u5C1D\u8BD5 path X, \u53CD\u601D\u540E\u6539\u8D70 path Y (\u5C24\u5176\u5F53 path X \u662F\u975E\u663E\u7136\u8E29\u5751)
|
|
28
|
+
3. **Decision confirmation** \u2014 \u7528\u6237\u5728 \u22652 \u5019\u9009\u4E2D\u6743\u8861\u540E\u7ED9\u51FA rationale \u9501\u5B9A\u65B9\u5411
|
|
29
|
+
4. **Explicit dismissal with reason** \u2014 \u7528\u6237\u62D2\u4E86\u67D0\u5EFA\u8BAE**\u5E76**\u8BF4\u4E86\u539F\u56E0
|
|
30
|
+
|
|
31
|
+
- **Anti-trigger** (\u660E\u786E\u4E0D\u89E6\u53D1):
|
|
32
|
+
- \u7528\u6237\u7EAF\u8BE2\u95EE (\u65E0 normative \u8868\u8FBE)
|
|
33
|
+
- \u7B80\u5355 refactor / typo fix
|
|
34
|
+
- AI \u81EA\u5DF1\u4EA7\u751F\u7684'\u6D1E\u5BDF' (\u5FC5\u987B\u7531\u7528\u6237\u6D88\u606F\u4E2D\u4FE1\u53F7\u89E6\u53D1)
|
|
35
|
+
|
|
36
|
+
- **Anti-loop \u4E09\u6761\u9632\u62A4**:
|
|
37
|
+
- \u540C turn \u6700\u591A\u81EA\u8C03 1 \u6B21
|
|
38
|
+
- \u540C session \u540C outcome \u4E0D\u91CD\u590D (\u82E5 user_dismissed, \u672C\u4F1A\u8BDD\u4E0D\u518D\u81EA\u8C03\u76F8\u540C\u4E3B\u9898)
|
|
39
|
+
- Phase 0.5 viability gate \u515C\u5E95 (skill \u5185\u90E8\u4ECD\u8DD1 gate, AI \u5224\u9519\u4E0D\u4F1A\u4E71\u5199 pending)
|
|
40
|
+
|
|
41
|
+
- **\u5448\u73B0\u6A21\u677F** (turn \u672B\u5C3E\u63D2\u5165, \u4E24\u884C: \u5148 marker \u884C\u4F9B Phase 0.4 \u68C0\u6D4B, \u518D user-facing \u63D0\u793A):
|
|
42
|
+
\`\`\`
|
|
43
|
+
self-archive policy triggered by signal: <Normative|Wrong-turn-and-revert|Decision confirmation|Explicit dismissal>
|
|
44
|
+
\u987A\u624B\u5F52\u6863: \u6CE8\u610F\u5230\u4F60\u8BF4 \`<\u89E6\u53D1\u77ED\u8BED>\`, \u5DF2\u8C03\u7528 fabric-archive \u6293 N \u6761\u5019\u9009 \u2192 .fabric/knowledge/pending/...
|
|
45
|
+
\u82E5\u4E0D\u8BE5\u8BB0, \u7B54 '\u64A4\u9500' \u6211\u4F1A\u8C03 fab_review reject\u3002
|
|
46
|
+
\`\`\`
|
|
47
|
+
\u7B2C\u4E00\u884C\u662F Phase 0.4 Trigger Gate \u7528\u6765\u8BC6\u522B E3 \u5165\u53E3\u7684 structured marker (verbatim \u5B57\u7B26\u4E32 \`self-archive policy triggered by signal\`, \u540E\u63A5\u5192\u53F7 + \u89E6\u53D1\u4FE1\u53F7\u540D)\u3002\u7B2C\u4E8C\u884C\u8D77\u662F\u7ED9\u7528\u6237\u770B\u7684\u4E2D\u6587\u63D0\u793A\u3002\u4E24\u884C\u90FD\u5FC5\u987B\u51FA\u73B0; \u7F3A marker \u884C Phase 0.4 \u65E0\u6CD5\u8DEF\u7531\u5230 E3_ai_self_trigger\u3002
|
|
48
|
+
|
|
22
49
|
## Cite policy
|
|
23
50
|
|
|
24
51
|
- **\u89E6\u53D1**: \u505A edit / decide / propose plan \u4E4B\u524D,**\u56DE\u590D\u9996\u884C**\u5FC5\u987B\u5199 \`KB: <id> (<\u22648\u5B57 \u7528\u6CD5>) [planned|recalled|chained-from <id>|dismissed:<reason>]\` \u6216 \`KB: none [<reason>]\`\u3002
|
|
25
52
|
- **\`[recalled]\` \u9A8C\u8BC1**: \u5FC5\u987B\u7D27\u8DDF\u4E24\u6B65\u8C03\u7528\u2014\u2014\u5148 \`fab_plan_context(paths=[...])\` \u62FF \`selection_token\`,\u518D \`fab_get_knowledge_sections({ selection_token, ai_selected_stable_ids: [<id>] })\`,\u9632\u6B62\u7F16\u9020 id\u3002
|
|
53
|
+
- **contract \u8BED\u6CD5**: decisions/pitfalls \u7C7B\u5F15\u7528\u5FC5\u987B\u5728\u5C3E\u6BB5\u52A0 contract: \`\u2192 <operator> [<operator> ...]\`,operator \u2208 {\`edit:<glob>\` \`!edit:<glob>\` \`require:<symbol>\` \`forbid:<symbol>\` \`skip:<reason>\`}\u3002\u4F8B:\`KB: K-001 (auth) [planned] \u2192 edit:src/auth/**/*.ts !edit:src/legacy/**\`\u3002
|
|
54
|
+
- **skip reason \u8BCD\u5178**: \`sequencing | conditional | semantic | aesthetic | architectural | other:<text>\`\u3002
|
|
55
|
+
- **type \u8DEF\u7531**: models \u7C7B\u5F15\u7528\u4E3A reference cite,\u4E0D\u9700\u8981 contract;guidelines/processes \u7C7B\u6682\u4E0D\u5F3A\u5236,\u63A8\u540E LLM-judge\u3002
|
|
26
56
|
- **\u7528\u6237\u53E3\u5934\u63D0\u89C4\u5219\u6CA1\u7ED9 id**: \u5148\u8C03 \`fab_extract_knowledge\` \u6216 \`search_context\` \u53CD\u67E5\u3002
|
|
27
57
|
- **dismissed reason**: \u679A\u4E3E \`scope-mismatch | outdated | not-applicable | other:<text>\`\u3002
|
|
28
58
|
- **\`KB: none\` sentinel**: \u679A\u4E3E\u4E24\u79CD\u5408\u89C4\u7406\u7531\u2014\u2014\`[no-relevant]\` \u5DF2\u8C03 \`fab_plan_context\`(\u6216 hook \u8F93\u51FA\u53EF\u89C1)\u4F46\u65E0\u53EF\u7528\u6761\u76EE;\`[not-applicable]\` \u5F53\u524D\u52A8\u4F5C\u4E0D\u5728 cite \u8303\u56F4(\u7EAF\u63A2\u7D22 / Bash \u53EA\u8BFB / \u7528\u6237\u95EE\u7B54)\u3002\u88F8 \`KB: none\`(\u65E0\u540E\u7F00)\u4ECD\u7136 valid,\u5F52\u7C7B\u4E3A \`[unspecified]\`(legacy \u517C\u5BB9,\u9F13\u52B1\u540E\u7EED\u8865\u6CE8)\u3002
|
|
@@ -119,6 +119,41 @@ var enMessages = {
|
|
|
119
119
|
"doctor.cite.none.not-applicable": "Not applicable",
|
|
120
120
|
"doctor.cite.none.unspecified": "Unspecified",
|
|
121
121
|
"doctor.cite.status.skipped": "Cite policy not yet activated for this workspace.",
|
|
122
|
+
// v2.0.0-rc.24 TASK-09: cite-coverage contract-policy renderer keys.
|
|
123
|
+
// Companion schema: packages/shared/src/schemas/api-contracts.ts
|
|
124
|
+
// citeCoverageReportSchema. Consumer: TASK-10 CLI doctor --cite-coverage.
|
|
125
|
+
"cite-coverage.contract.header": "Contract check",
|
|
126
|
+
"cite-coverage.contract.decisions_cited": "Decisions cited",
|
|
127
|
+
"cite-coverage.contract.pitfalls_cited": "Pitfalls cited",
|
|
128
|
+
"cite-coverage.contract.with": "With contract",
|
|
129
|
+
"cite-coverage.contract.missing": "Missing contract",
|
|
130
|
+
"cite-coverage.contract.hard_violated": "Hard violations (operator did not match session edits)",
|
|
131
|
+
"cite-coverage.contract.cite_id_unresolved": "Unresolved cite IDs",
|
|
132
|
+
"cite-coverage.contract.skip_count": "Skip bucket",
|
|
133
|
+
"cite-coverage.contract.status.ok": "ok",
|
|
134
|
+
"cite-coverage.contract.status.skipped_bootstrap_drift": "skipped (bootstrap drift \u2014 run `fab install`)",
|
|
135
|
+
"cite-coverage.contract.status.awaiting_marker": "awaiting first marker emit",
|
|
136
|
+
// Singular knowledge-type labels (verbatim alignment with KnowledgeTypeSchema)
|
|
137
|
+
// plus the sixth "unresolved" bucket.
|
|
138
|
+
"cite-coverage.contract.type.decision": "decision",
|
|
139
|
+
"cite-coverage.contract.type.pitfall": "pitfall",
|
|
140
|
+
"cite-coverage.contract.type.model": "model",
|
|
141
|
+
"cite-coverage.contract.type.guideline": "guideline",
|
|
142
|
+
"cite-coverage.contract.type.process": "process",
|
|
143
|
+
"cite-coverage.contract.type.unresolved": "unresolved",
|
|
144
|
+
// Layer labels (per_layer_type headers + layer_filter banner).
|
|
145
|
+
"cite-coverage.layer.team": "team",
|
|
146
|
+
"cite-coverage.layer.personal": "personal",
|
|
147
|
+
"cite-coverage.layer.team_review": "[team \u2014 review]",
|
|
148
|
+
"cite-coverage.layer.personal_fyi": "[personal \u2014 fyi]",
|
|
149
|
+
// skip_reason vocabulary (bootstrap-docs canonical; renderer falls back to
|
|
150
|
+
// the raw key for unknown buckets — operators data-drive extensions).
|
|
151
|
+
"cite-coverage.skip.sequencing": "sequencing constraint",
|
|
152
|
+
"cite-coverage.skip.conditional": "conditional branch",
|
|
153
|
+
"cite-coverage.skip.semantic": "semantic rule",
|
|
154
|
+
"cite-coverage.skip.aesthetic": "style / aesthetic",
|
|
155
|
+
"cite-coverage.skip.architectural": "architectural layer",
|
|
156
|
+
"cite-coverage.skip.other": "other",
|
|
122
157
|
"cli.doctor.args.target.description": "Target project path. Defaults to --target, then EXTERNAL_FIXTURE_PATH, then cwd.",
|
|
123
158
|
"cli.doctor.args.fix.description": "Repair derived Fabric state (meta + indexes).",
|
|
124
159
|
"cli.doctor.args.json.description": "Print the doctor report as JSON.",
|
|
@@ -130,9 +165,12 @@ var enMessages = {
|
|
|
130
165
|
"cli.doctor.args.cite-coverage.description": "Generate cite policy adherence report (read-only; skips standard inspections)",
|
|
131
166
|
"cli.doctor.args.since.description": "Time window for cite coverage (e.g. 7d, 24h, 30m)",
|
|
132
167
|
"cli.doctor.args.client.description": "Filter cite coverage by client (cc|codex|cursor|all)",
|
|
168
|
+
// v2.0.0-rc.24 TASK-10: --layer filters cite contract audit by KB layer (team|personal|all).
|
|
169
|
+
"cli.doctor.args.layer.description": "Filter cite contract audit by KB layer (team|personal|all)",
|
|
133
170
|
"cli.doctor.errors.cite-coverage-mutex": "--cite-coverage cannot be combined with --fix or --fix-knowledge",
|
|
134
171
|
"cli.doctor.errors.invalid-since": "Invalid --since value: {input}. Expected duration like 7d, 24h, 30m or epoch ms.",
|
|
135
172
|
"cli.doctor.errors.invalid-client": "Invalid --client value: {input}. Expected cc, codex, cursor, or all.",
|
|
173
|
+
"cli.doctor.errors.invalid-layer": "Invalid --layer value: {input}. Expected team, personal, or all.",
|
|
136
174
|
// rc.23 TASK-007 (a-C2): --enrich-descriptions flag set. Back-fills the
|
|
137
175
|
// four description-grade frontmatter fields on canonical knowledge entries.
|
|
138
176
|
"cli.doctor.args.enrich-descriptions.description": "Back-fill missing intent_clues / tech_stack / impact / must_read_if on canonical knowledge entries (read-only by default; pair with --auto to write stubs).",
|
|
@@ -140,6 +178,18 @@ var enMessages = {
|
|
|
140
178
|
"cli.doctor.args.dry-run.description": "With --enrich-descriptions --auto: preview the would-be changes without writing to disk.",
|
|
141
179
|
"cli.doctor.errors.enrich-descriptions-mutex": "--enrich-descriptions cannot be combined with --fix, --fix-knowledge, or --cite-coverage. Run them separately.",
|
|
142
180
|
"doctor.enrich.allComplete": "All canonical knowledge entries already declare intent_clues / tech_stack / impact / must_read_if.",
|
|
181
|
+
// v2.0.0-rc.25 TASK-10: --archive-history flag set. Read-only audit of
|
|
182
|
+
// session_archive_attempted events; mutually exclusive with the other
|
|
183
|
+
// mutation/report surfaces.
|
|
184
|
+
"cli.doctor.args.archive-history.description": "Render per-session archive attempt history (read-only; reads session_archive_attempted events).",
|
|
185
|
+
"cli.doctor.errors.archive-history-mutex": "--archive-history cannot be combined with --fix, --fix-knowledge, --cite-coverage, or --enrich-descriptions. Run them separately.",
|
|
186
|
+
"doctor.archive-history.header": "Archive history (last {sinceLabel}, {count} session{plural})",
|
|
187
|
+
"doctor.archive-history.empty": "No archive history yet within the --since={sinceLabel} window.",
|
|
188
|
+
"doctor.archive-history.table.session": "Session",
|
|
189
|
+
"doctor.archive-history.table.lastAttempt": "Last attempt",
|
|
190
|
+
"doctor.archive-history.table.outcome": "Outcome",
|
|
191
|
+
"doctor.archive-history.table.candidates": "Candidates",
|
|
192
|
+
"doctor.archive-history.table.coveredGap": "Covered gap",
|
|
143
193
|
"cli.hooks.description": "Manage Fabric Git hook templates.",
|
|
144
194
|
"cli.hooks.install.description": "Install the Fabric Husky pre-commit hook template.",
|
|
145
195
|
"cli.hooks.install.args.target.description": "Target project path, default is the current working directory.",
|
|
@@ -669,6 +719,39 @@ var zhCNMessages = {
|
|
|
669
719
|
"doctor.cite.none.not-applicable": "\u4E0D\u5728\u8303\u56F4",
|
|
670
720
|
"doctor.cite.none.unspecified": "\u672A\u6CE8\u660E",
|
|
671
721
|
"doctor.cite.status.skipped": "\u672C\u5DE5\u4F5C\u533A Cite policy \u5C1A\u672A\u6FC0\u6D3B\u3002",
|
|
722
|
+
// v2.0.0-rc.24 TASK-09: cite-coverage 合约审计渲染键(contract-policy 审计窗口)。
|
|
723
|
+
// 配套 schema:packages/shared/src/schemas/api-contracts.ts citeCoverageReportSchema。
|
|
724
|
+
// 渲染器消费方:TASK-10 CLI doctor --cite-coverage(layer / type / skip / status / contract)。
|
|
725
|
+
"cite-coverage.contract.header": "\u5E94\u7528\u5951\u7EA6\u6821\u9A8C",
|
|
726
|
+
"cite-coverage.contract.decisions_cited": "decisions \u5F15\u7528",
|
|
727
|
+
"cite-coverage.contract.pitfalls_cited": "pitfalls \u5F15\u7528",
|
|
728
|
+
"cite-coverage.contract.with": "\u5DF2\u9644\u5951\u7EA6",
|
|
729
|
+
"cite-coverage.contract.missing": "\u7F3A\u5951\u7EA6",
|
|
730
|
+
"cite-coverage.contract.hard_violated": "\u786C\u6027\u8FDD\u89C4\uFF08\u64CD\u4F5C\u7B26\u672A\u5339\u914D session \u7F16\u8F91\uFF09",
|
|
731
|
+
"cite-coverage.contract.cite_id_unresolved": "\u5F15\u7528 ID \u4E0D\u5B58\u5728",
|
|
732
|
+
"cite-coverage.contract.skip_count": "skip \u6876",
|
|
733
|
+
"cite-coverage.contract.status.ok": "\u6B63\u5E38",
|
|
734
|
+
"cite-coverage.contract.status.skipped_bootstrap_drift": "\u5DF2\u8DF3\u8FC7\uFF08bootstrap drift \u2014 \u8BF7\u8FD0\u884C fab install\uFF09",
|
|
735
|
+
"cite-coverage.contract.status.awaiting_marker": "\u7B49\u5F85\u9996\u6B21 marker emit",
|
|
736
|
+
// 单数知识类型(与 KnowledgeTypeSchema 枚举字面量逐字对齐)+ 第六桶 unresolved。
|
|
737
|
+
"cite-coverage.contract.type.decision": "decision",
|
|
738
|
+
"cite-coverage.contract.type.pitfall": "pitfall",
|
|
739
|
+
"cite-coverage.contract.type.model": "model",
|
|
740
|
+
"cite-coverage.contract.type.guideline": "guideline",
|
|
741
|
+
"cite-coverage.contract.type.process": "process",
|
|
742
|
+
"cite-coverage.contract.type.unresolved": "unresolved",
|
|
743
|
+
// 知识层标签(per_layer_type 表头 + layer_filter 标识)。
|
|
744
|
+
"cite-coverage.layer.team": "team",
|
|
745
|
+
"cite-coverage.layer.personal": "personal",
|
|
746
|
+
"cite-coverage.layer.team_review": "[team \u2014 \u9700\u590D\u6838]",
|
|
747
|
+
"cite-coverage.layer.personal_fyi": "[personal \u2014 fyi]",
|
|
748
|
+
// skip_reason 标准词表(bootstrap 文档定义;运营方可继续扩展词条,渲染器对未知键回退到原始 key)。
|
|
749
|
+
"cite-coverage.skip.sequencing": "\u987A\u5E8F\u7EA6\u675F",
|
|
750
|
+
"cite-coverage.skip.conditional": "\u6761\u4EF6\u5206\u652F",
|
|
751
|
+
"cite-coverage.skip.semantic": "\u8BED\u4E49\u7EA6\u675F",
|
|
752
|
+
"cite-coverage.skip.aesthetic": "\u7F8E\u5B66/\u98CE\u683C",
|
|
753
|
+
"cite-coverage.skip.architectural": "\u67B6\u6784\u5C42",
|
|
754
|
+
"cite-coverage.skip.other": "\u5176\u4ED6",
|
|
672
755
|
"cli.doctor.args.target.description": "\u76EE\u6807\u9879\u76EE\u8DEF\u5F84\u3002\u9ED8\u8BA4\u4F9D\u6B21\u4F7F\u7528 --target\u3001EXTERNAL_FIXTURE_PATH\u3001\u5F53\u524D\u76EE\u5F55\u3002",
|
|
673
756
|
"cli.doctor.args.fix.description": "\u4FEE\u590D Fabric \u6D3E\u751F\u72B6\u6001\uFF08meta + \u7D22\u5F15\uFF09\u3002",
|
|
674
757
|
"cli.doctor.args.json.description": "\u4EE5 JSON \u8F93\u51FA doctor \u62A5\u544A\u3002",
|
|
@@ -680,15 +763,28 @@ var zhCNMessages = {
|
|
|
680
763
|
"cli.doctor.args.cite-coverage.description": "Cite \u653F\u7B56\u5408\u89C4\u62A5\u544A(\u53EA\u8BFB;\u8DF3\u8FC7\u6807\u51C6\u68C0\u67E5)",
|
|
681
764
|
"cli.doctor.args.since.description": "Cite \u8986\u76D6\u7387\u7EDF\u8BA1\u7A97\u53E3(\u5982 7d, 24h, 30m)",
|
|
682
765
|
"cli.doctor.args.client.description": "\u6309\u5BA2\u6237\u7AEF\u8FC7\u6EE4(cc|codex|cursor|all)",
|
|
766
|
+
// v2.0.0-rc.24 TASK-10: --layer 过滤 cite 合约审计的知识层 (team|personal|all)。
|
|
767
|
+
"cli.doctor.args.layer.description": "\u6309\u77E5\u8BC6\u5C42\u8FC7\u6EE4 cite \u5408\u7EA6\u5BA1\u8BA1 (team|personal|all)",
|
|
683
768
|
"cli.doctor.errors.cite-coverage-mutex": "--cite-coverage \u4E0D\u80FD\u4E0E --fix \u6216 --fix-knowledge \u540C\u65F6\u4F7F\u7528",
|
|
684
769
|
"cli.doctor.errors.invalid-since": "--since \u53D6\u503C\u65E0\u6548: {input}\u3002\u9884\u671F\u683C\u5F0F 7d / 24h / 30m \u6216 epoch ms\u3002",
|
|
685
770
|
"cli.doctor.errors.invalid-client": "--client \u53D6\u503C\u65E0\u6548: {input}\u3002\u9884\u671F cc / codex / cursor / all\u3002",
|
|
771
|
+
"cli.doctor.errors.invalid-layer": "--layer \u53D6\u503C\u65E0\u6548: {input}\u3002\u9884\u671F team / personal / all\u3002",
|
|
686
772
|
// rc.23 TASK-007 (a-C2): --enrich-descriptions 回填四个 description 字段。
|
|
687
773
|
"cli.doctor.args.enrich-descriptions.description": "\u56DE\u586B\u6B63\u5F0F\u77E5\u8BC6\u6761\u76EE\u7F3A\u5931\u7684 intent_clues / tech_stack / impact / must_read_if \u5B57\u6BB5\uFF08\u9ED8\u8BA4\u53EA\u8BFB;\u642D\u914D --auto \u5199\u5165 stub\uFF09\u3002",
|
|
688
774
|
"cli.doctor.args.auto.description": "\u4E0E --enrich-descriptions \u642D\u914D\uFF1A\u4E3A\u7F3A\u5931\u5B57\u6BB5\u5199\u5165\u786E\u5B9A\u6027 stub \u503C\u3002\u4E0D\u52A0 --auto \u4EC5\u505A\u53EA\u8BFB\u626B\u63CF\u3002",
|
|
689
775
|
"cli.doctor.args.dry-run.description": "\u4E0E --enrich-descriptions --auto \u642D\u914D\uFF1A\u4EC5\u9884\u89C8\u6539\u52A8\u8BA1\u5212,\u4E0D\u5199\u5165\u78C1\u76D8\u3002",
|
|
690
776
|
"cli.doctor.errors.enrich-descriptions-mutex": "--enrich-descriptions \u4E0D\u80FD\u4E0E --fix / --fix-knowledge / --cite-coverage \u540C\u65F6\u4F7F\u7528,\u8BF7\u5206\u522B\u8FD0\u884C\u3002",
|
|
691
777
|
"doctor.enrich.allComplete": "\u6240\u6709\u6B63\u5F0F\u77E5\u8BC6\u6761\u76EE\u5747\u5DF2\u5305\u542B intent_clues / tech_stack / impact / must_read_if\u3002",
|
|
778
|
+
// v2.0.0-rc.25 TASK-10: --archive-history 子命令——按 session 维度审计归档尝试记录。
|
|
779
|
+
"cli.doctor.args.archive-history.description": "\u6309 session \u7EF4\u5EA6\u6E32\u67D3\u5F52\u6863\u5C1D\u8BD5\u5386\u53F2(\u53EA\u8BFB;\u8BFB\u53D6 session_archive_attempted \u4E8B\u4EF6)\u3002",
|
|
780
|
+
"cli.doctor.errors.archive-history-mutex": "--archive-history \u4E0D\u80FD\u4E0E --fix / --fix-knowledge / --cite-coverage / --enrich-descriptions \u540C\u65F6\u4F7F\u7528,\u8BF7\u5206\u522B\u8FD0\u884C\u3002",
|
|
781
|
+
"doctor.archive-history.header": "\u5F52\u6863\u5386\u53F2(\u6700\u8FD1 {sinceLabel},{count} \u4E2A\u4F1A\u8BDD)",
|
|
782
|
+
"doctor.archive-history.empty": "\u6682\u65E0\u5F52\u6863\u5386\u53F2\u8BB0\u5F55 (--since={sinceLabel} \u7A97\u53E3\u5185)\u3002",
|
|
783
|
+
"doctor.archive-history.table.session": "\u4F1A\u8BDD",
|
|
784
|
+
"doctor.archive-history.table.lastAttempt": "\u6700\u8FD1\u5C1D\u8BD5",
|
|
785
|
+
"doctor.archive-history.table.outcome": "\u7ED3\u679C",
|
|
786
|
+
"doctor.archive-history.table.candidates": "\u5019\u9009\u6570",
|
|
787
|
+
"doctor.archive-history.table.coveredGap": "\u8986\u76D6\u8DDD\u4ECA",
|
|
692
788
|
"cli.hooks.description": "\u7BA1\u7406 Fabric Git \u94A9\u5B50\u6A21\u677F\u3002",
|
|
693
789
|
"cli.hooks.install.description": "\u5B89\u88C5 Fabric Husky pre-commit \u94A9\u5B50\u6A21\u677F\u3002",
|
|
694
790
|
"cli.hooks.install.args.target.description": "\u76EE\u6807\u9879\u76EE\u8DEF\u5F84\uFF0C\u9ED8\u8BA4\u4E3A\u5F53\u524D\u5DE5\u4F5C\u76EE\u5F55\u3002",
|
package/dist/i18n/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { AgentsActivationTier, AgentsMetaCountersEnvelope, AgentsMetaKnowledgeTy
|
|
|
3
3
|
export { Locale, Messages, PROTECTED_TOKENS, ProtectedToken, TranslationKey, Translator, createTranslator, defaultMessages, detectNodeLocale, enMessages, normalizeLocale, zhCNMessages } from './i18n/index.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { Layer, KnowledgeType, StableId } from './schemas/api-contracts.js';
|
|
6
|
-
export { FabExtractKnowledgeInput, FabExtractKnowledgeInputSchema, FabExtractKnowledgeInputShape, FabExtractKnowledgeOutput, FabExtractKnowledgeOutputSchema, FabReviewInput, FabReviewInputSchema, FabReviewInputShape, FabReviewOutput, FabReviewOutputSchema, FabReviewOutputShape, KNOWLEDGE_TYPE_CODES, KnowledgeEntryFrontmatter, KnowledgeEntryFrontmatterSchema, KnowledgeTypeCode, KnowledgeTypeSchema, LayerSchema, Maturity, MaturitySchema, PROPOSED_REASON_DESCRIPTIONS, ProposedReason, ProposedReasonSchema, StableIdSchema, annotateIntentRequestSchema, fabExtractKnowledgeAnnotations, fabReviewAnnotations, formatKnowledgeId, historyStateQuerySchema, humanLockApproveRequestSchema, humanLockFileParamsSchema, knowledgeSectionsAnnotations, knowledgeSectionsInputSchema, knowledgeSectionsOutputSchema, ledgerQuerySchema, ledgerSourceSchema, parseKnowledgeId, planContextAnnotations, planContextHintNarrowEntrySchema, planContextHintOutputSchema, planContextInputSchema, planContextOutputSchema, structuredWarningSchema } from './schemas/api-contracts.js';
|
|
6
|
+
export { CiteContractMetrics, CiteCoverageReport, CiteLayerTypeBreakdown, FabExtractKnowledgeInput, FabExtractKnowledgeInputSchema, FabExtractKnowledgeInputShape, FabExtractKnowledgeOutput, FabExtractKnowledgeOutputSchema, FabReviewInput, FabReviewInputSchema, FabReviewInputShape, FabReviewOutput, FabReviewOutputSchema, FabReviewOutputShape, KNOWLEDGE_TYPE_CODES, KnowledgeEntryFrontmatter, KnowledgeEntryFrontmatterSchema, KnowledgeTypeCode, KnowledgeTypeSchema, LayerSchema, Maturity, MaturitySchema, PROPOSED_REASON_DESCRIPTIONS, ProposedReason, ProposedReasonSchema, StableIdSchema, annotateIntentRequestSchema, citeContractMetricsSchema, citeCoverageReportSchema, citeLayerTypeBreakdownSchema, fabExtractKnowledgeAnnotations, fabReviewAnnotations, formatKnowledgeId, historyStateQuerySchema, humanLockApproveRequestSchema, humanLockFileParamsSchema, knowledgeSectionsAnnotations, knowledgeSectionsInputSchema, knowledgeSectionsOutputSchema, ledgerQuerySchema, ledgerSourceSchema, parseKnowledgeId, planContextAnnotations, planContextHintNarrowEntrySchema, planContextHintOutputSchema, planContextInputSchema, planContextOutputSchema, structuredWarningSchema } from './schemas/api-contracts.js';
|
|
7
7
|
export { BOOTSTRAP_CANONICAL, BOOTSTRAP_MARKER_BEGIN, BOOTSTRAP_MARKER_END, BOOTSTRAP_REGEX, LEGACY_KB_MARKER_BEGIN, LEGACY_KB_MARKER_END, LEGACY_KB_REGEX } from './templates/bootstrap-canonical.js';
|
|
8
8
|
|
|
9
9
|
declare const ONBOARD_SLOT_NAMES: readonly ["tech-stack-decision", "architecture-pattern", "code-style-tone", "build-system-idiom", "domain-vocabulary"];
|
|
@@ -1091,8 +1091,8 @@ declare const knowledgeTestIndexSchema: z.ZodObject<{
|
|
|
1091
1091
|
previous_test_hash?: string | undefined;
|
|
1092
1092
|
}>, "many">;
|
|
1093
1093
|
}, "strict", z.ZodTypeAny, {
|
|
1094
|
-
schema_version: 1;
|
|
1095
1094
|
generated_at: string;
|
|
1095
|
+
schema_version: 1;
|
|
1096
1096
|
links: {
|
|
1097
1097
|
rule_stable_id: string;
|
|
1098
1098
|
rule_file: string;
|
|
@@ -1113,8 +1113,8 @@ declare const knowledgeTestIndexSchema: z.ZodObject<{
|
|
|
1113
1113
|
revision?: string | undefined;
|
|
1114
1114
|
previous_revision?: string | undefined;
|
|
1115
1115
|
}, {
|
|
1116
|
-
schema_version: 1;
|
|
1117
1116
|
generated_at: string;
|
|
1117
|
+
schema_version: 1;
|
|
1118
1118
|
links: {
|
|
1119
1119
|
rule_stable_id: string;
|
|
1120
1120
|
rule_file: string;
|
|
@@ -1321,14 +1321,14 @@ declare const clientPathsSchema: z.ZodObject<{
|
|
|
1321
1321
|
cursor: z.ZodOptional<z.ZodString>;
|
|
1322
1322
|
codexCLI: z.ZodOptional<z.ZodString>;
|
|
1323
1323
|
}, "strict", z.ZodTypeAny, {
|
|
1324
|
+
cursor?: string | undefined;
|
|
1324
1325
|
claudeCodeCLI?: string | undefined;
|
|
1325
1326
|
claudeCodeDesktop?: string | undefined;
|
|
1326
|
-
cursor?: string | undefined;
|
|
1327
1327
|
codexCLI?: string | undefined;
|
|
1328
1328
|
}, {
|
|
1329
|
+
cursor?: string | undefined;
|
|
1329
1330
|
claudeCodeCLI?: string | undefined;
|
|
1330
1331
|
claudeCodeDesktop?: string | undefined;
|
|
1331
|
-
cursor?: string | undefined;
|
|
1332
1332
|
codexCLI?: string | undefined;
|
|
1333
1333
|
}>;
|
|
1334
1334
|
declare const mcpPayloadLimitsSchema: z.ZodOptional<z.ZodObject<{
|
|
@@ -1350,14 +1350,14 @@ declare const fabricConfigSchema: z.ZodObject<{
|
|
|
1350
1350
|
cursor: z.ZodOptional<z.ZodString>;
|
|
1351
1351
|
codexCLI: z.ZodOptional<z.ZodString>;
|
|
1352
1352
|
}, "strict", z.ZodTypeAny, {
|
|
1353
|
+
cursor?: string | undefined;
|
|
1353
1354
|
claudeCodeCLI?: string | undefined;
|
|
1354
1355
|
claudeCodeDesktop?: string | undefined;
|
|
1355
|
-
cursor?: string | undefined;
|
|
1356
1356
|
codexCLI?: string | undefined;
|
|
1357
1357
|
}, {
|
|
1358
|
+
cursor?: string | undefined;
|
|
1358
1359
|
claudeCodeCLI?: string | undefined;
|
|
1359
1360
|
claudeCodeDesktop?: string | undefined;
|
|
1360
|
-
cursor?: string | undefined;
|
|
1361
1361
|
codexCLI?: string | undefined;
|
|
1362
1362
|
}>>;
|
|
1363
1363
|
scanIgnores: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -1417,9 +1417,9 @@ declare const fabricConfigSchema: z.ZodObject<{
|
|
|
1417
1417
|
review_stale_pending_days: number;
|
|
1418
1418
|
onboard_slots_opted_out: string[];
|
|
1419
1419
|
clientPaths?: {
|
|
1420
|
+
cursor?: string | undefined;
|
|
1420
1421
|
claudeCodeCLI?: string | undefined;
|
|
1421
1422
|
claudeCodeDesktop?: string | undefined;
|
|
1422
|
-
cursor?: string | undefined;
|
|
1423
1423
|
codexCLI?: string | undefined;
|
|
1424
1424
|
} | undefined;
|
|
1425
1425
|
scanIgnores?: string[] | undefined;
|
|
@@ -1431,9 +1431,9 @@ declare const fabricConfigSchema: z.ZodObject<{
|
|
|
1431
1431
|
fabric_event_retention_days?: 7 | 30 | 90 | undefined;
|
|
1432
1432
|
}, {
|
|
1433
1433
|
clientPaths?: {
|
|
1434
|
+
cursor?: string | undefined;
|
|
1434
1435
|
claudeCodeCLI?: string | undefined;
|
|
1435
1436
|
claudeCodeDesktop?: string | undefined;
|
|
1436
|
-
cursor?: string | undefined;
|
|
1437
1437
|
codexCLI?: string | undefined;
|
|
1438
1438
|
} | undefined;
|
|
1439
1439
|
scanIgnores?: string[] | undefined;
|
|
@@ -6247,6 +6247,31 @@ declare const assistantTurnObservedEventSchema: z.ZodObject<{
|
|
|
6247
6247
|
kb_line_raw: z.ZodNullable<z.ZodString>;
|
|
6248
6248
|
cite_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
6249
6249
|
cite_tags: z.ZodDefault<z.ZodArray<z.ZodEnum<["planned", "recalled", "chained-from", "dismissed", "none"]>, "many">>;
|
|
6250
|
+
cite_commitments: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
6251
|
+
operators: z.ZodArray<z.ZodObject<{
|
|
6252
|
+
kind: z.ZodEnum<["edit", "not_edit", "require", "forbid"]>;
|
|
6253
|
+
target: z.ZodString;
|
|
6254
|
+
}, "strip", z.ZodTypeAny, {
|
|
6255
|
+
kind: "require" | "edit" | "not_edit" | "forbid";
|
|
6256
|
+
target: string;
|
|
6257
|
+
}, {
|
|
6258
|
+
kind: "require" | "edit" | "not_edit" | "forbid";
|
|
6259
|
+
target: string;
|
|
6260
|
+
}>, "many">;
|
|
6261
|
+
skip_reason: z.ZodNullable<z.ZodString>;
|
|
6262
|
+
}, "strip", z.ZodTypeAny, {
|
|
6263
|
+
operators: {
|
|
6264
|
+
kind: "require" | "edit" | "not_edit" | "forbid";
|
|
6265
|
+
target: string;
|
|
6266
|
+
}[];
|
|
6267
|
+
skip_reason: string | null;
|
|
6268
|
+
}, {
|
|
6269
|
+
operators: {
|
|
6270
|
+
kind: "require" | "edit" | "not_edit" | "forbid";
|
|
6271
|
+
target: string;
|
|
6272
|
+
}[];
|
|
6273
|
+
skip_reason: string | null;
|
|
6274
|
+
}>, "many">>;
|
|
6250
6275
|
client: z.ZodOptional<z.ZodEnum<["cc", "codex", "cursor"]>>;
|
|
6251
6276
|
turn_id: z.ZodString;
|
|
6252
6277
|
envelope_index: z.ZodOptional<z.ZodNumber>;
|
|
@@ -6267,10 +6292,17 @@ declare const assistantTurnObservedEventSchema: z.ZodObject<{
|
|
|
6267
6292
|
kb_line_raw: string | null;
|
|
6268
6293
|
cite_ids: string[];
|
|
6269
6294
|
cite_tags: ("none" | "planned" | "recalled" | "chained-from" | "dismissed")[];
|
|
6295
|
+
cite_commitments: {
|
|
6296
|
+
operators: {
|
|
6297
|
+
kind: "require" | "edit" | "not_edit" | "forbid";
|
|
6298
|
+
target: string;
|
|
6299
|
+
}[];
|
|
6300
|
+
skip_reason: string | null;
|
|
6301
|
+
}[];
|
|
6270
6302
|
turn_id: string;
|
|
6271
6303
|
correlation_id?: string | undefined;
|
|
6272
6304
|
session_id?: string | undefined;
|
|
6273
|
-
client?: "
|
|
6305
|
+
client?: "cc" | "codex" | "cursor" | undefined;
|
|
6274
6306
|
envelope_index?: number | undefined;
|
|
6275
6307
|
}, {
|
|
6276
6308
|
id: string;
|
|
@@ -6285,7 +6317,14 @@ declare const assistantTurnObservedEventSchema: z.ZodObject<{
|
|
|
6285
6317
|
session_id?: string | undefined;
|
|
6286
6318
|
cite_ids?: string[] | undefined;
|
|
6287
6319
|
cite_tags?: ("none" | "planned" | "recalled" | "chained-from" | "dismissed")[] | undefined;
|
|
6288
|
-
|
|
6320
|
+
cite_commitments?: {
|
|
6321
|
+
operators: {
|
|
6322
|
+
kind: "require" | "edit" | "not_edit" | "forbid";
|
|
6323
|
+
target: string;
|
|
6324
|
+
}[];
|
|
6325
|
+
skip_reason: string | null;
|
|
6326
|
+
}[] | undefined;
|
|
6327
|
+
client?: "cc" | "codex" | "cursor" | undefined;
|
|
6289
6328
|
envelope_index?: number | undefined;
|
|
6290
6329
|
}>;
|
|
6291
6330
|
declare const citePolicyActivatedEventSchema: z.ZodObject<{
|
|
@@ -6319,6 +6358,31 @@ declare const citePolicyActivatedEventSchema: z.ZodObject<{
|
|
|
6319
6358
|
correlation_id?: string | undefined;
|
|
6320
6359
|
session_id?: string | undefined;
|
|
6321
6360
|
}>;
|
|
6361
|
+
declare const citeContractPolicyActivatedEventSchema: z.ZodObject<{
|
|
6362
|
+
event_type: z.ZodLiteral<"cite_contract_policy_activated">;
|
|
6363
|
+
kind: z.ZodLiteral<"fabric-event">;
|
|
6364
|
+
id: z.ZodString;
|
|
6365
|
+
ts: z.ZodNumber;
|
|
6366
|
+
schema_version: z.ZodLiteral<1>;
|
|
6367
|
+
correlation_id: z.ZodOptional<z.ZodString>;
|
|
6368
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
6369
|
+
}, "strip", z.ZodTypeAny, {
|
|
6370
|
+
id: string;
|
|
6371
|
+
ts: number;
|
|
6372
|
+
schema_version: 1;
|
|
6373
|
+
kind: "fabric-event";
|
|
6374
|
+
event_type: "cite_contract_policy_activated";
|
|
6375
|
+
correlation_id?: string | undefined;
|
|
6376
|
+
session_id?: string | undefined;
|
|
6377
|
+
}, {
|
|
6378
|
+
id: string;
|
|
6379
|
+
ts: number;
|
|
6380
|
+
schema_version: 1;
|
|
6381
|
+
kind: "fabric-event";
|
|
6382
|
+
event_type: "cite_contract_policy_activated";
|
|
6383
|
+
correlation_id?: string | undefined;
|
|
6384
|
+
session_id?: string | undefined;
|
|
6385
|
+
}>;
|
|
6322
6386
|
declare const eventsRotatedEventSchema: z.ZodObject<{
|
|
6323
6387
|
event_type: z.ZodLiteral<"events_rotated">;
|
|
6324
6388
|
cutoff_ts: z.ZodString;
|
|
@@ -6464,6 +6528,43 @@ declare const knowledgeEnrichedEventSchema: z.ZodObject<{
|
|
|
6464
6528
|
correlation_id?: string | undefined;
|
|
6465
6529
|
session_id?: string | undefined;
|
|
6466
6530
|
}>;
|
|
6531
|
+
declare const sessionArchiveAttemptedEventSchema: z.ZodObject<{
|
|
6532
|
+
event_type: z.ZodLiteral<"session_archive_attempted">;
|
|
6533
|
+
outcome: z.ZodEnum<["proposed", "viability_failed", "user_dismissed", "skipped_no_signal"]>;
|
|
6534
|
+
covered_through_ts: z.ZodNumber;
|
|
6535
|
+
candidates_proposed: z.ZodDefault<z.ZodNumber>;
|
|
6536
|
+
knowledge_proposed_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
6537
|
+
kind: z.ZodLiteral<"fabric-event">;
|
|
6538
|
+
id: z.ZodString;
|
|
6539
|
+
ts: z.ZodNumber;
|
|
6540
|
+
schema_version: z.ZodLiteral<1>;
|
|
6541
|
+
correlation_id: z.ZodOptional<z.ZodString>;
|
|
6542
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
6543
|
+
}, "strip", z.ZodTypeAny, {
|
|
6544
|
+
id: string;
|
|
6545
|
+
ts: number;
|
|
6546
|
+
schema_version: 1;
|
|
6547
|
+
kind: "fabric-event";
|
|
6548
|
+
event_type: "session_archive_attempted";
|
|
6549
|
+
outcome: "proposed" | "viability_failed" | "user_dismissed" | "skipped_no_signal";
|
|
6550
|
+
covered_through_ts: number;
|
|
6551
|
+
candidates_proposed: number;
|
|
6552
|
+
knowledge_proposed_ids: string[];
|
|
6553
|
+
correlation_id?: string | undefined;
|
|
6554
|
+
session_id?: string | undefined;
|
|
6555
|
+
}, {
|
|
6556
|
+
id: string;
|
|
6557
|
+
ts: number;
|
|
6558
|
+
schema_version: 1;
|
|
6559
|
+
kind: "fabric-event";
|
|
6560
|
+
event_type: "session_archive_attempted";
|
|
6561
|
+
outcome: "proposed" | "viability_failed" | "user_dismissed" | "skipped_no_signal";
|
|
6562
|
+
covered_through_ts: number;
|
|
6563
|
+
correlation_id?: string | undefined;
|
|
6564
|
+
session_id?: string | undefined;
|
|
6565
|
+
candidates_proposed?: number | undefined;
|
|
6566
|
+
knowledge_proposed_ids?: string[] | undefined;
|
|
6567
|
+
}>;
|
|
6467
6568
|
declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.ZodObject<{
|
|
6468
6569
|
event_type: z.ZodLiteral<"knowledge_context_planned">;
|
|
6469
6570
|
target_paths: z.ZodArray<z.ZodString, "many">;
|
|
@@ -7682,6 +7783,31 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
|
|
|
7682
7783
|
kb_line_raw: z.ZodNullable<z.ZodString>;
|
|
7683
7784
|
cite_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
7684
7785
|
cite_tags: z.ZodDefault<z.ZodArray<z.ZodEnum<["planned", "recalled", "chained-from", "dismissed", "none"]>, "many">>;
|
|
7786
|
+
cite_commitments: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
7787
|
+
operators: z.ZodArray<z.ZodObject<{
|
|
7788
|
+
kind: z.ZodEnum<["edit", "not_edit", "require", "forbid"]>;
|
|
7789
|
+
target: z.ZodString;
|
|
7790
|
+
}, "strip", z.ZodTypeAny, {
|
|
7791
|
+
kind: "require" | "edit" | "not_edit" | "forbid";
|
|
7792
|
+
target: string;
|
|
7793
|
+
}, {
|
|
7794
|
+
kind: "require" | "edit" | "not_edit" | "forbid";
|
|
7795
|
+
target: string;
|
|
7796
|
+
}>, "many">;
|
|
7797
|
+
skip_reason: z.ZodNullable<z.ZodString>;
|
|
7798
|
+
}, "strip", z.ZodTypeAny, {
|
|
7799
|
+
operators: {
|
|
7800
|
+
kind: "require" | "edit" | "not_edit" | "forbid";
|
|
7801
|
+
target: string;
|
|
7802
|
+
}[];
|
|
7803
|
+
skip_reason: string | null;
|
|
7804
|
+
}, {
|
|
7805
|
+
operators: {
|
|
7806
|
+
kind: "require" | "edit" | "not_edit" | "forbid";
|
|
7807
|
+
target: string;
|
|
7808
|
+
}[];
|
|
7809
|
+
skip_reason: string | null;
|
|
7810
|
+
}>, "many">>;
|
|
7685
7811
|
client: z.ZodOptional<z.ZodEnum<["cc", "codex", "cursor"]>>;
|
|
7686
7812
|
turn_id: z.ZodString;
|
|
7687
7813
|
envelope_index: z.ZodOptional<z.ZodNumber>;
|
|
@@ -7702,10 +7828,17 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
|
|
|
7702
7828
|
kb_line_raw: string | null;
|
|
7703
7829
|
cite_ids: string[];
|
|
7704
7830
|
cite_tags: ("none" | "planned" | "recalled" | "chained-from" | "dismissed")[];
|
|
7831
|
+
cite_commitments: {
|
|
7832
|
+
operators: {
|
|
7833
|
+
kind: "require" | "edit" | "not_edit" | "forbid";
|
|
7834
|
+
target: string;
|
|
7835
|
+
}[];
|
|
7836
|
+
skip_reason: string | null;
|
|
7837
|
+
}[];
|
|
7705
7838
|
turn_id: string;
|
|
7706
7839
|
correlation_id?: string | undefined;
|
|
7707
7840
|
session_id?: string | undefined;
|
|
7708
|
-
client?: "
|
|
7841
|
+
client?: "cc" | "codex" | "cursor" | undefined;
|
|
7709
7842
|
envelope_index?: number | undefined;
|
|
7710
7843
|
}, {
|
|
7711
7844
|
id: string;
|
|
@@ -7720,7 +7853,14 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
|
|
|
7720
7853
|
session_id?: string | undefined;
|
|
7721
7854
|
cite_ids?: string[] | undefined;
|
|
7722
7855
|
cite_tags?: ("none" | "planned" | "recalled" | "chained-from" | "dismissed")[] | undefined;
|
|
7723
|
-
|
|
7856
|
+
cite_commitments?: {
|
|
7857
|
+
operators: {
|
|
7858
|
+
kind: "require" | "edit" | "not_edit" | "forbid";
|
|
7859
|
+
target: string;
|
|
7860
|
+
}[];
|
|
7861
|
+
skip_reason: string | null;
|
|
7862
|
+
}[] | undefined;
|
|
7863
|
+
client?: "cc" | "codex" | "cursor" | undefined;
|
|
7724
7864
|
envelope_index?: number | undefined;
|
|
7725
7865
|
}>, z.ZodObject<{
|
|
7726
7866
|
event_type: z.ZodLiteral<"cite_policy_activated">;
|
|
@@ -7752,6 +7892,30 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
|
|
|
7752
7892
|
policy_version: string;
|
|
7753
7893
|
correlation_id?: string | undefined;
|
|
7754
7894
|
session_id?: string | undefined;
|
|
7895
|
+
}>, z.ZodObject<{
|
|
7896
|
+
event_type: z.ZodLiteral<"cite_contract_policy_activated">;
|
|
7897
|
+
kind: z.ZodLiteral<"fabric-event">;
|
|
7898
|
+
id: z.ZodString;
|
|
7899
|
+
ts: z.ZodNumber;
|
|
7900
|
+
schema_version: z.ZodLiteral<1>;
|
|
7901
|
+
correlation_id: z.ZodOptional<z.ZodString>;
|
|
7902
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
7903
|
+
}, "strip", z.ZodTypeAny, {
|
|
7904
|
+
id: string;
|
|
7905
|
+
ts: number;
|
|
7906
|
+
schema_version: 1;
|
|
7907
|
+
kind: "fabric-event";
|
|
7908
|
+
event_type: "cite_contract_policy_activated";
|
|
7909
|
+
correlation_id?: string | undefined;
|
|
7910
|
+
session_id?: string | undefined;
|
|
7911
|
+
}, {
|
|
7912
|
+
id: string;
|
|
7913
|
+
ts: number;
|
|
7914
|
+
schema_version: 1;
|
|
7915
|
+
kind: "fabric-event";
|
|
7916
|
+
event_type: "cite_contract_policy_activated";
|
|
7917
|
+
correlation_id?: string | undefined;
|
|
7918
|
+
session_id?: string | undefined;
|
|
7755
7919
|
}>, z.ZodObject<{
|
|
7756
7920
|
event_type: z.ZodLiteral<"knowledge_meta_auto_healed">;
|
|
7757
7921
|
previous_revision_hash: z.ZodString;
|
|
@@ -7893,6 +8057,42 @@ declare const eventLedgerEventSchema: z.ZodDiscriminatedUnion<"event_type", [z.Z
|
|
|
7893
8057
|
added_fields: ("intent_clues" | "tech_stack" | "impact" | "must_read_if")[];
|
|
7894
8058
|
correlation_id?: string | undefined;
|
|
7895
8059
|
session_id?: string | undefined;
|
|
8060
|
+
}>, z.ZodObject<{
|
|
8061
|
+
event_type: z.ZodLiteral<"session_archive_attempted">;
|
|
8062
|
+
outcome: z.ZodEnum<["proposed", "viability_failed", "user_dismissed", "skipped_no_signal"]>;
|
|
8063
|
+
covered_through_ts: z.ZodNumber;
|
|
8064
|
+
candidates_proposed: z.ZodDefault<z.ZodNumber>;
|
|
8065
|
+
knowledge_proposed_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
8066
|
+
kind: z.ZodLiteral<"fabric-event">;
|
|
8067
|
+
id: z.ZodString;
|
|
8068
|
+
ts: z.ZodNumber;
|
|
8069
|
+
schema_version: z.ZodLiteral<1>;
|
|
8070
|
+
correlation_id: z.ZodOptional<z.ZodString>;
|
|
8071
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
8072
|
+
}, "strip", z.ZodTypeAny, {
|
|
8073
|
+
id: string;
|
|
8074
|
+
ts: number;
|
|
8075
|
+
schema_version: 1;
|
|
8076
|
+
kind: "fabric-event";
|
|
8077
|
+
event_type: "session_archive_attempted";
|
|
8078
|
+
outcome: "proposed" | "viability_failed" | "user_dismissed" | "skipped_no_signal";
|
|
8079
|
+
covered_through_ts: number;
|
|
8080
|
+
candidates_proposed: number;
|
|
8081
|
+
knowledge_proposed_ids: string[];
|
|
8082
|
+
correlation_id?: string | undefined;
|
|
8083
|
+
session_id?: string | undefined;
|
|
8084
|
+
}, {
|
|
8085
|
+
id: string;
|
|
8086
|
+
ts: number;
|
|
8087
|
+
schema_version: 1;
|
|
8088
|
+
kind: "fabric-event";
|
|
8089
|
+
event_type: "session_archive_attempted";
|
|
8090
|
+
outcome: "proposed" | "viability_failed" | "user_dismissed" | "skipped_no_signal";
|
|
8091
|
+
covered_through_ts: number;
|
|
8092
|
+
correlation_id?: string | undefined;
|
|
8093
|
+
session_id?: string | undefined;
|
|
8094
|
+
candidates_proposed?: number | undefined;
|
|
8095
|
+
knowledge_proposed_ids?: string[] | undefined;
|
|
7896
8096
|
}>]>;
|
|
7897
8097
|
type KnowledgeContextPlannedEvent = z.infer<typeof knowledgeContextPlannedEventSchema>;
|
|
7898
8098
|
type KnowledgeSelectionEvent = z.infer<typeof knowledgeSelectionEventSchema>;
|
|
@@ -7929,13 +8129,39 @@ type DoctorRunEvent = z.infer<typeof doctorRunEventSchema>;
|
|
|
7929
8129
|
type RelevanceMigrationRunEvent = z.infer<typeof relevanceMigrationRunEventSchema>;
|
|
7930
8130
|
type AssistantTurnObservedEvent = z.infer<typeof assistantTurnObservedEventSchema>;
|
|
7931
8131
|
type CitePolicyActivatedEvent = z.infer<typeof citePolicyActivatedEventSchema>;
|
|
8132
|
+
type CiteContractPolicyActivatedEvent = z.infer<typeof citeContractPolicyActivatedEventSchema>;
|
|
7932
8133
|
type KnowledgeMetaAutoHealedEvent = z.infer<typeof knowledgeMetaAutoHealedEventSchema>;
|
|
7933
8134
|
type EventsRotatedEvent = z.infer<typeof eventsRotatedEventSchema>;
|
|
7934
8135
|
type ServeLockClearedEvent = z.infer<typeof serveLockClearedEventSchema>;
|
|
7935
8136
|
type KnowledgeEnrichedEvent = z.infer<typeof knowledgeEnrichedEventSchema>;
|
|
7936
|
-
type
|
|
8137
|
+
type SessionArchiveAttemptedEvent = z.infer<typeof sessionArchiveAttemptedEventSchema>;
|
|
8138
|
+
type EventLedgerEvent = KnowledgeContextPlannedEvent | KnowledgeSelectionEvent | KnowledgeSectionsFetchedEvent | EditIntentCheckedEvent | KnowledgeDriftDetectedEvent | McpEventLedgerEvent | ReapplyCompletedEvent | EventLedgerTruncatedEvent | McpConfigMigratedEvent | BootstrapMarkerMigratedEvent | MetaReconciledOnStartupEvent | MetaReconciledEvent | ClaudeSkillPathMigratedEvent | ClaudeHookPathMigratedEvent | CodexSkillPathMigratedEvent | InitScanCompletedEvent | KnowledgeProposedEvent | KnowledgePromoteStartedEvent | KnowledgePromotedEvent | KnowledgePromoteFailedEvent | KnowledgeLayerChangedEvent | KnowledgeSlugRenamedEvent | KnowledgeDemotedEvent | KnowledgeArchivedEvent | KnowledgeArchiveAttemptedEvent | KnowledgeDeferredEvent | KnowledgeRejectedEvent | KnowledgeConsumedEvent | KnowledgeScopeDegradedEvent | PendingAutoArchivedEvent | KnowledgePathDangledEvent | DoctorRunEvent | RelevanceMigrationRunEvent | AssistantTurnObservedEvent | CitePolicyActivatedEvent | CiteContractPolicyActivatedEvent | KnowledgeMetaAutoHealedEvent | EventsRotatedEvent | ServeLockClearedEvent | KnowledgeEnrichedEvent | SessionArchiveAttemptedEvent;
|
|
7937
8139
|
type EventLedgerEventType = EventLedgerEvent["event_type"];
|
|
7938
8140
|
type EventLedgerEventInputFor<T extends EventLedgerEvent> = T extends EventLedgerEvent ? Omit<T, "kind" | "id" | "ts" | "schema_version" | "correlation_id" | "session_id"> & Partial<Pick<T, "id" | "ts" | "correlation_id" | "session_id">> : never;
|
|
7939
8141
|
type EventLedgerEventInput = EventLedgerEventInputFor<EventLedgerEvent>;
|
|
7940
8142
|
|
|
7941
|
-
|
|
8143
|
+
type CiteTag = "planned" | "recalled" | "chained-from" | "dismissed" | "none";
|
|
8144
|
+
type CiteCommitmentOperatorKind = "edit" | "not_edit" | "require" | "forbid";
|
|
8145
|
+
interface CiteCommitmentOperator {
|
|
8146
|
+
kind: CiteCommitmentOperatorKind;
|
|
8147
|
+
target: string;
|
|
8148
|
+
}
|
|
8149
|
+
interface CiteCommitment {
|
|
8150
|
+
operators: CiteCommitmentOperator[];
|
|
8151
|
+
skip_reason: string | null;
|
|
8152
|
+
}
|
|
8153
|
+
interface ParseCiteLineResult {
|
|
8154
|
+
cite_ids: string[];
|
|
8155
|
+
cite_tags: CiteTag[];
|
|
8156
|
+
cite_commitments: CiteCommitment[];
|
|
8157
|
+
}
|
|
8158
|
+
/**
|
|
8159
|
+
* Parse one or more newline-separated `KB:` cite lines into structured
|
|
8160
|
+
* arrays matching the assistant_turn_observed event-ledger fields.
|
|
8161
|
+
*
|
|
8162
|
+
* Tolerates whitespace, CR/LF line endings, blank lines, and non-KB
|
|
8163
|
+
* interleaved prose. Index contract documented above.
|
|
8164
|
+
*/
|
|
8165
|
+
declare function parseCiteLine(raw: string): ParseCiteLineResult;
|
|
8166
|
+
|
|
8167
|
+
export { AGENTS_META_IDENTITY_SOURCES, AGENTS_META_LAYERS, AGENTS_META_TOPOLOGY_TYPES, AgentsIdentitySource, AgentsLayer, AgentsMeta, type AgentsMetaCounters, AgentsMetaCountersSchema, AgentsMetaNode, AgentsTopologyType, type AssistantTurnObservedEvent, type BootstrapMarkerMigratedEvent, type CandidateFileEntry, type CandidateFileFamily, type CiteCommitment, type CiteCommitmentOperator, type CiteCommitmentOperatorKind, type CiteContractPolicyActivatedEvent, type CitePolicyActivatedEvent, type CiteTag, type ClaudeHookPathMigratedEvent, type ClaudeSkillPathMigratedEvent, type CodexSkillPathMigratedEvent, type DoctorRunEvent, type DriftDetectedEvent, type EditIntentCheckedEvent, type EventLedgerEvent, type EventLedgerEventInput, type EventLedgerEventType, type EventLedgerTruncatedEvent, type EventsRotatedEvent, type FabricConfigSchemaShape, type FabricEvent, type ForensicAssertion, type ForensicAssertionConfidence, type ForensicAssertionCoverage, type ForensicAssertionType, type ForensicCodeSample, type ForensicEntryPoint, type ForensicEvidenceAnchor, type ForensicFramework, type ForensicReadme, type ForensicReport, type ForensicSamplingBudget, type ForensicTopology, HumanLockEntry, type HumanLockFile, type InitContext, type InitContextDomainGroup, type InitContextFramework, type InitContextInterviewTrailEntry, type InitContextInvariant, type InitContextInvariantConfidenceSnapshot, type InitContextSourceEvidence, type InitScanCompletedEvent, KNOWLEDGE_TEST_INDEX_SCHEMA_VERSION, type KnowledgeArchiveAttemptedEvent, type KnowledgeArchivedEvent, type KnowledgeConsumedEvent, type KnowledgeContextPlannedEvent, type KnowledgeDeferredEvent, type KnowledgeDemotedEvent, type KnowledgeDriftDetectedEvent, type KnowledgeEnrichedEvent, type KnowledgeLayerChangedEvent, type KnowledgeMetaAutoHealedEvent, type KnowledgePathDangledEvent, type KnowledgePromoteFailedEvent, type KnowledgePromoteStartedEvent, type KnowledgePromotedEvent, type KnowledgeProposedEvent, type KnowledgeRejectedEvent, type KnowledgeScopeDegradedEvent, type KnowledgeSectionsFetchedEvent, type KnowledgeSelectionEvent, type KnowledgeSlugRenamedEvent, type KnowledgeTestIndex, type KnowledgeTestLink, type KnowledgeTestOrphanAnnotation, KnowledgeType, Layer, type LedgerAppendedEvent, LedgerEntry, type LockApprovedEvent, type LockDriftEvent, type McpConfigMigratedEvent, type McpEventLedgerEvent, type MetaReconciledEvent, type MetaReconciledOnStartupEvent, type MetaUpdatedEvent, ONBOARD_SLOT_NAMES, ONBOARD_SLOT_TOTAL, type OnboardSlot, type PanelFieldGroup, type PanelFieldMeta, type ParseCiteLineResult, type PendingAutoArchivedEvent, type ReapplyCompletedEvent, type RelevanceMigrationRunEvent, type ServeLockClearedEvent, type SessionArchiveAttemptedEvent, StableId, type ValidateResult, agentsIdentitySourceSchema, agentsLayerSchema, agentsMetaNodeSchema, agentsMetaSchema, agentsTopologyTypeSchema, aiLedgerEntrySchema, allocateKnowledgeId, assistantTurnObservedEventSchema, auditModeSchema, bootstrapMarkerMigratedEventSchema, candidateFileEntrySchema, citeContractPolicyActivatedEventSchema, citePolicyActivatedEventSchema, claudeHookPathMigratedEventSchema, claudeSkillPathMigratedEventSchema, clientPathsSchema, codexSkillPathMigratedEventSchema, defaultAgentsMetaCounters, defaultLayerFilterSchema, deriveAgentsMetaIdentitySource, deriveAgentsMetaLayer, deriveAgentsMetaStableId, deriveAgentsMetaTopologyType, doctorRunEventSchema, driftDetectedEventSchema, editIntentCheckedEventSchema, eventLedgerEventSchema, eventLedgerTruncatedEventSchema, eventsRotatedEventSchema, fabricConfigSchema, fabricEventSchema, fabricLanguageSchema, forensicAssertionCoverageSchema, forensicAssertionSchema, forensicCodeSampleSchema, forensicEntryPointSchema, forensicEvidenceAnchorSchema, forensicFrameworkSchema, forensicReadmeSchema, forensicReportSchema, forensicSamplingBudgetSchema, forensicTopologySchema, getPanelFieldByKey, getPanelFields, humanLedgerEntrySchema, humanLockEntrySchema, humanLockFileSchema, initContextDomainGroupSchema, initContextFrameworkSchema, initContextInterviewTrailEntrySchema, initContextInvariantConfidenceSnapshotSchema, initContextInvariantSchema, initContextSchema, initContextSourceEvidenceSchema, initScanCompletedEventSchema, isKnowledgeStableId, knowledgeArchiveAttemptedEventSchema, knowledgeArchivedEventSchema, knowledgeConsumedEventSchema, knowledgeContextPlannedEventSchema, knowledgeDeferredEventSchema, knowledgeDemotedEventSchema, knowledgeDriftDetectedEventSchema, knowledgeEnrichedEventSchema, knowledgeLayerChangedEventSchema, knowledgeMetaAutoHealedEventSchema, knowledgePathDangledEventSchema, knowledgePromoteFailedEventSchema, knowledgePromoteStartedEventSchema, knowledgePromotedEventSchema, knowledgeProposedEventSchema, knowledgeRejectedEventSchema, knowledgeScopeDegradedEventSchema, knowledgeSectionsFetchedEventSchema, knowledgeSelectionEventSchema, knowledgeSlugRenamedEventSchema, knowledgeTestIndexSchema, knowledgeTestLinkSchema, knowledgeTestOrphanAnnotationSchema, ledgerAppendedEventSchema, ledgerEntrySchema, lockApprovedEventSchema, lockDriftEventSchema, mcpConfigMigratedEventSchema, mcpEventLedgerEventSchema, mcpPayloadLimitsSchema, metaReconciledEventSchema, metaReconciledOnStartupEventSchema, metaUpdatedEventSchema, onboardSlotSchema, parseCiteLine, pendingAutoArchivedEventSchema, reapplyCompletedEventSchema, relevanceMigrationRunEventSchema, ruleDescriptionIndexItemSchema, ruleDescriptionSchema, serveLockClearedEventSchema, sessionArchiveAttemptedEventSchema, withDerivedAgentsMetaNodeDefaults };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
BOOTSTRAP_CANONICAL,
|
|
3
|
+
BOOTSTRAP_MARKER_BEGIN,
|
|
4
|
+
BOOTSTRAP_MARKER_END,
|
|
5
|
+
BOOTSTRAP_REGEX,
|
|
6
|
+
LEGACY_KB_MARKER_BEGIN,
|
|
7
|
+
LEGACY_KB_MARKER_END,
|
|
8
|
+
LEGACY_KB_REGEX
|
|
9
|
+
} from "./chunk-4OQXR6JW.js";
|
|
2
10
|
import {
|
|
3
11
|
PROTECTED_TOKENS,
|
|
4
12
|
createTranslator,
|
|
@@ -7,7 +15,7 @@ import {
|
|
|
7
15
|
enMessages,
|
|
8
16
|
normalizeLocale,
|
|
9
17
|
zhCNMessages
|
|
10
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-AFUQKKGR.js";
|
|
11
19
|
import {
|
|
12
20
|
FabExtractKnowledgeInputSchema,
|
|
13
21
|
FabExtractKnowledgeInputShape,
|
|
@@ -27,6 +35,9 @@ import {
|
|
|
27
35
|
ProposedReasonSchema,
|
|
28
36
|
StableIdSchema,
|
|
29
37
|
annotateIntentRequestSchema,
|
|
38
|
+
citeContractMetricsSchema,
|
|
39
|
+
citeCoverageReportSchema,
|
|
40
|
+
citeLayerTypeBreakdownSchema,
|
|
30
41
|
fabExtractKnowledgeAnnotations,
|
|
31
42
|
fabReviewAnnotations,
|
|
32
43
|
formatKnowledgeId,
|
|
@@ -46,16 +57,8 @@ import {
|
|
|
46
57
|
planContextInputSchema,
|
|
47
58
|
planContextOutputSchema,
|
|
48
59
|
structuredWarningSchema
|
|
49
|
-
} from "./chunk-
|
|
50
|
-
import
|
|
51
|
-
BOOTSTRAP_CANONICAL,
|
|
52
|
-
BOOTSTRAP_MARKER_BEGIN,
|
|
53
|
-
BOOTSTRAP_MARKER_END,
|
|
54
|
-
BOOTSTRAP_REGEX,
|
|
55
|
-
LEGACY_KB_MARKER_BEGIN,
|
|
56
|
-
LEGACY_KB_MARKER_END,
|
|
57
|
-
LEGACY_KB_REGEX
|
|
58
|
-
} from "./chunk-IP6VWOVE.js";
|
|
60
|
+
} from "./chunk-3RSYWMQU.js";
|
|
61
|
+
import "./chunk-LXNCAKJZ.js";
|
|
59
62
|
|
|
60
63
|
// src/schemas/agents-meta.ts
|
|
61
64
|
import { z } from "zod";
|
|
@@ -1076,6 +1079,24 @@ var assistantTurnObservedEventSchema = z10.object({
|
|
|
1076
1079
|
kb_line_raw: z10.string().nullable(),
|
|
1077
1080
|
cite_ids: z10.array(z10.string()).default([]),
|
|
1078
1081
|
cite_tags: z10.array(z10.enum(["planned", "recalled", "chained-from", "dismissed", "none"])).default([]),
|
|
1082
|
+
// v2.0.0-rc.24 TASK-01: per-cite contract commitments. Index-aligned with
|
|
1083
|
+
// cite_ids/cite_tags (commitments[i] belongs to cite_ids[i]). Each slot
|
|
1084
|
+
// carries `operators[]` (kind + glob target) or `skip_reason` when the cite
|
|
1085
|
+
// cannot be operator-ized. Old rc.20-rc.23 events naturally parse with an
|
|
1086
|
+
// empty array via `.default([])` and are excluded from contract-policy
|
|
1087
|
+
// audits by the marker-gate (see cite_contract_policy_activated below).
|
|
1088
|
+
// Mirrors the rc.20 cite_tags parallel-array evolution exactly.
|
|
1089
|
+
cite_commitments: z10.array(
|
|
1090
|
+
z10.object({
|
|
1091
|
+
operators: z10.array(
|
|
1092
|
+
z10.object({
|
|
1093
|
+
kind: z10.enum(["edit", "not_edit", "require", "forbid"]),
|
|
1094
|
+
target: z10.string()
|
|
1095
|
+
})
|
|
1096
|
+
),
|
|
1097
|
+
skip_reason: z10.string().nullable()
|
|
1098
|
+
})
|
|
1099
|
+
).default([]),
|
|
1079
1100
|
client: z10.enum(["cc", "codex", "cursor"]).optional(),
|
|
1080
1101
|
turn_id: z10.string(),
|
|
1081
1102
|
envelope_index: z10.number().int().nonnegative().optional(),
|
|
@@ -1087,6 +1108,10 @@ var citePolicyActivatedEventSchema = z10.object({
|
|
|
1087
1108
|
policy_version: z10.string(),
|
|
1088
1109
|
timestamp: z10.string().datetime()
|
|
1089
1110
|
});
|
|
1111
|
+
var citeContractPolicyActivatedEventSchema = z10.object({
|
|
1112
|
+
...eventLedgerEnvelopeSchema,
|
|
1113
|
+
event_type: z10.literal("cite_contract_policy_activated")
|
|
1114
|
+
});
|
|
1090
1115
|
var eventsRotatedEventSchema = z10.object({
|
|
1091
1116
|
...eventLedgerEnvelopeSchema,
|
|
1092
1117
|
event_type: z10.literal("events_rotated"),
|
|
@@ -1118,6 +1143,14 @@ var knowledgeEnrichedEventSchema = z10.object({
|
|
|
1118
1143
|
mode: z10.enum(["auto", "interactive"]),
|
|
1119
1144
|
timestamp: z10.string().datetime()
|
|
1120
1145
|
});
|
|
1146
|
+
var sessionArchiveAttemptedEventSchema = z10.object({
|
|
1147
|
+
...eventLedgerEnvelopeSchema,
|
|
1148
|
+
event_type: z10.literal("session_archive_attempted"),
|
|
1149
|
+
outcome: z10.enum(["proposed", "viability_failed", "user_dismissed", "skipped_no_signal"]),
|
|
1150
|
+
covered_through_ts: z10.number().int().nonnegative(),
|
|
1151
|
+
candidates_proposed: z10.number().int().nonnegative().default(0),
|
|
1152
|
+
knowledge_proposed_ids: z10.array(z10.string()).default([])
|
|
1153
|
+
});
|
|
1121
1154
|
var eventLedgerEventSchema = z10.discriminatedUnion("event_type", [
|
|
1122
1155
|
knowledgeContextPlannedEventSchema,
|
|
1123
1156
|
knowledgeSelectionEventSchema,
|
|
@@ -1170,6 +1203,10 @@ var eventLedgerEventSchema = z10.discriminatedUnion("event_type", [
|
|
|
1170
1203
|
// v2.0.0-rc.20 TASK-02: cite_policy_activated — session/policy-bump
|
|
1171
1204
|
// marker recording when a given policy_version became active.
|
|
1172
1205
|
citePolicyActivatedEventSchema,
|
|
1206
|
+
// v2.0.0-rc.24 TASK-01: cite_contract_policy_activated — drift-gated
|
|
1207
|
+
// idempotent marker opening the contract-policy audit window. Distinct
|
|
1208
|
+
// from cite_policy_activated so contract metrics get their own window.
|
|
1209
|
+
citeContractPolicyActivatedEventSchema,
|
|
1173
1210
|
// v2.0.0-rc.22 Scope D T-D1: knowledge_meta_auto_healed — emitted by
|
|
1174
1211
|
// loadActiveMeta when read-path drift triggers an in-place meta rebuild.
|
|
1175
1212
|
knowledgeMetaAutoHealedEventSchema,
|
|
@@ -1185,8 +1222,91 @@ var eventLedgerEventSchema = z10.discriminatedUnion("event_type", [
|
|
|
1185
1222
|
// `fab doctor --enrich-descriptions` once per modified canonical knowledge
|
|
1186
1223
|
// file when one or more of the four rc.23 description-grade frontmatter
|
|
1187
1224
|
// fields is back-filled.
|
|
1188
|
-
knowledgeEnrichedEventSchema
|
|
1225
|
+
knowledgeEnrichedEventSchema,
|
|
1226
|
+
// v2.0.0-rc.25 TASK-01: session_archive_attempted — emitted by the
|
|
1227
|
+
// fabric-archive skill at the end of every invocation. Drives Phase 0.0
|
|
1228
|
+
// cross-session digest, outcome-based rescan filter (skips user_dismissed),
|
|
1229
|
+
// covered_through_ts watermark, and `fab doctor --archive-history`.
|
|
1230
|
+
sessionArchiveAttemptedEventSchema
|
|
1231
|
+
]);
|
|
1232
|
+
|
|
1233
|
+
// src/cite-line-parser.ts
|
|
1234
|
+
var ID_RE = /^K[TP]-[A-Z]+-\d+$/;
|
|
1235
|
+
var SENTINEL_RE = /^KB:\s*none\b\s*(?:\[[^\]]*\])?\s*$/i;
|
|
1236
|
+
var FULL_RE = /^KB:\s+(K[TP]-[A-Z]+-\d+)(?:\s+\(([^)]*)\))?(?:\s+\[([^\]]+)\])?(?:\s+→\s*(.+))?\s*$/;
|
|
1237
|
+
var ALLOWED_TAGS = /* @__PURE__ */ new Set([
|
|
1238
|
+
"planned",
|
|
1239
|
+
"recalled",
|
|
1240
|
+
"chained-from",
|
|
1241
|
+
"dismissed",
|
|
1242
|
+
"none"
|
|
1189
1243
|
]);
|
|
1244
|
+
function parseTag(rawTag) {
|
|
1245
|
+
if (!rawTag) return "none";
|
|
1246
|
+
const head = rawTag.trim().split(/[\s:]+/)[0].toLowerCase();
|
|
1247
|
+
return ALLOWED_TAGS.has(head) ? head : "none";
|
|
1248
|
+
}
|
|
1249
|
+
function parseContractTail(tail) {
|
|
1250
|
+
const result = { operators: [], skip_reason: null };
|
|
1251
|
+
if (!tail) return result;
|
|
1252
|
+
const tokens = tail.trim().split(/\s+/).filter((t) => t.length > 0);
|
|
1253
|
+
for (const token of tokens) {
|
|
1254
|
+
const skipMatch = token.match(/^skip:(.+)$/i);
|
|
1255
|
+
if (skipMatch) {
|
|
1256
|
+
if (result.skip_reason === null) result.skip_reason = skipMatch[1];
|
|
1257
|
+
continue;
|
|
1258
|
+
}
|
|
1259
|
+
const notEditMatch = token.match(/^!edit:(.+)$/i);
|
|
1260
|
+
if (notEditMatch) {
|
|
1261
|
+
result.operators.push({ kind: "not_edit", target: notEditMatch[1] });
|
|
1262
|
+
continue;
|
|
1263
|
+
}
|
|
1264
|
+
const opMatch = token.match(/^(edit|require|forbid):(.+)$/i);
|
|
1265
|
+
if (opMatch) {
|
|
1266
|
+
result.operators.push({
|
|
1267
|
+
kind: opMatch[1].toLowerCase(),
|
|
1268
|
+
target: opMatch[2]
|
|
1269
|
+
});
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
return result;
|
|
1273
|
+
}
|
|
1274
|
+
function parseLine(line) {
|
|
1275
|
+
const trimmed = line.trim();
|
|
1276
|
+
if (trimmed.length === 0) return null;
|
|
1277
|
+
if (SENTINEL_RE.test(trimmed)) {
|
|
1278
|
+
return { id: null, tag: "none", commitment: null };
|
|
1279
|
+
}
|
|
1280
|
+
const fullMatch = trimmed.match(FULL_RE);
|
|
1281
|
+
if (fullMatch) {
|
|
1282
|
+
const id = fullMatch[1];
|
|
1283
|
+
if (!ID_RE.test(id)) return null;
|
|
1284
|
+
return {
|
|
1285
|
+
id,
|
|
1286
|
+
tag: parseTag(fullMatch[3]),
|
|
1287
|
+
commitment: parseContractTail(fullMatch[4])
|
|
1288
|
+
};
|
|
1289
|
+
}
|
|
1290
|
+
return null;
|
|
1291
|
+
}
|
|
1292
|
+
function parseCiteLine(raw) {
|
|
1293
|
+
const result = {
|
|
1294
|
+
cite_ids: [],
|
|
1295
|
+
cite_tags: [],
|
|
1296
|
+
cite_commitments: []
|
|
1297
|
+
};
|
|
1298
|
+
if (typeof raw !== "string") return result;
|
|
1299
|
+
for (const line of raw.split(/\r?\n/)) {
|
|
1300
|
+
const parsed = parseLine(line);
|
|
1301
|
+
if (!parsed) continue;
|
|
1302
|
+
result.cite_tags.push(parsed.tag);
|
|
1303
|
+
if (parsed.id !== null) result.cite_ids.push(parsed.id);
|
|
1304
|
+
if (parsed.commitment !== null) {
|
|
1305
|
+
result.cite_commitments.push(parsed.commitment);
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
return result;
|
|
1309
|
+
}
|
|
1190
1310
|
export {
|
|
1191
1311
|
AGENTS_META_IDENTITY_SOURCES,
|
|
1192
1312
|
AGENTS_META_LAYERS,
|
|
@@ -1230,6 +1350,10 @@ export {
|
|
|
1230
1350
|
auditModeSchema,
|
|
1231
1351
|
bootstrapMarkerMigratedEventSchema,
|
|
1232
1352
|
candidateFileEntrySchema,
|
|
1353
|
+
citeContractMetricsSchema,
|
|
1354
|
+
citeContractPolicyActivatedEventSchema,
|
|
1355
|
+
citeCoverageReportSchema,
|
|
1356
|
+
citeLayerTypeBreakdownSchema,
|
|
1233
1357
|
citePolicyActivatedEventSchema,
|
|
1234
1358
|
claudeHookPathMigratedEventSchema,
|
|
1235
1359
|
claudeSkillPathMigratedEventSchema,
|
|
@@ -1324,6 +1448,7 @@ export {
|
|
|
1324
1448
|
metaUpdatedEventSchema,
|
|
1325
1449
|
normalizeLocale,
|
|
1326
1450
|
onboardSlotSchema,
|
|
1451
|
+
parseCiteLine,
|
|
1327
1452
|
parseKnowledgeId,
|
|
1328
1453
|
pendingAutoArchivedEventSchema,
|
|
1329
1454
|
planContextAnnotations,
|
|
@@ -1336,6 +1461,7 @@ export {
|
|
|
1336
1461
|
ruleDescriptionIndexItemSchema,
|
|
1337
1462
|
ruleDescriptionSchema,
|
|
1338
1463
|
serveLockClearedEventSchema,
|
|
1464
|
+
sessionArchiveAttemptedEventSchema,
|
|
1339
1465
|
structuredWarningSchema,
|
|
1340
1466
|
withDerivedAgentsMetaNodeDefaults,
|
|
1341
1467
|
zhCNMessages
|
|
@@ -1630,6 +1630,208 @@ declare const fabReviewAnnotations: {
|
|
|
1630
1630
|
readonly openWorldHint: false;
|
|
1631
1631
|
readonly title: "Review pending knowledge entries";
|
|
1632
1632
|
};
|
|
1633
|
+
declare const citeContractMetricsSchema: z.ZodObject<{
|
|
1634
|
+
decisions_cited: z.ZodNumber;
|
|
1635
|
+
pitfalls_cited: z.ZodNumber;
|
|
1636
|
+
contract_with: z.ZodNumber;
|
|
1637
|
+
contract_missing: z.ZodNumber;
|
|
1638
|
+
hard_violated: z.ZodNumber;
|
|
1639
|
+
cite_id_unresolved: z.ZodNumber;
|
|
1640
|
+
skip_count: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
1641
|
+
}, "strip", z.ZodTypeAny, {
|
|
1642
|
+
decisions_cited: number;
|
|
1643
|
+
pitfalls_cited: number;
|
|
1644
|
+
contract_with: number;
|
|
1645
|
+
contract_missing: number;
|
|
1646
|
+
hard_violated: number;
|
|
1647
|
+
cite_id_unresolved: number;
|
|
1648
|
+
skip_count: Record<string, number>;
|
|
1649
|
+
}, {
|
|
1650
|
+
decisions_cited: number;
|
|
1651
|
+
pitfalls_cited: number;
|
|
1652
|
+
contract_with: number;
|
|
1653
|
+
contract_missing: number;
|
|
1654
|
+
hard_violated: number;
|
|
1655
|
+
cite_id_unresolved: number;
|
|
1656
|
+
skip_count: Record<string, number>;
|
|
1657
|
+
}>;
|
|
1658
|
+
type CiteContractMetrics = z.infer<typeof citeContractMetricsSchema>;
|
|
1659
|
+
declare const citeLayerTypeBreakdownSchema: z.ZodObject<{
|
|
1660
|
+
team: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
1661
|
+
personal: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
1662
|
+
}, "strip", z.ZodTypeAny, {
|
|
1663
|
+
personal: Record<string, number>;
|
|
1664
|
+
team: Record<string, number>;
|
|
1665
|
+
}, {
|
|
1666
|
+
personal: Record<string, number>;
|
|
1667
|
+
team: Record<string, number>;
|
|
1668
|
+
}>;
|
|
1669
|
+
type CiteLayerTypeBreakdown = z.infer<typeof citeLayerTypeBreakdownSchema>;
|
|
1670
|
+
declare const citeCoverageReportSchema: z.ZodObject<{
|
|
1671
|
+
status: z.ZodEnum<["ok", "skipped"]>;
|
|
1672
|
+
marker_ts: z.ZodNumber;
|
|
1673
|
+
marker_emitted_now: z.ZodBoolean;
|
|
1674
|
+
since_ts: z.ZodNumber;
|
|
1675
|
+
client_filter: z.ZodEnum<["cc", "codex", "cursor", "all"]>;
|
|
1676
|
+
layer_filter: z.ZodOptional<z.ZodEnum<["team", "personal", "all"]>>;
|
|
1677
|
+
metrics: z.ZodObject<{
|
|
1678
|
+
edits_touched: z.ZodNumber;
|
|
1679
|
+
qualifying_cites: z.ZodNumber;
|
|
1680
|
+
recalled_unverified: z.ZodNumber;
|
|
1681
|
+
expected_but_missed: z.ZodNumber;
|
|
1682
|
+
total_turns: z.ZodNumber;
|
|
1683
|
+
}, "strip", z.ZodTypeAny, {
|
|
1684
|
+
edits_touched: number;
|
|
1685
|
+
qualifying_cites: number;
|
|
1686
|
+
recalled_unverified: number;
|
|
1687
|
+
expected_but_missed: number;
|
|
1688
|
+
total_turns: number;
|
|
1689
|
+
}, {
|
|
1690
|
+
edits_touched: number;
|
|
1691
|
+
qualifying_cites: number;
|
|
1692
|
+
recalled_unverified: number;
|
|
1693
|
+
expected_but_missed: number;
|
|
1694
|
+
total_turns: number;
|
|
1695
|
+
}>;
|
|
1696
|
+
per_client: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1697
|
+
edits_touched: z.ZodOptional<z.ZodNumber>;
|
|
1698
|
+
qualifying_cites: z.ZodOptional<z.ZodNumber>;
|
|
1699
|
+
recalled_unverified: z.ZodOptional<z.ZodNumber>;
|
|
1700
|
+
expected_but_missed: z.ZodOptional<z.ZodNumber>;
|
|
1701
|
+
total_turns: z.ZodOptional<z.ZodNumber>;
|
|
1702
|
+
}, "strip", z.ZodTypeAny, {
|
|
1703
|
+
edits_touched?: number | undefined;
|
|
1704
|
+
qualifying_cites?: number | undefined;
|
|
1705
|
+
recalled_unverified?: number | undefined;
|
|
1706
|
+
expected_but_missed?: number | undefined;
|
|
1707
|
+
total_turns?: number | undefined;
|
|
1708
|
+
}, {
|
|
1709
|
+
edits_touched?: number | undefined;
|
|
1710
|
+
qualifying_cites?: number | undefined;
|
|
1711
|
+
recalled_unverified?: number | undefined;
|
|
1712
|
+
expected_but_missed?: number | undefined;
|
|
1713
|
+
total_turns?: number | undefined;
|
|
1714
|
+
}>>>;
|
|
1715
|
+
dismissed_reason_histogram: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
1716
|
+
none_reason_histogram: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
1717
|
+
contract_metrics_status: z.ZodOptional<z.ZodEnum<["ok", "skipped:bootstrap_drift", "awaiting_marker"]>>;
|
|
1718
|
+
contract_metrics: z.ZodOptional<z.ZodObject<{
|
|
1719
|
+
decisions_cited: z.ZodNumber;
|
|
1720
|
+
pitfalls_cited: z.ZodNumber;
|
|
1721
|
+
contract_with: z.ZodNumber;
|
|
1722
|
+
contract_missing: z.ZodNumber;
|
|
1723
|
+
hard_violated: z.ZodNumber;
|
|
1724
|
+
cite_id_unresolved: z.ZodNumber;
|
|
1725
|
+
skip_count: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
1726
|
+
}, "strip", z.ZodTypeAny, {
|
|
1727
|
+
decisions_cited: number;
|
|
1728
|
+
pitfalls_cited: number;
|
|
1729
|
+
contract_with: number;
|
|
1730
|
+
contract_missing: number;
|
|
1731
|
+
hard_violated: number;
|
|
1732
|
+
cite_id_unresolved: number;
|
|
1733
|
+
skip_count: Record<string, number>;
|
|
1734
|
+
}, {
|
|
1735
|
+
decisions_cited: number;
|
|
1736
|
+
pitfalls_cited: number;
|
|
1737
|
+
contract_with: number;
|
|
1738
|
+
contract_missing: number;
|
|
1739
|
+
hard_violated: number;
|
|
1740
|
+
cite_id_unresolved: number;
|
|
1741
|
+
skip_count: Record<string, number>;
|
|
1742
|
+
}>>;
|
|
1743
|
+
per_layer_type: z.ZodOptional<z.ZodObject<{
|
|
1744
|
+
team: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
1745
|
+
personal: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
1746
|
+
}, "strip", z.ZodTypeAny, {
|
|
1747
|
+
personal: Record<string, number>;
|
|
1748
|
+
team: Record<string, number>;
|
|
1749
|
+
}, {
|
|
1750
|
+
personal: Record<string, number>;
|
|
1751
|
+
team: Record<string, number>;
|
|
1752
|
+
}>>;
|
|
1753
|
+
contract_marker_ts: z.ZodOptional<z.ZodNumber>;
|
|
1754
|
+
generated_at: z.ZodString;
|
|
1755
|
+
}, "strip", z.ZodTypeAny, {
|
|
1756
|
+
status: "ok" | "skipped";
|
|
1757
|
+
marker_ts: number;
|
|
1758
|
+
marker_emitted_now: boolean;
|
|
1759
|
+
since_ts: number;
|
|
1760
|
+
client_filter: "all" | "cc" | "codex" | "cursor";
|
|
1761
|
+
metrics: {
|
|
1762
|
+
edits_touched: number;
|
|
1763
|
+
qualifying_cites: number;
|
|
1764
|
+
recalled_unverified: number;
|
|
1765
|
+
expected_but_missed: number;
|
|
1766
|
+
total_turns: number;
|
|
1767
|
+
};
|
|
1768
|
+
generated_at: string;
|
|
1769
|
+
layer_filter?: "personal" | "team" | "all" | undefined;
|
|
1770
|
+
per_client?: Record<string, {
|
|
1771
|
+
edits_touched?: number | undefined;
|
|
1772
|
+
qualifying_cites?: number | undefined;
|
|
1773
|
+
recalled_unverified?: number | undefined;
|
|
1774
|
+
expected_but_missed?: number | undefined;
|
|
1775
|
+
total_turns?: number | undefined;
|
|
1776
|
+
}> | undefined;
|
|
1777
|
+
dismissed_reason_histogram?: Record<string, number> | undefined;
|
|
1778
|
+
none_reason_histogram?: Record<string, number> | undefined;
|
|
1779
|
+
contract_metrics_status?: "ok" | "skipped:bootstrap_drift" | "awaiting_marker" | undefined;
|
|
1780
|
+
contract_metrics?: {
|
|
1781
|
+
decisions_cited: number;
|
|
1782
|
+
pitfalls_cited: number;
|
|
1783
|
+
contract_with: number;
|
|
1784
|
+
contract_missing: number;
|
|
1785
|
+
hard_violated: number;
|
|
1786
|
+
cite_id_unresolved: number;
|
|
1787
|
+
skip_count: Record<string, number>;
|
|
1788
|
+
} | undefined;
|
|
1789
|
+
per_layer_type?: {
|
|
1790
|
+
personal: Record<string, number>;
|
|
1791
|
+
team: Record<string, number>;
|
|
1792
|
+
} | undefined;
|
|
1793
|
+
contract_marker_ts?: number | undefined;
|
|
1794
|
+
}, {
|
|
1795
|
+
status: "ok" | "skipped";
|
|
1796
|
+
marker_ts: number;
|
|
1797
|
+
marker_emitted_now: boolean;
|
|
1798
|
+
since_ts: number;
|
|
1799
|
+
client_filter: "all" | "cc" | "codex" | "cursor";
|
|
1800
|
+
metrics: {
|
|
1801
|
+
edits_touched: number;
|
|
1802
|
+
qualifying_cites: number;
|
|
1803
|
+
recalled_unverified: number;
|
|
1804
|
+
expected_but_missed: number;
|
|
1805
|
+
total_turns: number;
|
|
1806
|
+
};
|
|
1807
|
+
generated_at: string;
|
|
1808
|
+
layer_filter?: "personal" | "team" | "all" | undefined;
|
|
1809
|
+
per_client?: Record<string, {
|
|
1810
|
+
edits_touched?: number | undefined;
|
|
1811
|
+
qualifying_cites?: number | undefined;
|
|
1812
|
+
recalled_unverified?: number | undefined;
|
|
1813
|
+
expected_but_missed?: number | undefined;
|
|
1814
|
+
total_turns?: number | undefined;
|
|
1815
|
+
}> | undefined;
|
|
1816
|
+
dismissed_reason_histogram?: Record<string, number> | undefined;
|
|
1817
|
+
none_reason_histogram?: Record<string, number> | undefined;
|
|
1818
|
+
contract_metrics_status?: "ok" | "skipped:bootstrap_drift" | "awaiting_marker" | undefined;
|
|
1819
|
+
contract_metrics?: {
|
|
1820
|
+
decisions_cited: number;
|
|
1821
|
+
pitfalls_cited: number;
|
|
1822
|
+
contract_with: number;
|
|
1823
|
+
contract_missing: number;
|
|
1824
|
+
hard_violated: number;
|
|
1825
|
+
cite_id_unresolved: number;
|
|
1826
|
+
skip_count: Record<string, number>;
|
|
1827
|
+
} | undefined;
|
|
1828
|
+
per_layer_type?: {
|
|
1829
|
+
personal: Record<string, number>;
|
|
1830
|
+
team: Record<string, number>;
|
|
1831
|
+
} | undefined;
|
|
1832
|
+
contract_marker_ts?: number | undefined;
|
|
1833
|
+
}>;
|
|
1834
|
+
type CiteCoverageReport = z.infer<typeof citeCoverageReportSchema>;
|
|
1633
1835
|
declare const ledgerSourceSchema: z.ZodEnum<["ai", "human"]>;
|
|
1634
1836
|
declare const ledgerQuerySchema: z.ZodObject<{
|
|
1635
1837
|
source: z.ZodOptional<z.ZodEnum<["ai", "human"]>>;
|
|
@@ -1736,4 +1938,4 @@ declare function parseKnowledgeId(id: string): {
|
|
|
1736
1938
|
counter: number;
|
|
1737
1939
|
} | null;
|
|
1738
1940
|
|
|
1739
|
-
export { type FabExtractKnowledgeInput, FabExtractKnowledgeInputSchema, FabExtractKnowledgeInputShape, type FabExtractKnowledgeOutput, FabExtractKnowledgeOutputSchema, type FabReviewInput, FabReviewInputSchema, FabReviewInputShape, type FabReviewOutput, FabReviewOutputSchema, FabReviewOutputShape, KNOWLEDGE_TYPE_CODES, type KnowledgeEntryFrontmatter, KnowledgeEntryFrontmatterSchema, type KnowledgeType, type KnowledgeTypeCode, KnowledgeTypeSchema, type Layer, LayerSchema, type Maturity, MaturitySchema, PROPOSED_REASON_DESCRIPTIONS, type ProposedReason, ProposedReasonSchema, type StableId, StableIdSchema, annotateIntentRequestSchema, fabExtractKnowledgeAnnotations, fabReviewAnnotations, formatKnowledgeId, historyStateQuerySchema, humanLockApproveRequestSchema, humanLockFileParamsSchema, knowledgeSectionsAnnotations, knowledgeSectionsInputSchema, knowledgeSectionsOutputSchema, ledgerQuerySchema, ledgerSourceSchema, parseKnowledgeId, planContextAnnotations, planContextHintNarrowEntrySchema, planContextHintOutputSchema, planContextInputSchema, planContextOutputSchema, structuredWarningSchema };
|
|
1941
|
+
export { type CiteContractMetrics, type CiteCoverageReport, type CiteLayerTypeBreakdown, type FabExtractKnowledgeInput, FabExtractKnowledgeInputSchema, FabExtractKnowledgeInputShape, type FabExtractKnowledgeOutput, FabExtractKnowledgeOutputSchema, type FabReviewInput, FabReviewInputSchema, FabReviewInputShape, type FabReviewOutput, FabReviewOutputSchema, FabReviewOutputShape, KNOWLEDGE_TYPE_CODES, type KnowledgeEntryFrontmatter, KnowledgeEntryFrontmatterSchema, type KnowledgeType, type KnowledgeTypeCode, KnowledgeTypeSchema, type Layer, LayerSchema, type Maturity, MaturitySchema, PROPOSED_REASON_DESCRIPTIONS, type ProposedReason, ProposedReasonSchema, type StableId, StableIdSchema, annotateIntentRequestSchema, citeContractMetricsSchema, citeCoverageReportSchema, citeLayerTypeBreakdownSchema, fabExtractKnowledgeAnnotations, fabReviewAnnotations, formatKnowledgeId, historyStateQuerySchema, humanLockApproveRequestSchema, humanLockFileParamsSchema, knowledgeSectionsAnnotations, knowledgeSectionsInputSchema, knowledgeSectionsOutputSchema, ledgerQuerySchema, ledgerSourceSchema, parseKnowledgeId, planContextAnnotations, planContextHintNarrowEntrySchema, planContextHintOutputSchema, planContextInputSchema, planContextOutputSchema, structuredWarningSchema };
|
|
@@ -15,6 +15,9 @@ import {
|
|
|
15
15
|
ProposedReasonSchema,
|
|
16
16
|
StableIdSchema,
|
|
17
17
|
annotateIntentRequestSchema,
|
|
18
|
+
citeContractMetricsSchema,
|
|
19
|
+
citeCoverageReportSchema,
|
|
20
|
+
citeLayerTypeBreakdownSchema,
|
|
18
21
|
fabExtractKnowledgeAnnotations,
|
|
19
22
|
fabReviewAnnotations,
|
|
20
23
|
formatKnowledgeId,
|
|
@@ -33,7 +36,7 @@ import {
|
|
|
33
36
|
planContextInputSchema,
|
|
34
37
|
planContextOutputSchema,
|
|
35
38
|
structuredWarningSchema
|
|
36
|
-
} from "../chunk-
|
|
39
|
+
} from "../chunk-3RSYWMQU.js";
|
|
37
40
|
export {
|
|
38
41
|
FabExtractKnowledgeInputSchema,
|
|
39
42
|
FabExtractKnowledgeInputShape,
|
|
@@ -51,6 +54,9 @@ export {
|
|
|
51
54
|
ProposedReasonSchema,
|
|
52
55
|
StableIdSchema,
|
|
53
56
|
annotateIntentRequestSchema,
|
|
57
|
+
citeContractMetricsSchema,
|
|
58
|
+
citeCoverageReportSchema,
|
|
59
|
+
citeLayerTypeBreakdownSchema,
|
|
54
60
|
fabExtractKnowledgeAnnotations,
|
|
55
61
|
fabReviewAnnotations,
|
|
56
62
|
formatKnowledgeId,
|
|
@@ -49,8 +49,8 @@ declare const LEGACY_KB_REGEX: RegExp;
|
|
|
49
49
|
* {@link BOOTSTRAP_MARKER_END} by `fab install` across all three supported
|
|
50
50
|
* clients (Claude Code, Cursor, Codex CLI).
|
|
51
51
|
*
|
|
52
|
-
* Length guarantee: ≥
|
|
52
|
+
* Length guarantee: ≥ 800 bytes (rc.24: grew from ≥400 with cite-contract syntax).
|
|
53
53
|
*/
|
|
54
|
-
declare const BOOTSTRAP_CANONICAL = "# Fabric Bootstrap\n\n\u672C\u9879\u76EE\u4F7F\u7528 Fabric \u7BA1\u7406\u8DE8\u5BA2\u6237\u7AEF AI \u77E5\u8BC6\u4E0E\u884C\u4E3A\u89C4\u5219\u3002\u672C\u6587\u4EF6\u7531 `fab install` \u540C\u6B65\u5230\u4E09\u7AEF managed block,**\u4E0D\u8981\u624B\u52A8\u7F16\u8F91\u4E09\u7AEF\u7684 block**,\u53EA\u6539\u8FD9\u91CC + \u91CD\u8DD1 `fab install`\u3002\n\n## \u884C\u4E3A\u89C4\u5219\n- **\u4FEE\u6539\u4EFB\u4F55\u6587\u4EF6\u524D**:\u4E24\u6B65\u8C03\u7528\u2014\u2014\u5148 `fab_plan_context(paths=[<\u88AB\u6539\u6587\u4EF6>])` \u62FF\u5230 `selection_token` \u4E0E\u5019\u9009 `entries`(\u6311 `selectable===true` \u7684 `stable_id`),\u518D `fab_get_knowledge_sections({ selection_token, ai_selected_stable_ids: [<id>...] })` \u53D6\u89C4\u5219\u6B63\u6587\u3002\n- **`.fabric/agents.meta.json` \u4E25\u7981\u624B\u52A8\u7F16\u8F91**;engine \u4F1A\u81EA\u52A8\u540C\u6B65\u6D3E\u751F\u72B6\u6001,\u663E\u5F0F reconcile \u8DD1 `fab doctor --fix`\u3002\n\n## \u77E5\u8BC6\u5E93(KB)\n- **Discovery**:SessionStart hook \u5217 broad-scoped \u6761\u76EE;edit \u6587\u4EF6\u65F6 PreToolUse hook \u53EF\u80FD\u89E6\u53D1 narrow hint\u3002\n- **Usage**:\u4E24\u6B65\u5F0F\u2014\u2014`fab_plan_context(paths=[...])` \u8FD4\u56DE `selection_token` + \u5019\u9009 entries,\u518D `fab_get_knowledge_sections({ selection_token, ai_selected_stable_ids: [<id>...] })` \u62C9\u5168\u6587;`selection_token` \u5FC5\u987B\u6765\u81EA\u6700\u8FD1\u4E00\u6B21 `fab_plan_context`,\u4E0D\u53EF\u51ED\u7A7A\u7F16\u9020\u3002\n- **Write flows**:`fabric-archive` / `fabric-review` / `fabric-import` \u4E09\u4E2A Skills\u3002\n- **Language**:\u6E32\u67D3\u6309 `.fabric/fabric-config.json` \u7684 `fabric_language` \u5B57\u6BB5\u3002\n\n## Cite policy\n\n- **\u89E6\u53D1**: \u505A edit / decide / propose plan \u4E4B\u524D,**\u56DE\u590D\u9996\u884C**\u5FC5\u987B\u5199 `KB: <id> (<\u22648\u5B57 \u7528\u6CD5>) [planned|recalled|chained-from <id>|dismissed:<reason>]` \u6216 `KB: none [<reason>]`\u3002\n- **`[recalled]` \u9A8C\u8BC1**: \u5FC5\u987B\u7D27\u8DDF\u4E24\u6B65\u8C03\u7528\u2014\u2014\u5148 `fab_plan_context(paths=[...])` \u62FF `selection_token`,\u518D `fab_get_knowledge_sections({ selection_token, ai_selected_stable_ids: [<id>] })`,\u9632\u6B62\u7F16\u9020 id\u3002\n- **\u7528\u6237\u53E3\u5934\u63D0\u89C4\u5219\u6CA1\u7ED9 id**: \u5148\u8C03 `fab_extract_knowledge` \u6216 `search_context` \u53CD\u67E5\u3002\n- **dismissed reason**: \u679A\u4E3E `scope-mismatch | outdated | not-applicable | other:<text>`\u3002\n- **`KB: none` sentinel**: \u679A\u4E3E\u4E24\u79CD\u5408\u89C4\u7406\u7531\u2014\u2014`[no-relevant]` \u5DF2\u8C03 `fab_plan_context`(\u6216 hook \u8F93\u51FA\u53EF\u89C1)\u4F46\u65E0\u53EF\u7528\u6761\u76EE;`[not-applicable]` \u5F53\u524D\u52A8\u4F5C\u4E0D\u5728 cite \u8303\u56F4(\u7EAF\u63A2\u7D22 / Bash \u53EA\u8BFB / \u7528\u6237\u95EE\u7B54)\u3002\u88F8 `KB: none`(\u65E0\u540E\u7F00)\u4ECD\u7136 valid,\u5F52\u7C7B\u4E3A `[unspecified]`(legacy \u517C\u5BB9,\u9F13\u52B1\u540E\u7EED\u8865\u6CE8)\u3002\n- **\u7A3D\u6838**: `fab doctor --cite-coverage [--since=7d] [--client=cc|codex|all]` \u8F93\u51FA cite \u8986\u76D6\u7387,\u542B `KB: none` sentinel \u62C6\u5206\u3002\u672C\u89C4\u5219\u4E0D\u963B\u65AD\u4F60\u5DE5\u4F5C,\u53EA\u8BB0\u5F55\u3002\n";
|
|
54
|
+
declare const BOOTSTRAP_CANONICAL = "# Fabric Bootstrap\n\n\u672C\u9879\u76EE\u4F7F\u7528 Fabric \u7BA1\u7406\u8DE8\u5BA2\u6237\u7AEF AI \u77E5\u8BC6\u4E0E\u884C\u4E3A\u89C4\u5219\u3002\u672C\u6587\u4EF6\u7531 `fab install` \u540C\u6B65\u5230\u4E09\u7AEF managed block,**\u4E0D\u8981\u624B\u52A8\u7F16\u8F91\u4E09\u7AEF\u7684 block**,\u53EA\u6539\u8FD9\u91CC + \u91CD\u8DD1 `fab install`\u3002\n\n## \u884C\u4E3A\u89C4\u5219\n- **\u4FEE\u6539\u4EFB\u4F55\u6587\u4EF6\u524D**:\u4E24\u6B65\u8C03\u7528\u2014\u2014\u5148 `fab_plan_context(paths=[<\u88AB\u6539\u6587\u4EF6>])` \u62FF\u5230 `selection_token` \u4E0E\u5019\u9009 `entries`(\u6311 `selectable===true` \u7684 `stable_id`),\u518D `fab_get_knowledge_sections({ selection_token, ai_selected_stable_ids: [<id>...] })` \u53D6\u89C4\u5219\u6B63\u6587\u3002\n- **`.fabric/agents.meta.json` \u4E25\u7981\u624B\u52A8\u7F16\u8F91**;engine \u4F1A\u81EA\u52A8\u540C\u6B65\u6D3E\u751F\u72B6\u6001,\u663E\u5F0F reconcile \u8DD1 `fab doctor --fix`\u3002\n\n## \u77E5\u8BC6\u5E93(KB)\n- **Discovery**:SessionStart hook \u5217 broad-scoped \u6761\u76EE(\u542B personal layer `KP-*` \u6761\u76EE,\u5F15\u7528\u65B9\u5F0F\u76F8\u540C);edit \u6587\u4EF6\u65F6 PreToolUse hook \u53EF\u80FD\u89E6\u53D1 narrow hint\u3002\n- **Usage**:\u4E24\u6B65\u5F0F\u2014\u2014`fab_plan_context(paths=[...])` \u8FD4\u56DE `selection_token` + \u5019\u9009 entries,\u518D `fab_get_knowledge_sections({ selection_token, ai_selected_stable_ids: [<id>...] })` \u62C9\u5168\u6587;`selection_token` \u5FC5\u987B\u6765\u81EA\u6700\u8FD1\u4E00\u6B21 `fab_plan_context`,\u4E0D\u53EF\u51ED\u7A7A\u7F16\u9020\u3002\n- **session_id**: \u8C03\u7528 `fab_plan_context` \u65F6, \u52A1\u5FC5\u628A\u5F53\u524D client session id \u4F5C\u4E3A `session_id` \u53C2\u6570\u4F20\u5165(Claude Code \u7684 session id \u5728 stdin payload \u4E2D, Codex \u7684\u5BF9\u5E94 identifier \u540C\u7406)\u3002\u8FD9\u80FD\u8BA9 `fab doctor --archive-history` \u4E0E archive-hint hook \u51C6\u786E\u8BC6\u522B\u8DE8\u4F1A\u8BDD debt \u72B6\u6001\u3002\n- **Write flows**:`fabric-archive` / `fabric-review` / `fabric-import` \u4E09\u4E2A Skills\u3002\n- **Language**:\u6E32\u67D3\u6309 `.fabric/fabric-config.json` \u7684 `fabric_language` \u5B57\u6BB5\u3002\n\n## Self-archive policy\n\n- **\u89E6\u53D1**: \u672C\u4F1A\u8BDD\u51FA\u73B0\u4EE5\u4E0B\u4EFB\u4E00\u4FE1\u53F7, \u5728\u8BE5 turn \u56DE\u590D\u672B\u5C3E\u81EA\u4E3B\u8C03\u7528 `fabric-archive` skill (E3-strong mode):\n 1. **Normative \u8BED\u8A00** \u2014 \u7528\u6237\u6D88\u606F\u51FA\u73B0 `\u4EE5\u540E` / `always` / `never` / `from now on` / `\u4E0B\u6B21\u6CE8\u610F` / `\u8BB0\u4E00\u4E0B` / `\u6C38\u8FDC\u4E0D\u8981`\n 2. **Wrong-turn-and-revert** \u2014 AI \u5C1D\u8BD5 path X, \u53CD\u601D\u540E\u6539\u8D70 path Y (\u5C24\u5176\u5F53 path X \u662F\u975E\u663E\u7136\u8E29\u5751)\n 3. **Decision confirmation** \u2014 \u7528\u6237\u5728 \u22652 \u5019\u9009\u4E2D\u6743\u8861\u540E\u7ED9\u51FA rationale \u9501\u5B9A\u65B9\u5411\n 4. **Explicit dismissal with reason** \u2014 \u7528\u6237\u62D2\u4E86\u67D0\u5EFA\u8BAE**\u5E76**\u8BF4\u4E86\u539F\u56E0\n\n- **Anti-trigger** (\u660E\u786E\u4E0D\u89E6\u53D1):\n - \u7528\u6237\u7EAF\u8BE2\u95EE (\u65E0 normative \u8868\u8FBE)\n - \u7B80\u5355 refactor / typo fix\n - AI \u81EA\u5DF1\u4EA7\u751F\u7684'\u6D1E\u5BDF' (\u5FC5\u987B\u7531\u7528\u6237\u6D88\u606F\u4E2D\u4FE1\u53F7\u89E6\u53D1)\n\n- **Anti-loop \u4E09\u6761\u9632\u62A4**:\n - \u540C turn \u6700\u591A\u81EA\u8C03 1 \u6B21\n - \u540C session \u540C outcome \u4E0D\u91CD\u590D (\u82E5 user_dismissed, \u672C\u4F1A\u8BDD\u4E0D\u518D\u81EA\u8C03\u76F8\u540C\u4E3B\u9898)\n - Phase 0.5 viability gate \u515C\u5E95 (skill \u5185\u90E8\u4ECD\u8DD1 gate, AI \u5224\u9519\u4E0D\u4F1A\u4E71\u5199 pending)\n\n- **\u5448\u73B0\u6A21\u677F** (turn \u672B\u5C3E\u63D2\u5165, \u4E24\u884C: \u5148 marker \u884C\u4F9B Phase 0.4 \u68C0\u6D4B, \u518D user-facing \u63D0\u793A):\n ```\n self-archive policy triggered by signal: <Normative|Wrong-turn-and-revert|Decision confirmation|Explicit dismissal>\n \u987A\u624B\u5F52\u6863: \u6CE8\u610F\u5230\u4F60\u8BF4 `<\u89E6\u53D1\u77ED\u8BED>`, \u5DF2\u8C03\u7528 fabric-archive \u6293 N \u6761\u5019\u9009 \u2192 .fabric/knowledge/pending/...\n \u82E5\u4E0D\u8BE5\u8BB0, \u7B54 '\u64A4\u9500' \u6211\u4F1A\u8C03 fab_review reject\u3002\n ```\n \u7B2C\u4E00\u884C\u662F Phase 0.4 Trigger Gate \u7528\u6765\u8BC6\u522B E3 \u5165\u53E3\u7684 structured marker (verbatim \u5B57\u7B26\u4E32 `self-archive policy triggered by signal`, \u540E\u63A5\u5192\u53F7 + \u89E6\u53D1\u4FE1\u53F7\u540D)\u3002\u7B2C\u4E8C\u884C\u8D77\u662F\u7ED9\u7528\u6237\u770B\u7684\u4E2D\u6587\u63D0\u793A\u3002\u4E24\u884C\u90FD\u5FC5\u987B\u51FA\u73B0; \u7F3A marker \u884C Phase 0.4 \u65E0\u6CD5\u8DEF\u7531\u5230 E3_ai_self_trigger\u3002\n\n## Cite policy\n\n- **\u89E6\u53D1**: \u505A edit / decide / propose plan \u4E4B\u524D,**\u56DE\u590D\u9996\u884C**\u5FC5\u987B\u5199 `KB: <id> (<\u22648\u5B57 \u7528\u6CD5>) [planned|recalled|chained-from <id>|dismissed:<reason>]` \u6216 `KB: none [<reason>]`\u3002\n- **`[recalled]` \u9A8C\u8BC1**: \u5FC5\u987B\u7D27\u8DDF\u4E24\u6B65\u8C03\u7528\u2014\u2014\u5148 `fab_plan_context(paths=[...])` \u62FF `selection_token`,\u518D `fab_get_knowledge_sections({ selection_token, ai_selected_stable_ids: [<id>] })`,\u9632\u6B62\u7F16\u9020 id\u3002\n- **contract \u8BED\u6CD5**: decisions/pitfalls \u7C7B\u5F15\u7528\u5FC5\u987B\u5728\u5C3E\u6BB5\u52A0 contract: `\u2192 <operator> [<operator> ...]`,operator \u2208 {`edit:<glob>` `!edit:<glob>` `require:<symbol>` `forbid:<symbol>` `skip:<reason>`}\u3002\u4F8B:`KB: K-001 (auth) [planned] \u2192 edit:src/auth/**/*.ts !edit:src/legacy/**`\u3002\n- **skip reason \u8BCD\u5178**: `sequencing | conditional | semantic | aesthetic | architectural | other:<text>`\u3002\n- **type \u8DEF\u7531**: models \u7C7B\u5F15\u7528\u4E3A reference cite,\u4E0D\u9700\u8981 contract;guidelines/processes \u7C7B\u6682\u4E0D\u5F3A\u5236,\u63A8\u540E LLM-judge\u3002\n- **\u7528\u6237\u53E3\u5934\u63D0\u89C4\u5219\u6CA1\u7ED9 id**: \u5148\u8C03 `fab_extract_knowledge` \u6216 `search_context` \u53CD\u67E5\u3002\n- **dismissed reason**: \u679A\u4E3E `scope-mismatch | outdated | not-applicable | other:<text>`\u3002\n- **`KB: none` sentinel**: \u679A\u4E3E\u4E24\u79CD\u5408\u89C4\u7406\u7531\u2014\u2014`[no-relevant]` \u5DF2\u8C03 `fab_plan_context`(\u6216 hook \u8F93\u51FA\u53EF\u89C1)\u4F46\u65E0\u53EF\u7528\u6761\u76EE;`[not-applicable]` \u5F53\u524D\u52A8\u4F5C\u4E0D\u5728 cite \u8303\u56F4(\u7EAF\u63A2\u7D22 / Bash \u53EA\u8BFB / \u7528\u6237\u95EE\u7B54)\u3002\u88F8 `KB: none`(\u65E0\u540E\u7F00)\u4ECD\u7136 valid,\u5F52\u7C7B\u4E3A `[unspecified]`(legacy \u517C\u5BB9,\u9F13\u52B1\u540E\u7EED\u8865\u6CE8)\u3002\n- **\u7A3D\u6838**: `fab doctor --cite-coverage [--since=7d] [--client=cc|codex|all]` \u8F93\u51FA cite \u8986\u76D6\u7387,\u542B `KB: none` sentinel \u62C6\u5206\u3002\u672C\u89C4\u5219\u4E0D\u963B\u65AD\u4F60\u5DE5\u4F5C,\u53EA\u8BB0\u5F55\u3002\n";
|
|
55
55
|
|
|
56
56
|
export { BOOTSTRAP_CANONICAL, BOOTSTRAP_MARKER_BEGIN, BOOTSTRAP_MARKER_END, BOOTSTRAP_REGEX, LEGACY_KB_MARKER_BEGIN, LEGACY_KB_MARKER_END, LEGACY_KB_REGEX };
|