fix(polymarket): accept verified noncanonical preflight - #432
Conversation
📝 WalkthroughWalkthroughThe real-market shadow gate now propagates and validates canonical metadata, accepts zero canonical uploaded segments when triplets are non-canonical, enforces policy consistency, and expands control-plane coverage for invalid canonical states. ChangesCanonical Upload Validation
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 543b967e1f
ℹ️ 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".
Change contract
Accept a real closed-segment compatibility preflight when the exact candidate uploads exactly one segment and the immutable OSS data/manifest/_SUCCESS triplet independently matches the source bytes and SHA, even when canonical_uploaded_segments is zero. Bind the 0/1 canonical count to the independently read-back manifest flags.
Out of scope
Dependency / merge order
None. Base is main at 170cdea. Merge before rebuilding the next raw-ops candidate and running a new real-segment preflight.
Focused validation
The regression fixture runs the real candidate uploader on a format-valid, non-canonical closed segment and proves uploaded_segments=1, canonical_uploaded_segments=0, exact source/readback SHA, immutable triplet verification, and manifest/count binding. Negative coverage retains incompatible, empty/no-quote, cross-hour, unrelated-output, missing-triplet, tampered, multiple-upload, missing-flag, flag/count mismatch, negative-count, and non-canonical reference-Gate rejection.
Rollout / rollback impact
Control-plane policy only. Rollback is reverting this PR. Production remains Python until a separately governed real-segment preflight and complete 3600+601 second Gate pass.
PRD
None; this is the small, already-specified defect in #431.
Closes #431
Summary by CodeRabbit
Bug Fixes
Tests