Skip to content

fix: validate trace item object shapes#104

Merged
mertsatilmaz merged 1 commit into
OWASP:mainfrom
snoopuppy582:fix/trace-item-shapes
May 13, 2026
Merged

fix: validate trace item object shapes#104
mertsatilmaz merged 1 commit into
OWASP:mainfrom
snoopuppy582:fix/trace-item-shapes

Conversation

@snoopuppy582

Copy link
Copy Markdown
Contributor

Fixes #86

Summary

  • Added validation that messages, tool_calls, and events contain only object items.
  • Included field name and item index in each validation error.
  • Added unit coverage for invalid trace items and adapter error wrapping.

Tests

  • uv run --python 3.12 --extra dev pytest tests/test_trace.py tests/test_adapters.py -q
  • uv run --python 3.12 --extra dev pytest tests/test_cli.py tests/test_live_http.py -q
  • uv run --python 3.12 --extra dev pytest -q
  • git diff --check

AI-assisted contribution disclosure

  • Tool used: OpenAI Codex.
  • AI-assisted parts: small validation helper and focused unit tests.
  • Human review: I checked the issue requirements, reviewed the diff, verified the errors include field/index details, and ran targeted plus full pytest suites locally.

Notes

  • Existing trace fixture paths still pass through the full test suite.

@mertsatilmaz mertsatilmaz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@mertsatilmaz

Copy link
Copy Markdown
Collaborator

Welcome to the team @snoopuppy582

@mertsatilmaz mertsatilmaz merged commit ad1b02a into OWASP:main May 13, 2026
1 check passed
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.

Tighten trace validation for message, tool call, and event item shapes

2 participants