PhilosophyEngine class
Sole PhilosophyPort implementation in mcp_philosophy.
Consumes:
- EthosStorePort (required) — active ethos resolution and persistence.
- FactsPort (optional) — entity-based overloads query facts directly.
- EvidencePort (optional) — provenance verification hook.
- ContextBundlePort (optional) — multi-layer context construction hook.
- EventPort (optional) — feedback proposal events are emitted here.
REDESIGN-PLAN.md Phase 6 §4.1a path (a) lock — the legacy
ethos-at-construction PhilosophyAdapter is removed; this is the only
PhilosophyPort implementation. See DDD core-port.md §3.2.
Provides two entry points that produce equivalent results for the same facts (FR-PORT-012 conformance):
- Entity-based: detectTensionsForEntity / checkProhibitionsForEntity query FactsPort internally.
- Caller-supplied: detectTensions / checkProhibitions take a pre-built context. Use deriveKnowledgeProvenance to mirror the engine's records → provenance encoding.
- Implemented types
Constructors
- PhilosophyEngine({required EthosStorePort ethosStore, FactsPort? facts, EvidencePort? evidence, ContextBundlePort? contextBundle, EventPort? events, PhilosophyEvaluator? evaluator, InterventionEngine? interventionEngine, TensionDetector? tensionDetector, ReinforcementEngine? reinforcementEngine, bool autoSeedEthos = true})
Properties
- autoSeedEthos → bool
-
Whether initialize should seed the default ethos into an empty store.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
checkProhibitions(
ProhibitionCheckRequest request) → Future< ProhibitionCheckResult> -
Check a proposed action or output against all prohibitions.
override
-
checkProhibitionsForEntity(
String entityId, ProhibitionCheckRequest request, {required String workspaceId}) → Future< ProhibitionCheckResult> - Check prohibitions against an entity's facts.
-
detectTensions(
MultiLayerContext context) → Future< List< Tension> > -
Detect tensions between Philosophy and other layers.
override
-
detectTensionsForEntity(
String entityId, {required String workspaceId}) → Future< List< Tension> > - Detect tensions for a specific entity by querying FactsPort directly.
-
evaluate(
PhilosophyEvaluationContext context) → Future< PhilosophyGuidance> -
Evaluate the current context against the active Ethos.
override
-
getEthos(
) → Future< Ethos> -
Retrieve the currently active Ethos instance.
override
-
initialize(
) → Future< void> - Lazily seed the default ethos when autoSeedEthos is enabled.
-
intervene(
InterventionPoint point, PipelineContext context) → Future< InterventionResult> -
Apply philosophy intervention at a pipeline stage.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
proposeFeedback(
FeedbackEvent event) → Future< EvolutionProposal?> -
Generate an evolution proposal from action feedback.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
deriveKnowledgeProvenance(
List< FactRecord> records) → Map<String, dynamic> -
Derive a
knowledgeProvenancemap from a list of FactRecord.