npm.io
1.34.0 • Published 4d ago

@x12i/memorix-resolvers

Licence
exellix-license
Version
1.34.0
Deps
0
Size
279 kB
Vulns
0
Weekly
0

@x12i/memorix-resolvers

Pluggable resolver APIs for Memorix. Resolvers normalize join keys, bridge lookups, and domain-specific relationship signals without baking domain knowledge into the pipeline engine.

Used in:

  • Pipeline resolution / enrichment stages — via descriptor processing.resolvers (see memorix-pipeline)
  • Associator requests — optional resolvers / normalization blocks before cross-record join rules

Design

  • Resolver registry — register built-in and custom resolver types.
  • Resolver steps — run one or more resolvers against a source record.
  • Domain plug-ins — networking, pharma, marketing, identity, or any future domain implements the same ResolverDefinition API.
  • Remote resolvers — HTTP providers registered through Explorer /pipeline/registry/parts and merged at pipeline run time.

The engine does not branch on resolver type. A CIDR containment resolver, pharma SKU resolver, and marketing campaign resolver are all ordinary plug-ins.

Usage

import {
  createResolverRegistry,
  builtinResolvers,
  runResolverSteps,
  type ResolverDefinition,
} from "@x12i/memorix-resolvers";

const registry = createResolverRegistry(builtinResolvers);

const myResolver: ResolverDefinition<{ outputPath: string }> = {
  type: "my-domain",
  create(config) {
    return {
      async resolve(input) {
        return {
          outputs: [{ path: config.outputPath, values: ["resolved"] }],
          stats: { inputsScanned: 1, valuesParsed: 1, valuesRejected: 0, matchesFound: 1, ambiguousMatches: 0 },
          diagnostics: [],
        };
      },
    };
  },
};

registry.register(myResolver);

const result = await runResolverSteps(registry, {
  steps: [{ type: "my-domain", resolverKey: "step-1", config: { outputPath: "data.key" } }],
  record: { data: {} },
});

Built-in resolvers

Type Purpose Typical pipeline stage
exact-match Copy normalized values from source paths to an output path resolution
multi-value Split comma-separated scalars into array join fields resolution
bridge-index Map readable keys through a bridge collection to target join keys resolution
markdown-key-value Parse **Label:** value markdown strings into plain objects resolution
markdown-pipe-records Parse pipe-delimited **ID:** … | **Name:** … lines into object arrays resolution
path-existence-classifier Classify path objects into attackPathExistence enum (supported|possible|limited|none|unknown) from pathContext / attackPathMeaning resolution
identifier-key Ensure concept._extIdentifier.key (kind + values, :-joined; migrates legacy concept.identifier) resolution
vulnerability-concept Fix vulnerability snapshot title + hostVulnerability _extIdentifier + vulnerabilityGroupIdentifierKey resolution
subnet-cidr Normalize CIDR or resolve asset IPs to canonical subnet CIDRs resolution
subnet-key Derive legacy subnetIp / subnetId from IP or CIDR network portion resolution
topology-extractor Build associatedTopology from associatedData or subnet IP lookup resolution
zone-from-topology Remediate UNKNOWN subnet data.zone from topology-raw graph enrichment

Assignments are declared per object type in entity descriptor processing.resolvers. The pipeline parts catalog (loadPipelinePartsCatalog) indexes which types use each resolver.

Keywords