feat(pebble): add orchestrator/schemas.py — Pydantic data models (slice 1) - #205
Open
jpb33333 wants to merge 1 commit into
Open
feat(pebble): add orchestrator/schemas.py — Pydantic data models (slice 1)#205jpb33333 wants to merge 1 commit into
jpb33333 wants to merge 1 commit into
Conversation
Adds the data-model foundation for the new orchestrator pipeline. Eleven
public types covering plans, tool calls, evaluations, and final responses:
- StepType, EvalVerdict (enums)
- PlanStep, Plan (the planner's output)
- ToolCall, ToolResult (executor I/O)
- Evaluation (verifier output, with factuality/harm bounds)
- Citation, ChartSpec, SuggestedAction, FinalResponse (renderer output)
All models are frozen (immutable). Validators enforce: non-empty queries
and tool names (after strip), no forward references in PlanStep.depends_on,
factuality scores in [0.0, 1.0], harm value in {none, mild, severe},
chart kind matches the supported Recharts whitelist.
Slice 1 of 12 in the PR #191 carve. Stacked on slice 0
(feat/pebble-orchestrator-package, PR #204) — purely additive against that
base. No internal pebble imports; only stdlib + pydantic (already in
requirements.txt at pydantic>=2.5.2).
Verification:
- 27 new schemas tests pass.
- Full pebble suite: 317 passed (290 baseline + 27 new), no regressions.
- financial_forecasting suite: 827 passed, 22 skipped, unchanged.
See ~/.claude/plans/pr191-carve-strategy.md for the full slice sequence.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.
Once credits are available, push a new commit or reopen this pull request to trigger a review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the data-model foundation for the new orchestrator pipeline. Eleven public types covering plans, tool calls, evaluations, and final responses, with strict validation and immutable instances.
Stacked on PR #204 (slice 0 — the package conversion). This PR's base is
feat/pebble-orchestrator-package. When #204 merges todev, GitHub will automatically retarget this PR todev.What's added
pebble/orchestrator/schemas.py(221 LOC):StepTypesearch,read,compute,write)EvalVerdictpass,retry,abort)PlanStepPlanToolCallToolResultEvaluationCitationChartSpecSuggestedActionFinalResponseAll models are
frozen=True(immutable). Validators enforce:PlanStep.depends_on(step N can only depend on steps < N).Evaluation.factualityin[0.0, 1.0].Evaluation.harm∈{none, mild, severe}.ChartSpec.kindmatches the supported Recharts whitelist.Why
Every later orchestrator slice (planner, executor, renderer, chat_orchestrator, …) imports from
schemas. Landing the data foundation first means each subsequent slice can be reviewed against a stable type surface.How tested
pytest pebble/tests/test_orchestrator_schemas.py -v— 27 passed:depends_on, accept valid chains, frozen.pytest pebble/tests/ -q— 317 passed (290 baseline + 27 new).pytest financial_forecasting/tests/ -q— 827 passed, 22 skipped, unchanged.Imports
Stdlib + pydantic only:
pydantic>=2.5.2is already inrequirements.txt. No new dependencies.Risk
Very low. The module is purely additive — nothing on dev (or on slice 0) imports from
pebble.orchestrator.schemas, so this PR cannot change any existing code path. The only consumers will be future slices.Rollback
Revert this single commit. The
schemas.pyandtest_orchestrator_schemas.pyfiles disappear; nothing else moves.Next slice
Slice 2:
pebble/llm/(Anthropic client + cost helpers + tests + cassettes). Independent of schemas — can be reviewed in parallel with this one.🤖 Generated with Claude Code