Coordination & Governance

Reactive Memory Triggers

Turn passive memory storage into an event-driven nervous system. Triggers watch 10 memory, graph, and Agent Bus events and execute deterministic lifecycle actions, cross-namespace broadcasts, or HMAC-signed webhooks.

10 Event Hooks7 Deterministic ActionsEdge-Crossing CadenceSSRF-Hardened Webhooks
01 · Event-Driven Governance

How Triggers Execute

Triggers evaluate synchronously inside a recursion-guarded task context (MAX_TRIGGER_DEPTH = 1) so an action such as boost or tag can never cause a runaway cascade.
Control Panel · Ledger & Triggers -> Reactive Memory Triggers
Sulcus Control Panel Reactive Memory Triggers interface showing active triggers and recent trigger firings
Creating and auditing Reactive Triggers in the Control Panel. Operators can inspect total fire counts, toggle triggers live, and review recent event -> action firings.
EventDomainWhen It Fires
on_storeMemory LifecycleFires when a memory node is stored via POST /api/v1/agent/nodes, POST /api/v1/agent/ingest, or MCP store_memory.
on_recallMemory LifecycleFires when a memory node is returned by hybrid search or hot-context assembly.
on_boostMemory LifecycleFires when salience increases via MCP memory_boost (direction="up") or POST /api/v1/agent/boost-batch.
on_decayMemory LifecycleFires during thermodynamic decay or downward boost/deprecation. Defaults filter_heat_below to 0.25 if no heat bound is set.
on_thresholdMemory LifecycleEdge-triggered (on_crossing by default) when node heat crosses filter_heat_below or filter_heat_above.
on_relateKnowledge GraphFires when a relationship edge is created via POST /api/v1/agent/graph/relate or MCP memory_relate.
on_conflictAgent BusFires when concurrent sessions edit the same repo-relative file path (alias: territory.conflict).
on_milestoneAgent BusFires when a milestone signal is evaluated via ingest or POST /api/v1/triggers/evaluate (alias: milestone.reached).
on_solutionAgent BusFires when an agent records a verified fix or debugging breakthrough (alias: solution.discovered).
on_intent_overlapAgent BusFires when active sessions share >= 2 domain focus terms or Jaccard similarity >= 0.25 (alias: intent.overlap).
02 · Predicates & Rate Controls

Top-Level Filters & Crossing Cadence

Trigger filters are top-level fields on the trigger payload (there is no nested condition wrapper object). All specified filters combine with logical AND.

Top-Level Filter Fields

  • filter_memory_type: episodic | semantic | preference | procedural | fact | synthesis (or *).
  • filter_namespace: Source namespace slug (requires ACL read permission; * matches all readable namespaces).
  • filter_label_pattern: Case-insensitive substring match against the memory label / pointer summary.
  • filter_heat_below & filter_heat_above: Salience bounds (0.0 to 1.0).
  • max_fires & cooldown_seconds: Rate caps (defaults to 60s cooldown on the Sulcus API, 0s locally; enabled is toggled via PATCH /api/v1/triggers/:id).

Advanced Cadence Keys in action_config

  • fire_scope: "global" (default) or "per_memory" (tracks cooldown and max_fires independently per (trigger_id, node_id)).
  • evaluation_mode: "on_crossing" (default edge-triggered crossing from old_heat to heat), "while_true", "once", or "repeat_n".
  • threshold_direction: "auto" | "below" | "above" | "either" | "band".
  • filter_node_id: Target a single UUID or comma-separated list of memory UUIDs.
03 · Action Reference

Actions, Schemas & Webhook Security

Message templates in notify and broadcast interpolate {node_id}, {label}, {content}, {namespace}, {source_namespace}, {target_namespace}, {trigger_name}, {event}, {heat}, {old_heat}, and {memory_type}.
Actionaction_config ExampleRuntime Effect
pin{}Sets is_pinned = true on the triggering node (and raises heat to at least 0.90 on the Sulcus API) so it never decays.
boost{"strength": 0.3, "target": "self"}Adjusts current_heat (clamped -1.0 to 1.0) and increases thermodynamic stability on "self" or an explicit node UUID.
tag{"tag": "needs-review"}Appends the normalized tag to golden_index.tags and badges pointer_summary with [needs-review] (alias: "label").
deprecate{"factor": 0.5, "reason": "superseded"}Multiplies current_heat by factor (clamped 0.05 to 0.95) and marks confidence = "stale" (volatile decay locally).
notify{"message": "Cooling procedure: {label} ({heat})", "target_namespace": "*"}Logs a structured alert and publishes a trigger.notify event to the Agent Bus for proactive MCP delivery.
broadcast{"broadcast_type": "milestone.reached", "message": "{label}", "target_namespaces": ["checkout-web", "qa"]}Fans out a live BusEvent to one or more target namespaces (or "*" / "all" across the tenant).
webhook{"url": "https://hooks.example.com/sulcus", "secret": "whsec_...", "headers": {"X-Env": "prod"}}Sends a 5s-timeout HTTP POST with X-Sulcus-Event, X-Sulcus-Trigger, and HMAC-SHA256 X-Sulcus-Signature headers.
Webhook HMAC-SHA256 Signing & SSRF Protection
Outbound webhook triggers validate target URLs before connecting, blocking loopback, cloud metadata (169.254.0.0/16), RFC1918 private subnets, multicast, and HTTP redirects. When action_config.secret is configured, Sulcus signs the raw JSON body with HMAC-SHA256 and attaches X-Sulcus-Signature: sha256=<hex>.
pythonPython SDK (sulcus)
from sulcus import Sulcus

client = Sulcus(api_key="sk-...")

# 1. Auto-pin every security playbook stored in security-playbooks
client.create_trigger(
    name="pin-security-playbooks",
    namespace="security-playbooks",
    event="on_store",
    action="pin",
    filter_memory_type="procedural",
    filter_label_pattern="SECURITY",
    cooldown_seconds=0,
)

# 2. Alert peer namespaces when critical runbooks cool below 0.30 heat
client.create_trigger(
    name="alert-cooling-runbooks",
    namespace="payments-rails",
    event="on_threshold",
    action="broadcast",
    filter_memory_type="procedural",
    filter_heat_below=0.30,
    cooldown_seconds=300,
    action_config={
        "fire_scope": "per_memory",
        "evaluation_mode": "on_crossing",
        "broadcast_type": "cooling.alert",
        "target_namespaces": ["payments-rails", "shared-platform"],
        "message": "Runbook [{memory_type}] {label} cooled from {old_heat} to {heat}",
    },
)
typescriptTypeScript & Node.js SDK (sulcus)
import { Sulcus } from "sulcus";

const client = new Sulcus({ apiKey: process.env.SULCUS_API_KEY! });

// HMAC-signed webhook whenever an OIDC architecture fact is stored
await client.createTrigger({
  name: "webhook-oidc-facts",
  namespace: "shared-platform",
  event: "on_store",
  action: "webhook",
  filterMemoryType: "fact",
  filterLabelPattern: "OIDC",
  cooldownSeconds: 60,
  actionConfig: {
    url: "https://ops.example.com/webhooks/sulcus",
    secret: process.env.WEBHOOK_HMAC_SECRET,
    headers: { "X-Source": "sulcus-shared-platform" },
  },
});
bashDry-Run Evaluation & Trigger Precision Feedback
# Test-fire triggers against a synthetic event payload
curl -X POST https://api.sulcus.ca/api/v1/triggers/evaluate \
  -H "Authorization: Bearer $SULCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "event": "on_milestone",
    "node_namespace": "shared-platform",
    "node_memory_type": "fact",
    "node_label": "OIDC token exchange live on connected on-prem",
    "node_heat": 0.95
  }'

# Record precision feedback on a fired trigger for SIU telemetry
curl -X POST https://api.sulcus.ca/api/v1/triggers/feedback \
  -H "Authorization: Bearer $SULCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "trigger_id": "0195f4c0-7b12-7000-8000-000000000001",
    "signal": "helpful",
    "note": "Surfaced contract update to checkout-web agent immediately"
  }'
04 · Protocol Reference

Trigger Endpoints & MCP Tools

GET/api/v1/triggers
List triggers visible to the caller (?namespace, ?event, ?enabled_only).
POST/api/v1/triggers
Create a trigger in an ACL-writable namespace.
PATCH/api/v1/triggers/:id
Enable/disable a trigger or update filters, cooldowns, and action_config.
DELETE/api/v1/triggers/:id
Delete a trigger by UUID.
GET/api/v1/triggers/history
Inspect recent trigger_log firings (?trigger_id, ?limit).
POST/api/v1/triggers/evaluate
Evaluate matching triggers manually for a given event and node payload.
POST/api/v1/triggers/feedback
Record precision telemetry (helpful | noisy | dismissed | acted_on | false_positive).
GET/api/v1/triggers/feedback
List recorded trigger feedback signals for precision tuning.
MCPcreate_trigger / list_triggers / update_trigger / delete_trigger / trigger_history
Full trigger lifecycle management over Stdio or Streamable HTTP MCP.