Skip to content

chore: remove dead internal/orders and internal/execution packages#24

Open
XelHaku wants to merge 1 commit into
mainfrom
chore/remove-dead-orders-execution
Open

chore: remove dead internal/orders and internal/execution packages#24
XelHaku wants to merge 1 commit into
mainfrom
chore/remove-dead-orders-execution

Conversation

@XelHaku

@XelHaku XelHaku commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes two packages that were unused by the live Go path:

  • internal/execution — imported by nothing.
  • internal/orders — imported only by internal/execution (also removed).

Both also carried latent bugs surfaced during the audit (orders.ComputeAmounts ignored AmountUSDC → zero-notional order; execution.PaperExecutor never debited cash and ignored price/postOnly). Rather than fix dead code, they're deleted.

Live order construction + V2 deposit-wallet signing live in internal/clob; paper simulation lives in internal/paper (+ internal/workflows/paperaccount).

Docs updated (these packages were documented surfaces)

  • ARCHITECTURE.md — dropped the two package rows; live-execution path now lists internal/clob.
  • PRD.md — R5 (Order Builder) downgraded ✅→⚠️ (standalone builder removed; construction/signing in internal/clob); R6/R9 and package lists reworded to drop internal/execution/internal/orders.
  • PRD_POLYDART.md / POLYGOLEM-POLYDART-PARITY.md — Polydart now mirrors internal/clob for order amount-math/signing (parity row points at internal/clob helpers + the golden test).

Note: internal/orders was the documented "Older-Brother Reference" parity source for Polydart. This change reassigns that reference to internal/clob (where the live, golden-tested order math actually is). Confirm the Polydart side is updated accordingly.

Test Plan

  • go build ./... clean (nothing imported the removed packages)
  • go vet ./... clean
  • go test -short ./... passes
  • No stale references remain (only intentional "was removed" notes)

🤖 Generated with Claude Code

Both packages were imported by nothing in the live Go path (internal/execution
by nothing; internal/orders only by internal/execution). They also carried
latent bugs (orders.ComputeAmounts ignored AmountUSDC; execution.PaperExecutor
never debited cash and ignored price/postOnly). Removed both.

Live order construction/signing lives in internal/clob; paper simulation in
internal/paper (+ internal/workflows/paperaccount). Updated ARCHITECTURE.md,
PRD.md, PRD_POLYDART.md, and POLYGOLEM-POLYDART-PARITY.md to drop the
references and point at internal/clob / internal/paper, and to note Polydart
now mirrors internal/clob for order math/signing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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