Skip to content

test: add Tradernet quote reducer integrity replay v0.2 - #122

Draft
safal207 wants to merge 7 commits into
agent/tradernet-public-quotes-reconnectfrom
agent/tradernet-quote-reducer-integrity-v0-2
Draft

safal207 wants to merge 7 commits into
agent/tradernet-public-quotes-reconnectfrom
agent/tradernet-quote-reducer-integrity-v0-2

Conversation

@safal207

@safal207 safal207 commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Purpose

Extends the bounded public Tradernet quote-stream audit from server-message integrity to deterministic client-state consequences.

Parent PR #120 reproduced monotonic n/rev with repeated approximately 15-minute backward ltt jumps. This stacked PR tests the next causal transition:

observed q event trace
→ conventional monotonic n/rev shallow-merge reducer
→ visible quote state

The same exact trace is replayed through a guarded reducer that suppresses ltt, ltp, and lts when market time materially regresses without explicit provenance.

Exact result

Exact audited head: 879262b3e14785fdffd6be47867f4cb43a7f7f24.

Workflow run 30280948711 completed successfully with exact-head identity, clean initial/final worktrees, immutable manifest, evidence artifact and receipt.

TRD-RED-001 — confirmed reducer-level defect candidate

The naive reducer accepted 15 materially backward-time messages because every message had non-decreasing n/rev.

  • affected tickers: AAPL.US, MSFT.US;
  • affected phases: before controlled drop and after reconnect/resubscribe;
  • naive visible-time rollbacks: 15;
  • guarded suppressions: 15.

Verdict: CONFIRMED_DEFECT_CANDIDATE for the conventional reducer model.

TRD-RED-002 — price/size state also changes

All 15 backward-time payloads also changed ltp and/or lts.

Example:

AAPL.US
n   26492 → 26493
rev 70326001 → 70326953
ltt 11:38:28 → 11:23:27  (-901 s)
ltp 338.60 → 338.61
lts 432 → 25

This proves that the observed trace can deterministically roll back more than a timestamp label under shallow merge. It does not prove that the production Tradernet UI uses this reducer.

TRD-RED-003 — repeated snapshot is not stale

The repeated identical subscription produced two new init=1 snapshots, one per ticker.

  • repeated snapshots: 2;
  • stale reinitializations: 0;
  • sequence, revision, market time and ltp matched the current state.

Verdict: REINITIALIZATION_SIGNAL, not a defect candidate in this run.

TRD-RED-004 — no explicit provenance

All 15 contradictory updates lacked an explicit feed/source/delay/entitlement provenance field.

Verdict: SYSTEM_CONTRACT_SIGNAL. The audit does not identify the upstream producer.

Causal conclusion

A conventional reducer that trusts monotonic n/rev and shallow-merges partial quote payloads is sufficient to reproduce visible market-time and price/size rollback from the bounded public demo trace. A provenance-aware freshness guard prevented all 15 deterministic rollback effects.

Evidence

  • run: 30280948711;
  • evidence artifact: 8658790542;
  • artifact digest: sha256:79dfc687b5c72a0185f128d0f544764ca6ce3089c54bd9fe38c12dd4d6d3ddc7;
  • receipt artifact: 8658790877;
  • receipt digest: sha256:f0e9feaad0f2dd7295a6f1cc5941241a9e3727270d3feaf4e34c0c9bcd25f030.

Safety boundary

Public unauthenticated demo stream only, two tickers, one active socket, one controlled reconnect and one repeated identical subscription.

No market depth, account, portfolio, order entry, financial operation, malformed protocol message, fuzzing, concurrency, load testing, active security testing, external contact, deployment or merge.

Claim boundary

The result proves a deterministic client-state consequence for a conventional reducer model. It does not prove the exact production Tradernet reducer, upstream venue, entitlement source, production-account behavior or order-execution impact. Exact production implementation remains NEEDS_AUTHORISED_EVIDENCE.

This PR remains draft and stacked on PR #120.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 706d49ad-2912-438f-b8a1-777429c5deb1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/tradernet-quote-reducer-integrity-v0-2

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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