Repository navigation
fix: archive cached account facts before publishing - #490
Conversation
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Pigbibi
left a comment
There was a problem hiding this comment.
Codex author self-review completed for this head after green CI (1,552 tests and 13 subtests). Checked that account identity and snapshot validation precede storage, the client closes before archival, the archive uses the original UTC observation date and exact values, missing values remain null, storage failure prevents a success response and console publishing, and no additional broker/authentication/trading calls are introduced. Confirmed the four-file diff contains only generic code, synthetic fixtures and documentation. The existing non-atomic latest/history write is documented; failures require readback rather than automatic retries. No blocking finding in this scope. This is a Codex self-review, not an independent Grok review. The user explicitly authorized owner-approved labeling and squash merge after CI/review; deployment remains gated by separate user sign-off.
AI assistance
Codex implemented and self-reviewed this change.
What changed
The daily cached-only account facts endpoint published to the console without writing the configured funds archive. When account snapshot persistence is enabled, archive the same validated observation before publishing, preserving its original UTC time, exact decimal text, null balances and position coverage. Return a sanitized HTTP 503 and skip publishing if the archive is unavailable. A later console failure retains the collected archive.
Reuse the existing store and archive paths without new broker reads, authentication, trading, schedule or configuration changes. The existing two-object write is not atomic; partial or unknown outcomes require inspection before retrying. This change does not reconstruct missed historical observations.
How verified
CI run 41287871897 passed: 1,552 tests and 13 subtests, Ruff, locked shared dependency checks, QPK pin consistency, dependency validation and package build. Documentation and engineering governance checks passed. The first CI attempt identified an over-precision test fixture; the fixture now obeys the existing amount contract, which was not relaxed.
Local Ruff, Python AST parsing and git diff --check passed. Local pytest attempts were stopped after hanging during macOS dynamic library loading; no local test pass is claimed. The regression cases passed in CI and cover archive contents and timestamps, failed or missing storage, invalid identity, disabled persistence, console failure and unrequested positions.
No deployment, IAM, secret or scheduler changes are included. Deployment requires separate owner sign-off.