@happyvertical/smrt-facts 0.60.13 → 0.60.15

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.
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-facts",
5
- "packageVersion": "0.60.13",
5
+ "packageVersion": "0.60.15",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-facts:FactContent": {
8
8
  "name": "factcontent",
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gCAAgC,wDAwC3C,CAAC;AAEH,eAAO,MAAM,wBAAwB,wDA0BnC,CAAC;AAEH,eAAO,MAAM,mCAAmC,wDAmC9C,CAAC;AAEH,eAAO,MAAM,iCAAiC,wDA+B5C,CAAC"}
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gCAAgC,wDAyC3C,CAAC;AAEH,eAAO,MAAM,wBAAwB,wDA2BnC,CAAC;AAEH,eAAO,MAAM,mCAAmC,wDAoC9C,CAAC;AAEH,eAAO,MAAM,iCAAiC,wDAgC5C,CAAC"}
@@ -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.60.13",
6
+ "packageVersion": "0.60.15",
7
7
  "sourceManifestPath": "dist/manifest.json",
8
8
  "agentDocPath": "AGENTS.md",
9
9
  "sourceHashes": {
10
- "manifest": "f800effacf291b250879061811bf9736099c8c13b663909bd370acde1d9ea5de",
11
- "packageJson": "03fe7483fb6350de242b9465dd76f494a93484a0974ea089a913d3484815b340",
12
- "agents": "3dff097c8282b094889f06247bdab664e75e54c85c4025219c82007f57b3a1bd"
10
+ "manifest": "465a4b32593794e404e78c5e20014246c8dd1d85365c3d58684196d143f93c13",
11
+ "packageJson": "ecf00806c8f1100e7be1a5715f8ebbd969d28673519af18c2a73b4e74734512e",
12
+ "agents": "bf4a2f2954b9cd564d1ac19356a4c5b9e98afbd41636ad78e79ed18c58fb9666"
13
13
  },
14
14
  "exports": [
15
15
  ".",
@@ -4473,7 +4473,7 @@
4473
4473
  "polymorphicAssociations": 0,
4474
4474
  "uuidColumns": 38
4475
4475
  },
4476
- "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",
4476
+ "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## Prompt tiers (#4755)\n\nRule in `../prompts/AGENTS.md`. `smrtFacts.extractCandidates`,\n`smrtFacts.extractArticleClaims` and `smrtFacts.reconcile` → `great`\n(persisted facts and merges); `smrtFacts.assessClaimSupport` → `cheap`\n(closed-vocabulary status). `FactCollection.preparePromptCall()` binds the tier\nthrough `prepareAiOperation()`; a message-only client injected as `options.ai`\nthat core does not adopt (no `embed`) is used as is with `routeTier: false`;\none core adopts binds the tier. A typed-decision client answers\nreconciliation without any tier (#3158).\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",
4477
4477
  "browser": {
4478
4478
  "status": "server-only",
4479
4479
  "issues": [
@@ -5,10 +5,10 @@ description: "Distributed memory and knowledge management with provenance tracki
5
5
  status: "stable"
6
6
  generated:
7
7
  by: "smrt/scripts/generate-knowledge-okf.ts"
8
- at: "2026-11-05T15:48:19Z"
8
+ at: "2026-11-08T18:33:46Z"
9
9
  audience: "internal"
10
10
  evidence_level: "source-inspected"
11
- source_revision: "sha256:74aa5926b3f3a4f9c58fb4641535c987ef2d5dd2cd7bf41c00e7d80a24adc8fe"
11
+ source_revision: "sha256:460a057b5429a63c6d56979a7d593fbf84ee5130e1db5f727d52cfa02ed30674"
12
12
  sources:
13
13
  - id: "manifest"
14
14
  resource: "https://github.com/happyvertical/smrt/blob/main/packages/facts/package.json"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-facts",
3
- "version": "0.60.13",
3
+ "version": "0.60.15",
4
4
  "description": "Distributed memory and knowledge management with provenance tracking for SMRT framework",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -22,14 +22,14 @@
22
22
  "@happyvertical/ai": "^0.111.6",
23
23
  "@happyvertical/files": "^0.111.6",
24
24
  "@happyvertical/logger": "^0.111.6",
25
- "@happyvertical/smrt-core": "0.60.13",
26
- "@happyvertical/smrt-prompts": "0.60.13",
27
- "@happyvertical/smrt-tenancy": "0.60.13",
25
+ "@happyvertical/smrt-core": "0.60.15",
26
+ "@happyvertical/smrt-prompts": "0.60.15",
27
+ "@happyvertical/smrt-tenancy": "0.60.15",
28
28
  "@happyvertical/sql": "^0.111.6",
29
29
  "@happyvertical/utils": "^0.111.6"
30
30
  },
31
31
  "devDependencies": {
32
- "@happyvertical/smrt-vitest": "0.60.13",
32
+ "@happyvertical/smrt-vitest": "0.60.15",
33
33
  "@types/node": "24.13.6",
34
34
  "typescript": "6.0.3",
35
35
  "vite": "8.1.6",