feat: Adopt program wrapper as canonical PTC format - Update to_json_schema/0#63
Conversation
…schema/0 This commit updates the JSON schema generation to wrap operations in a `program` property and use the `$defs` pattern for recursive references, addressing LLM structured output compatibility issues with root-level `oneOf`. Changes: - Updated `to_json_schema/0` to return schema with program wrapper using $defs pattern - All 33 operations now under $defs.operation.oneOf - Updated $ref handling to use "#/$defs/operation" for recursive references - Regenerated priv/ptc_schema.json with new structure - Updated all schema tests to validate new structure - Added test for recursive operations like pipe.steps Fixes #59 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
PR Review: Adopt program wrapper as canonical PTC format - Update to_json_schema/0SummaryThis PR updates What's Good
Issues (Must Fix)
Suggestions (Optional)None. The implementation is clean and focused. SecurityNo concerns. This PR only modifies JSON Schema generation structure. VerdictRequest Changes - The implementation logic is correct and well-tested. However, the extraneous |
|
@claude please fix these issues from PR review: Issue 1: Remove extraneous .commit_msg.txt fileLocation: Issue 2: Add trailing newline to priv/ptc_schema.jsonLocation: Please fix ALL issues above in a SINGLE commit. Make minimal changes to resolve each issue. |
Auto-Triage SummaryDecisions Made
Status
RationaleBoth issues identified in the review are mechanical fixes that are directly in-scope for this PR:
All issues have been batched into a single fix request to minimize workflow cycles. The PR logic is correct and well-tested; these are minor cleanup items. |
- Remove extraneous .commit_msg.txt file that was accidentally committed - Add .commit_msg.txt to .gitignore to prevent future commits - Add trailing newline to priv/ptc_schema.json (POSIX standard compliance) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
SummaryAll issues from the PR review have been fixed in a single commit. Changes Made
Verification
|
PR Review: feat: Adopt program wrapper as canonical PTC format - Update to_json_schema/0SummaryThis PR correctly updates What's Good
Issues (Must Fix)None. The schema-related changes are complete and self-contained. Suggestions (Optional)
SecurityNo concerns. This is a schema format change with no security implications. VerdictApprove - The implementation is complete, correctly addresses the |
Summary
Implements issue #59 to adopt the
programwrapper as the canonical PTC format, updatingto_json_schema/0to wrap operations in aprogramproperty and use the$defspattern for recursive references.Changes
to_json_schema/0inlib/ptc_runner/schema.exto return schema with program wrapper using $defs pattern$defs.operation.oneOftype_to_json_schema/1to use"#/$defs/operation"for recursive referencespriv/ptc_schema.jsonwith new structurepipe.stepsAddresses Review Concerns
The review identified a critical issue with
$refhandling when wrapping inprogram. This implementation:$defspattern to properly reference operation definitions$refvalues to point to#/$defs/operationTesting
priv/ptc_schema.jsonmatches generated schemaFixes #59