@fenglimg/fabric-server 2.0.0-rc.22 → 2.0.0-rc.23

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.
@@ -14,7 +14,7 @@ import {
14
14
  readEventLedger,
15
15
  runDoctorReport,
16
16
  sha256
17
- } from "./chunk-7N3FW5LX.js";
17
+ } from "./chunk-IRB77C6E.js";
18
18
 
19
19
  // src/http.ts
20
20
  import { randomUUID as randomUUID2 } from "crypto";
package/dist/index.d.ts CHANGED
@@ -112,12 +112,33 @@ type CiteCoverageReport = {
112
112
  };
113
113
  per_client?: Record<string, Partial<CiteCoverageReport["metrics"]>>;
114
114
  dismissed_reason_histogram?: Record<string, number>;
115
+ none_reason_histogram?: Record<string, number>;
115
116
  generated_at: string;
116
117
  };
117
118
  declare function runDoctorCiteCoverage(projectRoot: string, options: {
118
119
  since: number;
119
120
  client: "cc" | "codex" | "cursor" | "all";
120
121
  }): Promise<CiteCoverageReport>;
122
+ type EnrichDescriptionsMode = "auto" | "interactive";
123
+ type EnrichDescriptionsCandidate = {
124
+ path: string;
125
+ missing: Array<"intent_clues" | "tech_stack" | "impact" | "must_read_if">;
126
+ modified: boolean;
127
+ added_fields: Array<"intent_clues" | "tech_stack" | "impact" | "must_read_if">;
128
+ error?: string;
129
+ };
130
+ type EnrichDescriptionsReport = {
131
+ mode: EnrichDescriptionsMode;
132
+ dryRun: boolean;
133
+ scanned: number;
134
+ modified: number;
135
+ skipped: number;
136
+ candidates: EnrichDescriptionsCandidate[];
137
+ };
138
+ declare function enrichDescriptions(projectRoot: string, opts?: {
139
+ auto?: boolean;
140
+ dryRun?: boolean;
141
+ }): Promise<EnrichDescriptionsReport>;
121
142
 
122
143
  type KnowledgeMetaBuildSource = "doctor_fix" | "sync_meta";
123
144
  type KnowledgeMetaBuildResult = {
@@ -176,8 +197,11 @@ declare class KnowledgeIdAllocator {
176
197
  /**
177
198
  * Append-evidence-on-collision service for fab_extract_knowledge.
178
199
  *
179
- * Idempotency_key = sha256({source_session, type, slug}). When the same
180
- * triple hits an existing pending file (verified by frontmatter
200
+ * Idempotency_key = sha256({source_session: source_sessions[0], type, slug}).
201
+ * The `source_session` key inside the hash payload is FROZEN for backward
202
+ * compatibility with on-disk pending entries written before rc.23 — changing
203
+ * it would invalidate every existing `x-fabric-idempotency-key`. When the
204
+ * same triple hits an existing pending file (verified by frontmatter
181
205
  * `x-fabric-idempotency-key`), the body is preserved and a fresh
182
206
  * `## Evidence (call N)` section is appended — LLM-regenerated summaries
183
207
  * stay observable without overwriting prior context.
@@ -333,8 +357,14 @@ interface KnowledgeSyncReport {
333
357
  */
334
358
  declare function ensureKnowledgeFresh(projectRoot: string, opts?: KnowledgeSyncOptions): Promise<KnowledgeSyncReport>;
335
359
  interface ReconcileKnowledgeOptions {
336
- /** Identifies who triggered the reconcile; controls which summary ledger event is written. */
337
- trigger?: "startup" | "doctor" | "manual";
360
+ /**
361
+ * Identifies who triggered the reconcile; controls which summary ledger event is written.
362
+ *
363
+ * v2.0.0-rc.23 TASK-005 (a-B): `auto-heal-description` added so plan_context
364
+ * can drive a full reconcile when it detects nodes with `description === undefined`
365
+ * (legacy meta drift the revision-hash gate cannot detect).
366
+ */
367
+ trigger?: "startup" | "doctor" | "manual" | "auto-heal-description";
338
368
  }
339
369
  /**
340
370
  * Full scan + rewrites agents.meta.json with ground-truth disk state + emits
@@ -405,4 +435,4 @@ declare function startHttpServer(options: {
405
435
  authToken?: string;
406
436
  }): Promise<Server>;
407
437
 
408
- export { AGENTS_MD_RESOURCE_URI, type AcquireOptions, type CiteCoverageReport, type DoctorApplyLintMutation, type DoctorApplyLintMutationKind, type DoctorApplyLintReport, type DoctorFixReport, type DoctorIssue, type DoctorReport, EVENT_LEDGER_PATH, type InFlightTracker, KnowledgeIdAllocator, type KnowledgeMetaBuildResult, type KnowledgeMetaBuildSource, type KnowledgeSyncLedgerEvent, type KnowledgeSyncOptions, type KnowledgeSyncReport, LEDGER_PATH, LEGACY_LEDGER_PATH, type LedgerEvent, type LockState, type PlanContextInput, type PlanContextResult, type ReconcileKnowledgeOptions, type RequirementProfile, type SelectionTokenState, ServeLockHeldError, type ShutdownHandlerDeps, type StructuredWarning, type WriteKnowledgeMetaOptions, acquireLock, appendEventLedgerEvent, buildKnowledgeMeta, checkLockOrThrow, computeKnowledgeBasedAgentsMeta, computeKnowledgeTestIndex, createFabricServer, createInFlightTracker, createShutdownHandler, deriveKnowledgeMetaLayer, deriveKnowledgeMetaTopologyType, ensureKnowledgeFresh, extractKnowledge, flushAndSyncEventLedger, formatPreexistingRootMessage, getEventLedgerPath, getLedgerPath, getLegacyLedgerPath, isSameKnowledgeTestIndex, planContext, readLockState, readSelectionToken, reconcileKnowledge, releaseLock, reviewKnowledge, runDoctorApplyLint, runDoctorCiteCoverage, runDoctorFix, runDoctorReport, stableStringify, startHttpServer, startStdioServer, writeKnowledgeMeta };
438
+ export { AGENTS_MD_RESOURCE_URI, type AcquireOptions, type CiteCoverageReport, type DoctorApplyLintMutation, type DoctorApplyLintMutationKind, type DoctorApplyLintReport, type DoctorFixReport, type DoctorIssue, type DoctorReport, EVENT_LEDGER_PATH, type EnrichDescriptionsCandidate, type EnrichDescriptionsMode, type EnrichDescriptionsReport, type InFlightTracker, KnowledgeIdAllocator, type KnowledgeMetaBuildResult, type KnowledgeMetaBuildSource, type KnowledgeSyncLedgerEvent, type KnowledgeSyncOptions, type KnowledgeSyncReport, LEDGER_PATH, LEGACY_LEDGER_PATH, type LedgerEvent, type LockState, type PlanContextInput, type PlanContextResult, type ReconcileKnowledgeOptions, type RequirementProfile, type SelectionTokenState, ServeLockHeldError, type ShutdownHandlerDeps, type StructuredWarning, type WriteKnowledgeMetaOptions, acquireLock, appendEventLedgerEvent, buildKnowledgeMeta, checkLockOrThrow, computeKnowledgeBasedAgentsMeta, computeKnowledgeTestIndex, createFabricServer, createInFlightTracker, createShutdownHandler, deriveKnowledgeMetaLayer, deriveKnowledgeMetaTopologyType, enrichDescriptions, ensureKnowledgeFresh, extractKnowledge, flushAndSyncEventLedger, formatPreexistingRootMessage, getEventLedgerPath, getLedgerPath, getLegacyLedgerPath, isSameKnowledgeTestIndex, planContext, readLockState, readSelectionToken, reconcileKnowledge, releaseLock, reviewKnowledge, runDoctorApplyLint, runDoctorCiteCoverage, runDoctorFix, runDoctorReport, stableStringify, startHttpServer, startStdioServer, writeKnowledgeMeta };