dsh-fundus 0.1.1 → 0.1.2

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/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // src/shared/types.ts
2
2
  var PLUGIN = "dsh-fundus";
3
- var VERSION = "0.1.1";
3
+ var VERSION = "0.1.2";
4
4
 
5
5
  // src/core/config.ts
6
6
  import { homedir } from "node:os";
@@ -874,7 +874,18 @@ CREATE VIRTUAL TABLE IF NOT EXISTS fundus_fts USING fts5(
874
874
  if (!sheet) continue;
875
875
  for (const block of sheet.blocks) {
876
876
  blockSheetMap.set(block.id, sheetId);
877
- if (!block.provenance) continue;
877
+ if (!block.provenance) {
878
+ if (block.type === "source_text") {
879
+ warnings.push({
880
+ code: "FUNDUS_UNSOURCED_QUOTE_BLOCK",
881
+ severity: "warn",
882
+ sheetId,
883
+ blockId: block.id,
884
+ message: `Block ${block.id} (source_text) has no provenance metadata attached.`
885
+ });
886
+ }
887
+ continue;
888
+ }
878
889
  const text = galleyInlinesToText(block.body);
879
890
  const res = this.verifyQuote({ text, provenance: block.provenance });
880
891
  if (!res.ok) {
@@ -885,6 +896,14 @@ CREATE VIRTUAL TABLE IF NOT EXISTS fundus_fts USING fts5(
885
896
  blockId: block.id,
886
897
  message: `Block ${block.id} provenance ${block.provenance.sourceId}: ${res.message ?? res.code}`
887
898
  });
899
+ } else if (res.code === "NON_FUNDUS_ID") {
900
+ warnings.push({
901
+ code: "FUNDUS_UNVERIFIED_EXTERNAL_ID",
902
+ severity: "warn",
903
+ sheetId,
904
+ blockId: block.id,
905
+ message: `Block ${block.id} provenance "${res.sourceId}" is an unverified external reference (not a Fundus pas-*/src-* ID).`
906
+ });
888
907
  }
889
908
  }
890
909
  }
@@ -901,6 +920,14 @@ CREATE VIRTUAL TABLE IF NOT EXISTS fundus_fts USING fts5(
901
920
  blockId: ann.blockId,
902
921
  message: `Annotation ${ann.id} (block ${ann.blockId}) provenance ${ann.provenance.sourceId}: ${res.message ?? res.code}`
903
922
  });
923
+ } else if (res.code === "NON_FUNDUS_ID") {
924
+ warnings.push({
925
+ code: "FUNDUS_UNVERIFIED_EXTERNAL_ID",
926
+ severity: "warn",
927
+ sheetId: blockSheetMap.get(ann.blockId),
928
+ blockId: ann.blockId,
929
+ message: `Annotation ${ann.id} (block ${ann.blockId}) provenance "${res.sourceId}" is an unverified external reference (not a Fundus pas-*/src-* ID).`
930
+ });
904
931
  }
905
932
  }
906
933
  }