Skip to content

Support nested output schemas in reference validation#401

Open
zhongkaifu wants to merge 10 commits into
mainfrom
codex/update-reference-check-for-nested-params
Open

Support nested output schemas in reference validation#401
zhongkaifu wants to merge 10 commits into
mainfrom
codex/update-reference-check-for-nested-params

Conversation

@zhongkaifu
Copy link
Copy Markdown
Owner

Motivation

  • Reference validation should accept nested out_params_schema mappings so that node creation/update checks can validate deeply nested output definitions.

Description

  • Add a recursive helper _coerce_out_param_schema to coerce nested out_params_schema entries into JSON-schema-like objects.
  • Update _schema_from_out_params_schema to use the coercion helper and preserve existing behavior when a full schema (keys like type, properties, or $schema) is already provided.
  • Changes are limited to velvetflow/verification/binding_checks.py and maintain prior behavior for scalar/fully-specified schemas.

Testing

  • No automated tests were executed as part of this change.

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2a0e93c30d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +26 to +31
def _coerce_out_param_schema(value: Any) -> Mapping[str, Any]:
if isinstance(value, Mapping):
if any(key in value for key in ("type", "properties", "$schema")):
return value
properties = {key: _coerce_out_param_schema(item) for key, item in value.items()}
return {"type": "object", "properties": properties}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Treat non-type schema keywords as schemas, not objects

The new _coerce_out_param_schema treats any mapping that lacks type/properties/$schema as a nested object map, which changes the previous behavior for field-level schemas that only use other JSON Schema keywords (e.g., {"enum": [...]}, {"oneOf": [...]}, {"items": {...}}). Those were previously passed through as-is, but now get coerced into {type: object, properties: {enum: ...}}, so reference validation will interpret foo.enum as a property instead of applying the schema to foo. This breaks existing out_params_schema definitions that rely on keyword-only schemas; consider broadening the “already a schema” check to include other JSON Schema keywords.

Useful? React with 👍 / 👎.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant