Skip to content

feat: add research input manifest validation - #276

Closed
Pigbibi wants to merge 1 commit into
mainfrom
codex/pre-p3-f0-semantics-v3-implementation-20260731
Closed

feat: add research input manifest validation#276
Pigbibi wants to merge 1 commit into
mainfrom
codex/pre-p3-f0-semantics-v3-implementation-20260731

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Scope

  • Adds the retained F0 research-input manifest validator, schema, and contract tests.
  • Exact scope: three files only; no dependency, export, workflow, or product-scope expansion.

Deterministic gates

  • Focused contract tests: 144 passed.
  • Full CI-equivalent test suite: 768 passed, 1 skipped, 3 subtests passed.
  • Ruff, compileall, schema JSON parse, Python/JSON Schema/ECMAScript parity corpus, constraint refs, and diff/scope checks passed.

F0 closeout only. No F1/P3/provider/live scope.

Co-Authored-By: Codex <noreply@openai.com>
@Pigbibi Pigbibi closed this Jul 31, 2026

@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: 1f1515f1e7

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

from pathlib import Path

import pytest
from jsonschema import Draft202012Validator

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Declare the jsonschema test dependency

The new test module imports jsonschema, but the test job in .github/workflows/ci.yml installs only the editable package, NumPy, pandas, pytest, pytest-cov, and Ruff, while the project declares no runtime dependencies. On that clean CI environment, collection stops here with ModuleNotFoundError: No module named 'jsonschema' before any tests run; add it to the CI/test dependency set or avoid the external import.

Useful? React with 👍 / 👎.

Comment on lines +182 to +184
try:
ZoneInfo(timezone)
except ZoneInfoNotFoundError:

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 Bundle timezone data for clean installations

When this package runs on Windows or a minimal image without a system IANA timezone database, ZoneInfo("America/New_York") raises ZoneInfoNotFoundError; because the project declares neither tzdata nor another fallback, an otherwise valid manifest such as the test fixture is rejected solely according to the host installation. Bundle timezone data or avoid making contract validity depend on an undeclared system resource.

Useful? React with 👍 / 👎.

Comment on lines +186 to +187
if timezone in {"Factory", "posixrules"}:
_invalid()

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 Reject the host-dependent localtime zone

On Linux layouts that expose /usr/share/zoneinfo/localtime, ZoneInfo("localtime") succeeds and this blocklist accepts it. That key follows the machine's /etc/localtime, so the same frozen manifest can denote UTC on one host and another timezone on a different host, undermining reproducibility; reject localtime along with the other non-canonical pseudo-zones.

Useful? React with 👍 / 👎.

Comment on lines +318 to +319
except (InvalidResearchInputEvidence, UnicodeDecodeError, TypeError, ValueError, json.JSONDecodeError):
raise InvalidResearchInputEvidence("invalid research-input manifest JSON") from None

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 Translate excessive nesting into the contract exception

For an invalid payload containing roughly a thousand nested arrays, json.loads raises RecursionError, which is not covered by this exception handler, so read_research_input_manifest_json leaks an implementation exception instead of the documented InvalidResearchInputEvidence. Callers that use that exception to fail closed can therefore crash on malformed input; reject excessive nesting or translate RecursionError consistently.

Useful? React with 👍 / 👎.

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.

1 participant