PulseContext.regulated constructor

PulseContext.regulated({
  1. required String actor,
  2. required String framework,
  3. String? reason,
  4. PulseContext? baseContext,
  5. Sensitivity sensitivity = Sensitivity.confidential,
})

Creates a PulseContext anchored to a specific Regulatory Framework (e.g., GDPR, HIPAA, SOC2).

This factory is a Human‑Centric Shortcut designed to enforce institutional safety constraints automatically. It pre‑configures:

  • compliance to the specified framework (static pillar).
  • auditLevel to full (forensic trace).
  • strategy to deterministic.
  • sensitivity to confidential (or as provided).

When to use

Use this when the pulse contains regulated data (e.g., PII, financial info) that must be audited and handled with extra care.

How it works

The factory populates all necessary provenance dimensions to ensure compliance. The resulting pulse will be fully audited and carry the required legal markers.

Non‑obvious

  • The auditLevel is forced to full – you cannot reduce it.
  • The strategy is set to deterministic to avoid probabilistic reasoning on regulated data.

Example

final context = PulseContext.regulated(
  actor: 'Payment_Processor_B',
  framework: 'PCI-DSS',
  reason: 'Authorizing Transaction #992',
);

Parameters:

  • actor: The entity originating the regulated stimulus.
  • framework: The legal/regulatory protocol (e.g., 'GDPR', 'HIPAA').
  • reason: The immediate justification.
  • baseContext: Ancestral Context for lineage.
  • sensitivity: Data classification, defaulting to Sensitivity.confidential.

Implementation

factory PulseContext.regulated({
  required String actor,
  required String framework,
  String? reason,
  PulseContext? baseContext,
  Sensitivity sensitivity = Sensitivity.confidential,
}) {
  return PulseContext.fromEntries([
    // Static Pillars
    Provenance.actor.entry(actor),
    Provenance.compliance.entry(framework),
    Provenance.sensitivity.entry(sensitivity),
    Provenance.traceId.entry(Identity.next()),
    if (baseContext != null)
      Provenance.parentTraceId.entry(baseContext.traceId!),

    // Operational Boundaries (Escalated for Compliance)
    Provenance.auditLevel.entry(AuditLevel.full),
    Provenance.strategy.entry(ReasoningStrategy.deterministic),
    Provenance.priority.entry(85), // High priority due to regulatory nature
    Provenance.purpose.entry('REGULATED_TRANSACTION'),
    Provenance.reason
        .entry(reason ?? 'Executing within $framework framework.'),
    Provenance.confidence.entry(1.0),
  ]);
}