# Function design

| Record | Covers |
| --- | --- |
| [Program model](https://fzkuji.github.io/OpenProgram/docs/reference/design/function/program-model.html) | Tools and applications, `ProgramContext`, plugins, exposure tiers, user directory, CLI |
| [Function calling](https://fzkuji.github.io/OpenProgram/docs/reference/design/function/calling-unification.html) | `@function` and Agent methods, shared registry, gating, deferred loading |
| [Deferred tools](https://fzkuji.github.io/OpenProgram/docs/reference/design/function/deferred-tools.html) | Catalog, `tool_search` ranking and loading per provider, unavailable tools, tool-array epochs |
| [Tool guides](https://fzkuji.github.io/OpenProgram/docs/reference/design/function/tool-guides.html) | Instructions delivered when a call needs them, `help`, single-entry tools |
| [Agent classes, Programs and tools](https://fzkuji.github.io/OpenProgram/docs/reference/design/function/agentic-program.html) | Agent classes and what each shape is for |
| [Fixed-order calls](https://fzkuji.github.io/OpenProgram/docs/reference/design/function/calling/code-call.html) | A method calling sub-functions in source order |

Decorator usage, metadata, the tool-call loop and pure-Python helpers live only in the [Agentic programming guide](https://fzkuji.github.io/OpenProgram/docs/capabilities/agentic-programming/README.html).

## Implementation

- `openprogram/runtime/agent/call_state.py`
- `openprogram/runtime/agent/runtime/`
- `openprogram/runtime/agent/decision.py`
- `openprogram/programs/tools/<group>/<name>/`
