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-case-format

v2.11.0

Published

Deterministic case condition DSL: validation, evaluation, and case selection.

Readme

@x12i/graphenix-case-format

Deterministic case condition DSL for executable graphs: validate conditions, evaluate them against pre-run context, and select graph/node model cases.

Case evaluation is pure, deterministic, bounded, and non-AI. Forbidden selectors (ai.*, node.output.*, semanticMatch, etc.) are rejected at validation time.

Canonical vocabulary: GLOSSARY.md §4 — phase model profiles (preActionModel, skillModel, postActionModel).
Design brief: GRAPH-FORMAT-FINALIZATION.md · Compile brief: COMPILE-FORMAT-FINALIZATION.md.

Cases are selected at compile time only — the engine uses frozen modelSlots on the plan.


Who should use this

| Role | Use this package? | | ---- | ----------------- | | Graph designer / Studio (case editor) | Yes | | Compiler service | Usually via @x12i/graphenix-plan-compiler | | Engine at runtime | No — cases are resolved at compile time |


Content pipeline example (graph-level cases)

From createContentPipelineReferenceGraph() / contentPipelineModelConfig():

"cases": [
  {
    "id": "default",
    "modelConfig": {
      "preActionModel": { "kind": "profileChoice", "key": "cheap/default" },
      "skillModel": { "kind": "profileChoice", "key": "vol/default" },
      "postActionModel": { "kind": "profileChoice", "key": "cheap/default" }
    }
  },
  {
    "id": "rush",
    "when": { "path": "runtime.input.priority", "op": "eq", "value": "rush" },
    "modelConfig": {
      "preActionModel": { "kind": "profileChoice", "key": "vol/default" },
      "skillModel": { "kind": "profileChoice", "key": "deep/openai_deep" },
      "postActionModel": { "kind": "profileChoice", "key": "vol/default" }
    }
  }
]

When runtime.input.priority === "rush" at compile time, the rush case is selected and frozen on the plan.


Node-level override example

Partial override of MAIN-phase model profile only:

"taskConfiguration": {
  "modelConfig": {
    "inherit": true,
    "cases": [{
      "id": "high-risk",
      "when": { "path": "runtime.input.riskLevel", "op": "eq", "value": "high" },
      "modelConfig": {
        "skillModel": { "kind": "profileChoice", "key": "deep/openai_deep" }
      }
    }]
  }
}

Install

npm install @x12i/graphenix-case-format

Example (API)

import {
  validateCaseCondition,
  evaluateCaseCondition,
  selectGraphModelCase,
  selectNodeModelCase
} from "@x12i/graphenix-case-format";
import type { DeterministicCaseContext } from "@x12i/graphenix-executable-contracts";

const context: DeterministicCaseContext = {
  runtime: { mode: "live", input: { priority: "rush" } },
  graph: { id: "graph:content-pipeline" }
};

validateCaseCondition({
  path: "runtime.input.priority",
  op: "eq",
  value: "rush"
});

const matched = evaluateCaseCondition(
  { path: "runtime.input.priority", op: "eq", value: "rush" },
  context
);

const graphCase = selectGraphModelCase(
  {
    version: "graph-model-config/v1",
    cases: [
      { id: "default", modelConfig: { skillModel: { kind: "profileChoice", key: "vol/default" } } },
      {
        id: "rush",
        when: { path: "runtime.input.priority", op: "eq", value: "rush" },
        modelConfig: { skillModel: { kind: "profileChoice", key: "deep/openai_deep" } }
      }
    ]
  },
  context
);
// → "rush" when priority is rush, else "default"

Key exports

| API | Purpose | | --- | ------- | | validateCaseCondition | Structural + security validation of a condition | | evaluateCaseCondition | Evaluate a condition against deterministic context | | explainMatchedCondition | Human-readable match explanation | | selectGraphModelCase | Pick graph-level model case | | selectNodeModelCase | Pick node-level model case | | isAllowedCasePath / isForbiddenCasePath | Path guardrails |


Allowed path roots

runtime.mode, runtime.environment, runtime.job.*, runtime.input.*,
runtime.variables.*, runtime.flags.*, runtime.context.*,
graph.id, graph.revision

Forbidden: ai.*, node.output.*, semanticMatch, LLM-based selectors.


Critical rule

Cases may choose stronger or weaker AI profiles.
AI may not choose the case.

Dependencies

  • @x12i/graphenix-executable-contracts ^1.0.0

Related packages

| Package | Role | | ------- | ---- | | @x12i/graphenix-authoring-format | Validates cases inside authoring graphs | | @x12i/graphenix-plan-compiler | Selects cases when compiling plans | | @x12i/graphenix-executable-profile-format | Phase model profile slots on extension |