Skip to content

rlippmann/context-compiler-example-integrations

Repository files navigation

Context Compiler Example Integrations

What runtime behavior changes when authoritative state exists?

These examples show how authoritative state changes application behavior at runtime.

Each example demonstrates a single enforcement point where premise and policy influence what a host allows, routes, retrieves, builds, or executes.

Prompt reinjection influences model behavior.

Context Compiler influences runtime behavior.

Each example:

  • demonstrates a single runtime enforcement point
  • uses explicit authoritative state
  • remains meaningful with an adversarial model stub
  • focuses on the enforcement point rather than the framework

Start here

Start with Python guide or TypeScript guide if you want language-level orientation first.

Use the enforcement-point catalog below when you already know which runtime behavior you want to inspect.

Both language tracks include generic examples. TypeScript also includes starter apps. Python also includes reference integrations.

Ecosystem map

Project Question
context-compiler (Python), context-compiler (TypeScript) What is the authority contract?
context-compiler-directive-drafter (Python), context-compiler-directive-drafter (TypeScript) How is authority acquired?
context-compiler-example-integrations Where can authority be enforced?

Enforcement-point catalog

Enforcement Point Domain Technology
Gateway middleware Customer support routing generic Python / TypeScript, LiteLLM Proxy
Schema selection Order / incident intake generic Python / TypeScript, Ollama, LiteLLM, Vercel AI SDK
Checkpoint continuation Travel booking generic Python / TypeScript, FastAPI, Node, Next.js
Execution authorization Expense approval generic Python / TypeScript, Node
Retrieval filtering HR policy lookup generic Python / TypeScript, ChromaDB
Request construction / context assembly Writing assistant generic Python / TypeScript, LiteLLM, Open WebUI, Next.js
Tool gating Calendar / email / admin generic Python / TypeScript, MCP

Organization

Examples are organized by enforcement point.

  • Python includes generic examples and reference integrations.
  • TypeScript includes generic examples and starter apps.
  • Available examples differ between Python and TypeScript.

Current layout

Adding examples

Examples in this repo should:

  • use explicit authoritative state
  • avoid deriving Context Compiler state from model output
  • remain meaningful with an adversarial stub
  • demonstrate observable runtime behavior changes

See CONTRIBUTING.md and AGENTS.md for more detail.

Validation

Canonical repo-level validation commands:

uv sync --group dev --no-editable
./scripts/validate_python.sh
./scripts/validate_typescript_fast.sh
./scripts/validate_typescript.sh

Python contributors may install and run local pre-commit hooks:

uv run pre-commit install
uv run pre-commit run --all-files

TypeScript contributors can run the validation scripts directly without installing Python pre-commit tooling.

CI is the authoritative cross-language validation path.

License

Apache-2.0

Releases

No releases published

Packages

 
 
 

Contributors