Skip to content

Commit 8c6a8e6

Browse files
committed
refactor: finalize readability cleanup
1 parent e2a3cfc commit 8c6a8e6

623 files changed

Lines changed: 12417 additions & 7354 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ All notable user-visible changes are documented in this file.
44

55
## [Unreleased]
66

7+
## [1.2.0] - 2026-03-07
8+
79
### Added
810

911
- Versioning policy documented in `docs/versioning-and-release.md`.
@@ -20,6 +22,7 @@ All notable user-visible changes are documented in this file.
2022

2123
### Changed
2224

25+
- Internal readability refactor: decomposed `rexos-tools` browser/defs/dispatch/ops/patch internals into smaller modules and aligned dependent crates/tests with the new layout.
2326
- Competitor-analysis posts were moved out of `docs-site/` into `docs/internal/competitive/`, and public blog/homepage references to OpenFang/OpenClaw were removed.
2427
- `loopforge release check` now fails when public docs contain competitor-analysis terms or when semver tags on HEAD do not match the requested release tag.
2528

Cargo.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ members = [
1414
]
1515

1616
[workspace.package]
17-
version = "1.1.0"
17+
version = "1.2.0"
1818
edition = "2021"
1919
license = "MIT"
2020
rust-version = "1.75"

crates/loopforge-cli/src/skills.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use std::collections::BTreeMap;
22
use std::path::{Path, PathBuf};
33

4-
use anyhow::{Context, bail};
4+
use anyhow::{bail, Context};
55
use serde::Serialize;
66

77
use rexos::paths::RexosPaths;
8-
use rexos_skills::loader::{DiscoveredSkill, SkillSource, discover_skills};
8+
use rexos_skills::loader::{discover_skills, DiscoveredSkill, SkillSource};
99
use rexos_skills::manifest::parse_manifest;
1010

1111
#[derive(Debug, Clone, Serialize)]
@@ -41,7 +41,9 @@ pub struct SkillsDoctorReport {
4141
pub issues: Vec<SkillsDoctorIssue>,
4242
}
4343

44-
pub fn discover_workspace_skills(workspace_root: &Path) -> anyhow::Result<BTreeMap<String, DiscoveredSkill>> {
44+
pub fn discover_workspace_skills(
45+
workspace_root: &Path,
46+
) -> anyhow::Result<BTreeMap<String, DiscoveredSkill>> {
4547
let home_skills = home_skills_root()?;
4648
discover_skills(workspace_root, &home_skills)
4749
}

crates/rexos-daemon/src/lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,7 @@ pub async fn serve(addr: SocketAddr) -> anyhow::Result<()> {
126126
let listener = tokio::net::TcpListener::bind(addr)
127127
.await
128128
.with_context(|| format!("bind {addr}"))?;
129-
axum::serve(listener, app())
130-
.await
131-
.context("serve http")?;
129+
axum::serve(listener, app()).await.context("serve http")?;
132130
Ok(())
133131
}
134132

@@ -185,7 +183,10 @@ async fn enforce_auth_and_rate_limit(
185183
next.run(request).await
186184
}
187185

188-
async fn add_security_headers(request: axum::http::Request<axum::body::Body>, next: Next) -> Response {
186+
async fn add_security_headers(
187+
request: axum::http::Request<axum::body::Body>,
188+
next: Next,
189+
) -> Response {
189190
let mut response = next.run(request).await;
190191
let headers = response.headers_mut();
191192
headers.insert(

crates/rexos-harness/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,10 @@ fn run_init_script_capture(workspace_dir: &Path) -> anyhow::Result<String> {
557557
Ok(combined)
558558
}
559559

560-
fn run_powershell_script_output(workspace_dir: &Path, script: &str) -> anyhow::Result<std::process::Output> {
560+
fn run_powershell_script_output(
561+
workspace_dir: &Path,
562+
script: &str,
563+
) -> anyhow::Result<std::process::Output> {
561564
let args = [
562565
"-NoProfile",
563566
"-NonInteractive",

crates/rexos-kernel/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
pub mod config;
22
pub mod paths;
33
pub mod router;
4-

crates/rexos-kernel/src/paths.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,14 @@ mod tests {
6565
let workspace = Path::new("/tmp/workspace");
6666
let home = Path::new("/tmp/home");
6767

68-
assert_eq!(paths.config_path(), PathBuf::from("/tmp/home/.loopforge/config.toml"));
69-
assert_eq!(paths.db_path(), PathBuf::from("/tmp/home/.loopforge/loopforge.db"));
68+
assert_eq!(
69+
paths.config_path(),
70+
PathBuf::from("/tmp/home/.loopforge/config.toml")
71+
);
72+
assert_eq!(
73+
paths.db_path(),
74+
PathBuf::from("/tmp/home/.loopforge/loopforge.db")
75+
);
7076
assert_eq!(
7177
RexosPaths::workspace_skills_dir(workspace),
7278
PathBuf::from("/tmp/workspace/.loopforge/skills")

crates/rexos-llm/src/anthropic.rs

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,26 @@ fn map_messages(messages: &[ChatMessage]) -> anyhow::Result<(String, Vec<Anthrop
142142
for m in messages {
143143
match m.role {
144144
Role::System => {
145-
if let Some(s) = m.content.as_ref().map(|s| s.trim()).filter(|s| !s.is_empty()) {
145+
if let Some(s) = m
146+
.content
147+
.as_ref()
148+
.map(|s| s.trim())
149+
.filter(|s| !s.is_empty())
150+
{
146151
system_parts.push(s.to_string());
147152
}
148153
}
149154
Role::User => {
150155
let mut blocks = Vec::new();
151-
if let Some(s) = m.content.as_ref().map(|s| s.trim()).filter(|s| !s.is_empty()) {
152-
blocks.push(AnthropicContentBlock::Text { text: s.to_string() });
156+
if let Some(s) = m
157+
.content
158+
.as_ref()
159+
.map(|s| s.trim())
160+
.filter(|s| !s.is_empty())
161+
{
162+
blocks.push(AnthropicContentBlock::Text {
163+
text: s.to_string(),
164+
});
153165
}
154166
if !blocks.is_empty() {
155167
out.push(AnthropicMessage {
@@ -160,14 +172,22 @@ fn map_messages(messages: &[ChatMessage]) -> anyhow::Result<(String, Vec<Anthrop
160172
}
161173
Role::Assistant => {
162174
let mut blocks = Vec::new();
163-
if let Some(s) = m.content.as_ref().map(|s| s.trim()).filter(|s| !s.is_empty()) {
164-
blocks.push(AnthropicContentBlock::Text { text: s.to_string() });
175+
if let Some(s) = m
176+
.content
177+
.as_ref()
178+
.map(|s| s.trim())
179+
.filter(|s| !s.is_empty())
180+
{
181+
blocks.push(AnthropicContentBlock::Text {
182+
text: s.to_string(),
183+
});
165184
}
166185

167186
if let Some(calls) = &m.tool_calls {
168187
for c in calls {
169-
let input = serde_json::from_str::<serde_json::Value>(&c.function.arguments)
170-
.unwrap_or(serde_json::Value::Null);
188+
let input =
189+
serde_json::from_str::<serde_json::Value>(&c.function.arguments)
190+
.unwrap_or(serde_json::Value::Null);
171191
blocks.push(AnthropicContentBlock::ToolUse {
172192
id: c.id.clone(),
173193
name: c.function.name.clone(),

crates/rexos-llm/src/dashscope.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ impl LlmDriver for DashscopeDriver {
4343
},
4444
};
4545

46-
let url = format!(
47-
"{}/services/aigc/text-generation/generation",
48-
self.base_url
49-
);
46+
let url = format!("{}/services/aigc/text-generation/generation", self.base_url);
5047
let mut http_req = self.http.post(url).json(&dash_req);
5148
if let Some(key) = &self.api_key {
5249
if !key.trim().is_empty() {
@@ -137,7 +134,11 @@ fn map_messages(messages: &[ChatMessage]) -> Vec<DashscopeMessage> {
137134
}
138135

139136
fn clean_message(mut m: ChatMessage) -> ChatMessage {
140-
if m.content.as_ref().map(|s| s.trim().is_empty()).unwrap_or(false) {
137+
if m.content
138+
.as_ref()
139+
.map(|s| s.trim().is_empty())
140+
.unwrap_or(false)
141+
{
141142
m.content = None;
142143
}
143144
if m.tool_calls.as_ref().map(|c| c.is_empty()).unwrap_or(false) {

0 commit comments

Comments
 (0)