feat(isolation): AgentRecipe models (Plan 1b Task 1)#237
feat(isolation): AgentRecipe models (Plan 1b Task 1)#237NeuralEmpowerment wants to merge 1 commit into
Conversation
Adds frozen, extra=forbid Pydantic v2 models (ModelSpec, SystemInstructions, AgentRecipe) implementing the Agent Recipe Standard schema, including non-empty-string validation rules from the spec's section 5 validation table (name, model.name, skill refs, instructions content).
There was a problem hiding this comment.
Pull request overview
Adds the initial “agent recipe” contract to agentic_isolation by introducing Pydantic v2 models that encode the APSS EXP-V1-0003 AgentRecipeStandard schema and its key non-empty/extra-forbid constraints, along with a dedicated test suite. This fits the codebase by establishing a typed, validated recipe artifact that other isolation/workspace components can consume later.
Changes:
- Add
AgentRecipe,ModelSpec, andSystemInstructionsPydantic v2 models (frozen,extra="forbid") in a newrecipe.pymodule. - Add comprehensive validation tests for valid/invalid payloads, round-tripping, and “frozen” behavior.
- Introduce
pydantic==2.13.4as a runtime dependency and update the lockfile accordingly.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lib/python/agentic_isolation/agentic_isolation/recipe.py | Introduces the Pydantic v2 contract models for agent recipes and their validation rules. |
| lib/python/agentic_isolation/tests/test_recipe.py | Adds unit tests covering schema correctness, forbidding unknown fields, and non-empty constraints. |
| lib/python/agentic_isolation/pyproject.toml | Adds pydantic==2.13.4 as a core runtime dependency. |
| lib/python/agentic_isolation/uv.lock | Locks Pydantic and its transitive dependencies for reproducible installs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| name: str = Field(min_length=1) | ||
| agent: Literal["claude", "codex"] | ||
| model: ModelSpec | ||
| skills: list[str] = Field(default_factory=list) | ||
| system_instructions: SystemInstructions | None = None |
|
Superseded by the consolidated Plan 1b contract PR (feat/workspace-run) - all 4 contract tasks in one coherent reviewable unit. This work is included there. |
Plan 1b Task 1. Pydantic v2 models (
frozen,extra=forbid) for an agent recipe -AgentRecipe/ModelSpec/SystemInstructions- matching the APSS AgentRecipeStandard EXP-V1-0003 (PR #88), including the spec's non-empty validation rules (name, model.name, skills entries, content). 20 tests; mypy strict + ruff clean; full package suite 376 pass.Introduces
pydantic==2.13.4asagentic-isolation's first core runtime dep (the contract is Pydantic per the Workspace Standard design/ADR). Merge note: PR for Plan 1b Task 3 (itmux client) also adds this same pydantic line; merge this one first, then Task 3's pyproject/uv.lock resolves trivially. Tracks okrs-51p.3 / okrs-o78.