SynapseHealer 1.0.2
Fixes
zpm "install synapse-healer" no longer fails in the Reload phase with ERROR #5021 ("Directory .../src/cls/Synapse does not exist"). The package used to ship src/cls/Synapse as a symbolic link, which ZPM extracted as an empty file. The 23 class files now live directly under src/cls/Synapse, and the package contains no symlinks.Changes
Upgrade
zpm "install synapse-healer"
Autonomous Dead-Letter & Schema Healer for InterSystems IRIS Interoperability
InterSystems Programming Contest: AI Agents in Interoperability Workflows
In enterprise healthcare and commerce, the Dead-Letter Queue (DLQ) is notoriously known as the graveyard of critical transactions. When third-party vendors update formats without notice, emit malformed dates, swap HL7 segments, or stringify numeric fields, integration engines reject the messages. In traditional workflows, these messages sit in the DLQ until an engineer manually reviews, edits, and re-injects them days or weeks later.
SynapseHealer transforms the dead-letter queue into an autonomous, self-healing interoperability pipeline:
VECTOR_COSINE) queries a 384-dimensional %AI.RAG knowledge base of validated repair runbooks in < 45ms.%AI.Agent with governed tools (SearchRunbookRAG, ValidateRepairedPayload, CalculateRiskScore) diagnoses root causes, repairs corrupted schemas, and validates compliance.Confidence >= 88%, Risk = LOW) are automatically dispatched downstream; ambiguous or risky payloads are escalated to the InterSystems Workflow Engine for Human-in-the-Loop (HITL) approval; unrecoverable corruption is safely isolated in the Quarantine Vault.
📹 Watch Full HD Video:
https://github.com/Josephjbassey/synapse-healer/blob/main/docs/demo/synapse-healer-walkthrough.mp4(1080p 25fps) showing real-time chaos injection, automatic HL7 segment re-ordering, JSON type coercion, and Human Workflow task approval.
Point values are the official ones from the Technology Bonuses post. The organisers decide what is awarded; the bonus results table is the source of truth.
| Bonus | Points | Where it is in SynapseHealer | Status |
|---|---|---|---|
| Custom Adapter | 2 | Synapse.Adapter.DeadLetterInbound extends Ens.InboundAdapter (file drop polling plus a chaos generator) and is the adapter of Synapse.Service.ChaosIngestService |
Awarded |
| Embedded Python | 3 | [ Language = python ] methods: embeddings in SchemaKnowledgeBase, repair routines in AuditTelemetry, validation and risk tools in HealerTools |
Awarded |
| IRIS Vector Search | 2 | VECTOR(DOUBLE, 384) column in Synapse.RAG.HealingRunbook, searched with SQL VECTOR_COSINE |
Awarded |
| Docker | 2 | https://github.com/Josephjbassey/synapse-healer/blob/main/Dockerfile and https://github.com/Josephjbassey/synapse-healer/blob/main/docker-compose.yml, docker compose up -d |
Awarded |
| First article on DC | 2 | Building SynapseHealer: my journey creating a self-healing data pipeline | Awarded |
| Video | 3 | https://github.com/Josephjbassey/synapse-healer/blob/main/docs/demo/synapse-healer-walkthrough.mp4, downloadable without signing in |
Awarded |
| Workflow Engine | 2 | Escalations become EnsLib.Workflow.TaskRequest tasks for the SynapseReviewers role, delivered by the EnsLib.Workflow.Operation item of the same name in Synapse.Production. The role and its reviewers are created by Synapse.Config.WorkflowSetup; Approve/Reject in the Workflow inbox is handled by Synapse.Workflow.ReviewTaskResponse. See Human review with the Workflow Engine |
Requested |
| ZPM / IPM package | 2 | https://github.com/Josephjbassey/synapse-healer/blob/main/module.xml, zpm "install synapse-healer" |
Requested once the package is published |
| Second article on DC | 1 | link to be added when published | Not yet |
Not claimed: Questionnaire, PEX, online demo, AI Hub or Embedded Python bug reports, Community Idea.
flowchart TD subgraph Inbound ["1. Chaos & Dead-Letter Ingestion"] A["Inbound DLQ / Malformed Messages"] --> B["Synapse.Adapter.DeadLetterInbound
(Custom Adapter + Embedded Python)"] B --> C["Synapse.Service.ChaosIngestService
(Business Service)"] C -->|Audit to ^Synapse.DLQ| D["Synapse.Msg.DeadLetterRequest"] endsubgraph Process ["2. Governed Decision & Repair"] D --> E["Synapse.Process.DeadLetterHealerBP<br/>(Business Process / Arbitrator)"] E --> F["Synapse.RAG.SchemaKnowledgeBase<br/>(IRIS Vector Search: VECTOR_COSINE)"] F -.->|Cosine Similarity >= 0.85| E E --> G["Synapse.Agent.DeadLetterHealerAgent<br/>(%AI.Agent / Replay Engine)"] G --> H["Synapse.Agent.HealerToolSet<br/>(Governed HealerTools)"] H -.->|ValidateRepairedPayload| G G --> I["Synapse.Msg.HealResponse"] end subgraph Outbound ["3. Tri-Branch Delivery & HITL"] I --> J{Confidence & Risk Evaluation} J -->|Confidence >= 0.88<br/>Risk LOW| K["Synapse.Operation.ResubmitDeliveryOp<br/>(Downstream Dispatch -> /tmp/synapse/delivered)"] J -->|Risk HIGH / Confidence < 0.88| L["Synapse.Operation.WorkflowEscalationOp<br/>(InterSystems Workflow Engine -> TaskQueue)"] J -->|Corrupt / Critical Risk| M["Synapse.Operation.QuarantineVaultOp<br/>(Isolated Vault -> /tmp/synapse/quarantine)"] end subgraph UI ["4. Next.js Observability & HITL Workspace"] N["Synapse.REST.Dispatch (/api/synapse)"] <---> O["Next.js 14 Dashboard (ui/)"] O -.->|Operator APPROVE / REJECT| L O -.->|Inject 7 Canonical Scenarios| B end
SynapseHealer includes ready-to-test runbooks and regression handlers for 7 canonical enterprise failure patterns:
| ID | Title | Format | Root Cause Flaw | Healed State | Decision Branch |
|---|---|---|---|---|---|
| 1 | Swapped PID/PV1 Segments | HL7 |
Upstream vendor sent PV1 visit segment before PID patient segment in ADT^A01 |
Segments re-ordered to strict HL7 v2.5.1 grammar (MSH -> EVN -> PID -> PV1) |
AUTO_HEAL |
| 2 | Invalid Date Format | HL7 |
Slash format 1985/02/31 or out-of-bounds leap date rejected by strict parser |
Normalized to canonical HL7 YYYYMMDD (19850228) |
AUTO_HEAL |
| 3 | Unescaped Delimiter | HL7 |
Unescaped pipe delimiter | inside clinical complaint notes |
Escaped to standard \F\ delimiter sequence |
AUTO_HEAL |
| 4 | Stringified Numbers & Currency | JSON |
Unit price "$450.00", quantity "5", and boolean "true" stringified |
Converted to numeric floats 450.0, integers 5, and boolean true |
AUTO_HEAL |
| 5 | Vendor Key Drift (v2 Migration) | JSON |
Vendor updated schema to snake_case (cust_id, trans_dt) |
Mapped to canonical enterprise schema (customerId, orderDate) |
AUTO_HEAL |
| 6 | Epoch Millis Timestamps | JSON |
Order date sent as Unix milliseconds integer 1710504000000 |
Converted to ISO-8601 UTC timestamp 2024-03-15T12:00:00Z |
AUTO_HEAL |
| 7 | Corrupted Array Nesting | JSON |
Complex order payload received with missing arrays and nested structures | Structural schema repair; flagged with Risk: MEDIUM_HIGH |
HUMAN_WORKFLOW |
A worked example of two near-identical JSON order failures — the same stringified quantities and currency-prefixed prices, except Case B has a trailing comma — is in https://github.com/Josephjbassey/synapse-healer/blob/main/docs/paired-example.md. Case A is auto-repaired (AUTO_HEAL) with every changed field listed; Case B is isolated (QUARANTINE) because json.loads fails before any field can be rewritten. That is the deciding check in the deterministic replay engine.
SynapseHealer runs on the official InterSystems IRIS Community AI Hub Early Access Program (EAP) build:
2027.1.0AI.109.0 or 2026.3.0AI.154.0.Why build 109? The contest announcement asks for build 154, but by early November the EAP portal only offered the 2027.1 builds. The organisers confirmed in the announcement comments that build 109 can be used and that judges will use the build each app names. SynapseHealer is developed and tested on
2027.1.0AI.109.0;https://github.com/Josephjbassey/synapse-healer/blob/main/module.xmlkeepsVersion=">=2026.3"so it also installs on 154.
# For x86_64: docker load -i iris-community-2027.1.0AI.109.0-docker.tar.gz(Optional) Tag image if using standard tag:
docker tag iris-community:2027.1.0AI.109.0 iris-community:2026.3.0AI.154.0
For ARM64 (Apple Silicon):
docker load -i iris-community-arm64-2027.1.0AI.109.0-docker.tar.gz
SynapseHealer offers two seamless operating modes:
Judges can test 100% of the functionality, vector similarity search, governed tool call sequences, side-by-side payload transformations, and human workflow approvals immediately without providing an external API key:
# 1. Start the IRIS container (iris.script auto-configures SYNAPSE and starts the production) docker compose up -d2. Start the Observability UI
cd ui npm install npm run dev
Open http://localhost:3000 in your browser!
To enable live LLM reasoning via %AI.Agent:
# Copy environment configuration cp .env.example .envEdit .env:
SYNAPSE_MODE=live LLM_PROVIDER=gemini # or openai LLM_API_KEY=your_gemini_or_openai_key LLM_MODEL=gemini-1.5-flash # or gpt-4o-mini
Restart container
docker compose up -d
Credentials are saved into the secure InterSystems IRIS Wallet (%Wallet.KeyValue) without ever exposing secrets in plaintext logs.
ui/)The web UI is built with Next.js 14 (App Router), TypeScript, and Tailwind CSS:
cd ui
npm run dev
REPLAY MODE vs LIVE AI HUB), Interoperability production online indicator, Auto-Heal Rate KPI (90%+), cumulative token counters, inference cost tracker (USD), and average latency monitor.%AI.RAG runbook, narrative agent diagnosis, and step-by-step governed tool execution trace (SearchRunbookRAG -> ValidateRepairedPayload -> CalculateRiskScore).WorkflowEscalationOp. Click Approve (routes to ResubmitDeliveryOp) or Reject (routes to QuarantineVaultOp) with operator notes.Synapse_Data.AuditTelemetry./api/synapse)All endpoints are hosted natively by Synapse.REST.Dispatch under the /api/synapse CSP web application on port 52773:
curl -u _SYSTEM:SYS http://localhost:52773/api/synapse/status
Sample Response:
{
"mode": "replay",
"llmProvider": "gemini",
"llmModel": "gemini-1.5-flash",
"hasApiKey": 0,
"productionRunning": 1,
"runbookCount": 10,
"totalProcessed": 10,
"autoHealedCount": 9,
"workflowPendingCount": 0,
"quarantinedCount": 0,
"totalTokens": 6631,
"estimatedCostUSD": 0.0018,
"avgLatencyMs": 145,
"autoHealRate": 90.0
}
# Inject Scenario 4 (Stringified numbers in JSON order) curl -X POST -u _SYSTEM:SYS http://localhost:52773/api/synapse/inject \ -H "Content-Type: application/json" \ -d '{"scenarioId": 4}'Inject Scenario 1 (HL7 PID/PV1 swapped fields)
curl -X POST -u _SYSTEM:SYS http://localhost:52773/api/synapse/inject
-H "Content-Type: application/json"
-d '{"scenarioId": 1}'
curl -u _SYSTEM:SYS http://localhost:52773/api/synapse/workflow/tasks
curl -X POST -u _SYSTEM:SYS http://localhost:52773/api/synapse/workflow/resolve \
-H "Content-Type: application/json" \
-d '{
"payloadId": "SYN-HL7-D9B31D3B",
"action": "APPROVE",
"reviewerNotes": "Approved by contest judge"
}'
When the agent’s decision is HUMAN_WORKFLOW (medium confidence or risky repairs), the payload is not resubmitted until a person decides.
Synapse.Process.DeadLetterHealerBP sends the HealResponse to Synapse.Operation.WorkflowEscalationOp. Payloads injected through POST /api/synapse/inject reach the same operation through Synapse.Service.WorkflowDispatchService.WorkflowEscalationOp records the task in ^Synapse.WorkflowQueue (used by the dashboard) and sends an EnsLib.Workflow.TaskRequest with actions Approve,Reject to the production item SynapseReviewers (class EnsLib.Workflow.Operation). The Workflow Engine uses that item name as the role, so the task appears in the Workflow inbox of every member of the role.Synapse.Config.WorkflowSetup.Setup() creates the role and adds the reviewers (default _SYSTEM,SuperUser; override with the SYNAPSE_REVIEWERS environment variable). It runs from iris.script during the Docker build and from SetupAll during an IPM install, and it is safe to run again.Synapse.Workflow.ReviewTaskResponse.OnAction calls the same Approve() / Reject() methods as the dashboard: approve resubmits through ResubmitDeliveryOp, reject goes to QuarantineVaultOp.POST /api/synapse/workflow/resolve still work. A decision taken there also removes the task from the Workflow inbox, and whichever decision comes first wins; a second decision on the same payload changes nothing.With the container running:
./scripts/smoke_test.sh synapse-iris SYNAPSE
It runs Synapse.Test.WorkflowSmoke.Run(), which checks that the role and reviewers exist, that an escalation creates a Workflow task for SynapseReviewers, that approving it through the Workflow Engine resubmits the payload, that dashboard decisions clear the inbox, and that the seven replay scenarios still produce decisions. It prints one PASS/FAIL line per check.
https://github.com/Josephjbassey/synapse-healer/blob/main/module.xml (module synapse-healer, version 1.0.2)https://github.com/Josephjbassey/synapse-healer/blob/main/src/cls/Synapse, which is the path IPM uses for a Synapse.PKG resource when <SourcesRoot>src</SourcesRoot>. Version 1.0.2 packages the real class files there; 1.0.1 shipped https://github.com/Josephjbassey/synapse-healer/blob/main/src/cls/Synapse as a symlink, which ZPM extracted as an empty file and failed to reload.<SystemRequirements Version=">=2026.3" Interoperability="enabled"/>, so it needs an AI Hub build (154 or 109) and a namespace with Interoperability enabled.Synapse package, the /api/synapse web application, and runs Synapse.Config.AIHubSetup.SetupAll() (credentials, Workflow role, runbooks, replay telemetry, production start).// From the community registry (after the package is published): zpm "install synapse-healer"
// From a local clone: zpm "load /path/to/synapse-healer -v"
| Class | Type | Purpose |
|---|---|---|
Synapse.Adapter.DeadLetterInbound |
Ens.InboundAdapter |
Custom Inbound Adapter with Embedded Python chaos generator |
Synapse.Service.ChaosIngestService |
Ens.BusinessService |
Inbound Business Service auditing DLQ events to ^Synapse.DLQ |
Synapse.Msg.DeadLetterRequest |
Ens.Request |
Inbound payload container with global character stream helpers |
Synapse.Msg.HealResponse |
Ens.Response |
Outbound response carrying healed content, confidence, risk, and tool traces |
Synapse.RAG.HealingRunbook |
%Persistent |
IRIS Vector Search table with VECTOR(DOUBLE, 384) |
Synapse.RAG.SchemaKnowledgeBase |
Utility | Vector embedding generator and SQL VECTOR_COSINE search engine |
Synapse.Config.AIHubSetup |
Config | Secure IRIS Wallet credential manager and AI Hub configuration |
Synapse.Data.AuditTelemetry |
%Persistent |
Persistent telemetry table and Deterministic Replay Engine |
Synapse.Agent.HealerTools |
%AI.Tool |
Governed tools (SearchRunbookRAG, ValidateRepairedPayload, CalculateRiskScore) |
Synapse.Agent.HealerToolSet |
%AI.ToolSet |
Governed toolset definition for %AI.Agent |
Synapse.Agent.DeadLetterHealerAgent |
%AI.Agent |
Autonomous schema diagnosis and repair agent |
Synapse.Process.DeadLetterHealerBP |
Ens.BusinessProcess |
Core triage coordinator and arbitrator |
Synapse.Operation.ResubmitDeliveryOp |
Ens.BusinessOperation |
Outbound delivery operation to /tmp/synapse/delivered |
Synapse.Operation.WorkflowEscalationOp |
Ens.BusinessOperation |
Records escalations and sends Workflow tasks to the SynapseReviewers role |
Synapse.Config.WorkflowSetup |
Config | Creates the SynapseReviewers Workflow role and its reviewers (idempotent) |
Synapse.Workflow.ReviewTaskResponse |
EnsLib.Workflow.TaskResponse |
Applies Approve/Reject from the Workflow inbox |
Synapse.Service.WorkflowDispatchService |
Ens.BusinessService |
Sends REST-injected escalations into the production |
Synapse.Test.WorkflowSmoke |
Test | Workflow and simulation smoke test |
Synapse.Operation.QuarantineVaultOp |
Ens.BusinessOperation |
Outbound isolation operation to /tmp/synapse/quarantine |
Synapse.Production |
Ens.Production |
Complete Interoperability pipeline wiring all services, processes, and operations |
Synapse.REST.Dispatch |
%CSP.REST |
REST dispatch handler mapped to /api/synapse |