Skip to content

feat(isolation): AgentRecipe models (Plan 1b Task 1)#237

Closed
NeuralEmpowerment wants to merge 1 commit into
mainfrom
feat/runspec-recipe-models
Closed

feat(isolation): AgentRecipe models (Plan 1b Task 1)#237
NeuralEmpowerment wants to merge 1 commit into
mainfrom
feat/runspec-recipe-models

Conversation

@NeuralEmpowerment

Copy link
Copy Markdown
Contributor

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.4 as agentic-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.

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).
Copilot AI review requested due to automatic review settings July 6, 2026 00:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and SystemInstructions Pydantic v2 models (frozen, extra="forbid") in a new recipe.py module.
  • Add comprehensive validation tests for valid/invalid payloads, round-tripping, and “frozen” behavior.
  • Introduce pydantic==2.13.4 as 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.

Comment on lines +61 to +65
name: str = Field(min_length=1)
agent: Literal["claude", "codex"]
model: ModelSpec
skills: list[str] = Field(default_factory=list)
system_instructions: SystemInstructions | None = None
@NeuralEmpowerment

Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants