@equationalapplications/core-llm-wiki 6.0.0 → 6.1.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 { __privateAdd, MetadataRepository, EmbeddingService, SearchService, JobManager, PromptService, IngestionService, MaintenanceService, ImportExportService, RetrievalService, WriteService, __privateGet, __privateSet, normalizeSourceRef, normalizeSourceHash, entitySummaryMetaKey, WikiSourceRefHashCollision, generateId, BaseRepository, emptyManifest, resolveNodeType, WikiStrictOntologyViolation, validateInlineEdges, resolveEdgeDefinitions, normalizeTitleKey, WikiTransactionError, extractSqliteCode } from './chunk-HREQ6F6Z.mjs';
2
- export { DEFAULT_CHUNK_OVERLAP, DEFAULT_MAX_CHUNK_LENGTH, HEAL_ANCHORS_PER_CANDIDATE, HEAL_BATCH_SIZE, HEAL_MAX_FACT_BODY_CHARS_L3, HEAL_MAX_TASKS, HEAL_RECHECK_MS, HOOK_TIMEOUT_MARKER, ONTOLOGY_BACKFILL_BATCH_SIZE, ONTOLOGY_BACKFILL_MAX_PROMPT_CHARS, ONTOLOGY_BACKFILL_RECHECK_MS, ONTOLOGY_BACKFILL_SYSTEM_PROMPT, PromptService, PrunePartialFailureError, WikiBusyError, WikiDuplicateHashError, WikiIngestEmptyError, WikiParseError, WikiSourceRefHashCollision, WikiStrictOntologyViolation, WikiTransactionError, chunkText, configureRandomSource, parseEmbedding, safeSlice, validateManifest } from './chunk-HREQ6F6Z.mjs';
1
+ import { __privateAdd, MetadataRepository, EmbeddingService, SearchService, JobManager, PromptService, IngestionService, MaintenanceService, ImportExportService, RetrievalService, WriteService, __privateGet, __privateSet, normalizeSourceRef, normalizeSourceHash, entitySummaryMetaKey, WikiSourceRefHashCollision, generateId, BaseRepository, validateManifest, emptyManifest, resolveNodeType, WikiStrictOntologyViolation, validateInlineEdges, resolveEdgeDefinitions, typeSatisfies, normalizeTitleKey, WikiTransactionError, extractSqliteCode } from './chunk-YEESP6J2.mjs';
2
+ export { DEFAULT_CHUNK_OVERLAP, DEFAULT_MAX_CHUNK_LENGTH, HEAL_ANCHORS_PER_CANDIDATE, HEAL_BATCH_SIZE, HEAL_MAX_FACT_BODY_CHARS_L3, HEAL_MAX_TASKS, HEAL_RECHECK_MS, HOOK_TIMEOUT_MARKER, ONTOLOGY_BACKFILL_BATCH_SIZE, ONTOLOGY_BACKFILL_MAX_PROMPT_CHARS, ONTOLOGY_BACKFILL_RECHECK_MS, ONTOLOGY_BACKFILL_SYSTEM_PROMPT, PromptService, PrunePartialFailureError, WikiBusyError, WikiDuplicateHashError, WikiIngestEmptyError, WikiParseError, WikiSourceRefHashCollision, WikiStrictOntologyViolation, WikiTransactionError, chunkText, configureRandomSource, parseEmbedding, safeSlice, validateManifest } from './chunk-YEESP6J2.mjs';
3
3
  import { appendRelatedSection, buildConceptDocument, buildLogMd, buildEntityIndexMd, buildRootIndexMd, isAllowedOkfPath, parseRootIndexMd, parseEntityIndexMd, parseConcept, splitRelatedSection, extractMarkdownLinks, parseLogMd, parseEventIdComment, latestVerified, formatSourcesJson, appendEventIdComment, parseVerifiedFlexible, parseCitationsList, deriveTrustTier, isStaleAfter } from '@equationalapplications/core-okf';
4
4
 
5
5
  // src/db/schema.ts
@@ -2305,7 +2305,7 @@ Each fact may optionally include:
2305
2305
  var EMERGENT_EXTRA = `
2306
2306
  You may also return "ontology_updates" to propose new types:
2307
2307
  "ontology_updates": {
2308
- "node_types": [{ "type": "slug", "description": "..." }],
2308
+ "node_types": [{ "type": "slug", "description": "...", "parent_type": "optional existing slug" }],
2309
2309
  "edge_types": [{ "type": "slug", "source_type": "...", "target_type": "...", "description": "..." }]
2310
2310
  }
2311
2311
  Only propose types not already in the manifest. Do not redefine existing types.`;
@@ -2351,6 +2351,7 @@ var OntologyService = class {
2351
2351
  }
2352
2352
  const seed = this.ontologyConfig?.seedManifests?.[entityId];
2353
2353
  if (seed) {
2354
+ validateManifest(seed.manifest);
2354
2355
  const state = {
2355
2356
  mode: this.resolveMode(seed.mode),
2356
2357
  manifest: seed.manifest
@@ -2397,14 +2398,13 @@ var OntologyService = class {
2397
2398
  if (!sourceType || edges.length === 0) return [];
2398
2399
  const out = [];
2399
2400
  for (const edge of edges) {
2400
- const candidates = resolveEdgeDefinitions(edge.edge_type, manifest).filter((d) => d.source_type.toLowerCase() === sourceType.toLowerCase());
2401
+ const candidates = resolveEdgeDefinitions(edge.edge_type, manifest).filter((d) => typeSatisfies(d.source_type, sourceType, manifest));
2401
2402
  if (candidates.length === 0) continue;
2402
2403
  const targetKey = normalizeTitleKey(edge.target_title);
2403
2404
  const target = titleIndex.get(targetKey);
2404
2405
  if (!target) continue;
2405
- const def = candidates.find(
2406
- (d) => d.target_type.toLowerCase() === (target.okf_type ?? "").toLowerCase()
2407
- );
2406
+ const targetType = (target.okf_type ?? "").trim().toLowerCase();
2407
+ const def = candidates.find((d) => d.target_type.trim().toLowerCase() === targetType) ?? candidates.find((d) => typeSatisfies(d.target_type, targetType, manifest));
2408
2408
  if (!def) continue;
2409
2409
  out.push({
2410
2410
  id: generateId(),