@equationalapplications/core-llm-wiki 9.10.0 → 9.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { BaseRepository, WikiGraphNodeOwnershipConflict, serializeSourcePointer, parseStoredSourcePointer, parseJsonObject, parseJsonArray, liveAtSql, reanchorRebuildFingerprint, __privateAdd, warnChangedDefaultsOnce, resolveContextBudgetOrThrow, EdgeRepository, MetadataRepository, EmbeddingService, VectorRemovalRepository, VectorRemovalService, SearchService, TemporalService, JobManager, PromptService, resolveGrounding, IngestionService, MaintenanceService, ImportExportService, RetrievalService, SourceStoreService, WriteService, __privateGet, __privateSet, createLegacySourceTypeIndex, writeNormalizeStamp, CURRENT_SCHEMA_VERSION, detectSchemaVersion, MIGRATIONS, runSourceRefNormalize, emitDiagnostic, normalizeSourceRef, normalizeSourceHash, resolveLibrarianStrategy, entitySummaryMetaKey, WikiSourceRefHashCollision, DiagnosticBuffer, validateManifest, isReservedAbstainSlug, ONTOLOGY_ABSTAIN_SENTINEL, WikiDraftNotFound, generateId, emptyManifest, resolveNodeTypeMatch, WikiStrictOntologyViolation, validateInlineEdges, resolveEdgeDefinitions, typeSatisfies, normalizeTitleKey, edgeTripleAllowed, resolveNodeType, shouldEmitOntologyReceipt, nodeTypeReceipts, MAX_EMBED_ATTEMPTS, UsageMeter, isWikiSearchUnavailableError, WikiBusyError, WikiInvalidReadOptions, isLiveAt, packFactsByBudget, factTokenCost, probePendingWork, WikiMigrationRequiredError, setupDatabase, UnavailableIndexStrategy, createdAtValue, isUsableDate, validateSourcePointerValue, assertEntityId, assertEpochMs, passageFtsTriggerNames, FTS5_STATE_KEY, fts5LedgerDropSql, passageFtsTablesDdl, passageFtsTriggersDdl, fts5TablesDdl, fts5PendingIndexesDdl, fts5TriggersDdl, writeRebuildStart, FTS5_RETIRED_COUNTER_KEY, retiredTableName, FTS5_RETIRED_TABLES_KEY, isRetiredTableName, idReindexChunkSql, readRebuildProgress, FTS5_DRAIN_CHUNK, FTS5_RECLAIM_MERGE_PAGES, windowHiSql, windowChunkSql, FTS5_REBUILD_WM_KEY, sweepHiSql, sweepChunkSql, FTS5_SWEEP_CURSOR_KEY, drainHiSql, drainChunkSql, FTS5_REBUILD_SNAPSHOT_KEY, idDrainChunkSql, entityDrainHiSql, entityDrainChunkSql, fts5TriggerNames, extractSqliteCode, WikiTransactionError } from './chunk-RPE6OMUZ.mjs';
2
- export { CLASSIFIER_MAX_CHOICES, CheckpointIncompleteError, DEFAULT_CHUNK_OVERLAP, DEFAULT_MAX_CHUNK_LENGTH, DEFAULT_MAX_EMBED_CHARS, DEFAULT_TYPING_MIN_CONFIDENCE, EMBED_CHARS_CEILING, EraseStepError, HEAL_ANCHORS_PER_CANDIDATE, HEAL_BATCH_SIZE, HEAL_MAX_FACT_BODY_CHARS_L3, HEAL_MAX_TASKS, HEAL_RECHECK_MS, HOOK_TIMEOUT_MARKER, ONTOLOGY_ABSTAIN_SENTINEL, ONTOLOGY_BACKFILL_BATCH_SIZE, ONTOLOGY_BACKFILL_MAX_PROMPT_CHARS, ONTOLOGY_BACKFILL_RECHECK_MS, ONTOLOGY_BACKFILL_SYSTEM_PROMPT, PromptService, PrunePartialFailureError, WikiBusyError, WikiDraftNotFound, WikiDuplicateHashError, WikiExternalDeletionError, WikiGraphNodeOwnershipConflict, WikiIngestEmptyError, WikiInvalidReadOptions, WikiMigrationRequiredError, WikiParseError, WikiSearchUnavailableError, WikiSourceRefHashCollision, WikiStrictOntologyViolation, WikiSupersedeError, WikiTransactionError, chunkText, configureRandomSource, isReservedAbstainSlug, isWikiSearchUnavailableError, parseEmbedding, resolveContextBudget, resolveDefaultChunkLength, resolveMaxPromptChars, resolveSystemOneTyping, resolveTypingMinConfidence, safeSlice, validUsage, validateManifest, warnOnce } from './chunk-RPE6OMUZ.mjs';
1
+ import { BaseRepository, WikiGraphNodeOwnershipConflict, serializeSourcePointer, parseStoredSourcePointer, parseJsonObject, parseJsonArray, liveAtSql, reanchorRebuildFingerprint, __privateAdd, warnChangedDefaultsOnce, resolveContextBudgetOrThrow, EdgeRepository, MetadataRepository, EmbeddingService, VectorRemovalRepository, VectorRemovalService, SearchService, TemporalService, JobManager, PromptService, resolveGrounding, IngestionService, MaintenanceService, ImportExportService, RetrievalService, SourceStoreService, WriteService, __privateGet, __privateSet, createLegacySourceTypeIndex, writeNormalizeStamp, CURRENT_SCHEMA_VERSION, detectSchemaVersion, MIGRATIONS, runSourceRefNormalize, emitDiagnostic, normalizeSourceRef, normalizeSourceHash, resolveLibrarianStrategy, entitySummaryMetaKey, WikiSourceRefHashCollision, DiagnosticBuffer, validateManifest, isReservedAbstainSlug, ONTOLOGY_ABSTAIN_SENTINEL, WikiDraftNotFound, generateId, emptyManifest, resolveNodeTypeMatch, WikiStrictOntologyViolation, validateInlineEdges, resolveEdgeDefinitions, typeSatisfies, normalizeTitleKey, edgeTripleAllowed, resolveNodeType, shouldEmitOntologyReceipt, nodeTypeReceipts, MAX_EMBED_ATTEMPTS, UsageMeter, isWikiSearchUnavailableError, WikiBusyError, WikiInvalidReadOptions, isLiveAt, packFactsByBudget, factTokenCost, probePendingWork, WikiMigrationRequiredError, setupDatabase, UnavailableIndexStrategy, createdAtValue, isUsableDate, validateSourcePointerValue, assertEntityId, assertEpochMs, passageFtsTriggerNames, FTS5_STATE_KEY, fts5LedgerDropSql, passageFtsTablesDdl, passageFtsTriggersDdl, fts5TablesDdl, fts5PendingIndexesDdl, fts5TriggersDdl, writeRebuildStart, FTS5_RETIRED_COUNTER_KEY, retiredTableName, FTS5_RETIRED_TABLES_KEY, isRetiredTableName, idReindexChunkSql, readRebuildProgress, FTS5_DRAIN_CHUNK, FTS5_RECLAIM_MERGE_PAGES, windowHiSql, windowChunkSql, FTS5_REBUILD_WM_KEY, sweepHiSql, sweepChunkSql, FTS5_SWEEP_CURSOR_KEY, drainHiSql, drainChunkSql, FTS5_REBUILD_SNAPSHOT_KEY, idDrainChunkSql, entityDrainHiSql, entityDrainChunkSql, fts5TriggerNames, extractSqliteCode, WikiTransactionError } from './chunk-QUVPQVJ6.mjs';
2
+ export { CLASSIFIER_MAX_CHOICES, CheckpointIncompleteError, DEFAULT_CHUNK_OVERLAP, DEFAULT_MAX_CHUNK_LENGTH, DEFAULT_MAX_EMBED_CHARS, DEFAULT_TYPING_MIN_CONFIDENCE, EMBED_CHARS_CEILING, EraseStepError, HEAL_ANCHORS_PER_CANDIDATE, HEAL_BATCH_SIZE, HEAL_MAX_FACT_BODY_CHARS_L3, HEAL_MAX_TASKS, HEAL_RECHECK_MS, HOOK_TIMEOUT_MARKER, ONTOLOGY_ABSTAIN_SENTINEL, ONTOLOGY_BACKFILL_BATCH_SIZE, ONTOLOGY_BACKFILL_MAX_PROMPT_CHARS, ONTOLOGY_BACKFILL_RECHECK_MS, ONTOLOGY_BACKFILL_SYSTEM_PROMPT, PromptService, PrunePartialFailureError, WikiBusyError, WikiDraftNotFound, WikiDuplicateHashError, WikiExternalDeletionError, WikiGraphNodeOwnershipConflict, WikiIngestEmptyError, WikiInvalidReadOptions, WikiMigrationRequiredError, WikiParseError, WikiSearchUnavailableError, WikiSourceRefHashCollision, WikiStrictOntologyViolation, WikiSupersedeError, WikiTransactionError, chunkText, configureRandomSource, isReservedAbstainSlug, isWikiSearchUnavailableError, parseEmbedding, resolveContextBudget, resolveDefaultChunkLength, resolveMaxPromptChars, resolveSystemOneTyping, resolveTypingMinConfidence, safeSlice, validUsage, validateManifest, warnOnce } from './chunk-QUVPQVJ6.mjs';
3
3
  import { deriveTrustTier, isStaleAfter, appendRelatedSection, buildConceptDocument, buildLogMd, buildEntityIndexMd, buildRootIndexMd, isAllowedOkfPath, parseRootIndexMd, parseEntityIndexMd, parseConcept, splitRelatedSection, extractMarkdownLinks, parseLogMd, parseEventIdComment, createEventIdDeriver, latestVerified, formatSourcesJson, appendEventIdComment, parseVerifiedFlexible, parseCitationsList } from '@equationalapplications/core-okf';
4
4
  import MiniSearch from 'minisearch';
5
5
 
@@ -3989,7 +3989,7 @@ interface LibrarianResult {
3989
3989
  }
3990
3990
 
3991
3991
  declare const ONTOLOGY_BACKFILL_BATCH_SIZE = 25;
3992
- declare const ONTOLOGY_BACKFILL_MAX_PROMPT_CHARS = 40000;
3992
+
3993
3993
  declare const ONTOLOGY_BACKFILL_RECHECK_MS: number;
3994
3994
  /**
3995
3995
  * Upper bound on one classifier choice question (specs/system-one-config §5):
@@ -5252,5 +5252,5 @@ declare class WikiMemory {
5252
5252
  setGeneratedByTask(taskId: string, entityId: string, actor: string): Promise<void>;
5253
5253
  }
5254
5254
 
5255
- export { ONTOLOGY_BACKFILL_RECHECK_MS as $, HEAL_RECHECK_MS as A, HOOK_TIMEOUT_MARKER as B, CLASSIFIER_MAX_CHOICES as C, HEAL_BATCH_SIZE as H, ONTOLOGY_ABSTAIN_SENTINEL as Y, ONTOLOGY_BACKFILL_BATCH_SIZE as Z, ONTOLOGY_BACKFILL_MAX_PROMPT_CHARS as _, EmbeddingService as a$, WikiDraftNotFound as aB, WikiDuplicateHashError as aC, WikiExternalDeletionError as aF, WikiGraphNodeOwnershipConflict as aH, WikiIngestEmptyError as aI, WikiInvalidReadOptions as aK, WikiMigrationRequiredError as aN, WikiParseError as aP, WikiSearchUnavailableError as aQ, WikiSourceRefHashCollision as aS, WikiStrictOntologyViolation as aT, WikiSupersedeError as aU, WikiTransactionError as aX, isReservedAbstainSlug as aY, isWikiSearchUnavailableError as aZ, validateManifest as a_, PromptService as aa, PrunePartialFailureError as ab, WikiBusyError as as, ImportExportService as b0, IngestionService as b1, JobManager as b2, MaintenanceService as b3, RetrievalService as b4, SearchService as b5, WriteService as b6, WikiMemory as e, CheckpointIncompleteError as f, EraseStepError as r };
5256
- export type { DegradedRecord as D, EmbedFactResult as E, FormatContextOptions as F, GraphNeighborhood as G, HealResult as I, ImportDumpResult as J, IngestDocumentResult as K, LLMProvider as L, MemoryBundle as M, LibrarianConfig as N, OntologyMode as O, LibrarianGateConfig as P, LockedMaintenanceJob as Q, ReadOptions as R, SQLiteAdapter as S, MaintenanceJob as T, MaintenanceStopReason as U, MemoryDumpEntity as V, WikiConfig as W, MigrationPolicy as X, MemoryDump as a, OntologyBackfillResult as a0, OntologyEdgeType as a1, OntologyManifest as a2, OntologyNodeType as a3, OntologyPromptContext as a4, OntologyUpdates as a5, PendingMaintenance as a6, PendingMigrationWork as a7, PendingSourceStatus as a8, PromptOverrides as a9, WikiDiagnosticTrigger as aA, WikiEdge as aD, WikiEvent as aE, WikiFact as aG, WikiInstructions as aJ, WikiLintReport as aL, WikiMemoryTestAccess as aM, WikiOutboxEvent as aO, WikiSourcePointer as aR, WikiSupersedeReason as aV, WikiTask as aW, ReembedResult as ac, RememberInput as ad, RunPendingMaintenanceOptions as ae, RunPendingMaintenanceResult as af, SourcePassage as ag, StoreSourceResult as ah, StoredSource as ai, StoredSourceDump as aj, StoredSourceSummary as ak, SupersedeReplacement as al, SystemOneConfig as am, SystemOneThresholdSite as an, VectorRanker as ao, VectorRankerFallback as ap, VectorRankerRankArgs as aq, VectorRankerSemanticResult as ar, WikiBusyOperation as at, WikiCheckpoint as au, WikiDiagnostic as av, WikiDiagnosticCode as aw, WikiDiagnosticDetail as ax, WikiDiagnosticOperation as ay, WikiDiagnosticSeverity as az, FormattedMemoryDump as b, OntologyConfig as c, WikiOptions as d, ChunkFailure as g, ClassifierAnswer as h, ClassifierQuestion as i, ClassifyRequest as j, ClassifyResponse as k, DraftPage as l, EmbedFailureKind as m, EmbeddingMarkerKind as n, EntityMaintenanceReport as o, EntityStatus as p, EraseReport as q, ExtractedFact as s, ExtractedFactEdge as t, ExtractedFactWithOntology as u, ExtractedTask as v, ForgetParams as w, ForgetResult as x, GraphTraversalOptions as y, GroundingConfig as z };
5255
+ export { HEAL_RECHECK_MS as A, HOOK_TIMEOUT_MARKER as B, CLASSIFIER_MAX_CHOICES as C, HEAL_BATCH_SIZE as H, ONTOLOGY_ABSTAIN_SENTINEL as Y, ONTOLOGY_BACKFILL_BATCH_SIZE as Z, ONTOLOGY_BACKFILL_RECHECK_MS as _, ImportExportService as a$, PromptService as a9, WikiDraftNotFound as aA, WikiDuplicateHashError as aB, WikiExternalDeletionError as aE, WikiGraphNodeOwnershipConflict as aG, WikiIngestEmptyError as aH, WikiInvalidReadOptions as aJ, WikiMigrationRequiredError as aM, WikiParseError as aO, WikiSearchUnavailableError as aP, WikiSourceRefHashCollision as aR, WikiStrictOntologyViolation as aS, WikiSupersedeError as aT, WikiTransactionError as aW, isReservedAbstainSlug as aX, isWikiSearchUnavailableError as aY, validateManifest as aZ, EmbeddingService as a_, PrunePartialFailureError as aa, WikiBusyError as ar, IngestionService as b0, JobManager as b1, MaintenanceService as b2, RetrievalService as b3, SearchService as b4, WriteService as b5, WikiMemory as e, CheckpointIncompleteError as f, EraseStepError as r };
5256
+ export type { OntologyBackfillResult as $, DegradedRecord as D, EmbedFactResult as E, FormatContextOptions as F, GraphNeighborhood as G, HealResult as I, ImportDumpResult as J, IngestDocumentResult as K, LLMProvider as L, MemoryBundle as M, LibrarianConfig as N, OntologyMode as O, LibrarianGateConfig as P, LockedMaintenanceJob as Q, ReadOptions as R, SQLiteAdapter as S, MaintenanceJob as T, MaintenanceStopReason as U, MemoryDumpEntity as V, WikiConfig as W, MigrationPolicy as X, MemoryDump as a, OntologyEdgeType as a0, OntologyManifest as a1, OntologyNodeType as a2, OntologyPromptContext as a3, OntologyUpdates as a4, PendingMaintenance as a5, PendingMigrationWork as a6, PendingSourceStatus as a7, PromptOverrides as a8, WikiEdge as aC, WikiEvent as aD, WikiFact as aF, WikiInstructions as aI, WikiLintReport as aK, WikiMemoryTestAccess as aL, WikiOutboxEvent as aN, WikiSourcePointer as aQ, WikiSupersedeReason as aU, WikiTask as aV, ReembedResult as ab, RememberInput as ac, RunPendingMaintenanceOptions as ad, RunPendingMaintenanceResult as ae, SourcePassage as af, StoreSourceResult as ag, StoredSource as ah, StoredSourceDump as ai, StoredSourceSummary as aj, SupersedeReplacement as ak, SystemOneConfig as al, SystemOneThresholdSite as am, VectorRanker as an, VectorRankerFallback as ao, VectorRankerRankArgs as ap, VectorRankerSemanticResult as aq, WikiBusyOperation as as, WikiCheckpoint as at, WikiDiagnostic as au, WikiDiagnosticCode as av, WikiDiagnosticDetail as aw, WikiDiagnosticOperation as ax, WikiDiagnosticSeverity as ay, WikiDiagnosticTrigger as az, FormattedMemoryDump as b, OntologyConfig as c, WikiOptions as d, ChunkFailure as g, ClassifierAnswer as h, ClassifierQuestion as i, ClassifyRequest as j, ClassifyResponse as k, DraftPage as l, EmbedFailureKind as m, EmbeddingMarkerKind as n, EntityMaintenanceReport as o, EntityStatus as p, EraseReport as q, ExtractedFact as s, ExtractedFactEdge as t, ExtractedFactWithOntology as u, ExtractedTask as v, ForgetParams as w, ForgetResult as x, GraphTraversalOptions as y, GroundingConfig as z };
@@ -3989,7 +3989,7 @@ interface LibrarianResult {
3989
3989
  }
3990
3990
 
3991
3991
  declare const ONTOLOGY_BACKFILL_BATCH_SIZE = 25;
3992
- declare const ONTOLOGY_BACKFILL_MAX_PROMPT_CHARS = 40000;
3992
+
3993
3993
  declare const ONTOLOGY_BACKFILL_RECHECK_MS: number;
3994
3994
  /**
3995
3995
  * Upper bound on one classifier choice question (specs/system-one-config §5):
@@ -5252,5 +5252,5 @@ declare class WikiMemory {
5252
5252
  setGeneratedByTask(taskId: string, entityId: string, actor: string): Promise<void>;
5253
5253
  }
5254
5254
 
5255
- export { ONTOLOGY_BACKFILL_RECHECK_MS as $, HEAL_RECHECK_MS as A, HOOK_TIMEOUT_MARKER as B, CLASSIFIER_MAX_CHOICES as C, HEAL_BATCH_SIZE as H, ONTOLOGY_ABSTAIN_SENTINEL as Y, ONTOLOGY_BACKFILL_BATCH_SIZE as Z, ONTOLOGY_BACKFILL_MAX_PROMPT_CHARS as _, EmbeddingService as a$, WikiDraftNotFound as aB, WikiDuplicateHashError as aC, WikiExternalDeletionError as aF, WikiGraphNodeOwnershipConflict as aH, WikiIngestEmptyError as aI, WikiInvalidReadOptions as aK, WikiMigrationRequiredError as aN, WikiParseError as aP, WikiSearchUnavailableError as aQ, WikiSourceRefHashCollision as aS, WikiStrictOntologyViolation as aT, WikiSupersedeError as aU, WikiTransactionError as aX, isReservedAbstainSlug as aY, isWikiSearchUnavailableError as aZ, validateManifest as a_, PromptService as aa, PrunePartialFailureError as ab, WikiBusyError as as, ImportExportService as b0, IngestionService as b1, JobManager as b2, MaintenanceService as b3, RetrievalService as b4, SearchService as b5, WriteService as b6, WikiMemory as e, CheckpointIncompleteError as f, EraseStepError as r };
5256
- export type { DegradedRecord as D, EmbedFactResult as E, FormatContextOptions as F, GraphNeighborhood as G, HealResult as I, ImportDumpResult as J, IngestDocumentResult as K, LLMProvider as L, MemoryBundle as M, LibrarianConfig as N, OntologyMode as O, LibrarianGateConfig as P, LockedMaintenanceJob as Q, ReadOptions as R, SQLiteAdapter as S, MaintenanceJob as T, MaintenanceStopReason as U, MemoryDumpEntity as V, WikiConfig as W, MigrationPolicy as X, MemoryDump as a, OntologyBackfillResult as a0, OntologyEdgeType as a1, OntologyManifest as a2, OntologyNodeType as a3, OntologyPromptContext as a4, OntologyUpdates as a5, PendingMaintenance as a6, PendingMigrationWork as a7, PendingSourceStatus as a8, PromptOverrides as a9, WikiDiagnosticTrigger as aA, WikiEdge as aD, WikiEvent as aE, WikiFact as aG, WikiInstructions as aJ, WikiLintReport as aL, WikiMemoryTestAccess as aM, WikiOutboxEvent as aO, WikiSourcePointer as aR, WikiSupersedeReason as aV, WikiTask as aW, ReembedResult as ac, RememberInput as ad, RunPendingMaintenanceOptions as ae, RunPendingMaintenanceResult as af, SourcePassage as ag, StoreSourceResult as ah, StoredSource as ai, StoredSourceDump as aj, StoredSourceSummary as ak, SupersedeReplacement as al, SystemOneConfig as am, SystemOneThresholdSite as an, VectorRanker as ao, VectorRankerFallback as ap, VectorRankerRankArgs as aq, VectorRankerSemanticResult as ar, WikiBusyOperation as at, WikiCheckpoint as au, WikiDiagnostic as av, WikiDiagnosticCode as aw, WikiDiagnosticDetail as ax, WikiDiagnosticOperation as ay, WikiDiagnosticSeverity as az, FormattedMemoryDump as b, OntologyConfig as c, WikiOptions as d, ChunkFailure as g, ClassifierAnswer as h, ClassifierQuestion as i, ClassifyRequest as j, ClassifyResponse as k, DraftPage as l, EmbedFailureKind as m, EmbeddingMarkerKind as n, EntityMaintenanceReport as o, EntityStatus as p, EraseReport as q, ExtractedFact as s, ExtractedFactEdge as t, ExtractedFactWithOntology as u, ExtractedTask as v, ForgetParams as w, ForgetResult as x, GraphTraversalOptions as y, GroundingConfig as z };
5255
+ export { HEAL_RECHECK_MS as A, HOOK_TIMEOUT_MARKER as B, CLASSIFIER_MAX_CHOICES as C, HEAL_BATCH_SIZE as H, ONTOLOGY_ABSTAIN_SENTINEL as Y, ONTOLOGY_BACKFILL_BATCH_SIZE as Z, ONTOLOGY_BACKFILL_RECHECK_MS as _, ImportExportService as a$, PromptService as a9, WikiDraftNotFound as aA, WikiDuplicateHashError as aB, WikiExternalDeletionError as aE, WikiGraphNodeOwnershipConflict as aG, WikiIngestEmptyError as aH, WikiInvalidReadOptions as aJ, WikiMigrationRequiredError as aM, WikiParseError as aO, WikiSearchUnavailableError as aP, WikiSourceRefHashCollision as aR, WikiStrictOntologyViolation as aS, WikiSupersedeError as aT, WikiTransactionError as aW, isReservedAbstainSlug as aX, isWikiSearchUnavailableError as aY, validateManifest as aZ, EmbeddingService as a_, PrunePartialFailureError as aa, WikiBusyError as ar, IngestionService as b0, JobManager as b1, MaintenanceService as b2, RetrievalService as b3, SearchService as b4, WriteService as b5, WikiMemory as e, CheckpointIncompleteError as f, EraseStepError as r };
5256
+ export type { OntologyBackfillResult as $, DegradedRecord as D, EmbedFactResult as E, FormatContextOptions as F, GraphNeighborhood as G, HealResult as I, ImportDumpResult as J, IngestDocumentResult as K, LLMProvider as L, MemoryBundle as M, LibrarianConfig as N, OntologyMode as O, LibrarianGateConfig as P, LockedMaintenanceJob as Q, ReadOptions as R, SQLiteAdapter as S, MaintenanceJob as T, MaintenanceStopReason as U, MemoryDumpEntity as V, WikiConfig as W, MigrationPolicy as X, MemoryDump as a, OntologyEdgeType as a0, OntologyManifest as a1, OntologyNodeType as a2, OntologyPromptContext as a3, OntologyUpdates as a4, PendingMaintenance as a5, PendingMigrationWork as a6, PendingSourceStatus as a7, PromptOverrides as a8, WikiEdge as aC, WikiEvent as aD, WikiFact as aF, WikiInstructions as aI, WikiLintReport as aK, WikiMemoryTestAccess as aL, WikiOutboxEvent as aN, WikiSourcePointer as aQ, WikiSupersedeReason as aU, WikiTask as aV, ReembedResult as ab, RememberInput as ac, RunPendingMaintenanceOptions as ad, RunPendingMaintenanceResult as ae, SourcePassage as af, StoreSourceResult as ag, StoredSource as ah, StoredSourceDump as ai, StoredSourceSummary as aj, SupersedeReplacement as ak, SystemOneConfig as al, SystemOneThresholdSite as am, VectorRanker as an, VectorRankerFallback as ao, VectorRankerRankArgs as ap, VectorRankerSemanticResult as aq, WikiBusyOperation as as, WikiCheckpoint as at, WikiDiagnostic as au, WikiDiagnosticCode as av, WikiDiagnosticDetail as aw, WikiDiagnosticOperation as ax, WikiDiagnosticSeverity as ay, WikiDiagnosticTrigger as az, FormattedMemoryDump as b, OntologyConfig as c, WikiOptions as d, ChunkFailure as g, ClassifierAnswer as h, ClassifierQuestion as i, ClassifyRequest as j, ClassifyResponse as k, DraftPage as l, EmbedFailureKind as m, EmbeddingMarkerKind as n, EntityMaintenanceReport as o, EntityStatus as p, EraseReport as q, ExtractedFact as s, ExtractedFactEdge as t, ExtractedFactWithOntology as u, ExtractedTask as v, ForgetParams as w, ForgetResult as x, GraphTraversalOptions as y, GroundingConfig as z };
@@ -1,2 +1,2 @@
1
- export { a$ as EmbeddingService, b0 as ImportExportService, b1 as IngestionService, b2 as JobManager, b2 as JobManagerType, b3 as MaintenanceService, b4 as RetrievalService, b5 as SearchService, b5 as SearchServiceType, aM as WikiMemoryTestAccess, b6 as WriteService } from './testing-DnYjL2QD.mjs';
1
+ export { a_ as EmbeddingService, a$ as ImportExportService, b0 as IngestionService, b1 as JobManager, b1 as JobManagerType, b2 as MaintenanceService, b3 as RetrievalService, b4 as SearchService, b4 as SearchServiceType, aL as WikiMemoryTestAccess, b5 as WriteService } from './testing-DFyghdSG.mjs';
2
2
  import '@equationalapplications/core-okf';
package/dist/testing.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { a$ as EmbeddingService, b0 as ImportExportService, b1 as IngestionService, b2 as JobManager, b2 as JobManagerType, b3 as MaintenanceService, b4 as RetrievalService, b5 as SearchService, b5 as SearchServiceType, aM as WikiMemoryTestAccess, b6 as WriteService } from './testing-DnYjL2QD.js';
1
+ export { a_ as EmbeddingService, a$ as ImportExportService, b0 as IngestionService, b1 as JobManager, b1 as JobManagerType, b2 as MaintenanceService, b3 as RetrievalService, b4 as SearchService, b4 as SearchServiceType, aL as WikiMemoryTestAccess, b5 as WriteService } from './testing-DFyghdSG.js';
2
2
  import '@equationalapplications/core-okf';
package/dist/testing.js CHANGED
@@ -2945,6 +2945,7 @@ var DEFAULT_CHUNK_OVERLAP = 400;
2945
2945
 
2946
2946
  // src/utils/contextCaps.ts
2947
2947
  var OPS_RESOLVE_MAX_PROMPT_CHARS = 4e4;
2948
+ var ONTOLOGY_BACKFILL_MAX_PROMPT_CHARS = 4e4;
2948
2949
  var HEAL_MAX_PROMPT_CHARS = 4e4;
2949
2950
  var OPS_MAX_EXTRACT_CHARS = 24e3;
2950
2951
 
@@ -2955,7 +2956,8 @@ var DEFAULT_OUTPUT_RESERVE_TOKENS = 4e3;
2955
2956
  var OP_FLOOR = {
2956
2957
  resolve: OPS_RESOLVE_MAX_PROMPT_CHARS,
2957
2958
  heal: HEAL_MAX_PROMPT_CHARS,
2958
- extract: OPS_MAX_EXTRACT_CHARS
2959
+ extract: OPS_MAX_EXTRACT_CHARS,
2960
+ backfill: ONTOLOGY_BACKFILL_MAX_PROMPT_CHARS
2959
2961
  };
2960
2962
  function bad(key, value, why) {
2961
2963
  return new Error(`[core-llm-wiki] config.context.${key} must be ${why}; received ${JSON.stringify(value)}`);
@@ -2993,12 +2995,11 @@ function declaredPromptCap(budget, op) {
2993
2995
  const derived = Math.floor(
2994
2996
  (budget.contextWindowTokens - budget.outputReserveTokens) * budget.safetyFraction * budget.charsPerToken
2995
2997
  );
2996
- if (op === "resolve") return Math.max(OP_FLOOR.resolve, derived);
2997
- return Math.max(OP_FLOOR.heal, derived);
2998
+ return Math.max(OP_FLOOR[op], derived);
2998
2999
  }
2999
3000
  function resolveMaxPromptChars(budget, op) {
3000
3001
  if (budget.mode !== "declared") {
3001
- return op === "resolve" ? OP_FLOOR.resolve : op === "heal" ? OP_FLOOR.heal : OP_FLOOR.extract;
3002
+ return OP_FLOOR[op];
3002
3003
  }
3003
3004
  if (op === "extract") {
3004
3005
  const resolveDerived = declaredPromptCap(budget, "resolve");
@@ -5927,7 +5928,6 @@ async function runLibrarianStrategy(deps, ctx) {
5927
5928
  // src/services/MaintenanceService.ts
5928
5929
  var CHAIN_TRUNCATED_NOTICE = `includeChain walk stopped at the depth cap (${HISTORY_MAX_DEPTH} links per direction); the chain is longer than the ids listed. Run forget again on a remaining chain id to continue.`;
5929
5930
  var ONTOLOGY_BACKFILL_BATCH_SIZE = 25;
5930
- var ONTOLOGY_BACKFILL_MAX_PROMPT_CHARS = 4e4;
5931
5931
  var ONTOLOGY_BACKFILL_RECHECK_MS = 7 * 24 * 60 * 60 * 1e3;
5932
5932
  var CLASSIFIER_MAX_CHOICES = 255;
5933
5933
  var HEAL_ANCHOR_SEARCH_OVERFETCH = 4;
@@ -7404,6 +7404,7 @@ DROP TRIGGER IF EXISTS ${ad};`);
7404
7404
  throw new TypeError(`Invalid classifier option: ${JSON.stringify(options.classifier)} \u2014 must be 'auto' or 'llm'`);
7405
7405
  }
7406
7406
  const shortlistK = resolveShortlistK(this.options.config);
7407
+ const maxPromptChars = resolveMaxPromptChars(resolveContextBudget(this.options.config), "backfill");
7407
7408
  const trigger = options?.trigger ?? "call";
7408
7409
  const now = Date.now();
7409
7410
  const recheckCutoff = options?.recheckCheckedBefore ?? now - ONTOLOGY_BACKFILL_RECHECK_MS;
@@ -7452,7 +7453,8 @@ DROP TRIGGER IF EXISTS ${ad};`);
7452
7453
  trigger,
7453
7454
  batchSize: escalated.length,
7454
7455
  recheckCutoff,
7455
- shortlistK
7456
+ shortlistK,
7457
+ maxPromptChars
7456
7458
  });
7457
7459
  return {
7458
7460
  scanned: classifierRun.result.scanned,
@@ -7474,7 +7476,8 @@ DROP TRIGGER IF EXISTS ${ad};`);
7474
7476
  meter: options?.meter,
7475
7477
  trigger,
7476
7478
  recheckCutoff,
7477
- shortlistK
7479
+ shortlistK,
7480
+ maxPromptChars
7478
7481
  });
7479
7482
  }
7480
7483
  /**
@@ -7506,6 +7509,10 @@ DROP TRIGGER IF EXISTS ${ad};`);
7506
7509
  if (shortlistK === void 0) {
7507
7510
  throw new Error("_runGenerativeBackfill: runOpts.shortlistK is required (resolved at doRunOntologyBackfill entry)");
7508
7511
  }
7512
+ const maxPromptChars = runOpts.maxPromptChars;
7513
+ if (maxPromptChars === void 0) {
7514
+ throw new Error("_runGenerativeBackfill: runOpts.maxPromptChars is required (resolved at doRunOntologyBackfill entry)");
7515
+ }
7509
7516
  const ontologyService = this.ontologyService;
7510
7517
  const now = Date.now();
7511
7518
  const recheckCutoff = runOpts.recheckCutoff;
@@ -7544,7 +7551,7 @@ DROP TRIGGER IF EXISTS ${ad};`);
7544
7551
  };
7545
7552
  },
7546
7553
  maxOutputTokens: this.options.llmProvider.maxOutputTokens,
7547
- maxPromptChars: ONTOLOGY_BACKFILL_MAX_PROMPT_CHARS,
7554
+ maxPromptChars,
7548
7555
  onSkip: (fact, err) => {
7549
7556
  if (isContextOverflowError(err)) {
7550
7557
  emitDiagnostic(this.options, {