Skip to content

[codex] strengthen event ingestion validation#8

Merged
stacknil merged 3 commits into
mainfrom
codex/issue-3-input-validation
Mar 23, 2026
Merged

[codex] strengthen event ingestion validation#8
stacknil merged 3 commits into
mainfrom
codex/issue-3-input-validation

Conversation

@stacknil

Copy link
Copy Markdown
Owner

Summary

Fixes #3.

This PR keeps scope limited to input validation and error clarity for local file ingestion. It strengthens load_events so the repository's two supported runtime formats, .jsonl and .csv, fail more predictably when input is malformed or when required event fields are missing.

Before this change, JSONL parsing already rejected invalid JSON lines, but CSV parsing mostly surfaced raw pandas exceptions, and required-field validation only checked whether a column existed anywhere in the frame. That meant a mixed JSONL or CSV file could still pass validation even if an individual record was missing a required field value, because the column existed due to other rows.

The fix does three focused things:

  • wraps malformed CSV parse failures in a clear ValueError that includes the file path
  • improves malformed JSONL errors so they include both the file path and line number
  • strengthens required-field validation so both .jsonl and .csv inputs must provide timestamp, event_type, source, target, and status for every row/record, not just somewhere in the table

I also made a one-line README clarification so the documented required fields match the stricter runtime behavior for both supported formats.

Validation

  • pytest tests/test_io.py
  • pytest

Notes

I also attempted python -m pip install -e . in this environment, but it timed out locally before completion. The repository's existing editable install was already available, and the full test suite still passed against the checked-out code.

@stacknil stacknil marked this pull request as ready for review March 23, 2026 19:04
@stacknil stacknil added v0.2 Planned for v0.2 milestone enhancement New feature or request docs Documentation and README behavior labels Mar 23, 2026
@stacknil stacknil added this to the v0.2 milestone Mar 23, 2026
@stacknil

Copy link
Copy Markdown
Owner Author

@codex review
Focus on:

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9dce0d5ea2

ℹ️ 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 thread src/telemetry_window_demo/io.py Outdated
@stacknil

Copy link
Copy Markdown
Owner Author

@codex review
Please re-review the latest head commit after the CSV NA-like literal fix.
Focus on:

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

ℹ️ 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".

@stacknil stacknil merged commit c78f89b into main Mar 23, 2026
2 checks passed
@stacknil stacknil deleted the codex/issue-3-input-validation branch March 23, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation and README behavior enhancement New feature or request v0.2 Planned for v0.2 milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v0.2: strengthen input validation for JSONL/CSV ingestion and required fields

1 participant