@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/{chunk-RPE6OMUZ.mjs → chunk-QUVPQVJ6.mjs} +17 -10
- package/dist/chunk-QUVPQVJ6.mjs.map +1 -0
- package/dist/index.d.mts +22 -19
- package/dist/index.d.ts +22 -19
- package/dist/index.js +15 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{testing-DnYjL2QD.d.mts → testing-DFyghdSG.d.mts} +3 -3
- package/dist/{testing-DnYjL2QD.d.ts → testing-DFyghdSG.d.ts} +3 -3
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +15 -8
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-RPE6OMUZ.mjs.map +0 -1
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-
|
|
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-
|
|
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
|
-
|
|
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 {
|
|
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,
|
|
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
|
-
|
|
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 {
|
|
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,
|
|
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 };
|
package/dist/testing.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
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 {
|
|
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
|
-
|
|
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
|
|
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
|
|
7554
|
+
maxPromptChars,
|
|
7548
7555
|
onSkip: (fact, err) => {
|
|
7549
7556
|
if (isContextOverflowError(err)) {
|
|
7550
7557
|
emitDiagnostic(this.options, {
|