Skip to content

feat: audit snapshot completeness and retain daily Binance detail - #1021

Merged
Pigbibi merged 6 commits into
mainfrom
feat/snapshot-completeness-guard
Nov 1, 2026
Merged

Pigbibi merged 6 commits into
mainfrom
feat/snapshot-completeness-guard

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

AI assistance

OpenAI Codex, using the host-selected GPT-6 model settings.

What changed

Add a cloud-only cross-platform archive completeness audit and retain full daily Binance native account detail beyond the two-day latest-cache TTL. Expected dates come from an independently bounded session calendar or continuous UTC calendar, so leading, trailing and entirely missing histories are detected.

The guard validates source identity, observation dates, cash/positions/orders/fills and explicit evidence for empty results. It reads GCS generations, records private audit readback, emits redacted Telegram alerts with uncertain-send suppression, and provides disabled-by-default real-history-only backfill hooks. Binance ingestion persists and reads back full daily detail in the existing Durable Object before acknowledging publication; a dedicated authenticated archive GET exposes one requested day.

A Cloud Run Job container and synthetic configuration describe adoption. There are no deployment, IAM, secret, scheduler or trading changes. Private account/calendar/field mappings and cloud activation require separate owner sign-off. Existing unavailable history and unsupported broker fields remain incomplete.

Coordination: QuantStrategyLab/LongBridgePlatform#685 owns its PAPER collector/watchdog. This PR does not modify that implementation or inherit its cloud authorization.

How verified

  • 19 synthetic Python regression tests passed: trailing/leading/no-sample gaps, known gap-date shapes, holidays/session deadlines/DST/early closes, empty-position proof, invalid fields, identity/permission stops, real-history-only backfill and independent readback, cloud-only entry, generation preconditions and uncertain notification delivery.
  • Existing Binance Worker/SQLite integration suite passed, including new daily-detail retention after cache expiry, authenticated archive reads, equal-time conflicts and date mismatches. Existing future-time negative integration input uses a larger time margin to avoid wall-clock expiry during slow requests; direct validator boundary tests remain unchanged.
  • Generated display/config checks, runtime target validation, JavaScript syntax, documentation style and git diff whitespace checks passed. Documentation check has one existing advisory on the README outline.
  • Full Python and JavaScript CI passed on the reviewed head: https://github.com/QuantStrategyLab/QuantRuntimeSettings/actions/runs/41289296624. Producer roundtrip, documentation, Gitleaks, actionlint and commit conventions passed. The macOS full-suite run was not used for acceptance: existing shell tests require Bash mapfile, nine workflow subprocesses timed out, and runtime-setting tests saw a main configuration update during the run. The clean Linux/Python 3.12 CI is the full-suite result. No live cloud job, Telegram message, broker history call or deployment has been executed.

Risk and rollback

The new Binance detail table intentionally has no TTL. The ingestion path fails publication when archive persistence/readback fails. Existing latest KV and wallet-summary contracts remain unchanged. The archive endpoint uses the dedicated Binance facts bearer token and active trusted binding; retired binding read access is not newly granted. Revert the code or restore the prior reviewed image before activation; preserve archived records. Stop for owner approval before any cloud activation or permission/secret changes.

Pigbibi and others added 6 commits November 1, 2026 16:14
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1cabc13a-2775-4a39-85dc-898acce79468
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@Pigbibi Pigbibi left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-review completed for head 03e3d5f after the configured Python/JavaScript CI passed. This is the implementing assistant's review, not an independent human or CodeRabbit approval.

  • Verified independently bounded calendar dates, unknown source states, empty-result proof, private identity matching and stop-on-access/identity failures.
  • Corrected two findings: null/unknown completeness configuration cannot pass, and backfill readback revalidates a concurrently newer incomplete observation. The 19 focused regression tests pass.
  • Verified Binance daily native detail uses the existing Durable Object transaction and validated readback, preserves source/date identity, rejects conflicts and remains separate from the expiring latest cache.
  • Reviewed the final public diff for account/resource/credential data; Gitleaks and documentation checks pass.
  • No remaining blocking findings in the code diff. Activation still needs the separately approved private account/calendar/field inventory, image deployment, IAM/secret wiring and cloud schedule. Historical gaps and uncollected broker fields remain incomplete.

The owner-approved label and squash merge are authorized by the user's current task instruction; they do not authorize cloud activation or trading.

@Pigbibi Pigbibi added the owner-approved Owner approval for high-risk PRs. AI agents must never apply this label. label Nov 1, 2026
@Pigbibi
Pigbibi merged commit a777bfe into main Nov 1, 2026
16 checks passed
@Pigbibi
Pigbibi deleted the feat/snapshot-completeness-guard branch November 1, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

owner-approved Owner approval for high-risk PRs. AI agents must never apply this label.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant