FactGraphRuntime class

Phase 2 composition root for mcp_fact_graph.

The primary constructor takes pre-wired services and storage ports. The FactGraphRuntime.inMemory factory offers a zero-config single-line setup that the Scenario A host uses:

final runtime = FactGraphRuntime.inMemory(defaultWorkspaceId: 'ws1');
await runtime.initialize();
await runtime.facts.writeFacts([...]);

Constructors

FactGraphRuntime({required EvidenceService evidenceService, required FactGraphService factGraphService, required ContextService contextService, required SkillOpsService skillOpsService, required EvidenceStoragePort evidenceStoragePort, required CandidateStoragePort candidateStoragePort, required EntityStoragePort entityStoragePort, required FactStoragePort factStoragePort, required ContextStoragePort contextStoragePort, required SkillOpsStoragePort skillOpsStoragePort, required RelationStoragePort relationStoragePort, required RunStoragePort runStoragePort, required ArtifactStoragePort artifactStoragePort, PatternMiner? patternMiner, SummaryScheduler? summaryScheduler, ConsistencyChecker? consistencyChecker, CandidateDeduplicator? candidateDeduplicator, String defaultWorkspaceId = 'default', String defaultPolicyVersion = 'v1'})
Primary constructor. All services and storage ports must be wired; the factory FactGraphRuntime.inMemory assembles a default in-memory stack on the caller's behalf.
FactGraphRuntime.inMemory({String defaultWorkspaceId = 'default', String defaultPolicyVersion = 'v1', bool enablePatternMining = true, bool enableSummaryScheduler = true, bool enableConsistencyCheck = true, bool enableCandidateDedup = true})
Convenience constructor: wires a full in-memory storage stack, default services, and the 12 standard adapters. Intended for tests and the Scenario A standalone host.
factory

Properties

asset → AssetPort
Capability: binary asset retrieval.
final
candidates → CandidatesPort
Capability: candidate CRUD and review.
final
claims → ClaimsPort
Capability: claim lifecycle.
final
contextBundle → ContextBundlePort
Capability: context bundle construction.
final
entities → EntitiesPort
Capability: entity CRUD / linking / merging.
final
evidence → EvidencePort
Capability: evidence fragment extraction / confidence / classification.
final
facts → FactsPort
Capability: facts CRUD.
final
hashCode int
The hash code for this object.
no setterinherited
index → IndexPort
Capability: knowledge index lifecycle.
final
patternMiner PatternMiner?
Optional L0 pattern miner. When wired, hosts can call mineAllPatterns to run the three default algorithms.
final
patterns → PatternsPort
Capability: pattern CRUD.
final
retrieval → RetrievalPort
Capability: lexical retrieval over facts.
final
runs → RunsPort
Capability: run record storage.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
summaries → SummariesPort
Capability: summary storage and refresh.
final
summaryScheduler SummaryScheduler?
Optional summary refresh scheduler (C3). Built automatically by FactGraphRuntime.inMemory and left stopped; hosts call startSummaryScheduler to begin periodic refresh and stopSummaryScheduler to halt it. close cancels the timer.
final

Methods

close() Future<void>
Release runtime resources. The in-memory adapters have nothing to do here but subclasses may override for a real backend.
initialize() Future<void>
Initialize the runtime. Idempotent.
isReady() Future<bool>
Whether the runtime has been initialized successfully.
mineAllPatterns([String? workspaceId]) Future<List<PatternRecord>>
Run the L0 pattern miner across all default algorithms for the given workspace. No-op and returns an empty list when no patternMiner is wired.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
startSummaryScheduler() → void
Start the periodic summary refresh loop, if a scheduler is wired. No-op when none.
stopSummaryScheduler() → void
Stop the periodic summary refresh loop, if a scheduler is wired. Safe to call when never started.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited