@equationalapplications/core-llm-wiki 9.5.3 → 9.6.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-QIS2SGUM.mjs → chunk-TZMLWQ3G.mjs} +310 -84
- package/dist/chunk-TZMLWQ3G.mjs.map +1 -0
- package/dist/index.d.mts +49 -3
- package/dist/index.d.ts +49 -3
- package/dist/index.js +344 -52
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +69 -12
- package/dist/index.mjs.map +1 -1
- package/dist/{testing-BA6CedgZ.d.mts → testing-BBeQQIYp.d.mts} +134 -11
- package/dist/{testing-BA6CedgZ.d.ts → testing-BBeQQIYp.d.ts} +134 -11
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +270 -43
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +1 -1
- package/package.json +3 -3
- package/dist/chunk-QIS2SGUM.mjs.map +0 -1
|
@@ -781,6 +781,10 @@ function resolveNodeType(raw, manifest) {
|
|
|
781
781
|
const hit = manifest.node_types.find((n) => n.type.toLowerCase() === slug.toLowerCase());
|
|
782
782
|
return hit?.type ?? null;
|
|
783
783
|
}
|
|
784
|
+
var ONTOLOGY_ABSTAIN_SENTINEL = "none_of_these";
|
|
785
|
+
function isReservedAbstainSlug(raw) {
|
|
786
|
+
return typeof raw === "string" && raw.trim().toLowerCase() === ONTOLOGY_ABSTAIN_SENTINEL;
|
|
787
|
+
}
|
|
784
788
|
function resolveEdgeDefinitions(rawEdgeType, manifest) {
|
|
785
789
|
const slug = rawEdgeType.trim();
|
|
786
790
|
if (!slug) return [];
|
|
@@ -2740,6 +2744,8 @@ var SEVERITY = {
|
|
|
2740
2744
|
grounding_failed: "warn",
|
|
2741
2745
|
classification_low_confidence: "info",
|
|
2742
2746
|
classification_invalid: "warn",
|
|
2747
|
+
classification_abstained: "info",
|
|
2748
|
+
node_type_assigned: "info",
|
|
2743
2749
|
context_overflow_skipped: "warn",
|
|
2744
2750
|
llm_usage: "info",
|
|
2745
2751
|
librarian_gate: "info",
|
|
@@ -2748,6 +2754,7 @@ var SEVERITY = {
|
|
|
2748
2754
|
resolve_failed: "warn",
|
|
2749
2755
|
read_budget: "info",
|
|
2750
2756
|
event_retention_held: "info",
|
|
2757
|
+
ontology_backfill_held: "info",
|
|
2751
2758
|
prune_checkpoint_incomplete: "warn",
|
|
2752
2759
|
erase_secure_delete_off: "error",
|
|
2753
2760
|
erase_entity_skipped: "warn",
|
|
@@ -2786,6 +2793,8 @@ var MESSAGE = {
|
|
|
2786
2793
|
grounding_failed: "A fact carried evidence not found in its source and was stored as a draft.",
|
|
2787
2794
|
classification_low_confidence: "A classifier answer was below the confidence threshold and was not applied.",
|
|
2788
2795
|
classification_invalid: "A classifier answer was invalid and was not applied.",
|
|
2796
|
+
classification_abstained: "The typing model declined to classify the fact; it was not typed.",
|
|
2797
|
+
node_type_assigned: "A typing run assigned an ontology node type to the fact.",
|
|
2789
2798
|
context_overflow_skipped: "An item (fact or event) was skipped because the model input exceeded its context window.",
|
|
2790
2799
|
llm_usage: "An LLM call completed; token usage attached.",
|
|
2791
2800
|
librarian_gate: "Librarian gate outcome counts for one pass.",
|
|
@@ -2794,6 +2803,7 @@ var MESSAGE = {
|
|
|
2794
2803
|
resolve_failed: "Reconciliation failed for a candidate; it was stored as a draft.",
|
|
2795
2804
|
read_budget: "A read was packed to a token budget.",
|
|
2796
2805
|
event_retention_held: "Event pruning was held back because the librarian has not processed those events yet.",
|
|
2806
|
+
ontology_backfill_held: "Ontology backfill was held because another job held the entity\u2019s lock.",
|
|
2797
2807
|
prune_checkpoint_incomplete: "The post-VACUUM WAL checkpoint was incomplete while a prune partial failure was also reported; deleted bytes may remain in the WAL.",
|
|
2798
2808
|
erase_secure_delete_off: "secure_delete could not be confirmed ON on the connection; erasure is unverified and the erase was stopped.",
|
|
2799
2809
|
erase_retired_vtab_undroppable: "A retired FTS table could not be dropped on a runtime without FTS5; its shadow-table text rows were emptied (fts5 %_config and %_data ids 1 and 10 are intentionally kept) and the name stays listed until an FTS5-capable open drops it.",
|
|
@@ -3662,6 +3672,99 @@ var IngestionService = class {
|
|
|
3662
3672
|
}
|
|
3663
3673
|
};
|
|
3664
3674
|
|
|
3675
|
+
// src/utils/engineDefaults.ts
|
|
3676
|
+
var DEFAULT_LIBRARIAN_STRATEGY = "ops";
|
|
3677
|
+
var DEFAULT_MAINTENANCE_MODE = "deferred";
|
|
3678
|
+
function resolveLibrarianStrategy(config) {
|
|
3679
|
+
return config?.librarian?.strategy ?? DEFAULT_LIBRARIAN_STRATEGY;
|
|
3680
|
+
}
|
|
3681
|
+
function resolveMaintenanceMode(config) {
|
|
3682
|
+
return config?.maintenance ?? DEFAULT_MAINTENANCE_MODE;
|
|
3683
|
+
}
|
|
3684
|
+
function changedDefaultWarnings(config) {
|
|
3685
|
+
const warnings = [];
|
|
3686
|
+
const hasThreshold = config?.autoLibrarianThreshold !== void 0 || config?.autoHealThreshold !== void 0 || config?.autoLibrarianTokenThreshold !== void 0;
|
|
3687
|
+
if (hasThreshold && config?.maintenance === void 0) {
|
|
3688
|
+
warnings.push(
|
|
3689
|
+
"[core-llm-wiki] auto-run thresholds are set, but `maintenance` now defaults to 'deferred', so write() will not start the librarian or heal. Set `maintenance: 'auto'` or call runPendingMaintenance()."
|
|
3690
|
+
);
|
|
3691
|
+
}
|
|
3692
|
+
if (config?.prompts?.librarianSystemPrompt !== void 0) {
|
|
3693
|
+
warnings.push(
|
|
3694
|
+
"[core-llm-wiki] `prompts.librarianSystemPrompt` was removed in 9.0.0 and its value is ignored. Move the domain part of it to `prompts.guidance`, which works under both librarian strategies."
|
|
3695
|
+
);
|
|
3696
|
+
}
|
|
3697
|
+
if (config?.librarian?.strategy === "legacy" && config?.maintenance === void 0 && !hasThreshold) {
|
|
3698
|
+
warnings.push(
|
|
3699
|
+
"[core-llm-wiki] `librarian.strategy` is pinned to 'legacy', but `maintenance` now defaults to 'deferred', so write() will not start the librarian or heal, and a deferred backlog run keeps only the newest 50 events. Set `maintenance: 'auto'` to keep 7.x auto-run behavior."
|
|
3700
|
+
);
|
|
3701
|
+
}
|
|
3702
|
+
return warnings;
|
|
3703
|
+
}
|
|
3704
|
+
var warnedDefaults = /* @__PURE__ */ new Set();
|
|
3705
|
+
function warnChangedDefaultsOnce(config) {
|
|
3706
|
+
for (const message of changedDefaultWarnings(config)) {
|
|
3707
|
+
if (warnedDefaults.has(message)) continue;
|
|
3708
|
+
warnedDefaults.add(message);
|
|
3709
|
+
console.warn(message);
|
|
3710
|
+
}
|
|
3711
|
+
}
|
|
3712
|
+
function warnOnce(message) {
|
|
3713
|
+
if (warnedDefaults.has(message)) return;
|
|
3714
|
+
warnedDefaults.add(message);
|
|
3715
|
+
console.warn(message);
|
|
3716
|
+
}
|
|
3717
|
+
function formatConfigValue(value) {
|
|
3718
|
+
try {
|
|
3719
|
+
const json = JSON.stringify(value);
|
|
3720
|
+
return json ?? String(value);
|
|
3721
|
+
} catch {
|
|
3722
|
+
return `[unserializable: ${typeof value}]`;
|
|
3723
|
+
}
|
|
3724
|
+
}
|
|
3725
|
+
var isTypingMode = (v) => v === "auto" || v === "llm";
|
|
3726
|
+
var isConfidenceFloor = (v) => typeof v === "number" && Number.isFinite(v) && v >= 0 && v <= 1;
|
|
3727
|
+
function resolveSystemOneTyping(config, classifierCallOption) {
|
|
3728
|
+
const systemOne = config?.systemOne;
|
|
3729
|
+
const legacy = config?.ontology?.backfillClassifier;
|
|
3730
|
+
const systemOneValid = isTypingMode(systemOne?.typing);
|
|
3731
|
+
const legacyValid = isTypingMode(legacy);
|
|
3732
|
+
if (systemOne?.typing !== void 0 && !systemOneValid) {
|
|
3733
|
+
warnOnce(
|
|
3734
|
+
`[core-llm-wiki] systemOne: \`systemOne.typing\` is ${formatConfigValue(systemOne.typing)}, which is not 'auto' or 'llm'. The key is treated as unset; the default ('llm') applies.`
|
|
3735
|
+
);
|
|
3736
|
+
}
|
|
3737
|
+
if (legacy !== void 0 && !legacyValid) {
|
|
3738
|
+
warnOnce(
|
|
3739
|
+
`[core-llm-wiki] systemOne: \`ontology.backfillClassifier\` is ${formatConfigValue(legacy)}, which is not 'auto' or 'llm'. The key is treated as unset; the default ('llm') applies.`
|
|
3740
|
+
);
|
|
3741
|
+
}
|
|
3742
|
+
if (systemOneValid && legacyValid && systemOne.typing !== legacy) {
|
|
3743
|
+
warnOnce(
|
|
3744
|
+
`[core-llm-wiki] systemOne: \`systemOne.typing\` (${systemOne.typing}) and \`ontology.backfillClassifier\` (${legacy}) disagree; \`systemOne.typing\` wins. Remove the legacy key to silence this warning.`
|
|
3745
|
+
);
|
|
3746
|
+
}
|
|
3747
|
+
return classifierCallOption ?? (systemOneValid ? systemOne.typing : void 0) ?? (legacyValid ? legacy : void 0) ?? "llm";
|
|
3748
|
+
}
|
|
3749
|
+
var DEFAULT_TYPING_MIN_CONFIDENCE = 0.5;
|
|
3750
|
+
function resolveTypingMinConfidence(config) {
|
|
3751
|
+
const systemOneFloor = config?.systemOne?.minConfidence?.typing;
|
|
3752
|
+
const legacyFloor = config?.ontology?.classifyMinConfidence;
|
|
3753
|
+
const systemOneValid = isConfidenceFloor(systemOneFloor);
|
|
3754
|
+
const legacyValid = isConfidenceFloor(legacyFloor);
|
|
3755
|
+
if (systemOneFloor !== void 0 && !systemOneValid) {
|
|
3756
|
+
warnOnce(
|
|
3757
|
+
`[core-llm-wiki] systemOne: \`systemOne.minConfidence.typing\` is ${formatConfigValue(systemOneFloor)}, which is not a finite number in [0, 1]. The key is treated as unset and the chain continues.`
|
|
3758
|
+
);
|
|
3759
|
+
}
|
|
3760
|
+
if (legacyFloor !== void 0 && !legacyValid) {
|
|
3761
|
+
warnOnce(
|
|
3762
|
+
`[core-llm-wiki] systemOne: \`ontology.classifyMinConfidence\` is ${formatConfigValue(legacyFloor)}, which is not a finite number in [0, 1]. The key is treated as unset and the chain continues.`
|
|
3763
|
+
);
|
|
3764
|
+
}
|
|
3765
|
+
return (systemOneValid ? systemOneFloor : void 0) ?? (legacyValid ? legacyFloor : void 0) ?? DEFAULT_TYPING_MIN_CONFIDENCE;
|
|
3766
|
+
}
|
|
3767
|
+
|
|
3665
3768
|
// src/utils/classifier.ts
|
|
3666
3769
|
var isUnit = (v) => typeof v === "number" && Number.isFinite(v) && v >= 0 && v <= 1;
|
|
3667
3770
|
function validateClassifierAnswer(response, key, question) {
|
|
@@ -3837,44 +3940,6 @@ var TemporalService = class {
|
|
|
3837
3940
|
}
|
|
3838
3941
|
};
|
|
3839
3942
|
|
|
3840
|
-
// src/utils/engineDefaults.ts
|
|
3841
|
-
var DEFAULT_LIBRARIAN_STRATEGY = "ops";
|
|
3842
|
-
var DEFAULT_MAINTENANCE_MODE = "deferred";
|
|
3843
|
-
function resolveLibrarianStrategy(config) {
|
|
3844
|
-
return config?.librarian?.strategy ?? DEFAULT_LIBRARIAN_STRATEGY;
|
|
3845
|
-
}
|
|
3846
|
-
function resolveMaintenanceMode(config) {
|
|
3847
|
-
return config?.maintenance ?? DEFAULT_MAINTENANCE_MODE;
|
|
3848
|
-
}
|
|
3849
|
-
function changedDefaultWarnings(config) {
|
|
3850
|
-
const warnings = [];
|
|
3851
|
-
const hasThreshold = config?.autoLibrarianThreshold !== void 0 || config?.autoHealThreshold !== void 0 || config?.autoLibrarianTokenThreshold !== void 0;
|
|
3852
|
-
if (hasThreshold && config?.maintenance === void 0) {
|
|
3853
|
-
warnings.push(
|
|
3854
|
-
"[core-llm-wiki] auto-run thresholds are set, but `maintenance` now defaults to 'deferred', so write() will not start the librarian or heal. Set `maintenance: 'auto'` or call runPendingMaintenance()."
|
|
3855
|
-
);
|
|
3856
|
-
}
|
|
3857
|
-
if (config?.prompts?.librarianSystemPrompt !== void 0) {
|
|
3858
|
-
warnings.push(
|
|
3859
|
-
"[core-llm-wiki] `prompts.librarianSystemPrompt` was removed in 9.0.0 and its value is ignored. Move the domain part of it to `prompts.guidance`, which works under both librarian strategies."
|
|
3860
|
-
);
|
|
3861
|
-
}
|
|
3862
|
-
if (config?.librarian?.strategy === "legacy" && config?.maintenance === void 0 && !hasThreshold) {
|
|
3863
|
-
warnings.push(
|
|
3864
|
-
"[core-llm-wiki] `librarian.strategy` is pinned to 'legacy', but `maintenance` now defaults to 'deferred', so write() will not start the librarian or heal, and a deferred backlog run keeps only the newest 50 events. Set `maintenance: 'auto'` to keep 7.x auto-run behavior."
|
|
3865
|
-
);
|
|
3866
|
-
}
|
|
3867
|
-
return warnings;
|
|
3868
|
-
}
|
|
3869
|
-
var warnedDefaults = /* @__PURE__ */ new Set();
|
|
3870
|
-
function warnChangedDefaultsOnce(config) {
|
|
3871
|
-
for (const message of changedDefaultWarnings(config)) {
|
|
3872
|
-
if (warnedDefaults.has(message)) continue;
|
|
3873
|
-
warnedDefaults.add(message);
|
|
3874
|
-
console.warn(message);
|
|
3875
|
-
}
|
|
3876
|
-
}
|
|
3877
|
-
|
|
3878
3943
|
// src/repositories/VectorRemovalRepository.ts
|
|
3879
3944
|
var CHUNK = 500;
|
|
3880
3945
|
function removalBackoffMs(attempts) {
|
|
@@ -6651,6 +6716,7 @@ var CHAIN_TRUNCATED_NOTICE = `includeChain walk stopped at the depth cap (${HIST
|
|
|
6651
6716
|
var ONTOLOGY_BACKFILL_BATCH_SIZE = 25;
|
|
6652
6717
|
var ONTOLOGY_BACKFILL_MAX_PROMPT_CHARS = 4e4;
|
|
6653
6718
|
var ONTOLOGY_BACKFILL_RECHECK_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
6719
|
+
var CLASSIFIER_MAX_CHOICES = 255;
|
|
6654
6720
|
var HEAL_ANCHOR_SEARCH_OVERFETCH = 4;
|
|
6655
6721
|
var HEAL_MAX_PROMPT_CHARS = 4e4;
|
|
6656
6722
|
var HEAL_BATCH_SIZE = 25;
|
|
@@ -7344,6 +7410,35 @@ DROP TRIGGER IF EXISTS ${ad};`);
|
|
|
7344
7410
|
this.jobManager.releaseLock("ontologyBackfill", entityId);
|
|
7345
7411
|
}
|
|
7346
7412
|
}
|
|
7413
|
+
/**
|
|
7414
|
+
* Scheduler read view (specs/system-one-config §8): untyped facts still
|
|
7415
|
+
* eligible for typing this pass — outside the 7-day recheck cooldown — or 0
|
|
7416
|
+
* when ontology is off for the entity (nothing is ever eligible there).
|
|
7417
|
+
* Read-only: never materializes a seed manifest, never writes.
|
|
7418
|
+
*/
|
|
7419
|
+
async pendingOntologyBackfill(entityId) {
|
|
7420
|
+
const ontologyService = this.ontologyService;
|
|
7421
|
+
if (!ontologyService) return 0;
|
|
7422
|
+
const { mode } = await ontologyService.getEffectiveState(entityId);
|
|
7423
|
+
if (mode === "off") return 0;
|
|
7424
|
+
const counts = await this.entryRepo.countUntypedByEntityId(entityId, Date.now() - ONTOLOGY_BACKFILL_RECHECK_MS);
|
|
7425
|
+
return counts.eligible;
|
|
7426
|
+
}
|
|
7427
|
+
/**
|
|
7428
|
+
* Emit `ontology_backfill_held` (severity `info`) when the scheduler found
|
|
7429
|
+
* the entity's `ontologyBackfill` lock held by another job. The lock state
|
|
7430
|
+
* names no content, so the fixed template carries all the information a
|
|
7431
|
+
* host needs; `JobManager.isBlocked` does not identify the blocker and the
|
|
7432
|
+
* diagnostic detail surface stays identifier-typed.
|
|
7433
|
+
*/
|
|
7434
|
+
noteOntologyBackfillHeld(entityId) {
|
|
7435
|
+
emitDiagnostic(this.options, {
|
|
7436
|
+
code: "ontology_backfill_held",
|
|
7437
|
+
operation: "ontologyBackfill",
|
|
7438
|
+
trigger: "call",
|
|
7439
|
+
entityId
|
|
7440
|
+
});
|
|
7441
|
+
}
|
|
7347
7442
|
/**
|
|
7348
7443
|
* Re-embed facts, honouring per-row failure markers and exponential backoff.
|
|
7349
7444
|
*
|
|
@@ -8090,45 +8185,120 @@ DROP TRIGGER IF EXISTS ${ad};`);
|
|
|
8090
8185
|
if (!Number.isInteger(batchSize) || batchSize < 1) {
|
|
8091
8186
|
throw new Error("Invalid batchSize: must be an integer >= 1");
|
|
8092
8187
|
}
|
|
8188
|
+
if (options?.classifier !== void 0 && options.classifier !== "auto" && options.classifier !== "llm") {
|
|
8189
|
+
throw new TypeError(`Invalid classifier option: ${JSON.stringify(options.classifier)} \u2014 must be 'auto' or 'llm'`);
|
|
8190
|
+
}
|
|
8191
|
+
const trigger = options?.trigger ?? "call";
|
|
8093
8192
|
const now = Date.now();
|
|
8094
8193
|
const recheckCutoff = now - ONTOLOGY_BACKFILL_RECHECK_MS;
|
|
8095
|
-
const zeroed = { scanned: 0, typed: 0, failedValidation: 0, edgesAdded: 0, skipped: 0 };
|
|
8194
|
+
const zeroed = { scanned: 0, typed: 0, failedValidation: 0, edgesAdded: 0, skipped: 0, abstained: 0 };
|
|
8096
8195
|
const ontologyService = this.ontologyService;
|
|
8097
8196
|
if (!ontologyService) {
|
|
8098
8197
|
return { ...zeroed, remaining: 0, deferred: 0 };
|
|
8099
8198
|
}
|
|
8100
8199
|
const { mode, manifest: effectiveManifest } = await ontologyService.getEffectiveState(entityId);
|
|
8101
8200
|
if (mode === "off") {
|
|
8102
|
-
const
|
|
8103
|
-
return { ...zeroed, remaining: 0, deferred:
|
|
8201
|
+
const counts = await this.entryRepo.countUntypedByEntityId(entityId, recheckCutoff);
|
|
8202
|
+
return { ...zeroed, remaining: 0, deferred: counts.deferred };
|
|
8104
8203
|
}
|
|
8105
8204
|
const candidates = await this.entryRepo.findUntypedByEntityId(entityId, batchSize, recheckCutoff);
|
|
8106
8205
|
if (candidates.length === 0) {
|
|
8107
|
-
const
|
|
8108
|
-
return { ...zeroed, remaining:
|
|
8206
|
+
const counts = await this.entryRepo.countUntypedByEntityId(entityId, recheckCutoff);
|
|
8207
|
+
return { ...zeroed, remaining: counts.eligible, deferred: counts.deferred };
|
|
8109
8208
|
}
|
|
8110
|
-
const classifierMode =
|
|
8209
|
+
const classifierMode = resolveSystemOneTyping(this.options.config, options?.classifier);
|
|
8111
8210
|
const classify = this.options.llmProvider.classify;
|
|
8112
8211
|
if (classifierMode === "auto" && typeof classify === "function") {
|
|
8113
8212
|
const slugs = effectiveManifest.node_types.map((n) => n.type);
|
|
8114
|
-
if (slugs.length > 0 && slugs.length <=
|
|
8115
|
-
|
|
8213
|
+
if (slugs.length > 0 && slugs.length + 1 <= CLASSIFIER_MAX_CHOICES && !slugs.some((s) => isReservedAbstainSlug(s))) {
|
|
8214
|
+
const classifierRun = await this._runClassifierBackfill(
|
|
8215
|
+
entityId,
|
|
8216
|
+
candidates,
|
|
8217
|
+
effectiveManifest,
|
|
8218
|
+
now,
|
|
8219
|
+
recheckCutoff,
|
|
8220
|
+
options?.meter,
|
|
8221
|
+
trigger
|
|
8222
|
+
);
|
|
8223
|
+
if (classifierRun.abortedOntologyOff || classifierRun.result.budgetStop) {
|
|
8224
|
+
return classifierRun.result;
|
|
8225
|
+
}
|
|
8226
|
+
if (classifierRun.escalated.length > 0 && this.resolveSystemOneOnLowConfidence() === "llm") {
|
|
8227
|
+
const { mode: liveMode } = await ontologyService.getEffectiveState(entityId);
|
|
8228
|
+
if (liveMode === "off") {
|
|
8229
|
+
const counts = await this.entryRepo.countUntypedByEntityId(entityId, recheckCutoff);
|
|
8230
|
+
return { ...zeroed, remaining: 0, deferred: counts.deferred };
|
|
8231
|
+
}
|
|
8232
|
+
const escalated = classifierRun.escalated;
|
|
8233
|
+
const generative = await this._runGenerativeBackfill(entityId, escalated, {
|
|
8234
|
+
promptOverride: options?.promptOverride,
|
|
8235
|
+
meter: options?.meter,
|
|
8236
|
+
trigger,
|
|
8237
|
+
batchSize: escalated.length
|
|
8238
|
+
});
|
|
8239
|
+
return {
|
|
8240
|
+
scanned: classifierRun.result.scanned,
|
|
8241
|
+
typed: classifierRun.result.typed + generative.typed,
|
|
8242
|
+
failedValidation: classifierRun.result.failedValidation + generative.failedValidation,
|
|
8243
|
+
edgesAdded: classifierRun.result.edgesAdded + generative.edgesAdded,
|
|
8244
|
+
abstained: classifierRun.result.abstained + generative.abstained,
|
|
8245
|
+
skipped: classifierRun.result.skipped + generative.skipped,
|
|
8246
|
+
remaining: generative.remaining,
|
|
8247
|
+
deferred: generative.deferred,
|
|
8248
|
+
...generative.budgetStop ? { budgetStop: generative.budgetStop } : {}
|
|
8249
|
+
};
|
|
8250
|
+
}
|
|
8251
|
+
return classifierRun.result;
|
|
8116
8252
|
}
|
|
8117
8253
|
}
|
|
8254
|
+
return this._runGenerativeBackfill(entityId, candidates, {
|
|
8255
|
+
promptOverride: options?.promptOverride,
|
|
8256
|
+
meter: options?.meter,
|
|
8257
|
+
trigger
|
|
8258
|
+
});
|
|
8259
|
+
}
|
|
8260
|
+
/**
|
|
8261
|
+
* Low-confidence routing (specs/system-one-config §4): `'leave'` (default)
|
|
8262
|
+
* keeps classifier abstains/low-confidence facts untyped and
|
|
8263
|
+
* cooldown-stamped; `'llm'` escalates them to the generative step. Invalid
|
|
8264
|
+
* config warns once and is treated as unset. Cost/quality setting, not a
|
|
8265
|
+
* safety mechanism — it cannot catch a confidently wrong classifier.
|
|
8266
|
+
*/
|
|
8267
|
+
resolveSystemOneOnLowConfidence() {
|
|
8268
|
+
const raw = this.options.config?.systemOne?.onLowConfidence;
|
|
8269
|
+
if (raw !== void 0 && raw !== "leave" && raw !== "llm") {
|
|
8270
|
+
warnOnce(
|
|
8271
|
+
`[core-llm-wiki] systemOne: \`systemOne.onLowConfidence\` is ${formatConfigValue(raw)}, which is not 'leave' or 'llm'. The key is treated as unset; the default ('leave') applies.`
|
|
8272
|
+
);
|
|
8273
|
+
return "leave";
|
|
8274
|
+
}
|
|
8275
|
+
return raw ?? "leave";
|
|
8276
|
+
}
|
|
8277
|
+
/**
|
|
8278
|
+
* Generative-mode backfill step: the original `generateText` pass over
|
|
8279
|
+
* `candidates`. Also the escalation target of the classifier step (§4) —
|
|
8280
|
+
* there `candidates` holds only the escalated facts and `batchSize` is
|
|
8281
|
+
* sized to send them in one batch.
|
|
8282
|
+
*/
|
|
8283
|
+
async _runGenerativeBackfill(entityId, candidates, runOpts) {
|
|
8284
|
+
runOpts.batchSize ?? ONTOLOGY_BACKFILL_BATCH_SIZE;
|
|
8285
|
+
const ontologyService = this.ontologyService;
|
|
8286
|
+
const now = Date.now();
|
|
8287
|
+
const recheckCutoff = now - ONTOLOGY_BACKFILL_RECHECK_MS;
|
|
8118
8288
|
const ontologyContext = await ontologyService.buildPromptContext(entityId);
|
|
8119
8289
|
const titleRows = await this.entryRepo.findTitleIndexByEntityId(entityId);
|
|
8120
8290
|
const titleCatalog = buildTitleCatalogBlock(titleRows);
|
|
8121
8291
|
const toPromptShape = (f) => ({ id: f.id, title: f.title, body: f.body, tags: f.tags });
|
|
8122
8292
|
const buildPrompt = (facts) => this.promptService.buildOntologyBackfillPrompt(
|
|
8123
8293
|
facts.map(toPromptShape),
|
|
8124
|
-
|
|
8294
|
+
runOpts.promptOverride,
|
|
8125
8295
|
ontologyContext,
|
|
8126
8296
|
titleCatalog
|
|
8127
8297
|
);
|
|
8128
8298
|
const outcome = await runBatched({
|
|
8129
8299
|
items: candidates,
|
|
8130
8300
|
buildPrompt,
|
|
8131
|
-
call: (prompts) => callLlm(this.options, { operation: "ontologyBackfill", entityId, trigger:
|
|
8301
|
+
call: (prompts) => callLlm(this.options, { operation: "ontologyBackfill", entityId, trigger: runOpts.trigger, meter: runOpts.meter }, prompts),
|
|
8132
8302
|
parse: (responseText, batch) => {
|
|
8133
8303
|
const parsed = parseJsonResponse(responseText);
|
|
8134
8304
|
return {
|
|
@@ -8144,7 +8314,7 @@ DROP TRIGGER IF EXISTS ${ad};`);
|
|
|
8144
8314
|
emitDiagnostic(this.options, {
|
|
8145
8315
|
entityId,
|
|
8146
8316
|
operation: "ontologyBackfill",
|
|
8147
|
-
trigger:
|
|
8317
|
+
trigger: runOpts.trigger,
|
|
8148
8318
|
code: "context_overflow_skipped",
|
|
8149
8319
|
detail: { factId: fact.id }
|
|
8150
8320
|
});
|
|
@@ -8159,9 +8329,12 @@ DROP TRIGGER IF EXISTS ${ad};`);
|
|
|
8159
8329
|
let failedValidation = 0;
|
|
8160
8330
|
let edgesAdded = 0;
|
|
8161
8331
|
let scanned = 0;
|
|
8332
|
+
let abstained = 0;
|
|
8162
8333
|
let abortedOntologyOff = false;
|
|
8334
|
+
const diagBuffer = new DiagnosticBuffer();
|
|
8335
|
+
const diagBase = { entityId, operation: "ontologyBackfill", trigger: runOpts.trigger };
|
|
8163
8336
|
for (const batchResult of outcome.results) {
|
|
8164
|
-
const applied = await this._applyOntologyBackfillBatch(entityId, batchResult, now);
|
|
8337
|
+
const applied = await this._applyOntologyBackfillBatch(entityId, batchResult, now, "llm", runOpts.trigger);
|
|
8165
8338
|
if (applied.abortedOntologyOff) {
|
|
8166
8339
|
abortedOntologyOff = true;
|
|
8167
8340
|
break;
|
|
@@ -8169,8 +8342,17 @@ DROP TRIGGER IF EXISTS ${ad};`);
|
|
|
8169
8342
|
typed += applied.typed;
|
|
8170
8343
|
failedValidation += applied.failedValidation;
|
|
8171
8344
|
edgesAdded += applied.edgesAdded;
|
|
8345
|
+
for (const factId of applied.omittedIds) {
|
|
8346
|
+
abstained += 1;
|
|
8347
|
+
diagBuffer.push({
|
|
8348
|
+
...diagBase,
|
|
8349
|
+
code: "classification_abstained",
|
|
8350
|
+
detail: { factId, writer: "llm" }
|
|
8351
|
+
});
|
|
8352
|
+
}
|
|
8172
8353
|
scanned += batchResult.batch.length;
|
|
8173
8354
|
}
|
|
8355
|
+
diagBuffer.flush(this.options);
|
|
8174
8356
|
if (abortedOntologyOff) {
|
|
8175
8357
|
const counts2 = await this.entryRepo.countUntypedByEntityId(entityId, recheckCutoff);
|
|
8176
8358
|
return {
|
|
@@ -8178,6 +8360,7 @@ DROP TRIGGER IF EXISTS ${ad};`);
|
|
|
8178
8360
|
typed,
|
|
8179
8361
|
failedValidation,
|
|
8180
8362
|
edgesAdded,
|
|
8363
|
+
abstained,
|
|
8181
8364
|
skipped: outcome.skipped.length,
|
|
8182
8365
|
remaining: 0,
|
|
8183
8366
|
deferred: counts2.deferred,
|
|
@@ -8202,6 +8385,7 @@ DROP TRIGGER IF EXISTS ${ad};`);
|
|
|
8202
8385
|
typed,
|
|
8203
8386
|
failedValidation,
|
|
8204
8387
|
edgesAdded,
|
|
8388
|
+
abstained,
|
|
8205
8389
|
skipped: outcome.skipped.length,
|
|
8206
8390
|
remaining: counts.eligible,
|
|
8207
8391
|
deferred: counts.deferred,
|
|
@@ -8209,20 +8393,24 @@ DROP TRIGGER IF EXISTS ${ad};`);
|
|
|
8209
8393
|
};
|
|
8210
8394
|
}
|
|
8211
8395
|
/**
|
|
8212
|
-
* Classifier-mode backfill (spec §7.3): one `choice` question per
|
|
8213
|
-
* fact over the effective manifest's node-type slugs
|
|
8214
|
-
*
|
|
8215
|
-
*
|
|
8396
|
+
* Classifier-mode backfill (spec §7.3, S1-0 §5): one `choice` question per
|
|
8397
|
+
* untyped fact over the effective manifest's node-type slugs plus the
|
|
8398
|
+
* reserved abstain sentinel. Accepted answers go through
|
|
8399
|
+
* `_applyOntologyBackfillBatch` exactly like LLM classifications. No edges
|
|
8400
|
+
* are proposed. Abstains and low-confidence answers are cooldown-stamped
|
|
8401
|
+
* omissions under `onLowConfidence: 'leave'`; under `'llm'` they are
|
|
8402
|
+
* returned un-stamped in `escalated` for the generative step. Always
|
|
8403
|
+
* returns the `OntologyBackfillResult` for its step plus escalation state.
|
|
8216
8404
|
*/
|
|
8217
|
-
async _runClassifierBackfill(entityId, candidates, manifest, now, recheckCutoff, meter) {
|
|
8218
|
-
const
|
|
8219
|
-
const minConfidence = typeof rawMin === "number" && Number.isFinite(rawMin) && rawMin >= 0 && rawMin <= 1 ? rawMin : 0.5;
|
|
8405
|
+
async _runClassifierBackfill(entityId, candidates, manifest, now, recheckCutoff, meter, trigger) {
|
|
8406
|
+
const minConfidence = resolveTypingMinConfidence(this.options.config);
|
|
8220
8407
|
const rawConcurrency = this.options.config?.chunkConcurrency ?? 1;
|
|
8221
8408
|
const concurrency = Number.isFinite(rawConcurrency) && rawConcurrency >= 1 ? Math.floor(rawConcurrency) : 1;
|
|
8222
8409
|
const question = {
|
|
8223
8410
|
kind: "choice",
|
|
8224
|
-
options: manifest.node_types.map((n) => n.type),
|
|
8225
|
-
instructions:
|
|
8411
|
+
options: [...manifest.node_types.map((n) => n.type), ONTOLOGY_ABSTAIN_SENTINEL],
|
|
8412
|
+
instructions: `Choose the ontology node type that best describes this fact, or choose "${ONTOLOGY_ABSTAIN_SENTINEL}" if none of the listed types fits.
|
|
8413
|
+
` + manifest.node_types.map((n) => `- ${n.type}: ${n.description}`).join("\n")
|
|
8226
8414
|
};
|
|
8227
8415
|
let stopped;
|
|
8228
8416
|
const outcomes = await withConcurrency(
|
|
@@ -8232,7 +8420,7 @@ DROP TRIGGER IF EXISTS ${ad};`);
|
|
|
8232
8420
|
try {
|
|
8233
8421
|
response = await callClassify(
|
|
8234
8422
|
this.options,
|
|
8235
|
-
{ operation: "ontologyBackfill", entityId, trigger
|
|
8423
|
+
{ operation: "ontologyBackfill", entityId, trigger, meter },
|
|
8236
8424
|
{ state: classifierStateForFact(fact), questions: { okf_type: question } }
|
|
8237
8425
|
);
|
|
8238
8426
|
} catch (err) {
|
|
@@ -8246,37 +8434,47 @@ DROP TRIGGER IF EXISTS ${ad};`);
|
|
|
8246
8434
|
const checked = validateClassifierAnswer(response, "okf_type", question);
|
|
8247
8435
|
if (!checked.ok) return { fact, kind: "invalid", reason: checked.reason };
|
|
8248
8436
|
if (checked.answer.kind !== "choice") return { fact, kind: "invalid", reason: "kind_mismatch" };
|
|
8437
|
+
if (isReservedAbstainSlug(checked.answer.choice)) return { fact, kind: "abstain" };
|
|
8249
8438
|
if (checked.answer.confidence < minConfidence) return { fact, kind: "low_confidence" };
|
|
8250
8439
|
return { fact, kind: "accepted", okfType: checked.answer.choice };
|
|
8251
8440
|
}),
|
|
8252
8441
|
concurrency
|
|
8253
8442
|
);
|
|
8254
|
-
const
|
|
8443
|
+
const escalate = this.resolveSystemOneOnLowConfidence() === "llm";
|
|
8444
|
+
const escalated = escalate ? outcomes.filter((o) => o.kind === "abstain" || o.kind === "low_confidence").map((o) => o.fact) : [];
|
|
8445
|
+
const isEscalated = (o) => escalate && (o.kind === "abstain" || o.kind === "low_confidence");
|
|
8446
|
+
const attempted = outcomes.filter((o) => o.kind !== "threw" && o.kind !== "unattempted" && !isEscalated(o)).map((o) => o.fact);
|
|
8255
8447
|
const unattemptedCount = outcomes.filter((o) => o.kind === "unattempted").length;
|
|
8256
8448
|
const skipped = outcomes.filter((o) => o.kind === "threw" || o.kind === "overflow_skip").length;
|
|
8257
8449
|
const classifications = outcomes.filter((o) => o.kind === "accepted").map((o) => ({ id: o.fact.id, okf_type: o.okfType }));
|
|
8258
8450
|
const invalidCount = outcomes.filter((o) => o.kind === "invalid").length;
|
|
8451
|
+
const abstainCount = outcomes.filter((o) => o.kind === "abstain" && !isEscalated(o)).length;
|
|
8259
8452
|
let typed = 0;
|
|
8260
8453
|
let failedValidation = 0;
|
|
8261
8454
|
let edgesAdded = 0;
|
|
8262
|
-
let
|
|
8455
|
+
let abortedOntologyOff = false;
|
|
8263
8456
|
if (attempted.length > 0) {
|
|
8264
8457
|
const applied = await this._applyOntologyBackfillBatch(
|
|
8265
8458
|
entityId,
|
|
8266
8459
|
{ batch: attempted, classifications, ontologyUpdates: void 0 },
|
|
8267
|
-
now
|
|
8460
|
+
now,
|
|
8461
|
+
"classifier",
|
|
8462
|
+
trigger
|
|
8268
8463
|
);
|
|
8269
|
-
|
|
8270
|
-
if (!
|
|
8464
|
+
abortedOntologyOff = applied.abortedOntologyOff;
|
|
8465
|
+
if (!abortedOntologyOff) {
|
|
8271
8466
|
typed = applied.typed;
|
|
8272
8467
|
failedValidation = invalidCount + applied.failedValidation;
|
|
8273
8468
|
edgesAdded = applied.edgesAdded;
|
|
8274
8469
|
}
|
|
8275
8470
|
}
|
|
8276
8471
|
const diagBuffer = new DiagnosticBuffer();
|
|
8277
|
-
const diagBase = { entityId, operation: "ontologyBackfill", trigger
|
|
8472
|
+
const diagBase = { entityId, operation: "ontologyBackfill", trigger };
|
|
8278
8473
|
for (const o of outcomes) {
|
|
8279
|
-
if (o.kind === "
|
|
8474
|
+
if (o.kind === "abstain") {
|
|
8475
|
+
if (isEscalated(o)) continue;
|
|
8476
|
+
diagBuffer.push({ ...diagBase, code: "classification_abstained", detail: { factId: o.fact.id, writer: "classifier" } });
|
|
8477
|
+
} else if (o.kind === "low_confidence") {
|
|
8280
8478
|
diagBuffer.push({ ...diagBase, code: "classification_low_confidence", detail: { factId: o.fact.id, reason: "below_threshold" } });
|
|
8281
8479
|
} else if (o.kind === "invalid") {
|
|
8282
8480
|
diagBuffer.push({ ...diagBase, code: "classification_invalid", detail: { factId: o.fact.id, reason: o.reason } });
|
|
@@ -8288,19 +8486,29 @@ DROP TRIGGER IF EXISTS ${ad};`);
|
|
|
8288
8486
|
}
|
|
8289
8487
|
diagBuffer.flush(this.options);
|
|
8290
8488
|
const counts = await this.entryRepo.countUntypedByEntityId(entityId, recheckCutoff);
|
|
8291
|
-
|
|
8292
|
-
|
|
8489
|
+
const budgetStop = stopped ? { requiredEstimate: stopped.requiredEstimate } : void 0;
|
|
8490
|
+
if (abortedOntologyOff) {
|
|
8491
|
+
return {
|
|
8492
|
+
result: { scanned: 0, typed: 0, failedValidation: 0, edgesAdded: 0, abstained: 0, skipped, remaining: 0, deferred: counts.deferred, ...budgetStop ? { budgetStop } : {} },
|
|
8493
|
+
escalated: [],
|
|
8494
|
+
abortedOntologyOff
|
|
8495
|
+
};
|
|
8293
8496
|
}
|
|
8294
8497
|
this.searchService.evictCache(entityId);
|
|
8295
8498
|
return {
|
|
8296
|
-
|
|
8297
|
-
|
|
8298
|
-
|
|
8299
|
-
|
|
8300
|
-
|
|
8301
|
-
|
|
8302
|
-
|
|
8303
|
-
|
|
8499
|
+
result: {
|
|
8500
|
+
scanned: candidates.length - unattemptedCount,
|
|
8501
|
+
typed,
|
|
8502
|
+
failedValidation,
|
|
8503
|
+
edgesAdded,
|
|
8504
|
+
abstained: abstainCount,
|
|
8505
|
+
skipped,
|
|
8506
|
+
remaining: counts.eligible,
|
|
8507
|
+
deferred: counts.deferred,
|
|
8508
|
+
...budgetStop ? { budgetStop } : {}
|
|
8509
|
+
},
|
|
8510
|
+
escalated,
|
|
8511
|
+
abortedOntologyOff: false
|
|
8304
8512
|
};
|
|
8305
8513
|
}
|
|
8306
8514
|
/**
|
|
@@ -8309,15 +8517,18 @@ DROP TRIGGER IF EXISTS ${ad};`);
|
|
|
8309
8517
|
* the mid-flight `mode === 'off'` abort check keep the shape they had when a
|
|
8310
8518
|
* pass was a single call.
|
|
8311
8519
|
*/
|
|
8312
|
-
async _applyOntologyBackfillBatch(entityId, batchResult, now) {
|
|
8520
|
+
async _applyOntologyBackfillBatch(entityId, batchResult, now, writer, trigger) {
|
|
8313
8521
|
const ontologyService = this.ontologyService;
|
|
8314
8522
|
const { batch, classifications, ontologyUpdates } = batchResult;
|
|
8315
8523
|
let typed = 0;
|
|
8316
8524
|
let failedValidation = 0;
|
|
8317
8525
|
let edgesAdded = 0;
|
|
8318
8526
|
let abortedOntologyOff = false;
|
|
8527
|
+
const typedIds = [];
|
|
8528
|
+
const omittedIds = [];
|
|
8529
|
+
const classifiedIds = /* @__PURE__ */ new Set();
|
|
8319
8530
|
const diagBuffer = new DiagnosticBuffer();
|
|
8320
|
-
const diagBase = { entityId, operation: "ontologyBackfill", trigger
|
|
8531
|
+
const diagBase = { entityId, operation: "ontologyBackfill", trigger };
|
|
8321
8532
|
await this.db.withTransactionAsync(async (tx) => {
|
|
8322
8533
|
let { mode: txMode, manifest } = await ontologyService.getEffectiveState(entityId, tx);
|
|
8323
8534
|
if (txMode === "off") {
|
|
@@ -8342,6 +8553,7 @@ DROP TRIGGER IF EXISTS ${ad};`);
|
|
|
8342
8553
|
continue;
|
|
8343
8554
|
}
|
|
8344
8555
|
applied.add(fact.id);
|
|
8556
|
+
classifiedIds.add(fact.id);
|
|
8345
8557
|
const validationDrops = [];
|
|
8346
8558
|
const normalized = ontologyService.validateAndNormalizeFact(
|
|
8347
8559
|
{
|
|
@@ -8363,8 +8575,17 @@ DROP TRIGGER IF EXISTS ${ad};`);
|
|
|
8363
8575
|
continue;
|
|
8364
8576
|
}
|
|
8365
8577
|
const result = await this.entryRepo.updateOkfType(fact.id, entityId, normalized.okf_type, tx);
|
|
8366
|
-
if (result.changes === 0)
|
|
8578
|
+
if (result.changes === 0) {
|
|
8579
|
+
omittedIds.push(fact.id);
|
|
8580
|
+
continue;
|
|
8581
|
+
}
|
|
8367
8582
|
typed++;
|
|
8583
|
+
typedIds.push(fact.id);
|
|
8584
|
+
diagBuffer.push({
|
|
8585
|
+
...diagBase,
|
|
8586
|
+
code: "node_type_assigned",
|
|
8587
|
+
detail: { factId: fact.id, okfType: normalized.okf_type, writer }
|
|
8588
|
+
});
|
|
8368
8589
|
titleIndex.set(normalizeTitleKey(fact.title), { id: fact.id, okf_type: normalized.okf_type });
|
|
8369
8590
|
if (normalized.edges.length > 0) {
|
|
8370
8591
|
pendingEdges.push({ sourceId: fact.id, sourceType: normalized.okf_type, edges: normalized.edges });
|
|
@@ -8390,8 +8611,13 @@ DROP TRIGGER IF EXISTS ${ad};`);
|
|
|
8390
8611
|
}
|
|
8391
8612
|
await this.entryRepo.markOntologyChecked(batch.map((f) => f.id), entityId, now, tx);
|
|
8392
8613
|
});
|
|
8614
|
+
if (!abortedOntologyOff) {
|
|
8615
|
+
for (const fact of batch) {
|
|
8616
|
+
if (!classifiedIds.has(fact.id)) omittedIds.push(fact.id);
|
|
8617
|
+
}
|
|
8618
|
+
}
|
|
8393
8619
|
diagBuffer.flush(this.options);
|
|
8394
|
-
return { typed, failedValidation, edgesAdded, abortedOntologyOff };
|
|
8620
|
+
return { typed, failedValidation, edgesAdded, abortedOntologyOff, typedIds, omittedIds };
|
|
8395
8621
|
}
|
|
8396
8622
|
_validatePruneDuration(value, name) {
|
|
8397
8623
|
if (value !== null && value !== void 0 && (typeof value !== "number" || !isFinite(value) || value < 0)) {
|
|
@@ -11028,6 +11254,6 @@ var WriteService = class {
|
|
|
11028
11254
|
}
|
|
11029
11255
|
};
|
|
11030
11256
|
|
|
11031
|
-
export { BaseRepository, CURRENT_SCHEMA_VERSION, CheckpointIncompleteError, DEFAULT_CHUNK_OVERLAP, DEFAULT_MAX_CHUNK_LENGTH, DEFAULT_MAX_EMBED_CHARS, DiagnosticBuffer, EMBED_CHARS_CEILING, EdgeRepository, EmbeddingService, EraseStepError, FTS5_DRAIN_CHUNK, FTS5_REBUILD_SNAPSHOT_KEY, FTS5_REBUILD_WM_KEY, FTS5_RECLAIM_MERGE_PAGES, FTS5_RETIRED_COUNTER_KEY, FTS5_RETIRED_TABLES_KEY, FTS5_STATE_KEY, FTS5_SWEEP_CURSOR_KEY, HEAL_ANCHORS_PER_CANDIDATE, HEAL_BATCH_SIZE, HEAL_MAX_FACT_BODY_CHARS_L3, HEAL_MAX_TASKS, HEAL_RECHECK_MS, HOOK_TIMEOUT_MARKER, ImportExportService, IngestionService, JobManager, MAX_EMBED_ATTEMPTS, MIGRATIONS, MaintenanceService, MetadataRepository, ONTOLOGY_BACKFILL_BATCH_SIZE, ONTOLOGY_BACKFILL_MAX_PROMPT_CHARS, ONTOLOGY_BACKFILL_RECHECK_MS, ONTOLOGY_BACKFILL_SYSTEM_PROMPT, PromptService, PrunePartialFailureError, RetrievalService, SearchService, SourceStoreService, TemporalService, UnavailableIndexStrategy, UsageMeter, VectorRemovalRepository, VectorRemovalService, WikiBusyError, WikiDraftNotFound, WikiDuplicateHashError, WikiExternalDeletionError, WikiGraphNodeOwnershipConflict, WikiIngestEmptyError, WikiInvalidReadOptions, WikiMigrationRequiredError, WikiParseError, WikiSearchUnavailableError, WikiSourceRefHashCollision, WikiStrictOntologyViolation, WikiSupersedeError, WikiTransactionError, WriteService, __privateAdd, __privateGet, __privateSet, assertEntityId, assertEpochMs, chunkText, configureRandomSource, createLegacySourceTypeIndex, createdAtValue, detectSchemaVersion, drainChunkSql, drainHiSql, edgeTripleAllowed, emitDiagnostic, emptyManifest, entityDrainChunkSql, entityDrainHiSql, entitySummaryMetaKey, extractSqliteCode, factTokenCost, fts5LedgerDropSql, fts5PendingIndexesDdl, fts5TablesDdl, fts5TriggerNames, fts5TriggersDdl, generateId, idDrainChunkSql, idReindexChunkSql, isLiveAt, isRetiredTableName, isUsableDate, isWikiSearchUnavailableError, liveAtSql, normalizeSourceHash, normalizeSourceRef, normalizeTitleKey, packFactsByBudget, parseEmbedding, parseJsonArray, parseJsonObject, parseStoredSourcePointer, passageFtsTablesDdl, passageFtsTriggerNames, passageFtsTriggersDdl, probePendingWork, readRebuildProgress, reanchorRebuildFingerprint, resolveEdgeDefinitions, resolveGrounding, resolveLibrarianStrategy, resolveNodeType, retiredTableName, runSourceRefNormalize, safeSlice, serializeSourcePointer, setupDatabase, sweepChunkSql, sweepHiSql, typeSatisfies, validUsage, validateInlineEdges, validateManifest, validateSourcePointerValue, warnChangedDefaultsOnce, windowChunkSql, windowHiSql, writeNormalizeStamp, writeRebuildStart };
|
|
11032
|
-
//# sourceMappingURL=chunk-
|
|
11033
|
-
//# sourceMappingURL=chunk-
|
|
11257
|
+
export { BaseRepository, CLASSIFIER_MAX_CHOICES, CURRENT_SCHEMA_VERSION, CheckpointIncompleteError, DEFAULT_CHUNK_OVERLAP, DEFAULT_MAX_CHUNK_LENGTH, DEFAULT_MAX_EMBED_CHARS, DEFAULT_TYPING_MIN_CONFIDENCE, DiagnosticBuffer, EMBED_CHARS_CEILING, EdgeRepository, EmbeddingService, EraseStepError, FTS5_DRAIN_CHUNK, FTS5_REBUILD_SNAPSHOT_KEY, FTS5_REBUILD_WM_KEY, FTS5_RECLAIM_MERGE_PAGES, FTS5_RETIRED_COUNTER_KEY, FTS5_RETIRED_TABLES_KEY, FTS5_STATE_KEY, FTS5_SWEEP_CURSOR_KEY, HEAL_ANCHORS_PER_CANDIDATE, HEAL_BATCH_SIZE, HEAL_MAX_FACT_BODY_CHARS_L3, HEAL_MAX_TASKS, HEAL_RECHECK_MS, HOOK_TIMEOUT_MARKER, ImportExportService, IngestionService, JobManager, MAX_EMBED_ATTEMPTS, MIGRATIONS, MaintenanceService, MetadataRepository, ONTOLOGY_ABSTAIN_SENTINEL, ONTOLOGY_BACKFILL_BATCH_SIZE, ONTOLOGY_BACKFILL_MAX_PROMPT_CHARS, ONTOLOGY_BACKFILL_RECHECK_MS, ONTOLOGY_BACKFILL_SYSTEM_PROMPT, PromptService, PrunePartialFailureError, RetrievalService, SearchService, SourceStoreService, TemporalService, UnavailableIndexStrategy, UsageMeter, VectorRemovalRepository, VectorRemovalService, WikiBusyError, WikiDraftNotFound, WikiDuplicateHashError, WikiExternalDeletionError, WikiGraphNodeOwnershipConflict, WikiIngestEmptyError, WikiInvalidReadOptions, WikiMigrationRequiredError, WikiParseError, WikiSearchUnavailableError, WikiSourceRefHashCollision, WikiStrictOntologyViolation, WikiSupersedeError, WikiTransactionError, WriteService, __privateAdd, __privateGet, __privateSet, assertEntityId, assertEpochMs, chunkText, configureRandomSource, createLegacySourceTypeIndex, createdAtValue, detectSchemaVersion, drainChunkSql, drainHiSql, edgeTripleAllowed, emitDiagnostic, emptyManifest, entityDrainChunkSql, entityDrainHiSql, entitySummaryMetaKey, extractSqliteCode, factTokenCost, fts5LedgerDropSql, fts5PendingIndexesDdl, fts5TablesDdl, fts5TriggerNames, fts5TriggersDdl, generateId, idDrainChunkSql, idReindexChunkSql, isLiveAt, isReservedAbstainSlug, isRetiredTableName, isUsableDate, isWikiSearchUnavailableError, liveAtSql, normalizeSourceHash, normalizeSourceRef, normalizeTitleKey, packFactsByBudget, parseEmbedding, parseJsonArray, parseJsonObject, parseStoredSourcePointer, passageFtsTablesDdl, passageFtsTriggerNames, passageFtsTriggersDdl, probePendingWork, readRebuildProgress, reanchorRebuildFingerprint, resolveEdgeDefinitions, resolveGrounding, resolveLibrarianStrategy, resolveNodeType, resolveSystemOneTyping, resolveTypingMinConfidence, retiredTableName, runSourceRefNormalize, safeSlice, serializeSourcePointer, setupDatabase, sweepChunkSql, sweepHiSql, typeSatisfies, validUsage, validateInlineEdges, validateManifest, validateSourcePointerValue, warnChangedDefaultsOnce, warnOnce, windowChunkSql, windowHiSql, writeNormalizeStamp, writeRebuildStart };
|
|
11258
|
+
//# sourceMappingURL=chunk-TZMLWQ3G.mjs.map
|
|
11259
|
+
//# sourceMappingURL=chunk-TZMLWQ3G.mjs.map
|