feat(#513): add earnings research packets#550
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cbe6234b1c
ℹ️ 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".
| export async function createInvestingEarningsPacket( | ||
| input: CreateInvestingEarningsPacketInput, | ||
| ): Promise<InvestingEarningsPacket> { | ||
| assertEarningsWorkflow(input.plan.workflow); |
There was a problem hiding this comment.
Validate execution workflow before creating packet
createInvestingEarningsPacket unconditionally calls assertEarningsWorkflow, which throws for any execution tied to non-earnings plans. Both new entry points accept an arbitrary executionId and do not pre-check workflow compatibility before invoking this function, so passing a valid but non-earnings execution now causes an uncaught error instead of the structured error response used for other invalid inputs; this makes create brittle for normal operator mistakes and can fail tool runs abruptly.
Useful? React with 👍 / 👎.
| const symbol = normalizeSymbol(input.plan.symbols[0] ?? ""); | ||
| if (!symbol) { | ||
| throw new Error("Earnings packets require a primary symbol."); |
There was a problem hiding this comment.
Avoid hard-failing when earnings plan has no primary symbol
Packet creation throws when plan.symbols[0] is empty, but planner input allows omitted symbols and symbol extraction depends on uppercase tickers, so common objectives like company-name text can produce earnings executions without a populated symbol list. In that case this path crashes packet creation rather than returning a degraded/structured error result, which blocks packet generation for otherwise valid persisted executions.
Useful? React with 👍 / 👎.
Summary
Validation
Closes #513