Skip to content

Preserve the frozen horizon across export pages - #120

Open
AdeptArbitrage wants to merge 1 commit into
prooflinedev:mainfrom
AdeptArbitrage:fix/export-settled-horizon
Open

AdeptArbitrage wants to merge 1 commit into
prooflinedev:mainfrom
AdeptArbitrage:fix/export-settled-horizon

Conversation

@AdeptArbitrage

Copy link
Copy Markdown

Problem

The export contract calls X-Proofline-Export-Settled-Until a frozen cutoff. The SDK validates that each page has a valid cutoff, but doesn't compare cutoffs across pages. On a synthetic continuation that returns a different cutoff, both clients hand the caller the mismatched page without warning.

Change

Check each page against the cutoff on the first page read by the iterator, before yielding the page, even if it is empty. A mismatch raises the existing urn:proofline:sdk:invalid-pagination error. Different RFC 3339 spellings of the same instant remain valid, and the SDK preserves the raw header it received. Single-page exports and the public API are unchanged. When resuming, the first page read establishes the cutoff for that iterator; this does not compare against pages saved by an earlier process.

This is a narrow follow-up to the iterator merged in #52. An alternate iterator in #31 proposed a cutoff guard; this PR adds only that guard and its tests to the existing implementation.

Verification

  • Baseline: bb9148da71343ad72af8a5d3965f9fb0e3ebf58b. The same ten new regression cases ran on the baseline and candidate. Baseline: 6 failed, 4 passed. Patched: all 10 passed. The six failures are newly added checks, not failures in the existing test suite.
  • The cases cover cutoff drift on a populated page, on an empty page, and below microsecond precision in both sync and async clients. Controls cover equivalent offsets and trailing fractional zeroes.
  • On Linux with Python 3.13.12, python scripts/check.py --artifacts <fresh-directory> passed: 228 tests, contract and generated-client checks, lint, formatting, types, wheel/sdist builds, and installed-package smoke tests.
  • No live service data was used. These are local results, not GitHub CI results.

This branch has not been deployed

No deployments
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