@happyvertical/smrt-facts 0.40.69 → 0.41.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/AGENTS.md +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +145 -79
- package/dist/smrt-knowledge.json +19 -7
- package/package.json +6 -5
package/dist/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"version": "1.0.0",
|
|
3
3
|
"timestamp": 0,
|
|
4
4
|
"packageName": "@happyvertical/smrt-facts",
|
|
5
|
-
"packageVersion": "0.
|
|
5
|
+
"packageVersion": "0.41.0",
|
|
6
6
|
"objects": {
|
|
7
7
|
"@happyvertical/smrt-facts:FactContent": {
|
|
8
8
|
"name": "factcontent",
|
|
@@ -226,12 +226,6 @@
|
|
|
226
226
|
}
|
|
227
227
|
},
|
|
228
228
|
"indexes": [
|
|
229
|
-
{
|
|
230
|
-
"name": "fact_contents_id_idx",
|
|
231
|
-
"columns": [
|
|
232
|
-
"id"
|
|
233
|
-
]
|
|
234
|
-
},
|
|
235
229
|
{
|
|
236
230
|
"name": "fact_contents_fact_id_content_id_idx",
|
|
237
231
|
"columns": [
|
|
@@ -240,6 +234,26 @@
|
|
|
240
234
|
"relationship"
|
|
241
235
|
],
|
|
242
236
|
"unique": true
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"name": "fact_contents_slug_context_idx",
|
|
240
|
+
"columns": [
|
|
241
|
+
"slug",
|
|
242
|
+
"context"
|
|
243
|
+
]
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"name": "fact_contents_tenant_id_created_at_idx",
|
|
247
|
+
"columns": [
|
|
248
|
+
"tenant_id",
|
|
249
|
+
"created_at"
|
|
250
|
+
]
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"name": "fact_contents_content_id_idx",
|
|
254
|
+
"columns": [
|
|
255
|
+
"content_id"
|
|
256
|
+
]
|
|
243
257
|
}
|
|
244
258
|
],
|
|
245
259
|
"version": "e74eafde"
|
|
@@ -437,12 +451,6 @@
|
|
|
437
451
|
}
|
|
438
452
|
},
|
|
439
453
|
"indexes": [
|
|
440
|
-
{
|
|
441
|
-
"name": "fact_content_collections_id_idx",
|
|
442
|
-
"columns": [
|
|
443
|
-
"id"
|
|
444
|
-
]
|
|
445
|
-
},
|
|
446
454
|
{
|
|
447
455
|
"name": "fact_content_collections_slug_context_idx",
|
|
448
456
|
"columns": [
|
|
@@ -450,6 +458,12 @@
|
|
|
450
458
|
"context"
|
|
451
459
|
],
|
|
452
460
|
"unique": true
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
"name": "fact_content_collections_created_at_idx",
|
|
464
|
+
"columns": [
|
|
465
|
+
"created_at"
|
|
466
|
+
]
|
|
453
467
|
}
|
|
454
468
|
],
|
|
455
469
|
"version": "22be8f54"
|
|
@@ -524,7 +538,7 @@
|
|
|
524
538
|
"default": ""
|
|
525
539
|
},
|
|
526
540
|
"confidence": {
|
|
527
|
-
"type": "
|
|
541
|
+
"type": "decimal",
|
|
528
542
|
"required": false,
|
|
529
543
|
"default": 0
|
|
530
544
|
},
|
|
@@ -646,7 +660,7 @@
|
|
|
646
660
|
],
|
|
647
661
|
"schema": {
|
|
648
662
|
"tableName": "fact_evidences",
|
|
649
|
-
"ddl": "CREATE TABLE IF NOT EXISTS \"fact_evidences\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"fact_id\" UUID NOT NULL,\n \"evidence_key\" TEXT NOT NULL DEFAULT '',\n \"status\" TEXT NOT NULL DEFAULT 'supports',\n \"source_kind\" TEXT DEFAULT '',\n \"source_id\" TEXT DEFAULT '',\n \"source_url\" TEXT DEFAULT '',\n \"source_title\" TEXT DEFAULT '',\n \"quote\" TEXT DEFAULT '',\n \"locator\" TEXT DEFAULT '',\n \"extraction_method\" TEXT DEFAULT '',\n \"confidence\"
|
|
663
|
+
"ddl": "CREATE TABLE IF NOT EXISTS \"fact_evidences\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"fact_id\" UUID NOT NULL,\n \"evidence_key\" TEXT NOT NULL DEFAULT '',\n \"status\" TEXT NOT NULL DEFAULT 'supports',\n \"source_kind\" TEXT DEFAULT '',\n \"source_id\" TEXT DEFAULT '',\n \"source_url\" TEXT DEFAULT '',\n \"source_title\" TEXT DEFAULT '',\n \"quote\" TEXT DEFAULT '',\n \"locator\" TEXT DEFAULT '',\n \"extraction_method\" TEXT DEFAULT '',\n \"confidence\" REAL DEFAULT 0,\n \"metadata\" TEXT DEFAULT '',\n \"tenant_id\" UUID\n);",
|
|
650
664
|
"columns": {
|
|
651
665
|
"id": {
|
|
652
666
|
"type": "UUID",
|
|
@@ -734,7 +748,7 @@
|
|
|
734
748
|
"default": ""
|
|
735
749
|
},
|
|
736
750
|
"confidence": {
|
|
737
|
-
"type": "
|
|
751
|
+
"type": "REAL",
|
|
738
752
|
"notNull": false,
|
|
739
753
|
"unique": false,
|
|
740
754
|
"default": 0
|
|
@@ -753,12 +767,6 @@
|
|
|
753
767
|
}
|
|
754
768
|
},
|
|
755
769
|
"indexes": [
|
|
756
|
-
{
|
|
757
|
-
"name": "fact_evidences_id_idx",
|
|
758
|
-
"columns": [
|
|
759
|
-
"id"
|
|
760
|
-
]
|
|
761
|
-
},
|
|
762
770
|
{
|
|
763
771
|
"name": "fact_evidences_fact_id_evidence_key_idx",
|
|
764
772
|
"columns": [
|
|
@@ -766,9 +774,23 @@
|
|
|
766
774
|
"evidence_key"
|
|
767
775
|
],
|
|
768
776
|
"unique": true
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
"name": "fact_evidences_slug_context_idx",
|
|
780
|
+
"columns": [
|
|
781
|
+
"slug",
|
|
782
|
+
"context"
|
|
783
|
+
]
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
"name": "fact_evidences_tenant_id_created_at_idx",
|
|
787
|
+
"columns": [
|
|
788
|
+
"tenant_id",
|
|
789
|
+
"created_at"
|
|
790
|
+
]
|
|
769
791
|
}
|
|
770
792
|
],
|
|
771
|
-
"version": "
|
|
793
|
+
"version": "5554e681"
|
|
772
794
|
}
|
|
773
795
|
},
|
|
774
796
|
"@happyvertical/smrt-facts:FactEvidenceCollection": {
|
|
@@ -923,12 +945,6 @@
|
|
|
923
945
|
}
|
|
924
946
|
},
|
|
925
947
|
"indexes": [
|
|
926
|
-
{
|
|
927
|
-
"name": "fact_evidences_id_idx",
|
|
928
|
-
"columns": [
|
|
929
|
-
"id"
|
|
930
|
-
]
|
|
931
|
-
},
|
|
932
948
|
{
|
|
933
949
|
"name": "fact_evidences_slug_context_idx",
|
|
934
950
|
"columns": [
|
|
@@ -936,6 +952,12 @@
|
|
|
936
952
|
"context"
|
|
937
953
|
],
|
|
938
954
|
"unique": true
|
|
955
|
+
},
|
|
956
|
+
{
|
|
957
|
+
"name": "fact_evidences_created_at_idx",
|
|
958
|
+
"columns": [
|
|
959
|
+
"created_at"
|
|
960
|
+
]
|
|
939
961
|
}
|
|
940
962
|
],
|
|
941
963
|
"version": "80329e4f"
|
|
@@ -1576,7 +1598,13 @@
|
|
|
1576
1598
|
"cli": true,
|
|
1577
1599
|
"tenantScoped": {
|
|
1578
1600
|
"mode": "optional"
|
|
1579
|
-
}
|
|
1601
|
+
},
|
|
1602
|
+
"conflictColumns": [
|
|
1603
|
+
"tenant_id",
|
|
1604
|
+
"slug",
|
|
1605
|
+
"context",
|
|
1606
|
+
"_meta_type"
|
|
1607
|
+
]
|
|
1580
1608
|
},
|
|
1581
1609
|
"extends": "SmrtObject",
|
|
1582
1610
|
"exportName": "FactSource",
|
|
@@ -1666,15 +1694,10 @@
|
|
|
1666
1694
|
}
|
|
1667
1695
|
},
|
|
1668
1696
|
"indexes": [
|
|
1669
|
-
{
|
|
1670
|
-
"name": "fact_sources_id_idx",
|
|
1671
|
-
"columns": [
|
|
1672
|
-
"id"
|
|
1673
|
-
]
|
|
1674
|
-
},
|
|
1675
1697
|
{
|
|
1676
1698
|
"name": "fact_sources_slug_context_meta_type_idx",
|
|
1677
1699
|
"columns": [
|
|
1700
|
+
"tenant_id",
|
|
1678
1701
|
"slug",
|
|
1679
1702
|
"context",
|
|
1680
1703
|
"_meta_type"
|
|
@@ -1686,6 +1709,19 @@
|
|
|
1686
1709
|
"columns": [
|
|
1687
1710
|
"_meta_type"
|
|
1688
1711
|
]
|
|
1712
|
+
},
|
|
1713
|
+
{
|
|
1714
|
+
"name": "fact_sources_tenant_id_created_at_idx",
|
|
1715
|
+
"columns": [
|
|
1716
|
+
"tenant_id",
|
|
1717
|
+
"created_at"
|
|
1718
|
+
]
|
|
1719
|
+
},
|
|
1720
|
+
{
|
|
1721
|
+
"name": "fact_sources_fact_id_idx",
|
|
1722
|
+
"columns": [
|
|
1723
|
+
"fact_id"
|
|
1724
|
+
]
|
|
1689
1725
|
}
|
|
1690
1726
|
],
|
|
1691
1727
|
"version": "7f9f04b2"
|
|
@@ -1843,12 +1879,6 @@
|
|
|
1843
1879
|
}
|
|
1844
1880
|
},
|
|
1845
1881
|
"indexes": [
|
|
1846
|
-
{
|
|
1847
|
-
"name": "fact_source_collections_id_idx",
|
|
1848
|
-
"columns": [
|
|
1849
|
-
"id"
|
|
1850
|
-
]
|
|
1851
|
-
},
|
|
1852
1882
|
{
|
|
1853
1883
|
"name": "fact_source_collections_slug_context_idx",
|
|
1854
1884
|
"columns": [
|
|
@@ -1856,6 +1886,12 @@
|
|
|
1856
1886
|
"context"
|
|
1857
1887
|
],
|
|
1858
1888
|
"unique": true
|
|
1889
|
+
},
|
|
1890
|
+
{
|
|
1891
|
+
"name": "fact_source_collections_created_at_idx",
|
|
1892
|
+
"columns": [
|
|
1893
|
+
"created_at"
|
|
1894
|
+
]
|
|
1859
1895
|
}
|
|
1860
1896
|
],
|
|
1861
1897
|
"version": "36f4adef"
|
|
@@ -2097,12 +2133,6 @@
|
|
|
2097
2133
|
}
|
|
2098
2134
|
},
|
|
2099
2135
|
"indexes": [
|
|
2100
|
-
{
|
|
2101
|
-
"name": "fact_subjects_id_idx",
|
|
2102
|
-
"columns": [
|
|
2103
|
-
"id"
|
|
2104
|
-
]
|
|
2105
|
-
},
|
|
2106
2136
|
{
|
|
2107
2137
|
"name": "fact_subjects_fact_id_entity_type_idx",
|
|
2108
2138
|
"columns": [
|
|
@@ -2111,6 +2141,20 @@
|
|
|
2111
2141
|
"entity_id"
|
|
2112
2142
|
],
|
|
2113
2143
|
"unique": true
|
|
2144
|
+
},
|
|
2145
|
+
{
|
|
2146
|
+
"name": "fact_subjects_slug_context_idx",
|
|
2147
|
+
"columns": [
|
|
2148
|
+
"slug",
|
|
2149
|
+
"context"
|
|
2150
|
+
]
|
|
2151
|
+
},
|
|
2152
|
+
{
|
|
2153
|
+
"name": "fact_subjects_tenant_id_created_at_idx",
|
|
2154
|
+
"columns": [
|
|
2155
|
+
"tenant_id",
|
|
2156
|
+
"created_at"
|
|
2157
|
+
]
|
|
2114
2158
|
}
|
|
2115
2159
|
],
|
|
2116
2160
|
"version": "979731eb"
|
|
@@ -2318,12 +2362,6 @@
|
|
|
2318
2362
|
}
|
|
2319
2363
|
},
|
|
2320
2364
|
"indexes": [
|
|
2321
|
-
{
|
|
2322
|
-
"name": "fact_subject_collections_id_idx",
|
|
2323
|
-
"columns": [
|
|
2324
|
-
"id"
|
|
2325
|
-
]
|
|
2326
|
-
},
|
|
2327
2365
|
{
|
|
2328
2366
|
"name": "fact_subject_collections_slug_context_idx",
|
|
2329
2367
|
"columns": [
|
|
@@ -2331,6 +2369,12 @@
|
|
|
2331
2369
|
"context"
|
|
2332
2370
|
],
|
|
2333
2371
|
"unique": true
|
|
2372
|
+
},
|
|
2373
|
+
{
|
|
2374
|
+
"name": "fact_subject_collections_created_at_idx",
|
|
2375
|
+
"columns": [
|
|
2376
|
+
"created_at"
|
|
2377
|
+
]
|
|
2334
2378
|
}
|
|
2335
2379
|
],
|
|
2336
2380
|
"version": "0ce73db4"
|
|
@@ -2533,12 +2577,6 @@
|
|
|
2533
2577
|
}
|
|
2534
2578
|
},
|
|
2535
2579
|
"indexes": [
|
|
2536
|
-
{
|
|
2537
|
-
"name": "fact_tags_id_idx",
|
|
2538
|
-
"columns": [
|
|
2539
|
-
"id"
|
|
2540
|
-
]
|
|
2541
|
-
},
|
|
2542
2580
|
{
|
|
2543
2581
|
"name": "fact_tags_fact_id_tag_slug_idx",
|
|
2544
2582
|
"columns": [
|
|
@@ -2546,6 +2584,20 @@
|
|
|
2546
2584
|
"tag_slug"
|
|
2547
2585
|
],
|
|
2548
2586
|
"unique": true
|
|
2587
|
+
},
|
|
2588
|
+
{
|
|
2589
|
+
"name": "fact_tags_slug_context_idx",
|
|
2590
|
+
"columns": [
|
|
2591
|
+
"slug",
|
|
2592
|
+
"context"
|
|
2593
|
+
]
|
|
2594
|
+
},
|
|
2595
|
+
{
|
|
2596
|
+
"name": "fact_tags_tenant_id_created_at_idx",
|
|
2597
|
+
"columns": [
|
|
2598
|
+
"tenant_id",
|
|
2599
|
+
"created_at"
|
|
2600
|
+
]
|
|
2549
2601
|
}
|
|
2550
2602
|
],
|
|
2551
2603
|
"version": "ebb242b1"
|
|
@@ -2713,12 +2765,6 @@
|
|
|
2713
2765
|
}
|
|
2714
2766
|
},
|
|
2715
2767
|
"indexes": [
|
|
2716
|
-
{
|
|
2717
|
-
"name": "fact_tag_collections_id_idx",
|
|
2718
|
-
"columns": [
|
|
2719
|
-
"id"
|
|
2720
|
-
]
|
|
2721
|
-
},
|
|
2722
2768
|
{
|
|
2723
2769
|
"name": "fact_tag_collections_slug_context_idx",
|
|
2724
2770
|
"columns": [
|
|
@@ -2726,6 +2772,12 @@
|
|
|
2726
2772
|
"context"
|
|
2727
2773
|
],
|
|
2728
2774
|
"unique": true
|
|
2775
|
+
},
|
|
2776
|
+
{
|
|
2777
|
+
"name": "fact_tag_collections_created_at_idx",
|
|
2778
|
+
"columns": [
|
|
2779
|
+
"created_at"
|
|
2780
|
+
]
|
|
2729
2781
|
}
|
|
2730
2782
|
],
|
|
2731
2783
|
"version": "4bac3c1d"
|
|
@@ -3473,7 +3525,13 @@
|
|
|
3473
3525
|
"cli": true,
|
|
3474
3526
|
"tenantScoped": {
|
|
3475
3527
|
"mode": "optional"
|
|
3476
|
-
}
|
|
3528
|
+
},
|
|
3529
|
+
"conflictColumns": [
|
|
3530
|
+
"tenant_id",
|
|
3531
|
+
"slug",
|
|
3532
|
+
"context",
|
|
3533
|
+
"_meta_type"
|
|
3534
|
+
]
|
|
3477
3535
|
},
|
|
3478
3536
|
"extends": "SmrtObject",
|
|
3479
3537
|
"exportName": "Fact",
|
|
@@ -3589,15 +3647,10 @@
|
|
|
3589
3647
|
}
|
|
3590
3648
|
},
|
|
3591
3649
|
"indexes": [
|
|
3592
|
-
{
|
|
3593
|
-
"name": "facts_id_idx",
|
|
3594
|
-
"columns": [
|
|
3595
|
-
"id"
|
|
3596
|
-
]
|
|
3597
|
-
},
|
|
3598
3650
|
{
|
|
3599
3651
|
"name": "facts_slug_context_meta_type_idx",
|
|
3600
3652
|
"columns": [
|
|
3653
|
+
"tenant_id",
|
|
3601
3654
|
"slug",
|
|
3602
3655
|
"context",
|
|
3603
3656
|
"_meta_type"
|
|
@@ -3609,6 +3662,19 @@
|
|
|
3609
3662
|
"columns": [
|
|
3610
3663
|
"_meta_type"
|
|
3611
3664
|
]
|
|
3665
|
+
},
|
|
3666
|
+
{
|
|
3667
|
+
"name": "facts_tenant_id_created_at_idx",
|
|
3668
|
+
"columns": [
|
|
3669
|
+
"tenant_id",
|
|
3670
|
+
"created_at"
|
|
3671
|
+
]
|
|
3672
|
+
},
|
|
3673
|
+
{
|
|
3674
|
+
"name": "facts_previous_fact_id_idx",
|
|
3675
|
+
"columns": [
|
|
3676
|
+
"previous_fact_id"
|
|
3677
|
+
]
|
|
3612
3678
|
}
|
|
3613
3679
|
],
|
|
3614
3680
|
"version": "b48d7b97"
|
|
@@ -3983,12 +4049,6 @@
|
|
|
3983
4049
|
}
|
|
3984
4050
|
},
|
|
3985
4051
|
"indexes": [
|
|
3986
|
-
{
|
|
3987
|
-
"name": "fact_collections_id_idx",
|
|
3988
|
-
"columns": [
|
|
3989
|
-
"id"
|
|
3990
|
-
]
|
|
3991
|
-
},
|
|
3992
4052
|
{
|
|
3993
4053
|
"name": "fact_collections_slug_context_idx",
|
|
3994
4054
|
"columns": [
|
|
@@ -3996,6 +4056,12 @@
|
|
|
3996
4056
|
"context"
|
|
3997
4057
|
],
|
|
3998
4058
|
"unique": true
|
|
4059
|
+
},
|
|
4060
|
+
{
|
|
4061
|
+
"name": "fact_collections_created_at_idx",
|
|
4062
|
+
"columns": [
|
|
4063
|
+
"created_at"
|
|
4064
|
+
]
|
|
3999
4065
|
}
|
|
4000
4066
|
],
|
|
4001
4067
|
"version": "3008a4e3"
|
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-facts",
|
|
6
|
-
"packageVersion": "0.
|
|
6
|
+
"packageVersion": "0.41.0",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
12
|
-
"agents": "
|
|
10
|
+
"manifest": "33aa9f4a697cb056fc93fe2bded9f245095b000cac4ff98dd31bb78efd812261",
|
|
11
|
+
"packageJson": "06310d91b5a8fa2b5b16fa5c461a985ef287f78fbefc70f3259dad8f25840d3e",
|
|
12
|
+
"agents": "3dff097c8282b094889f06247bdab664e75e54c85c4025219c82007f57b3a1bd"
|
|
13
13
|
},
|
|
14
14
|
"exports": [
|
|
15
15
|
".",
|
|
@@ -432,9 +432,9 @@
|
|
|
432
432
|
},
|
|
433
433
|
{
|
|
434
434
|
"name": "confidence",
|
|
435
|
-
"type": "
|
|
435
|
+
"type": "decimal",
|
|
436
436
|
"required": false,
|
|
437
|
-
"columnType": "
|
|
437
|
+
"columnType": "REAL",
|
|
438
438
|
"default": 0
|
|
439
439
|
},
|
|
440
440
|
{
|
|
@@ -1111,6 +1111,12 @@
|
|
|
1111
1111
|
"field": "tenantId"
|
|
1112
1112
|
},
|
|
1113
1113
|
"tableStrategy": "sti",
|
|
1114
|
+
"conflictColumns": [
|
|
1115
|
+
"tenant_id",
|
|
1116
|
+
"slug",
|
|
1117
|
+
"context",
|
|
1118
|
+
"_meta_type"
|
|
1119
|
+
],
|
|
1114
1120
|
"surfaces": [
|
|
1115
1121
|
{
|
|
1116
1122
|
"kind": "api",
|
|
@@ -2385,6 +2391,12 @@
|
|
|
2385
2391
|
"field": "tenantId"
|
|
2386
2392
|
},
|
|
2387
2393
|
"tableStrategy": "sti",
|
|
2394
|
+
"conflictColumns": [
|
|
2395
|
+
"tenant_id",
|
|
2396
|
+
"slug",
|
|
2397
|
+
"context",
|
|
2398
|
+
"_meta_type"
|
|
2399
|
+
],
|
|
2388
2400
|
"surfaces": [
|
|
2389
2401
|
{
|
|
2390
2402
|
"kind": "api",
|
|
@@ -3207,5 +3219,5 @@
|
|
|
3207
3219
|
"polymorphicAssociations": 0,
|
|
3208
3220
|
"uuidColumns": 25
|
|
3209
3221
|
},
|
|
3210
|
-
"agentDoc": "# @happyvertical/smrt-facts\n\nDistributed knowledge base with semantic deduplication, provenance tracking, and evolution chains.\n\n## Models\n\n- **Fact**: atomic knowledge unit with `textRefined`, auto-generated embeddings, status (active/pending/superseded), confidence score. Evolution via `previousFactId` (predecessor→successor with corrections/contradictions/refinements). NOT a structural hierarchy — Fact deliberately does not extend `SmrtHierarchical`; `parentId` is reserved for true structural parents elsewhere in the framework.\n- **FactSource**: provenance — URL, type, `credibility` (0-1), extraction timestamp.\n- **FactSubject**: polymorphic entity linking — `entityType` + `entityId` (no FK, string-based). `conflictColumns: ['fact_id', 'entity_type', 'entity_id']`.\n- **FactContent**: join table linking facts to Content. `conflictColumns: ['fact_id', 'content_id', 'relationship']`.\n\n## Semantic Reconciliation\n\n`reconcile()` uses three zones:\n- **≥0.85 similarity**: auto-merge (same fact, update metadata)\n- **0.60–0.85**: AI disambiguation — asks model to decide create/merge/branch\n- **<0.60**: new fact (no match)\n\n## Evolution Chains\n\n`getEvolutionChain()` (root→current), `getLatestInChain()` (highest confidence leaf), `getEvolutionTree()` (BFS all descendants). All traversals use `visited` Set for cycle detection.\n\n## Confidence Scoring\n\n`recalculateConfidence()`: weighted formula from `sourceCount`, `avgSourceCredibility`, `daysSinceLastSource`, `corroborationScore`.\n\n## Gotchas\n\n- **Embedding failures non-fatal**: try/catch with silent fail — doesn't block fact creation\n- **Metadata auto-stringify**: constructor `JSON.stringify`s objects; getters return parsed objects\n- **AI disambiguation fallback**: if AI fails, defaults to branch (safer than merge)\n- **Embeddings config**: `fields: ['textRefined'], autoGenerate: true, combinedField: {...}`\n- **Optional tenancy** with nullable tenantId. `findWithGlobals(tenantId)` for tenant + global facts\n"
|
|
3222
|
+
"agentDoc": "# @happyvertical/smrt-facts\n\nDistributed knowledge base with semantic deduplication, provenance tracking, and evolution chains.\n\n## Models\n\n- **Fact**: atomic knowledge unit with `textRefined`, auto-generated embeddings, status (active/pending/superseded), confidence score. Evolution via `previousFactId` (predecessor→successor with corrections/contradictions/refinements). NOT a structural hierarchy — Fact deliberately does not extend `SmrtHierarchical`; `parentId` is reserved for true structural parents elsewhere in the framework.\n- **FactSource**: provenance — URL, type, `credibility` (0-1), extraction timestamp.\n- **FactSubject**: polymorphic entity linking — `entityType` + `entityId` (no FK, string-based). `conflictColumns: ['fact_id', 'entity_type', 'entity_id']`.\n- **FactContent**: join table linking facts to Content. `conflictColumns: ['fact_id', 'content_id', 'relationship']`.\n\n## Semantic Reconciliation\n\n`reconcile()` uses three zones:\n- **≥0.85 similarity**: auto-merge (same fact, update metadata)\n- **0.60–0.85**: AI disambiguation — asks model to decide create/merge/branch\n- **<0.60**: new fact (no match)\n\n## Evolution Chains\n\n`getEvolutionChain()` (root→current), `getLatestInChain()` (highest confidence leaf), `getEvolutionTree()` (BFS all descendants). All traversals use `visited` Set for cycle detection.\n\n## Confidence Scoring\n\n`recalculateConfidence()`: weighted formula from `sourceCount`, `avgSourceCredibility`, `daysSinceLastSource`, `corroborationScore`.\n\n## Gotchas\n\n- **Embedding failures non-fatal**: try/catch with silent fail — doesn't block fact creation\n- **Metadata auto-stringify**: constructor `JSON.stringify`s objects; getters return parsed objects\n- **AI disambiguation fallback**: if AI fails, defaults to branch (safer than merge)\n- **Embeddings config**: `fields: ['textRefined'], autoGenerate: true, combinedField: {...}`\n- **Optional tenancy** with nullable tenantId. `findWithGlobals(tenantId)` for tenant + global facts\n- **Confidence/credibility must initialize `0.0`, never `0`**: they are rates, not money — inherently fractional. An integer literal compiles to an INTEGER column and a `[0, 1]` score becomes unstorable, so PostgreSQL raises `22P02` while SQLite silently accepts it. `FactEvidence.confidence` carried that bug until #2361; `pnpm --filter @happyvertical/smrt-facts test:postgres` is the lane that holds the line. (Money elsewhere in the framework goes the other way — integer minor units.)\n"
|
|
3211
3223
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-facts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
4
4
|
"description": "Distributed memory and knowledge management with provenance tracking for SMRT framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -24,16 +24,16 @@
|
|
|
24
24
|
"@happyvertical/logger": "^0.88.0",
|
|
25
25
|
"@happyvertical/sql": "^0.88.0",
|
|
26
26
|
"@happyvertical/utils": "^0.88.0",
|
|
27
|
-
"@happyvertical/smrt-core": "0.
|
|
28
|
-
"@happyvertical/smrt-prompts": "0.
|
|
29
|
-
"@happyvertical/smrt-tenancy": "0.
|
|
27
|
+
"@happyvertical/smrt-core": "0.41.0",
|
|
28
|
+
"@happyvertical/smrt-prompts": "0.41.0",
|
|
29
|
+
"@happyvertical/smrt-tenancy": "0.41.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "24.13.2",
|
|
33
33
|
"typescript": "5.9.3",
|
|
34
34
|
"vite": "8.1.4",
|
|
35
35
|
"vitest": "4.1.10",
|
|
36
|
-
"@happyvertical/smrt-vitest": "0.
|
|
36
|
+
"@happyvertical/smrt-vitest": "0.41.0"
|
|
37
37
|
},
|
|
38
38
|
"keywords": [
|
|
39
39
|
"ai",
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"dev": "vite dev",
|
|
63
63
|
"pretest": "[ -f ../cli/dist/index.js ] && node ../cli/dist/index.js test --manifest-only || true",
|
|
64
64
|
"test": "vitest run",
|
|
65
|
+
"test:postgres": "node ../../scripts/run-with-ci-postgres.mjs -- pnpm exec vitest run src/__tests__/confidence-fields.postgres.test.ts",
|
|
65
66
|
"test:watch": "vitest",
|
|
66
67
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
67
68
|
"verify:pack": "node ../../scripts/verify-package-types-exports.js ."
|