PulseContext.aiInference constructor

PulseContext.aiInference({
  1. required Context baseContext,
  2. required String actor,
  3. required String reason,
  4. required double confidence,
  5. String? purpose,
  6. int priority = 20,
})

Syntheses an Autonomous Inference Blueprint for signals originating from AI‑driven reasoning, pattern recognition, or optimisation tasks.

This factory is the architectural standard for Non‑Deterministic Intent. It ensures that signals generated by Autonomous Agents carry the necessary metadata – specifically confidence and AuditLevel.detailed auditing – to be properly governed.

When to use

Use this when an AI agent proposes a state change based on observed patterns or heuristics.

How it works

  • Sets strategy to probabilistic.
  • Sets auditLevel to detailed for XAI transparency.
  • Defaults priority to 20 (background) to avoid interfering with user actions.

Example

final context = PulseContext.aiInference(
  baseContext: clusterOntology,
  actor: 'Heuristic_Optimizer_v2',
  reason: 'Detected high latency in somatic processing',
  confidence: 0.82,
  purpose: 'RESOURCE_SCALING',
);

Parameters:

  • baseContext: Ancestral Context for lineage.
  • actor: The specific AI model or heuristic engine.
  • reason: Functional justification or evidence.
  • confidence: Validity probability (0.0 to 1.0).
  • purpose: Mission category, defaulting to 'AUTONOMOUS_OPTIMIZATION'.
  • priority: Urgency, defaulting to 20.

Implementation

factory PulseContext.aiInference({
  required Context baseContext,
  required String actor,
  required String reason,
  required double confidence,
  String? purpose,
  int priority = 20,
}) {
  return PulseContext.fromEntries([
    // --- Static Pillars (Non-Evolvable Identity) ---
    Provenance.actor.entry(actor),
    Provenance.traceId.entry(Identity.next()),
    if (baseContext is PulseContext)
      Provenance.parentTraceId.entry(baseContext.traceId!),
    Provenance.sensitivity.entry(Sensitivity.internal),

    // --- Fluid Boundaries (Evolvable Intent) ---
    Provenance.strategy.entry(ReasoningStrategy.probabilistic),
    Provenance.confidence.entry(confidence),
    Provenance.auditLevel.entry(AuditLevel.detailed),
    Provenance.priority.entry(priority),
    Provenance.purpose.entry(purpose ?? 'AUTONOMOUS_OPTIMIZATION'),
    Provenance.reason.entry(reason),
  ]);
}