@happyvertical/smrt-facts 0.55.7 → 0.55.9
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.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +10 -1
- package/dist/smrt-knowledge.json +13 -4
- package/package.json +10 -10
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.55.
|
|
5
|
+
"packageVersion": "0.55.9",
|
|
6
6
|
"objects": {
|
|
7
7
|
"@happyvertical/smrt-facts:FactContent": {
|
|
8
8
|
"name": "factcontent",
|
|
@@ -3624,5 +3624,14 @@
|
|
|
3624
3624
|
"@happyvertical/smrt-prompts",
|
|
3625
3625
|
"@happyvertical/smrt-tenancy"
|
|
3626
3626
|
],
|
|
3627
|
+
"browser": {
|
|
3628
|
+
"status": "server-only",
|
|
3629
|
+
"issues": [
|
|
3630
|
+
"#3624"
|
|
3631
|
+
],
|
|
3632
|
+
"via": [
|
|
3633
|
+
"@happyvertical/smrt-tenancy"
|
|
3634
|
+
]
|
|
3635
|
+
},
|
|
3627
3636
|
"stampsConstructors": true
|
|
3628
3637
|
}
|
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-facts",
|
|
6
|
-
"packageVersion": "0.55.
|
|
6
|
+
"packageVersion": "0.55.9",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
10
|
+
"manifest": "c2199efbcb566f7c9cf3c0344590af81c1f29a2c14014453d846211468c7fdb8",
|
|
11
|
+
"packageJson": "cc600214ab250297ce75d8eb9f09379e202a11d651d530de2633c8e10e6fe2bf",
|
|
12
12
|
"agents": "3dff097c8282b094889f06247bdab664e75e54c85c4025219c82007f57b3a1bd"
|
|
13
13
|
},
|
|
14
14
|
"exports": [
|
|
@@ -5742,5 +5742,14 @@
|
|
|
5742
5742
|
"polymorphicAssociations": 0,
|
|
5743
5743
|
"uuidColumns": 38
|
|
5744
5744
|
},
|
|
5745
|
-
"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"
|
|
5745
|
+
"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",
|
|
5746
|
+
"browser": {
|
|
5747
|
+
"status": "server-only",
|
|
5748
|
+
"issues": [
|
|
5749
|
+
"#3624"
|
|
5750
|
+
],
|
|
5751
|
+
"via": [
|
|
5752
|
+
"@happyvertical/smrt-tenancy"
|
|
5753
|
+
]
|
|
5754
|
+
}
|
|
5746
5755
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-facts",
|
|
3
|
-
"version": "0.55.
|
|
3
|
+
"version": "0.55.9",
|
|
4
4
|
"description": "Distributed memory and knowledge management with provenance tracking for SMRT framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -19,17 +19,17 @@
|
|
|
19
19
|
"./manifest.json": "./dist/manifest.json"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@happyvertical/ai": "^0.
|
|
23
|
-
"@happyvertical/files": "^0.
|
|
24
|
-
"@happyvertical/logger": "^0.
|
|
25
|
-
"@happyvertical/smrt-core": "0.55.
|
|
26
|
-
"@happyvertical/smrt-prompts": "0.55.
|
|
27
|
-
"@happyvertical/smrt-tenancy": "0.55.
|
|
28
|
-
"@happyvertical/sql": "^0.
|
|
29
|
-
"@happyvertical/utils": "^0.
|
|
22
|
+
"@happyvertical/ai": "^0.103.1",
|
|
23
|
+
"@happyvertical/files": "^0.103.1",
|
|
24
|
+
"@happyvertical/logger": "^0.103.1",
|
|
25
|
+
"@happyvertical/smrt-core": "0.55.9",
|
|
26
|
+
"@happyvertical/smrt-prompts": "0.55.9",
|
|
27
|
+
"@happyvertical/smrt-tenancy": "0.55.9",
|
|
28
|
+
"@happyvertical/sql": "^0.103.1",
|
|
29
|
+
"@happyvertical/utils": "^0.103.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@happyvertical/smrt-vitest": "0.55.
|
|
32
|
+
"@happyvertical/smrt-vitest": "0.55.9",
|
|
33
33
|
"@types/node": "24.13.6",
|
|
34
34
|
"typescript": "6.0.3",
|
|
35
35
|
"vite": "8.1.4",
|