Skip to content

Conversation

@espeon
Copy link
Member

@espeon espeon commented Oct 15, 2025

This PR migrates our Lexicon-based type generation from the Atrium ecosystem to Jacquard, resulting in cleaner, more idiomatic Rust code with better memory management.

Jacquard has a bunch of improvements compared to Atrium, including

  • Better string handling (CowStr)
  • Cleaner codegen and ser/de
  • Performance (via explicit borrow semantics)

@mmattbtw mmattbtw requested a review from Copilot October 15, 2025 19:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR migrates Lexicon-based type generation from Atrium to Jacquard, modernizing the Rust codebase with improved string handling (CowStr), cleaner serialization/deserialization, and explicit borrow semantics. The migration replaces the esquema-cli tool with jacquard-codegen and updates all type references throughout the codebase.

Key Changes:

  • Replaced esquema-cli with jacquard-codegen for Rust type generation, including faster installation via cargo-binstall
  • Updated all type imports from atrium-api to jacquard-common with new namespace conventions (e.g., fm::tealfm_teal)
  • Refactored code to use Jacquard's lifetime-aware types with explicit 'static conversions via IntoStatic trait

Reviewed Changes

Copilot reviewed 21 out of 22 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tools/lexicon-cli/src/commands/generate.ts Switched from esquema-cli to jacquard-codegen with cargo-binstall fallback
tools/lexicon-cli/README.md Updated documentation to reflect jacquard-lexicon tooling
services/types/readme.md Updated installation instructions for jacquard-lexicon
services/types/Cargo.toml Replaced atrium dependencies with jacquard-common and jacquard-derive
services/cadet/src/ingestors/teal/feed_play.rs Migrated to Jacquard types with CowStr handling and lifetime annotations
services/cadet/src/ingestors/teal/actor_status.rs Updated to use Jacquard's Did type and value deserialization
services/cadet/src/ingestors/teal/actor_profile.rs Converted to Jacquard types with blob reference handling changes
services/cadet/src/ingestors/car/car_import.rs Updated CAR import to use Jacquard value deserialization
services/cadet/Cargo.toml Removed atrium-api, added jacquard-common
lexicons/fm.teal.alpha/stats/defs.json Removed required fields from view objects
apps/aqua/src/xrpc/*.rs Added IntoStatic conversions for API responses with lifetime parameters
apps/aqua/src/repos/*.rs Migrated repository layer to Jacquard types with CowStr conversions
apps/aqua/Cargo.toml Replaced atrium-api with jacquard-common
README.md Updated references from esquema to jacquard-lexicon
Cargo.toml Added workspace jacquard dependencies, removed atrium-api

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +218 to 224
let artists = match row.artists {
Some(value) => {
from_json_value::<Vec<types::fm_teal::alpha::feed::Artist<'_>>>(value)
.unwrap_or_default()
}
None => vec![],
};
Copy link

Copilot AI Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The lifetime annotation <'_> on Artist is inconsistent with the explicit lifetime used elsewhere in this file. Consider using an explicit lifetime parameter or removing it if the compiler can infer it correctly.

Copilot uses AI. Check for mistakes.
Comment on lines +94 to 95
Did::new(&message.did)
.map_err(|e| anyhow::anyhow!("Failed to create Did: {}", e))?,
Copy link

Copilot AI Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The code still uses Did::new() with error handling here, but in actor_status.rs (line 75, 80), the simpler Did::from() is used. Consider using the consistent Did::from() pattern here as well for consistency.

Copilot uses AI. Check for mistakes.
espeon and others added 2 commits October 15, 2025 15:00
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@orual
Copy link

orual commented Oct 15, 2025

prob need to cargo update to make sure you got jacquard-lexicon 0.5.3

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.

3 participants