npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@x12i/graphenix-plan-compiler

v2.7.1

Published

Compile AuthoringGraphDocument + runtime into ExecutableGraphPlan.

Readme

@x12i/graphenix-plan-compiler

Plan compiler — transforms AuthoringGraphDocument + GraphRuntimeObject into an immutable ExecutableGraphPlan.

Handles normalization, deterministic case selection, phase model profile resolution, run-phase execution unit building, profile registry attachment, and plan hashing.

Canonical vocabulary: GLOSSARY.md.
Finalization brief: COMPILE-FORMAT-FINALIZATION.md.
When compile output for task run phases changes, update this README, plan-format/README.md, and GLOSSARY.md together.


Who should use this

| Role | Use this package? | | ---- | ----------------- | | Compiler / execution prep service | Yes | | Backend host | Often via @x12i/graphenix-execute-envelope | | Engine | No — receive the compiled plan, do not compile at runtime | | Graph designer / Studio | Only for compile preview |


Design → plan (phase mapping)

Authoring (task-node-format)              Plan (plan-format)
────────────────────────────              ────────────────────
prePhase.strategyKey                      PRE-phase execution units
  aiTaskStrategies.pre                      externalPreUtility / preAction
  + aiTaskProfile.inputSynthesis.sources    → invokeContract.reads + unitParams.memoryPaths (PRE only)

mainPhase.executionStrategies             MAIN-phase execution units
  + inputsConfig                            → mainSkill invokeContract.reads (MAIN only)
  + aiTaskProfile.inputSynthesis.enabled    pipelinePhase (MAIN skill input synthesis profile)

postPhase.strategyKey                       POST-phase execution units
  aiTaskStrategies.post                       externalPostUtility / postAction

graphenix.executable/v1 model cases              Resolved modelSlots on nodePlans
  preActionModel / skillModel / postActionModel

See GLOSSARY §5: preActions[] on design is optional; compiler may expand strategy keys into plan action lists.

Optional fact-guard: when taskConfiguration.factGuard is present, the compiler pass-through copies preSynthesis / postPolish / postAudit / postAuditMerge into the matching unit unitParams (never sets enabled: true implicitly). executionStrategy stays request-level — graph-engine maps to RunTaskRequest.executionStrategies[].factGuard. See GLOSSARY §6.


Examples (JSON)

Authoring input (design — phase utility strategies)

{
  "id": "node:audience-insights",
  "kind": "task",
  "layout": { "x": 120, "y": 200 },
  "parameters": {
    "profile": "graphenix.task-node/v1",
    "nodeType": "task",
    "skillKey": "professional-answer",
    "taskConfiguration": {
      "executionStrategies": [],
      "aiTaskStrategies": {
        "pre": "synthesis"
      }
    }
  }
}

Fixture: createContentPipelineReferenceGraph()graph:content-pipeline. When authoring declares aiTaskStrategies.post, the compiler appends POST-phase units.

Graph-level phase model profiles live in graph.metadata.extensions["graphenix.executable/v1"].modelConfig (see executable-profile-format README).

Compiled plan output (excerpt — PRE + MAIN only)

Content pipeline reference tasks declare PRE synthesis + plain MAIN — no POST unless design sets aiTaskStrategies.post:

"nodePlans": {
  "node:audience-insights": {
    "executionUnits": [
      {
        "unitKind": "externalPreUtility",
        "order": 0,
        "strategyKey": "synthesis",
        "modelSlot": "preActionModel"
      },
      {
        "unitKind": "mainSkill",
        "order": 1,
        "skillKey": "professional-answer",
        "modelSlot": "skillModel"
      }
    ]
  }
}

Design prePhase.strategyKey → plan PRE-phase execution unit. Not the same JSON field as preActions[] on authoring.

Runtime object (compile input)

{
  "jobId": "job-001",
  "mode": "live",
  "environment": "prod",
  "input": { "riskLevel": "low" }
}

Install

npm install @x12i/graphenix-plan-compiler @x12i/graphenix-plan-format

Example

import { compileExecutablePlan } from "@x12i/graphenix-plan-compiler";
import { validateExecutablePlan } from "@x12i/graphenix-plan-format";

const plan = compileExecutablePlan(authoringGraph, runtime, {
  profileRegistry: { package: "@x12i/ai-profiles", version: "3.2.0" }
});

validateExecutablePlan(plan);
// → hand { plan, runtime } to the engine

Compile pipeline

validateAuthoringExecutableGraph()
normalizeExecutableGraph()
assertNormalizedExecutableGraph()
selectGraphModelCase() → resolveNodeAiPlan() per task node
buildNodeExecutionUnits()     ← PRE / MAIN / POST phase units
buildFinalizerPlans()
validateExecutablePlan()      ← recommended before handoff

Key exports

| API | Purpose | | --- | ------- | | compileExecutablePlan | Authoring + runtime → v1 plan (legacy) | | compileExecutablePlanV2 | Authoring + runtime → v2 plan (canonical) | | createContentPipelineReferencePlan | Compile graph:content-pipeline reference fixture | | buildNodeExecutionUnits | Build PRE / MAIN / POST execution units for a node | | resolveGraphModelConfig / resolveNodeModelConfig | Case selection + inheritance | | resolveNodeModelSlot | Resolve a single phase model profile slot | | resolveNodeAiPlan / resolveAllNodeAiPlans | Full node AI plan | | buildDeterministicCaseContext | Freeze pre-run context for case selection | | explainNodeInheritance | Explain graph/node case and slot provenance |


Important rules

  • Case selection uses pre-run context only. In-run node output cannot change model case selection unless explicitly modeled as a separate compile stage.
  • Design-only fields (e.g. node.layout) are stripped from the embedded normalized graph via stripDesignOnlyFieldsFromGraph() at compile time.
  • Do not describe compile output using “Synthesis PRE”; use PRE-phase utility strategy vs skill input synthesis profile per GLOSSARY.md.

Dependencies

  • @x12i/graphenix-authoring-format ^1.0.0
  • @x12i/graphenix-case-format ^1.0.0
  • @x12i/graphenix-executable-contracts ^1.0.0
  • @x12i/graphenix-core ^2.3.0 (peer)
  • @x12i/ai-profiles ^3.2.0

Related packages

| Package | Role | | ------- | ---- | | GLOSSARY.md | Canonical vocabulary | | @x12i/graphenix-plan-format | Validate compiled plans | | @x12i/graphenix-execute-envelope | Host adapter that calls this compiler | | Compiler role guide | Client guide |