Repository navigation
feat: validate versioned parsed-result ZIP contracts - #420
Draft
Frankie-Xu wants to merge 7 commits into
Draft
Frankie-Xu wants to merge 7 commits into
Frankie-Xu wants to merge 7 commits into
Conversation
Record maintainer decisions needed for issue Ontos-AI#45 before any Pydantic models or worker validation land. Co-authored-by: Frankie-Xu <Frankie-Xu@users.noreply.github.com>
Frankie-Xu
marked this pull request as ready for review
September 14, 2026 18:53
…ie-Xu/parsed-result-contract-20261007
Frankie-Xu
marked this pull request as draft
October 7, 2026 10:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implement the parsed-result ZIP contract from #45. New successful packages add
schema_version: 1to chunks.json, doc_nav.json and manifest.json and validate all three artifacts before upload and job completion. Existing version strings, chunk content and enriched navigation extensions are preserved.Pydantic models generate SDK-discoverable JSON Schema with a CI drift check. The compatibility reader warns on legacy unversioned artifacts. Shape/version/count/asset/ZIP violations fail with sanitized structured details. Repeated asset paths store one member for equal content and reject conflicting content.
Draft design choices, not yet accepted by maintainers: models in shared-python plus generated language-neutral schemas, hard failure for malformed output, required navigation in new packages, integer versioning with additive optional fields unchanged, and retained legacy compatibility. Standalone SDKs are not modified.
Verification
28 synthetic Pydantic/JSON Schema/archive/logging cases and 6 actual ZIP writer cases passed.
Reproduced an unsafe raw NUL member name being hidden by Python ZIP normalization; the actual archive regression passes.
Reproduced upstream repeated-image duplicate ZIP members; repeated-reference and conflicting-content regressions pass.
Reproduced diagnostic traceback locals leaking a synthetic document value; the canonical exception logging regression passes after the scoped fix.
Ruff across apps/packages, targeted Pyright, generated schema drift check and diff check passed. Independent follow-up review found no actionable issues.
Four isolated actual-source navigation loader cases verified that unsupported future section layouts fail instead of silently rebuilding to v1; existing known/legacy rebuild fallback is retained.
11 actual ZIP service/manifest cases passed, including all three unsupported-navigation layouts and pre-write rejection; 2 real worker PostgreSQL/filesystem contracts passed, covering successful upload and malformed-contract failure before upload. Initial collection missed pandas; an isolated evidence-directory runtime overlay resolved it without modifying the API environment. No external accounts or model calls are used.
Full API/worker/shared Pyright in the API-only environment did not pass: 57 missing worker/optional import errors and 2 diagnostics in unchanged worker files. Scoped checks for the modified contract boundary passed; full worker dependency validation remains outside this local acceptance.
Current-head GitHub PR CI, Secret Scan and CodeQL workflows report
action_required; the PR has no reported check rollup. Remote CI has not passed.Deployment Notes
Checklist