WIP: Trajectory format - #457
Ankur Goyal (ankrgyl) wants to merge 7 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 234d7569b5
ℹ️ 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 (@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 (@codex) address that feedback".
| use serde_json::{Map, Value}; | ||
| use std::vec::Vec; | ||
|
|
||
| pub struct Trajectory { |
There was a problem hiding this comment.
Add serialization and TypeScript derives to trajectories
When consumers try to persist or exchange the new trajectory format, serde_json::to_value(&trajectory) cannot compile because Trajectory and its nested types implement neither Serialize nor Deserialize; likewise, enabling ts-rs's chrono-impl feature has no effect because none of these types derive TS or request an export. This leaves the format usable only as in-memory Rust structs and provides no generated TypeScript contract, so derive the required traits across the complete type graph.
AGENTS.md reference: AGENTS.md:L85-L89
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b70bcec55
ℹ️ 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 (@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 (@codex) address that feedback".
| }; | ||
| use chrono::{DateTime, Utc}; | ||
| use serde::{Deserialize, Serialize}; | ||
| use serde_json::{Map, Value}; |
There was a problem hiding this comment.
Use Lingua’s JSON value type for trajectory fields
When callers construct Trajectory metadata, tool inputs, or errors using the public lingua::serde_json::{Map, Value} types, those values are incompatible with these fields because this import resolves to the separate, standard serde_json crate. It also bypasses Lingua’s arbitrary-precision JSON wrapper, so large or high-precision numbers can be rejected or lose fidelity during trajectory round-trips. Import Map and Value from crate::serde_json, as the other universal-format modules do.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec2c221cf8
ℹ️ 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 (@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 (@codex) address that feedback".
| export type { Trajectory } from "./generated/Trajectory"; | ||
| export type { Turn } from "./generated/Turn"; | ||
| export type { WorkStep } from "./generated/WorkStep"; | ||
| export type { AgentResponse } from "./generated/AgentResponse"; | ||
| export type { UniversalUsage } from "./generated/UniversalUsage"; |
There was a problem hiding this comment.
Export all new trajectory constituent types
Because the package export map exposes only the root barrel, exporting just these five types leaves most of the newly generated public schema—such as Scope, Agent, Finding, FindingEvidence, Work, ToolResult, LLMAnalysis, and the token-detail types—unimportable by TypeScript consumers. This affects consumers as soon as they need a helper accepting one of these nested types or want to switch directly on the Work union; re-export the complete public trajectory type graph from this barrel.
AGENTS.md reference: AGENTS.md:L11-L14
Useful? React with 👍 / 👎.
No description provided.