Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ jobs:
cargo test --workspace --doc --locked ${{ needs.changes.outputs.eval == 'true' && '--features xtask/eval-tests' || '' }}
- name: Verify wall-clock background handoff
if: needs.changes.outputs.execution == 'true'
run: node scripts/run-rust-test.mjs target/test-artifacts.jsonl local_execution a_long_foreground_command_moves_to_the_background_after_30_seconds --ignored --exact
run: node scripts/run-rust-test.mjs target/test-artifacts.jsonl integration_flow local_execution::a_long_foreground_command_moves_to_the_background_after_30_seconds --ignored --exact
- name: Test development and release scripts
if: needs.changes.outputs.scripts == 'true'
run: |
Expand Down Expand Up @@ -267,7 +267,7 @@ jobs:
export DIM_TEST_JS_RUNTIME="$PWD/runtime/node_modules/@arcships/rutis-runtime"
export DIM_TEST_RUTIS_SDK="$PWD/runtime/node_modules/@arcships/rutis/src/index.mjs"
node scripts/run-rust-test.mjs target/test-artifacts.jsonl transport_flow node_ --ignored --test-threads=2
node scripts/run-rust-test.mjs target/test-artifacts.jsonl mcp_http_flow node_ --ignored --test-threads=2
node scripts/run-rust-test.mjs target/test-artifacts.jsonl app_server_flow mcp_http_flow::node_ --ignored --test-threads=2
node scripts/run-rust-test.mjs target/test-artifacts.jsonl migration_flow node_ --ignored --test-threads=2
node scripts/run-rust-test.mjs target/test-artifacts.jsonl hub_flow node_ --ignored --test-threads=2
if [[ '${{ needs.changes.outputs.eval }}' == true ]]; then
Expand Down
5 changes: 5 additions & 0 deletions crates/dim-agent-aimux/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
autotests = false

[[test]]
name = "agent_aimux_flow"
path = "tests/agent_aimux_flow.rs"

[dependencies]
dim-agent-capabilities.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions crates/dim-agent-aimux/tests/agent_aimux_flow.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#[path = "model_flow.rs"]
mod model_flow;
mod vendor_contract;
5 changes: 5 additions & 0 deletions crates/dim-agent-capabilities/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
autotests = false

[[test]]
name = "capabilities_flow"
path = "tests/capabilities_flow.rs"

[dependencies]
dim-agent-types.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/dim-agent-capabilities/tests/branch_flow.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::support;
use dim_agent_capabilities::{
adapters::{DefaultPrepareModelPlugin, EchoModel, MockTools},
defaults,
Expand Down Expand Up @@ -30,7 +31,6 @@ use std::{
use tokio::sync::Notify;
use tokio_util::sync::CancellationToken;
use tokio_util::task::TaskTracker;
mod support;

/// How many events one page of a line reads.
const LINE_PAGE: usize = 10_000;
Expand Down
29 changes: 29 additions & 0 deletions crates/dim-agent-capabilities/tests/capabilities_flow.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
mod support;

mod branch_flow;
#[path = "context_flow.rs"]
mod context_flow;
mod dispatch_flow;
mod faces_flow;
#[cfg(any(unix, windows))]
mod file_storage_flow;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Making file_storage_flow a module renames its tests to file_storage_flow::.... crates/dim-agent-capabilities/tests/file_storage_flow.rs:988-993 and :1211-1213 re-exec current_exe() with --exact and the bare names removal_scales_with_directory_size and file_storage_flow. Those filters now match zero tests, libtest exits 0, and the parent assertion passes, so both probes are skipped. On the built binary --list --exact removal_scales_with_directory_size prints 0 tests and the test passes in 0.01s. Pass the qualified names and assert the child ran one test.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

{"comment_id":4642233908,"body":"Fixed in 76059f7."}
{"comment_id":4642233921,"body":"Fixed in 76059f7."}
{"comment_id":4642233930,"body":"Fixed in 76059f7."}
{"comment_id":4642233936,"body":"Fixed in 76059f7."}
{"comment_id":4642233943,"body":"Fixed in 76059f7."}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Fixed in 23ab958.

mod flows;
#[cfg(unix)]
mod hooks_flow;
mod host_flows;
#[cfg(unix)]
mod host_platform_flow;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same failure for host_platform_flow: crates/dim-agent-capabilities/tests/host_platform_flow.rs:187-193 re-execs with --exact unchanged_shell_preferences_reuse_detection_and_edits_recover, which no longer matches host_platform_flow::unchanged_shell_preferences_reuse_detection_and_edits_recover. The child runs 0 tests and the parent passes without exercising shell detection. Use the qualified name.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Fixed in 76059f7.

#[cfg(windows)]
mod host_platform_windows_flow;
mod host_port_faces;
mod input_flow;
mod interrupt_flow;
mod legacy_port_faces;
mod legacy_session_faces;
mod method_declarations;
#[path = "permission_flow.rs"]
mod permission_flow;
mod recall_flow;
mod review_flows;
mod session_extension;
mod workspace_files;
23 changes: 14 additions & 9 deletions crates/dim-agent-capabilities/tests/file_storage_flow.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg(any(unix, windows))]

use dim_agent_capabilities::file_storage::{
DirectoryEntry, EntryKind, FileStorage, FileStorageError, FileStoragePlugin, FsRemove,
};
Expand Down Expand Up @@ -990,17 +988,18 @@ fn removal_scales_with_directory_size() {
let output = Command::new(std::env::current_exe().unwrap())
.args([
"--exact",
"removal_scales_with_directory_size",
"file_storage_flow::removal_scales_with_directory_size",
"--nocapture",
])
.env(SCALE_PROBE, "1")
.output()
.unwrap();
let stdout = String::from_utf8_lossy(&output.stdout);
let stderr = String::from_utf8_lossy(&output.stderr);
assert!(output.status.success(), "{stdout}{stderr}");
assert!(
output.status.success(),
"{}{}",
String::from_utf8_lossy(&output.stdout),
String::from_utf8_lossy(&output.stderr)
stdout.contains("1 passed;"),
"child scale probe ran no test:\n{stdout}{stderr}"
);
return;
}
Expand Down Expand Up @@ -1211,14 +1210,20 @@ fn file_storage_flow() {
let child_root = root_path.clone();
let (dead_pid, child) = tokio::task::spawn_blocking(move || {
let child = Command::new(std::env::current_exe().unwrap())
.args(["--exact", "file_storage_flow", "--nocapture"])
.args(["--exact", "file_storage_flow::file_storage_flow", "--nocapture"])
.env(PROBE_ROOT, child_root)
.stdout(Stdio::piped()).stderr(Stdio::piped())
.spawn().unwrap();
let pid = child.id();
(pid, child.wait_with_output().unwrap())
}).await.unwrap();
assert!(child.status.success(), "{}{}", String::from_utf8_lossy(&child.stdout), String::from_utf8_lossy(&child.stderr));
let stdout = String::from_utf8_lossy(&child.stdout);
let stderr = String::from_utf8_lossy(&child.stderr);
assert!(child.status.success(), "{stdout}{stderr}");
assert!(
stdout.contains("1 passed;"),
"child lock probe ran no test:\n{stdout}{stderr}"
);

let mut bytes = lease.read(&cancel).await.unwrap();
bytes.extend_from_slice(b"+second");
Expand Down
2 changes: 1 addition & 1 deletion crates/dim-agent-capabilities/tests/flows.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::support;
use dim_agent_capabilities::{defaults, history::project_messages};
use dim_agent_runtime::testing::MinimalHost;
use dim_agent_runtime::testing::{branch_events, chain_events};
use dim_agent_runtime::*;
use dim_agent_types::*;
use std::time::Duration;
mod support;
use support::Events;

async fn agent() -> MinimalHost {
Expand Down
1 change: 0 additions & 1 deletion crates/dim-agent-capabilities/tests/hooks_flow.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//! Hook points through the public Session interfaces and real commands
//! (`docs/design/plugins/Hooks.md`, appendix D).
#![cfg(unix)]
use dim_agent_capabilities::{
defaults,
execution_settings::ExecutionSettingsHost,
Expand Down
12 changes: 6 additions & 6 deletions crates/dim-agent-capabilities/tests/host_platform_flow.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//! HostPlatform acceptance on Unix (`docs/architecture/rust-agent/plugins/HostPlatform.md`).
#![cfg(unix)]
use dim_agent_capabilities::execution_settings::{ExecutionSettings, ExecutionSettingsHost};
use dim_agent_capabilities::host_platform::*;
use dim_agent_capabilities::toolchain::{InstalledToolchain, ToolchainSourceHost};
Expand Down Expand Up @@ -188,7 +187,7 @@ async fn unchanged_shell_preferences_reuse_detection_and_edits_recover() {
let output = tokio::process::Command::new(std::env::current_exe().unwrap())
.args([
"--exact",
"unchanged_shell_preferences_reuse_detection_and_edits_recover",
"host_platform_flow::unchanged_shell_preferences_reuse_detection_and_edits_recover",
"--nocapture",
])
.env(CHILD_HOME, &home)
Expand All @@ -198,11 +197,12 @@ async fn unchanged_shell_preferences_reuse_detection_and_edits_recover() {
.await
.unwrap();
std::fs::remove_dir_all(home).unwrap();
let stdout = String::from_utf8_lossy(&output.stdout);
let stderr = String::from_utf8_lossy(&output.stderr);
assert!(output.status.success(), "{stdout}\n{stderr}");
assert!(
output.status.success(),
"{}\n{}",
String::from_utf8_lossy(&output.stdout),
String::from_utf8_lossy(&output.stderr)
stdout.contains("1 passed;"),
"child shell-cache probe ran no test:\n{stdout}\n{stderr}"
);
return;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
//! (`docs/architecture/rust-agent/plugins/HostPlatform.md`). The platform has
//! no confinement backend, so the timeout, output caps and cancellation apply
//! and the result reports `confined: false`.
#![cfg(windows)]
use dim_agent_capabilities::execution_settings::{ExecutionSettings, ExecutionSettingsHost};
use dim_agent_capabilities::host_platform::*;
use std::{ffi::OsString, path::PathBuf, time::Duration};
Expand Down
2 changes: 1 addition & 1 deletion crates/dim-agent-capabilities/tests/input_flow.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! The input entry's atomic batch: several validated inputs commit together
//! or not at all, and a replayed batch returns what the branch already holds.
mod support;
use crate::support;

use std::{
ops::RangeInclusive,
Expand Down
4 changes: 0 additions & 4 deletions crates/dim-agent-capabilities/tests/support/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
//! Follows one branch the way a host does: listen on the Session broadcast
//! first, then read the Timeline history and drop what the broadcast repeats.
#![expect(
dead_code,
reason = "the three flow binaries share this fixture; each uses the parts it needs"
)]
use dim_agent_capabilities::session_broadcast::{
SessionBroadcast, SessionBroadcastEvent, session_channel,
};
Expand Down
5 changes: 5 additions & 0 deletions crates/dim-agent-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
autotests = false

[[test]]
name = "agent_runtime_flow"
path = "tests/agent_runtime_flow.rs"

[dependencies]
dim-agent-types.workspace = true
Expand Down
5 changes: 5 additions & 0 deletions crates/dim-agent-runtime/tests/agent_runtime_flow.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mod faces;
mod lifecycle_review;
mod opening_progress;
#[path = "timeline_flow.rs"]
mod timeline_flow;
5 changes: 5 additions & 0 deletions crates/dim-agent-scheduler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ repository.workspace = true
rust-version.workspace = true
publish = false
description = "Scheduled jobs: a native process owner and Session feature for Dim"
autotests = false

[[test]]
name = "scheduler_flow"
path = "tests/scheduler_flow.rs"

[dependencies]
dim-agent-runtime.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/dim-agent-scheduler/tests/lifecycle_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! `delivered` once its input is written and is not tracked afterwards, a
//! past `at` job records `missed`, DST gaps skip and repeated times fire
//! once, and a launch Session runs until its stop time.
mod support;
use crate::support;
use serde_json::{Value, json};
use std::sync::Arc;
use support::*;
Expand Down
16 changes: 16 additions & 0 deletions crates/dim-agent-scheduler/tests/scheduler_flow.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
mod support;

mod cross_crate_named_service;
mod data_faces_flow;
mod lifecycle_flow;
mod loop_flow;
mod management_flow;
mod plugin_file_transactions;
mod recovery_flow;
mod retention_flow;
mod run_flow;
mod session_flow;
mod timer_flow;
mod tool_flow;
mod wakeup_flow;
mod watch_flow;
2 changes: 1 addition & 1 deletion crates/dim-agent-scheduler/tests/session_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! A.1, A.6): one input per window on the target branch, the delivery
//! vocabulary, bounded lookup settling, overlap skips, legacy mapping and
//! retention.
mod support;
use crate::support;
use dim_agent_scheduler::testing::retention;
use serde_json::{Value, json};
use std::sync::Arc;
Expand Down
4 changes: 2 additions & 2 deletions crates/dim-agent-scheduler/tests/support/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! A real App Server with the Scheduler installed and a scripted model.
#![expect(
#![allow(
dead_code,
reason = "each test binary uses the helpers it needs; the rest are shared"
reason = "shared by lib tests and scheduler_flow; each uses the helpers it needs"
)]
use dim_agent_capabilities::{defaults, history::HistoryRenderer, host::*};
use dim_agent_runtime::{AgentBuilder, AgentConfig, SessionConfig};
Expand Down
2 changes: 1 addition & 1 deletion crates/dim-agent-scheduler/tests/wakeup_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use std::{
};
use tokio_util::sync::CancellationToken;

mod support;
use crate::support;
use support::*;

/// Replies with queued tool batches, then with text; keeps every request.
Expand Down
2 changes: 1 addition & 1 deletion crates/dim-agent-scheduler/tests/watch_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! watching connection alone as one numbered progress item, run states in
//! the order the record took them, nothing after the connection closes, and
//! a reload answers the open call `operation_interrupted`.
mod support;
use crate::support;

use dim_agent_capabilities::{defaults, history::HistoryRenderer};
use dim_agent_runtime::{AgentBuilder, AgentConfig};
Expand Down
5 changes: 5 additions & 0 deletions crates/dim-agent-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ edition = "2024"
license.workspace = true
repository.workspace = true
publish = false
autotests = false

[[test]]
name = "agent_types_contract"
path = "tests/agent_types_contract.rs"

[dependencies]
serde = { workspace = true }
Expand Down
6 changes: 6 additions & 0 deletions crates/dim-agent-types/tests/agent_types_contract.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
mod branch_contract;
mod control_contract;
mod extension_contract;
mod permission_cap_contract;
mod schema_contract;
mod wire_contract;
13 changes: 13 additions & 0 deletions crates/dim-app-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
autotests = false

[[test]]
name = "transport_flow"
path = "tests/transport_flow.rs"

[[test]]
name = "provider_memory_flow"
path = "tests/provider_memory_flow.rs"

[[test]]
name = "app_server_flow"
path = "tests/app_server_flow.rs"

[dependencies]
dim-codemode.workspace = true
Expand Down
10 changes: 5 additions & 5 deletions crates/dim-app-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ There is no atomic transaction spanning the account file and SQLite. A generatio
Public API-key, provider, native subscription, managed provider and transport flows do not need Node:

```sh
cargo test --locked -p dim-app-server --test provider_flow --test managed_oauth_flow --test managed_provider_flow --test model_catalog_flow --test transport_flow
cargo test --locked -p dim-app-server --test app_server_flow --test transport_flow
```

The separately enabled Node flows load plugins through the actual rutis runtime and MCP servers built on the official MCP SDK. They cover C4 Session tool and method binding, isolation, restore, cancellation, an unmodified Cordis 4 branch plugin, and stdio and legacy SSE MCP flows.
Expand All @@ -739,8 +739,8 @@ npm ci --prefix runtime --ignore-scripts
export DIM_TEST_NODE="$(command -v node)"
export DIM_TEST_JS_RUNTIME="$PWD/runtime/node_modules/@arcships/rutis-runtime"
export DIM_TEST_RUTIS_SDK="$PWD/runtime/node_modules/@arcships/rutis/src/index.mjs"
cargo test --locked -p dim-app-server --test transport_flow --test mcp_http_flow \
node_ -- --ignored
cargo test --locked -p dim-app-server --test transport_flow node_ -- --ignored
cargo test --locked -p dim-app-server --test app_server_flow mcp_http_flow::node_ -- --ignored
```

The separate Python flows cover plugin installation, reload and scoped parts. In the same shell, use Python 3.12 or later with the pinned `rutis` package.
Expand All @@ -762,8 +762,8 @@ cargo test --locked -p dim-app-server --test transport_flow \
Run the live Context7 check manually with `CONTEXT7_API_KEY`.

```sh
cargo test --locked -p dim-app-server --test mcp_http_flow \
context7_live_through_rust_plugins -- --ignored
cargo test --locked -p dim-app-server --test app_server_flow \
mcp_http_flow::context7_live_through_rust_plugins -- --ignored
```

The [C4 Session TypeScript spike](../../docs/design/session-typescript-spike.md)
Expand Down
Loading