Skip to content

An agent-managed museum exhibit, built in Rust with Gajae-Code / LazyCodex — developed and maintained with no human intervention.

Rust

Merge remote-tracking branch 'origin/omx-issue-9201-release-ci'

Yeachan-Heo3c73f0ffb3b1
diff --cc .github/workflows/rust-ci.yml
index ab4033d7,f475750c..80776557
--- a/.github/workflows/rust-ci.yml
+++ b/.github/workflows/rust-ci.yml
@@@ -1,38 -1,48 +1,56 @@@
- name: rust-ci
+ name: Rust CI
on:
+ push:
+ branches:
+ - main
+ - 'gaebal/**'
+ - 'omx-issue-*'
++ paths:
++ - .github/workflows/rust-ci.yml
++ - rust/**
pull_request:
+ branches:
+ - main
+ paths:
+ - .github/workflows/rust-ci.yml
+ - rust/**
+ workflow_dispatch:
+
+ concurrency:
+ group: rust-ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+ defaults:
+ run:
+ working-directory: rust
+
+ env:
+ CARGO_TERM_COLOR: always
jobs:
- rust-ci:
+ fmt:
+ name: cargo fmt
runs-on: ubuntu-latest
- defaults:
- run:
- working-directory: rust
steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Install Rust toolchain
- uses: dtolnay/rust-toolchain@stable
+ - uses: actions/checkout@v4
+ - uses: dtolnay/rust-toolchain@stable
with:
- components: rustfmt, clippy
-
- - name: Cache cargo
- uses: Swatinem/rust-cache@v2
+ components: rustfmt
+ - uses: Swatinem/rust-cache@v2
with:
- workspaces: rust
-
- - name: cargo fmt
+ workspaces: rust -> target
+ - name: Check formatting
- run: cargo fmt --all -- --check
+ run: cargo fmt --all --check
- - name: cargo clippy
- run: cargo clippy -p rusty-claude-cli --bin claw --no-deps -- -D warnings
-
- - name: cargo test
+ test-rusty-claude-cli:
+ name: cargo test -p rusty-claude-cli
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: dtolnay/rust-toolchain@stable
+ - uses: Swatinem/rust-cache@v2
+ with:
+ workspaces: rust -> target
+ - name: Run crate tests
run: cargo test -p rusty-claude-cli
diff --cc rust/crates/rusty-claude-cli/src/main.rs
index 027455d0,024774ce..da194cc7
--- a/rust/crates/rusty-claude-cli/src/main.rs
+++ b/rust/crates/rusty-claude-cli/src/main.rs
@@@ -835,59 -681,6 +835,60 @@@ struct StatusUsage
estimated_tokens: usize,
}
+#[allow(clippy::struct_field_names)]
+#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
+struct GitWorkspaceSummary {
+ changed_files: usize,
+ staged_files: usize,
+ unstaged_files: usize,
+ untracked_files: usize,
+ conflicted_files: usize,
+}
+
+impl GitWorkspaceSummary {
+ fn is_clean(self) -> bool {
+ self.changed_files == 0
+ }
+
+ fn headline(self) -> String {
+ if self.is_clean() {
+ "clean".to_string()
+ } else {
+ let mut details = Vec::new();
+ if self.staged_files > 0 {
+ details.push(format!("{} staged", self.staged_files));
+ }
+ if self.unstaged_files > 0 {
+ details.push(format!("{} unstaged", self.unstaged_files));
+ }
+ if self.untracked_files > 0 {
+ details.push(format!("{} untracked", self.untracked_files));
+ }
+ if self.conflicted_files > 0 {
+ details.push(format!("{} conflicted", self.conflicted_files));
+ }
+ format!(
+ "dirty · {} files · {}",
+ self.changed_files,
+ details.join(", ")
+ )
+ }
+ }
+}
+
++#[cfg(test)]
+fn format_unknown_slash_command_message(name: &str) -> String {
+ let suggestions = suggest_slash_commands(name);
+ if suggestions.is_empty() {
+ format!("unknown slash command: /{name}. Use /help to list available commands.")
+ } else {
+ format!(
+ "unknown slash command: /{name}. Did you mean {}? Use /help to list available commands.",
+ suggestions.join(", ")
+ )
+ }
+}
+
fn format_model_report(model: &str, message_count: usize, turns: u32) -> String {
format!(
"Model