@unrdf/fusion
v26.4.4
Published
Unified integration layer for 7-day UNRDF innovation - KGC-4D, blockchain, hooks, caching
Maintainers
Readme
@unrdf/fusion
Unified Integration Layer - 7-Day Innovation Consolidation
Canonical API surface for UNRDF's recent innovations:
- KGC-4D: Time-travel store, Git snapshots, HDIT coordinates
- Blockchain: Cryptographic receipts, Merkle proofs, anchoring
- Hooks: Policy execution, validation, transformation
- Caching: Multi-layer cache, resource management
- Oxigraph: High-performance RDF store
Quick Start
import { createEngine, prove } from '@unrdf/fusion';
// Create unified engine
const engine = await createEngine({
enableCaching: true,
enableBlockchain: true,
enableGit: false,
});
// Access subsystems
const { store, kgcStore, receipts, policies, resources } = engine;
// Get combined stats
console.log(engine.getStats());
// Cleanup
await engine.close();Deterministic Proof
Run the E2E proof scenario:
DETERMINISTIC=1 node tools/prove.mjsThis executes a complete workflow:
- Create KGC store + Git backbone
- Apply policy hooks
- Allocate resources via cache
- Execute test case
- Generate blockchain receipts
- Produce Merkle proof
Output:
- Final proof hash
- Merkle root
- Receipt count
- Verification status
- Full ledger JSON
Exported APIs
Core Store
createStore()- Create Oxigraph RDF storedataFactory- RDF term creation (namedNode, literal, etc.)
KGC-4D Engine
KGCStore- Time-travel enabled storeGitBackbone- Git-backed snapshotsfreezeUniverse()- Snapshot creationVectorClock- Distributed time- HDIT functions:
coordsForEvent,findKNearest,projectPCA
Blockchain
ReceiptAnchorer- Ethereum anchoringMerkleProofGenerator- Merkle tree generationWorkflowVerifier- Smart contract verification
Policy Hooks
defineHook()- Hook definitionexecuteHook()- Hook executioncreateHookRegistry()- Hook managementbuiltinHooks- Standard validators
Caching
createCachingSystem()- Multi-layer cacheMultiLayerCache- L1/L2/L3 cachingDependencyTracker- Invalidation tracking
Integration Map
@unrdf/fusion
├── Store (@unrdf/oxigraph)
│ └── createStore(), dataFactory
├── Engine (@unrdf/kgc-4d)
│ ├── KGCStore (time-travel)
│ ├── GitBackbone (snapshots)
│ └── HDIT (coordinates, similarity)
├── Receipts (@unrdf/blockchain)
│ ├── ReceiptAnchorer
│ └── MerkleProofGenerator
├── Policies (@unrdf/hooks)
│ ├── defineHook()
│ └── executeHook()
└── Resources (@unrdf/caching)
├── MultiLayerCache
└── DependencyTrackerProof Artifacts
Ledger location: ARTIFACTS/last7days-ledger.json
Schema:
{
"proofHash": "sha256 hex",
"scenario": {
"workflowCreated": true,
"policyApplied": true,
"resourceAllocated": true,
"caseExecuted": true,
"receiptsEmitted": 5,
"merkleRoot": "0x...",
"verificationPassed": true
},
"versions": { ... },
"hashes": { ... }
}For Agents 2-10
This package provides the canonical imports. Do NOT re-implement:
// ✅ CORRECT - Import from fusion
import { createEngine, KGCStore, ReceiptAnchorer } from '@unrdf/fusion';
// ❌ WRONG - Re-implementing
const myStore = new CustomStore(); // Don't do thisAll APIs are delegated to existing packages. Zero reimplementation.
