Signals and Signal Sources: Create the signals module
Back to Signals and Signal Sources.
Create the signals module
Section titled “Create the signals module”The Signals capability supplies the complete audit schema, so the module itself needs no fields:
[ { "resource_module": "signals", "depends_on": "resource_module.signal_sources", "resource": { "identifier": "signals", "title": "signal_identifier", "icon": "mdi:radar", "options": {"capabilities": ["Signals"]}, "fields": [] } }]Generated fields include the source relation and source key, normalized type and payload, occurrence time, classification result, safety, relevance, reason, classifier run, processing batch, case keys, and error text.
Signal states are:
| State | Meaning |
|---|---|
pending_classification | Persisted and queued for the filter agent. |
accepted | Both safe and relevant are true. |
rejected | Unsafe or not relevant. The record remains available for audit. |
classification_failed | The agent run or structured JSON parsing failed. |
processing | Reserved by the current case-building batch. |
processed | Batch processing finished; case_keys records generated cases. |
Every persisted source key is prefixed with source_identifier. Duplicate keys are ignored, which makes repeated polls
safe. The source cursor is stored after a successful poll. If ingestion is retried before the cursor is updated, the
same deduplication key prevents duplicate signal records.
Create cases and work items
Section titled “Create cases and work items”The batch processor only runs when Brezel finds modules with Cases and CaseWorkItems. They can use any identifiers;
the capabilities are what connect them to the signal runtime.
Example using decisions:
[ { "resource_module": "decisions", "resource": { "identifier": "decisions", "title": "title", "options": { "capabilities": [ { "identifier": "Cases", "options": { "include_optional_fields": true, "field_mapping": { "identifier_field": "decision_identifier" } } } ] }, "fields": [] } }, { "resource_module": "decision_work_items", "depends_on": "resource_module.decisions", "resource": { "identifier": "decision_work_items", "title": "description", "options": { "capabilities": [ { "identifier": "CaseWorkItems", "options": { "include_optional_fields": true, "case_module": "decisions", "field_mapping": { "case_relation_field": "decision" } } } ] }, "fields": [] } }]When no field_mapping is present, optional fields are included automatically. When at least one field is mapped,
include_optional_fields defaults to false; set it to true when the capability should still generate all review,
target, provenance, and agent-brief fields.
case_module tells CaseWorkItems which module the generated case relation references. It defaults to cases.
Mappings are intended for existing schemas. A mapped field keeps its existing type and required rules. If the mapped field does not yet exist, Bakery creates it using the capability’s standard definition.
Classification and batching behavior
Section titled “Classification and batching behavior”The scheduler dispatches source polling every minute and case batching every minute for every configured
system. Both jobs use the system workflow queue, onOneServer, and overlap protection. Poll jobs are additionally
unique per system while queued or running. Ingestion also locks each source and merges IMAP folder cursors
monotonically: within the same UIDVALIDITY, an older concurrent result cannot lower the stored UID. A changed
UIDVALIDITY is treated as a legitimate mailbox reset.
For every new signal, classification is queued immediately. The signal-filter agent must return a JSON object with:
{ "safe": true, "relevant": true, "reason": "Existing customer asks for a contract change.", "category": "customer_request", "confidence": 0.94, "security_flags": []}Safety and relevance are independent. Prompt injection, instruction manipulation, phishing, impersonation, and other
security warnings must produce safe = false, even when the underlying business subject is important and therefore
relevant = true. Only safe and relevant signals enter case batching. Existing systems can retain a historical
physical field such as serious by mapping safe_field to it; the field then carries safety semantics.
A batch takes at most 50 accepted signals in occurrence order. The signal-case-builder returns cases, each with
identifier, title, summary, priority, signal_keys, and work_items. Supported work item kinds are analysis,
reply, implementation, review, and follow_up. Invalid kinds fall back to follow_up; invalid priorities fall
back to medium.
Generated cases start with:
status = generatedreview_state = review_pendingGenerated work items start with:
status = generatedreview_state = review_pendingagent_release_state = withheldexecution_state = not_startedNo signal-generated work item is automatically released to an execution agent.