Skip to content

Finalize a stopped Rust reference tape for bounded shadow parity #488

Description

@proerror77

Parent

#486

What to build

Provide a fail-closed polymarket-raw-ops operation that finalizes the active reference tape into one strict rotated segment only after it can acquire the same exclusive spool lock held by the collector. The operation must validate and sync the active tape through the existing TapeWriter path, publish a new empty active tape atomically, and make a 15-minute shadow Gate able to verify and upload a closed Rust segment without waiting for a UTC-hour rotation.

Acceptance criteria

  • A focused Rust test proves a stopped collector leaves no closed segment today (red proof).
  • The collector and finalizer contend on one existing fs4 spool lock; finalization fails while collection owns it.
  • Finalization converts one valid active tape into exactly one strict rotated tape and publishes a fresh active tape without clobbering a pre-existing rotated file.
  • Empty, malformed, non-regular, or concurrent active tapes fail closed.
  • The existing uploader and parity remain closed-segment-only; neither learns to consume the active tape.
  • The CLI operation is independently buildable and carries a targeted counterexample test.

Blocked by

None

Out of scope

Changing quote data semantics, uploader acceptance, OSS behavior, Python health policy, the 15-minute Gate duration policy, research/snapshot/#235, or production cutover.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestready-for-agentFully specified and safe for an autonomous agent

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions