Skip to content

feat(reconciliation): add non-live static envelope - #369

Closed
Pigbibi wants to merge 1 commit into
mainfrom
codex/p4-ibkr-soxl-non-live-reconciliation-envelope-static-20260804
Closed

feat(reconciliation): add non-live static envelope#369
Pigbibi wants to merge 1 commit into
mainfrom
codex/p4-ibkr-soxl-non-live-reconciliation-envelope-static-20260804

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Scope

  • Add a pure in-memory, versioned SOXL non-live reconciliation envelope.
  • Keep reconciliation MISSING; retain negative learning-only/no-order/size-zero flags.
  • Reject material runtime assertions and recursively reject sensitive metadata.

Validation

  • uv run --frozen --extra test pytest -q tests/test_reconciliation_service.py tests/test_rebalance_service.py
  • uv run --frozen --extra test pytest -q
  • uv run --frozen --extra test ruff check .
  • uv run --frozen --extra test python -m compileall -q application tests

No runtime, provider, credential, broker, account, order, configuration, workflow, or dependency changes. This PR must remain unmerged pending explicit authority.

Co-Authored-By: Codex <noreply@openai.com>
@Pigbibi

Pigbibi commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

Closing unmerged: required CI fails before this slice tests because the current main QPK dependency pin is behind QuantPlatformKit main\047s QPK_PIN contract. Aligning pyproject.toml/uv.lock is outside this frozen two-file scope; no remediation, rerun, merge, or deployment is authorized.

@Pigbibi Pigbibi closed this Aug 4, 2026

@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: ed2dce6835

ℹ️ 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".

Comment on lines +139 to +140
if any(envelope.get(key) != value for key, value in required_values.items()):
raise ValueError("non-live reconciliation envelope contains a value that is not allowed")

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 Enforce exact types for fail-closed flags

When an envelope is reconstructed externally or mutated before serialization, Python equality lets integer flags pass this validation because 1 == True and 0 == False. For example, setting learning_only and no_order to 1 and the eligibility/readiness flags to 0 produces canonical JSON and a digest containing numbers rather than the fixed boolean schema, which can fail downstream validation or alter consumers that distinguish JSON booleans from numbers. Validate both the value and its exact type for these flags.

Useful? React with 👍 / 👎.

if key in envelope
}
)
return json.dumps(envelope, ensure_ascii=False, separators=(",", ":"), sort_keys=True)

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 Convert Mapping inputs before JSON serialization

When a caller supplies any valid non-dict Mapping, such as MappingProxyType or UserDict, all preceding validation succeeds but json.dumps raises TypeError because it does not serialize arbitrary mapping implementations. This contradicts the public parameter type and also prevents reconciliation_envelope_digest from accepting the same documented input; convert the outer mapping to a plain dictionary before serialization.

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