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
2 changes: 1 addition & 1 deletion benchmark_data/session-temporal/workload-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"status": "accepted_for_harness"
},
"implementation": {
"path": "crates/tracedecay/src/session_temporal_benchmark.rs"
"path": "crates/tracedecay/benches/session_temporal/harness.rs"
},
"measurement_contract": {
"measured_repetitions": 30,
Expand Down
2 changes: 1 addition & 1 deletion crates/tracedecay-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ hotpath-cpu = [
"hotpath/hotpath-cpu",
]
hotpath-mcp = ["hotpath", "hotpath/hotpath-mcp"]
production = ["tracedecay/production"]
production = ["tracedecay/production", "tracedecay/bench"]
# Opt-in tiered graph storage; not part of `production`.
graph-disk-tier = ["tracedecay/graph-disk-tier"]
graph-tiered-storage = ["tracedecay/graph-tiered-storage"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::provision_host_cli_fixture;
#[cfg(unix)]
use std::os::unix::fs::PermissionsExt;
use tempfile::TempDir;
use tracedecay::host_admission::HostAdmissionTestRuntimeV1;
use tracedecay::test_support::host_admission::HostAdmissionTestRuntimeV1;
use tracedecay_agent_hosts::PRODUCT_VERSION;
use tracedecay_automation_runtime::automation::run_ledger::{
AutomationRunArtifactKind, AutomationRunLedgerRecord, append_run_record, write_run_artifact,
Expand Down
2 changes: 1 addition & 1 deletion crates/tracedecay-cli/tests/core_cli_suite/gain_test.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::fs;

use tempfile::TempDir;
use tracedecay::host_admission::HostAdmissionTestRuntimeV1;
use tracedecay::test_support::host_admission::HostAdmissionTestRuntimeV1;

async fn open_isolated_runtime(tmp: &TempDir) -> HostAdmissionTestRuntimeV1 {
HostAdmissionTestRuntimeV1::profile(tmp.path().join(".tracedecay"))
Expand Down
6 changes: 6 additions & 0 deletions crates/tracedecay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ lang-fsharp = ["tracedecay-code-index/lang-fsharp"]
lang-quint = ["tracedecay-code-index/lang-quint"]
lang-toml = ["tracedecay-code-index/lang-toml"]
lang-lean = ["tracedecay-code-index/lang-lean"]
# Shipped `tracedecay bench` / MCP `admin_project` action `bench`. Off the
# default library graph; `tracedecay-cli`'s `production` feature selects it
# so the command stays in the binary without compiling this module into
# `cargo check -p tracedecay --lib`.
bench = []

# Integration fixture surface. `HostAdmissionTestRuntimeV1` and the registered
# database scaffolding it owns are assembled by the composition root, so they
# live in the product library rather than a test crate. This feature keeps them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ impl Default for BenchOptions {

/// The embedded default query set. Compiled into the binary so `tracedecay bench`
/// works without any external file dependency.
pub const DEFAULT_QUERIES_TOML: &str = include_str!("../../../benchmark_data/queries/default.toml");
pub const DEFAULT_QUERIES_TOML: &str =
include_str!("../../../../benchmark_data/queries/default.toml");

/// Run the bench from a TOML query file on disk.
pub async fn run_bench(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ use tracedecay_daemon_protocol::{
use tracedecay_domain::ProjectId;

use super::{BrokerStreamTransport, DaemonLifecycle, serve_routed_rmcp_connection};
use crate::host_admission::HostAdmissionTestRuntimeV1;
use crate::mcp::McpServer;
use crate::test_support::host_admission::HostAdmissionTestRuntimeV1;
use crate::tracedecay::TraceDecayOpenOptions;

pub const PERSISTENT_WARMUP_REQUESTS: usize = 8;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const HISTORICAL_RESULT_PATH: &str = "benchmark_data/session-temporal/result-pro
const HISTORICAL_RESULT_FILE_NAME: &str = "result-provisional.json";
const HISTORICAL_HARNESS_PATH: &str = "src/sessions/session_temporal_benchmark.rs";
const RUNNER_PATH: &str = "scripts/run-session-temporal-benchmark.sh";
const HARNESS_PATH: &str = "crates/tracedecay/src/session_temporal_benchmark.rs";
const HARNESS_PATH: &str = "crates/tracedecay/benches/session_temporal/harness.rs";
const SOURCE_MODE_CLEAN: &str = "clean_git_worktree_v1";
const SANITIZATION_RECEIPT_PATH: &str =
"benchmark_data/session-temporal/fixtures/codex-sanitization-receipt.json";
Expand All @@ -84,13 +84,13 @@ const NATIVE_CODEX_FIXTURES: &[(&str, &str)] = &[
(
"tests/fixtures/provider_normalization/codex/session_meta.input.json",
include_str!(
"../../../tests/fixtures/provider_normalization/codex/session_meta.input.json"
"../../../../tests/fixtures/provider_normalization/codex/session_meta.input.json"
),
),
(
"tests/fixtures/provider_normalization/codex/agent_message.input.json",
include_str!(
"../../../tests/fixtures/provider_normalization/codex/agent_message.input.json"
"../../../../tests/fixtures/provider_normalization/codex/agent_message.input.json"
),
),
];
Expand Down Expand Up @@ -718,7 +718,7 @@ fn measurement_result(source_identity: Value, measurement: Value) -> Value {
/// benchmark-private handle.
fn ensure_admission_resource_authorities()
-> Arc<tracedecay_runtime_core::background_cpu::ProcessBackgroundCpuV1> {
crate::host_admission::ensure_process_background_cpu_authority()
crate::test_support::host_admission::ensure_process_background_cpu_authority()
.expect("install process capture authorities for the benchmark")
}

Expand Down
2 changes: 1 addition & 1 deletion crates/tracedecay/benches/transcript_ingest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use std::path::{Path, PathBuf};
use std::time::{Duration, Instant};

use futures_util::FutureExt as _;
use tracedecay::host_admission::HostAdmissionTestRuntimeV1;
use tracedecay::test_support::host_admission::HostAdmissionTestRuntimeV1;
use tracedecay_domain::ProjectId;
use tracedecay_runtime_core::storage::write_repository_identity_marker;
use tracedecay_sessions::runtime::SessionProvider;
Expand Down
23 changes: 13 additions & 10 deletions crates/tracedecay/src/config/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,9 +572,10 @@ async fn discover_project_root_with_identity_does_not_open_registry_only_store()
let _profile = super::PinnedUserDataDir::new();
let profile_root = tracedecay_runtime_core::storage::default_profile_root().unwrap();

let gdb = crate::host_admission::HostAdmissionTestRuntimeV1::profile(&profile_root)
.await
.unwrap();
let gdb =
crate::test_support::host_admission::HostAdmissionTestRuntimeV1::profile(&profile_root)
.await
.unwrap();

let project_dir = TempDir::new().unwrap();
let project_root = project_dir.path().canonicalize().unwrap();
Expand Down Expand Up @@ -649,9 +650,10 @@ async fn discover_project_root_with_identity_does_not_open_registry_only_store()
async fn config_path_with_identity_does_not_open_registry_without_enrollment() {
let _profile = super::PinnedUserDataDir::new();
let profile_root = tracedecay_runtime_core::storage::default_profile_root().unwrap();
let gdb = crate::host_admission::HostAdmissionTestRuntimeV1::profile(&profile_root)
.await
.unwrap();
let gdb =
crate::test_support::host_admission::HostAdmissionTestRuntimeV1::profile(&profile_root)
.await
.unwrap();

let project_dir = TempDir::new().unwrap();
let project_root = project_dir.path().canonicalize().unwrap();
Expand Down Expand Up @@ -720,9 +722,10 @@ async fn config_path_with_identity_does_not_open_registry_without_enrollment() {
async fn discover_project_root_with_identity_does_not_bind_non_git_child_to_parent_store() {
let _profile = super::PinnedUserDataDir::new();
let profile_root = tracedecay_runtime_core::storage::default_profile_root().unwrap();
let gdb = crate::host_admission::HostAdmissionTestRuntimeV1::profile(&profile_root)
.await
.unwrap();
let gdb =
crate::test_support::host_admission::HostAdmissionTestRuntimeV1::profile(&profile_root)
.await
.unwrap();

let parent_dir = TempDir::new().unwrap();
let parent_root = parent_dir.path().canonicalize().unwrap();
Expand Down Expand Up @@ -894,7 +897,7 @@ mod runtime_configuration_cutover {
cached_telemetry_config, install_pinned_runtime_configuration,
runtime_configuration_for_layout,
};
use crate::host_admission::HostAdmissionTestRuntimeV1;
use crate::test_support::host_admission::HostAdmissionTestRuntimeV1;
use tracedecay_configuration::{
ConfigurationControlStore, ConfigurationMutationAuthority, DirectConfigurationMutation,
ProjectConfigurationRuntime,
Expand Down
1 change: 1 addition & 0 deletions crates/tracedecay/src/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ mod database_owner_registry;
use database_owner_registry::DatabaseOwnerRegistry;
pub(crate) mod dashboard_automation;
#[cfg(feature = "test-transport")]
#[path = "../tests/common/dashboard_configuration_test_runtime.rs"]
mod dashboard_configuration_test_runtime;
pub(crate) mod doctor_kernel;
pub(crate) mod hook_v2_replay_consumer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,13 +495,13 @@ mod tests {
project_id: &str,
) -> (
crate::tracedecay::TraceDecay,
crate::host_admission::HostAdmissionTestRuntimeV1,
crate::test_support::host_admission::HostAdmissionTestRuntimeV1,
) {
std::fs::create_dir_all(profile_root).expect("isolated profile root");
std::fs::create_dir_all(project_root).expect("isolated project root");
let project_id = tracedecay_domain::ProjectId::new(project_id.to_owned())
.expect("typed project identity");
let runtime = crate::host_admission::HostAdmissionTestRuntimeV1::project(
let runtime = crate::test_support::host_admission::HostAdmissionTestRuntimeV1::project(
profile_root,
project_root,
project_id,
Expand All @@ -522,13 +522,13 @@ mod tests {
}

async fn isolated_sibling_graph(
runtime: &crate::host_admission::HostAdmissionTestRuntimeV1,
runtime: &crate::test_support::host_admission::HostAdmissionTestRuntimeV1,
profile_root: &std::path::Path,
project_root: &std::path::Path,
project_id: &str,
) -> (
crate::tracedecay::TraceDecay,
crate::host_admission::HostAdmissionTestRuntimeV1,
crate::test_support::host_admission::HostAdmissionTestRuntimeV1,
) {
std::fs::create_dir_all(project_root).expect("isolated sibling project root");
let project_id = tracedecay_domain::ProjectId::new(project_id.to_owned())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ async fn persistent_graph_activation_publishes_a_small_generation() {
// Activation issues verified graph reads; the project graph runtime binds
// asynchronously after `project_memory` returns, so an unawaited bind
// races activation into "not ready for verified reads".
crate::host_admission::await_bound_graph_runtime(
crate::test_support::host_admission::await_bound_graph_runtime(
&project_database,
"bind small persistent activation graph runtime",
)
Expand Down Expand Up @@ -446,7 +446,7 @@ async fn restart_status_case(corrupt_graph: bool, dirty_before_restart: bool) {
.project_memory(project_id.clone(), [fixture.path().to_path_buf()])
.await
.expect("writable project database");
crate::host_admission::await_bound_graph_runtime(
crate::test_support::host_admission::await_bound_graph_runtime(
&project_database,
"bind stale graph status projection",
)
Expand Down Expand Up @@ -523,7 +523,7 @@ async fn restart_status_case(corrupt_graph: bool, dirty_before_restart: bool) {
.project_memory(project_id.clone(), [fixture.path().to_path_buf()])
.await
.expect("restarted writable project database");
crate::host_admission::await_bound_graph_runtime(
crate::test_support::host_admission::await_bound_graph_runtime(
&project_database,
"bind restarted graph status projection",
)
Expand Down
1 change: 1 addition & 0 deletions crates/tracedecay/src/daemon/connection_serving.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use tracedecay_session_memory::context::CancellationToken;
/// routing, selected-project response, delivery-settlement, and RMCP adapter
/// path as the daemon without adding a shipped benchmark API.
#[cfg(feature = "rmcp-benchmark")]
#[path = "../../benches/rmcp/benchmark.rs"]
pub mod rmcp_benchmark;

impl BrokerSelectedResponseLease for crate::mcp::server::SelectedProjectResponseLease {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use tracedecay_store::{
};

use super::*;
use crate::host_admission::HostAdmissionTestRuntimeV1;
use crate::test_support::host_admission::HostAdmissionTestRuntimeV1;
use tracedecay_sessions::admission::HostAdmissionScope;

fn id<T: TryFrom<String>>(value: &str) -> T
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ async fn feedback_admission_conflicts_construct_zero_losing_producers() {
let _pin = tracedecay_runtime_core::config::PinnedUserDataDir::new();
let project = tempfile::tempdir().expect("project root");
let project_id = ProjectId::new("project.feedback.atomic-publication").expect("project id");
let host = crate::host_admission::HostAdmissionTestRuntimeV1::project(
let host = crate::test_support::host_admission::HostAdmissionTestRuntimeV1::project(
tracedecay_runtime_core::storage::default_profile_root().expect("profile root"),
project.path(),
project_id.clone(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ async fn registered_work_evidence_hydrates_the_provider_qualified_task_session()
let project_id = id::<ProjectId>("project.work.evidence-journey");
let repository_id = id::<RepositoryId>("repository.work.evidence-journey");
let worktree_id = id::<WorktreeId>("worktree.work.evidence-journey");
let host = crate::host_admission::HostAdmissionTestRuntimeV1::project(
let host = crate::test_support::host_admission::HostAdmissionTestRuntimeV1::project(
profile.path(),
&project,
project_id.clone(),
Expand Down
4 changes: 2 additions & 2 deletions crates/tracedecay/src/daemon/invocation_tests/work_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async fn registered_work_services_dispatch_the_core_lifecycle() {
let _pin = tracedecay_runtime_core::config::PinnedUserDataDir::new();
let project = tempfile::tempdir().expect("project root");
let project_id = ProjectId::new("project.work.core-invocation").expect("project id");
let host = crate::host_admission::HostAdmissionTestRuntimeV1::project(
let host = crate::test_support::host_admission::HostAdmissionTestRuntimeV1::project(
tracedecay_runtime_core::storage::default_profile_root().expect("profile root"),
project.path(),
project_id.clone(),
Expand Down Expand Up @@ -494,7 +494,7 @@ async fn committed_work_mutations_publish_task_activity_and_reads_do_not() {
let _pin = tracedecay_runtime_core::config::PinnedUserDataDir::new();
let project = tempfile::tempdir().expect("project root");
let project_id = ProjectId::new("project.work.task-activity").expect("project id");
let host = crate::host_admission::HostAdmissionTestRuntimeV1::project(
let host = crate::test_support::host_admission::HostAdmissionTestRuntimeV1::project(
tracedecay_runtime_core::storage::default_profile_root().expect("profile root"),
project.path(),
project_id.clone(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async fn git_owner_uses_explicit_canonical_catalog_and_rechecks_authorization()
git(&project_root, &["add", "."]);
git(&project_root, &["commit", "-m", "fixture"]);
let project_id = ProjectId::new("project.git-catalog").unwrap();
let fixture = crate::host_admission::HostAdmissionTestRuntimeV1::project(
let fixture = crate::test_support::host_admission::HostAdmissionTestRuntimeV1::project(
&profile_root,
&project_root,
project_id.clone(),
Expand Down
4 changes: 2 additions & 2 deletions crates/tracedecay/src/daemon/projectless.rs
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ mod projectless_admission_tests {
.expect("restrict foreign profile root");
}
crate::product_runtime::register_fixture_product_runtime();
crate::host_admission::ensure_process_background_cpu_authority()
crate::test_support::host_admission::ensure_process_background_cpu_authority()
.expect("install fixture worker authority");
let identity = tracedecay_daemon_identity::profile_identity::load_or_create(&real_root)
.expect("pin profile identity");
Expand Down Expand Up @@ -769,7 +769,7 @@ mod projectless_admission_tests {
let temp = tempfile::tempdir().expect("tempdir");
let (real_root, linked_root) = linked_profile_root(temp.path());
crate::product_runtime::register_fixture_product_runtime();
crate::host_admission::ensure_process_background_cpu_authority()
crate::test_support::host_admission::ensure_process_background_cpu_authority()
.expect("install fixture worker authority");
let identity = tracedecay_daemon_identity::profile_identity::load_or_create(&real_root)
.expect("pin profile identity");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ mod tests {
tempfile::TempDir,
TraceDecay,
TraceDecay,
Arc<crate::host_admission::HostAdmissionTestRuntimeV1>,
Arc<crate::test_support::host_admission::HostAdmissionTestRuntimeV1>,
) {
let tmp = tempfile::tempdir().unwrap();
// Register the same canonical paths that retained-target lookup uses.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ use crate::daemon::StoreOwnerKey;
use crate::daemon::retained_owner::session_refresh::{
MountedSessionRefreshAuthorityV1, admitted_session_refresh_command,
};
use crate::host_admission::HostAdmissionTestRuntimeV1;
use crate::mcp::server::DaemonSessionRefreshService;
use crate::test_support::host_admission::HostAdmissionTestRuntimeV1;
use tracedecay_daemon_service::DaemonWorkflowIndexReadService;
use tracedecay_global_db::{RegisteredGlobalDb, RegisteredGlobalDbLeaseV1};
use tracedecay_session_memory::session::{SessionRefreshServiceOutcome, SessionRefreshServicePort};
Expand Down
2 changes: 1 addition & 1 deletion crates/tracedecay/src/daemon/session_runtime_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use tempfile::TempDir;
use tracedecay_session_runtime::StoreOwnerKey;
use tracedecay_sessions::admission::HostAdmissionScope;

use crate::host_admission::HostAdmissionTestRuntimeV1;
use crate::test_support::host_admission::HostAdmissionTestRuntimeV1;

#[tokio::test]
async fn evicted_project_owner_releases_temporal_scheduler() {
Expand Down
6 changes: 4 additions & 2 deletions crates/tracedecay/src/daemon/tests/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3859,8 +3859,10 @@ async fn production_composition_harness_reads_retained_profile_analytics_authori
.ledger_writes_settled()
.await;

let second_owner =
crate::host_admission::HostAdmissionTestRuntimeV1::profile(harness.profile_root()).await;
let second_owner = crate::test_support::host_admission::HostAdmissionTestRuntimeV1::profile(
harness.profile_root(),
)
.await;
let error = match second_owner {
Ok(_) => panic!("parallel profile authority must remain rejected"),
Err(error) => error,
Expand Down
14 changes: 8 additions & 6 deletions crates/tracedecay/src/daemon/tests/restart_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,10 @@ async fn initialize_root_routing_replaces_cached_project_and_scope() {
let project_b = TempDir::new().expect("project b temp dir");
let project_a = project_a.path().canonicalize().expect("project a path");
let project_b = project_b.path().canonicalize().expect("project b path");
let registry = crate::host_admission::HostAdmissionTestRuntimeV1::profile(profile.path())
.await
.expect("open retained profile runtime");
let registry =
crate::test_support::host_admission::HostAdmissionTestRuntimeV1::profile(profile.path())
.await
.expect("open retained profile runtime");
let global_db_path = profile.path().join("global.db");
registry
.upsert_code_project("project-a", &project_a, None, None, None)
Expand Down Expand Up @@ -596,9 +597,10 @@ async fn daemon_resolves_registry_only_initialize_root_alias() {
let alias = alias.path().canonicalize().expect("canonical alias");
let nested = alias.join("nested");
std::fs::create_dir_all(&nested).expect("nested alias path");
let registry = crate::host_admission::HostAdmissionTestRuntimeV1::profile(profile.path())
.await
.expect("open retained profile runtime");
let registry =
crate::test_support::host_admission::HostAdmissionTestRuntimeV1::profile(profile.path())
.await
.expect("open retained profile runtime");
let global_db_path = profile.path().join("global.db");
registry
.upsert_code_project("project-registry-only", &canonical, None, None, None)
Expand Down
6 changes: 4 additions & 2 deletions crates/tracedecay/src/daemon/tests/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1395,11 +1395,13 @@ async fn daemon_linked_worktree_route_repairs_primary_identity_and_keeps_alias()
.expect("linked project registry context present");
assert_eq!(
context.project.canonical_root,
crate::host_admission::HostAdmissionTestRuntimeV1::canonical_project_key(&primary)
crate::test_support::host_admission::HostAdmissionTestRuntimeV1::canonical_project_key(
&primary
)
);
assert!(context.aliases.iter().any(|alias| {
alias.alias_path
== crate::host_admission::HostAdmissionTestRuntimeV1::canonical_project_key(&linked)
== crate::test_support::host_admission::HostAdmissionTestRuntimeV1::canonical_project_key(&linked)
}));
}

Expand Down
Loading
Loading