npm.io
1.32.0 • Published 2 weeks ago

@x12i/memorix-insights

Licence
exellix-license
Version
1.32.0
Deps
1
Size
63 kB
Vulns
0
Weekly
0

@x12i/memorix-insights

Pluggable insight processors for Memorix. The platform runs processors generically by processorId; implementations may be local functions or HTTP APIs.

Used in the pipeline enrichment stage via descriptor processing.insightStages. See memorix-pipeline for stage order and orchestration.

Concepts

  • Stage: a processor with inputKind and outputKind (e.g. cidrcidr-path-factsinsights).
  • Engine: runInsightProcessor for one stage, runInsightPipeline for ordered stages.
  • Registry: createInsightProcessorRegistry + builtinInsightProcessors; remote processors via Explorer /pipeline/registry/parts.

Built-in processors

Processor id Input → output Purpose
network.cidr-topology-path-resolver cidrcidr-path-facts Structural topology facts from topology-raw
network.cidr-zone-path-insights cidr-path-factsinsights Zone flags and judgment insights

Topology resolution emits structural facts only. Zone insight generation applies zone rules and emits judgments — keep stages separate in descriptor assignments.

CIDR example

import {
  createInsightProcessorRegistry,
  runInsightPipeline,
  builtinInsightProcessors,
} from "@x12i/memorix-insights";

const registry = createInsightProcessorRegistry(builtinInsightProcessors);

const result = await runInsightPipeline(registry, {
  input: "10.150.68.0/24",
  stages: [
    {
      processorId: "network.cidr-topology-path-resolver",
      sources: {
        topologyDb: "memorix-knowledge",
        topologyCollection: "topology-raw",
      },
    },
    {
      processorId: "network.cidr-zone-path-insights",
      sources: { zonesCollection: "topology-zones-snapshots" },
    },
  ],
});

Pipeline integration

Descriptor example (simplified):

{
  "processing": {
    "insightStages": [
      {
        "processorId": "network.cidr-topology-path-resolver",
        "inputPath": "data.subnetCidrs",
        "sources": { "topologyCollection": "topology-raw" }
      },
      {
        "processorId": "network.cidr-zone-path-insights",
        "sources": { "zonesCollection": "topology-zones-snapshots" }
      }
    ]
  }
}

runEnrichmentStage in @x12i/memorix-pipeline wires record context, passes insightRegistry, and writes processor outputs back onto the record.

Keywords