Skip to content

Fix strict adjusted history diagnostic precedence - #300

Merged
Pigbibi merged 1 commit into
mainfrom
codex/qsl-p3-soxl-adjusted-last-diagnostic-contract-fix-qpk-20260806
Aug 6, 2026
Merged

Fix strict adjusted history diagnostic precedence#300
Pigbibi merged 1 commit into
mainfrom
codex/qsl-p3-soxl-adjusted-last-diagnostic-contract-fix-qpk-20260806

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a sanitized strict ADJUSTED_LAST diagnostic contract
  • classify provider errors and request completion before session equality
  • retain only counts, SHA-256 session-set commitments, and numeric provider error-code counts

Safety

  • exact session equality and fail-closed behavior remain required
  • no provider, credential, live data, runtime, or backtest calls
  • no production dependency changes

Verification

  • 17 passed, 10 subtests passed focused tests
  • 922 passed, 1 skipped, 86 subtests passed full tests
  • Ruff, lock, compile, package, actionlint, scope, and secret gates passed

Co-Authored-By: Codex <noreply@openai.com>
@Pigbibi
Pigbibi merged commit 9618b4b into main Aug 6, 2026
1 check passed
@Pigbibi
Pigbibi deleted the codex/qsl-p3-soxl-adjusted-last-diagnostic-contract-fix-qpk-20260806 branch August 6, 2026 08:32

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f6f242e75f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"strict_adjusted_history:invalid_request_outcome"
) from None

observed_sessions = tuple(_strict_history_session(bar) for bar in bars)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Classify request failures before parsing returned sessions

When a custom requester reports a provider error or missing completion together with a malformed partial bar (for example, a bar whose date is absent or invalid), this eager conversion raises strict_adjusted_history:invalid_bar_session before the documented precedence is applied. The caller therefore loses the higher-priority provider_error/completion_not_observed classification and receives no sanitized diagnostic; classify those request-level states before parsing sessions, or tolerate invalid sessions while constructing their diagnostics.

Useful? React with 👍 / 👎.

for code in provider_error_codes
):
raise ValueError
bars = tuple(outcome.bars)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Sanitize failures while materializing requester bars

When a custom requester returns a valid StrictAdjustedHistoryRequestOutcome whose bars is a provider-backed or lazily decoded Sequence, an exception raised during iteration (such as RuntimeError or an I/O exception) escapes here because the requester call has already left the outer transport try and this block catches only TypeError and ValueError. That exposes the raw provider exception—including potentially sensitive message text—and bypasses both StrictAdjustedHistoryError and its sanitized transport diagnostic; materialization failures should be translated through the same transport-error path.

Useful? React with 👍 / 👎.

diagnostic=diagnostic,
)

candles = tuple(_strict_history_candle(bar) for bar in bars)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reuse the validated session when constructing candles

When a custom requester supplies bar objects whose date attribute is mutable, computed, or concurrently updated, the session is read once for the exact-match check and then read again here by _strict_history_candle. If it changes between those reads, the function can return an exact_match diagnostic while the returned candle contains an unexpected session, violating the strict session contract; cache the validated sessions or construct candles without rereading each bar's date.

Useful? React with 👍 / 👎.

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