PulseContext.collaboration constructor

PulseContext.collaboration({
  1. required Context baseContext,
  2. required String actor,
  3. required String targetAgent,
  4. required String task,
})

Syntheses a Collaboration & Delegation Blueprint for signals routed between different Managed Nodes or autonomous agents.

This factory facilitates the handover of operational intent between agents, ensuring that the Causal Trace explicitly documents the transfer of responsibility.

When to use

Use this when one agent decomposes a high‑level goal and delegates sub‑tasks to specialised residents.

How it works

  • Sets purpose to COLLABORATIVE_TASK.
  • Sets priority to 60 (high, for coordination).
  • Sets sensitivity to private (inter‑agent metadata).
  • The reason includes the target agent and task description.

Non‑obvious

  • The auditLevel is full to track delegation chains.
  • The strategy is deterministic – delegation is a formal handoff.

Example

final context = PulseContext.collaboration(
  baseContext: currentPulse.context,
  actor: 'Orchestrator_Agent',
  targetAgent: 'Database_Resident',
  task: 'Fetch user transaction history (2023)',
);

Parameters:

  • baseContext: Ancestral Context for lineage.
  • actor: The delegating agent.
  • targetAgent: The agent receiving the mandate.
  • task: Semantic description of the delegated responsibility.

Implementation

factory PulseContext.collaboration({
  required Context baseContext,
  required String actor,
  required String targetAgent,
  required String task,
}) {
  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.private),

    // --- Fluid Boundaries (Evolvable Intent) ---
    Provenance.strategy.entry(ReasoningStrategy.deterministic),
    Provenance.confidence.entry(1.0),
    Provenance.auditLevel.entry(AuditLevel.full),
    Provenance.priority.entry(60),
    Provenance.purpose.entry('COLLABORATIVE_TASK'),
    Provenance.reason.entry('DELEGATION: Assigning $task to $targetAgent'),
  ]);
}