Skip to content

design: durable next-session execution commands with reconciliation #342

Description

@Pigbibi

Problem

Platform reports can state signal_date to effective_date next trading day while the same invocation submits broker orders. A simple date gate would discard each freshly generated signal on the next run.

Required design

  • immutable ExecutionCommand v1 persisted before broker routing
  • producer stores the target, effective date, strategy and immutable decision digest
  • consumer claims only due commands with create-if-absent semantics
  • broker submission, accepted, partial fill, fill, cancel and reject are separate states
  • incomplete claims stay blocked and alert operators instead of retrying blindly
  • reconciliation is idempotent by broker order id and command id
  • staged adapters for Longbridge, IBKR, Schwab and Firstrade

Guardrails

  • no parameter or allocation change in this work
  • no broker order is treated as filled without broker evidence
  • migration must read existing marker formats safely and default to fail closed

Validation

  • deterministic crash and retry tests
  • concurrent consumer claim test
  • broker reconciliation state-machine tests
  • paper-only migration before enabling any live consumer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions