End-to-end cookbooks¶
The repository's notebooks progress from credential-free execution to live model generation. Launch them from the repository root:
Learning path¶
- Credential-free quickstart
validates, inspects, and executes a complete program with
FakeToolProvider. - Custom provider
implements
ToolProvider, runs the reusable provider contract, and executes a program through the extension. - Calculator connects to a local MCP server and asks a configured OpenAI model to generate arithmetic, higher-order, and conditional programs.
- Memory adds conversational memory to model-backed generation.
- Game statistics composes local MCP tools into a data-processing workflow.
The first two tutorials need no credentials or network access and execute fully
in normal CI. The remaining notebooks require OPENAI_API_KEY; CI validates
their notebook structure, cleanliness, Python syntax, server paths, and
deterministic MCP tools without making model calls.
CI execution contract¶
A notebook opts into credential-free execution with:
make cookbooks rejects committed cell outputs or execution counts, compiles
every code cell, and executes each opted-in notebook in memory from the
repository root. The executed notebook is never written back to the working
tree.
When adding a tutorial:
- State its learning goal and prerequisites in the first Markdown cell.
- Keep every code cell independently readable and use assertions for important outcomes.
- Prefer
treelang.testingfakes for deterministic examples. - Mark it
ci_executeonly when it needs no credentials, network, or external service. - Clear all outputs and execution counts before committing.
- Add it to this learning path and run
make cookbooks.