{{ message }}
Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Background
Evaluating TradingAgents advice against existing holdings requires audit records isolated from real positions and paper trading. Decision-time quotes must remain available for later review.
Changes
Scope
One outcome: persist the schema and decision-time audit inputs for a future shadow portfolio. This does not create shadow positions, consume decisions or execute trades. The current PR diff contains 3 production files and 75 added/deleted production lines, plus 2 test files; no size exception is requested. A future decision bridge is a separate proposal, not delivered here.
Validation
Tested commit: 0d289de
Commands and results:
Independently executed on this exact detached commit on 2026-10-24, Linux, Python 3.12, pytest 9.1.1, SQLAlchemy 2.1.6:
An initial run without the local package path returned 69 passed / 1 failed (ModuleNotFoundError: marketdata); the corrected run above passed. The old description's Windows run also reported 70 passed, but its original log was not independently available. No live model request or production database was used.
Acceptance evidence
Steps:
Expected:
The shadow trade retains its real-position reference, target weight and cost JSON; the result retains decision-time quote fields. Existing rating/agent tests continue to pass.
Observed:
All 70 tests passed. The schema fixture asserts the real_position_id relationship, commission=12.5 and target_weight_pct=25. The snapshot test asserts price_at_analysis=12.34 and the supplied current/open prices and timestamp. This verifies these fixture assertions, not a production migration or an execution engine.
Evidence:
The sanitized executed output is included above and remains accessible in this PR body. Reproducible assertions: schema test and mapper tests. Source links describe assertions; they are not CI logs. No pull-request-triggered workflow runs were returned for this SHA during this audit. UI screenshots do not apply because this PR changes no UI.
Boundaries and risks
Follow-up
Agree on any decision-bridge scope separately before implementation. Before production use, verify database upgrade/rollback and deletion semantics, then validate execution timing and cost accounting with their own evidence. Maintainer review of whether this prerequisite has sufficient standalone value is still required.