diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a339f20ac..24bc6e5e4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -221,8 +221,17 @@ jobs: shared-key: ci-test-full-${{ runner.os }} cache-on-failure: true + # Every `crates/tracedecay` integration target declares + # `required-features = ["test-helpers"]`, because the fixture surface it + # gates is used by `tests/common/mod.rs`. Those targets are selected here + # today only as a side effect of dev-dependency feature unification + # (`tracedecay-cli` dev-depends on `tracedecay` with that feature), which + # is not a property this lane should depend on: it would evaporate the + # moment that dev-dependency changes, and nextest would then silently + # select zero of them and report green having run nothing. Asking for the + # feature explicitly makes the selection independent of that accident. - name: Run tests - run: cargo nextest run --workspace --profile ci --locked + run: cargo nextest run --workspace --profile ci --locked --features tracedecay/test-helpers # Compile-only gate for the features this lane does not enable. Both are # otherwise built for the first time at release (`--all-features`), so diff --git a/.github/workflows/plugin-validation.yml b/.github/workflows/plugin-validation.yml index 92b7d41df0..b734ec6cdd 100644 --- a/.github/workflows/plugin-validation.yml +++ b/.github/workflows/plugin-validation.yml @@ -13,14 +13,14 @@ on: - "plugin/**" - "plugin/cursor-native-extension/**" - "tests/fixtures/cursor-schemas/**" - - "tests/agent_suite/*plugin*" - - "tests/agent_suite/*skill*" + - "crates/tracedecay/tests/agent_suite/*plugin*" + - "crates/tracedecay/tests/agent_suite/*skill*" - "scripts/mcp-conformance-smoke.sh" - "scripts/check-dashboard-bundle.py" - - "src/serve.rs" + - "crates/tracedecay/src/serve.rs" - "crates/tracedecay-cli/**" - - "src/lib.rs" - - "src/mcp/**" + - "crates/tracedecay/src/lib.rs" + - "crates/tracedecay/src/mcp/**" - "Cargo.toml" - "Cargo.lock" - ".github/workflows/plugin-validation.yml" diff --git a/.github/workflows/sdk-conformance.yml b/.github/workflows/sdk-conformance.yml index c54f090a26..9ee17f5b83 100644 --- a/.github/workflows/sdk-conformance.yml +++ b/.github/workflows/sdk-conformance.yml @@ -21,7 +21,7 @@ on: - "scripts/plan-release-recovery.py" - "scripts/test-plan-release-recovery.py" - "tests/release_safety_test.sh" - - "src/application_surface.rs" + - "crates/tracedecay/src/application_surface.rs" push: branches: [master] diff --git a/AGENTS.md b/AGENTS.md index cb908919ad..b4028e0e85 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -13,18 +13,26 @@ compiles. ## Layout -- `src/` — main `tracedecay` crate (daemon, MCP tools, global DB, sessions, - code index, application services). -- `crates/` — workspace member crates (`tracedecay-api`, `-application`, - `-domain`, `-store`, `-hooks`, `-policy`, `-tool-catalog`, rusqlite - parity/runtime crates). +- The repository root is a **virtual workspace** — it has no package of its + own. Every crate lives under `crates/`. +- `crates/tracedecay/` — the composition-root library (daemon, MCP tools, + global DB, sessions, code index, application services). Its integration + suites are `crates/tracedecay/tests/`, and the ones that use the fixture + surface in `tests/common/` declare `required-features = ["test-helpers"]`. +- `crates/tracedecay-cli/` — the shipped `tracedecay` binary. Build it with + `cargo build -p tracedecay-cli --bin tracedecay`, never `-p tracedecay`. +- `crates/` — the remaining workspace member crates (`tracedecay-api`, + `-application`, `-domain`, `-store`, `-hooks`, `-policy`, `-tool-catalog`, + rusqlite parity/runtime crates). - `dashboard/` — the single embedded dashboard (React + rsbuild + vitest). `dashboard/src/contracts/` is generated from Rust schemas via schemars — never hand-edit it; regenerate with the `contracts:generate` script and verify with `contracts:check`. - `plugin/` — host bundles (Claude, Codex, Cursor, Kimi, opencode). -- `tests/` — integration test suites; `benches/` — criterion benches; - `benchmark_data/` — benchmark fixtures, harnesses, and provenance; +- `tests/` — shared fixtures, distribution suites, and shell/Python gates that + no single crate owns; crate-level integration suites and criterion benches + live under that crate's own `tests/` and `benches/`. +- `benchmark_data/` — benchmark fixtures, harnesses, and provenance; `evals/` — memory, hermetic, and agent-adoption evals; `docs/` — plans and guides. - `scripts/` — CI/dev gates (commit-msg check, bundle checks, release drift). diff --git a/Cargo.toml b/Cargo.toml index 9a94f3fe73..b1fbe77914 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [workspace] members = [ + "crates/tracedecay", "crates/tracedecay-agent-hosts", "crates/tracedecay-api", "crates/tracedecay-application", @@ -48,11 +49,12 @@ ignored-paths = [ "tests/fixtures/search_quality/incremental/**/*.rs", ] -# Declared once here; every member (including the root package) inherits via +# Declared once here; every package inherits via # `edition.workspace = true`. Cargo has no config-level edition default — this # inheritance table is the sanctioned single source of truth. [workspace.package] edition = "2024" +version = "0.1.0-beta.37" [workspace.dependencies] # Opt-in profiler, pinned once for the whole workspace. Non-optional on purpose: @@ -66,468 +68,6 @@ grafeo-core = { version = "=0.5.42", default-features = false, features = ["lpg" grafeo-engine = { version = "=0.5.42", default-features = false, features = ["lpg", "gql", "algos", "wal", "grafeo-file", "vector-index"] } rusqlite = { version = "0.40.1", default-features = false, features = ["backup", "cache"] } -[package] -name = "tracedecay" -version = "0.1.0-beta.37" -publish = false -edition.workspace = true -description = "Local semantic code intelligence, project memory, and workflow context for AI coding agents." -license = "MIT" -repository = "https://github.com/ScriptedAlchemy/tracedecay" -homepage = "https://github.com/ScriptedAlchemy/tracedecay" -readme = "README.md" -keywords = ["code-intelligence", "knowledge-graph", "mcp", "tree-sitter", "semantic-search"] -categories = ["development-tools", "command-line-utilities"] -# Explicit source-archive whitelist retained for local distribution validation. -# Frontend sources are deliberately excluded: build.rs embeds the canonical -# prebuilt dashboard/app-dist. Keep that packaged-asset check in build.rs in -# sync if the dashboard entries below change. -include = [ - "/CHANGELOG.md", - "/LICENSE", - "/README.md", - "/rust-toolchain.toml", - "/.cargo/config.toml", - "/build.rs", - "/build-support/dashboard_manifest.rs", - "/src/**", - "/benches/**", - "/examples/**", - "/tests/fixtures/analytics/**", - "/tests/fixtures/packaged_host_events/**", - "/tests/fixtures/provider_normalization/**", - "/tests/fixtures/redundancy_eval_labeled.json", - "/tests/fixtures/search_quality/query-semantic-candidate-workload-v1.json", - "/tests/fixtures/transcript_golden/cline_like/**", - "/benchmark_data/queries/default.toml", - "/benchmark_data/claude-observation/**", - "/benchmark_data/session-temporal/**", - "/benchmark_data/query-code-index/**", - "/benchmark_data/search-quality/query-fallback-report-v1.json", - "/scripts/run-session-temporal-benchmark.sh", - "/plugin/.claude-plugin/**", - "/plugin/.cursor-plugin/**", - "/plugin/.codex-plugin/**", - "/plugin/.kimi-plugin/**", - "/plugin/.lsp.json", - "/plugin/.mcp.json", - "/plugin/README*.md", - "/plugin/agents/**", - "/plugin/commands/**", - "/plugin/hooks/**", - "/plugin/mcp-cursor.json", - "/plugin/opencode/**", - "/plugin/overlays/**", - "/plugin/rules/**", - "/plugin/skills/**", - "/plugin/cursor-native-extension/package.json", - "/plugin/cursor-native-extension/README.md", - "/plugin/cursor-native-extension/LICENSE", - "/plugin/cursor-native-extension/embedded/extension.js", - "/vendor/**", - "/dashboard/app-dist/**", - "/dashboard/hermes-wrapper/manifest.json", - "/dashboard/hermes-wrapper/plugin_api.py", - "/dashboard/hermes-wrapper/src/**", -] - -[features] -# Default and explicitly selected production artifacts resolve through the -# same feature. Release packaging selects exactly `production`; profiling is a -# separate feature-enabled build because Hotpath 0.24 has no runtime-off mode. -# `--all-features` is test-only because it includes `test-transport`. -default = ["production"] - -# Opt-in profiling. Never in `default` and never in `production`: with no -# profiling feature selected every hotpath macro expands to a no-op, so the -# instrumented call sites below compile identically in both modes. -# -# `hotpath` alone gives wall-clock timing. The other three layer on top of it: -# `hotpath-alloc` installs the counting global allocator, `hotpath-cpu` adds -# on-CPU sampling, and `hotpath-mcp` exposes the live query server (port 6771 -# by default, `HOTPATH_MCP_PORT` overrides). `hotpath/tokio` is required by -# `hotpath::tokio_runtime!`, which this binary registers with the explicit -# runtime handle it builds in `async_main`. -# -# The per-crate passthroughs matter because the profiling features change what -# `#[hotpath::measure]` expands to: a library crate compiled without them -# reports no allocation or CPU samples even when the binary enables profiling. -hotpath = [ - "hotpath/hotpath", - "hotpath/tokio", - # The daemon serves its HTTP application surface with axum 0.8 and reaches - # GitHub through ureq 3, and hotpath instruments both natively. Matching the - # versions we already depend on, so no second HTTP stack is introduced. - "hotpath/axum-0-8", - "hotpath/ureq-3", - "tracedecay-agent-hosts/hotpath", - "tracedecay-api/hotpath", - "tracedecay-application/hotpath", - "tracedecay-automation/hotpath", - "tracedecay-capture/hotpath", - "tracedecay-code-extraction/hotpath", - "tracedecay-code-index/hotpath", - "tracedecay-dashboard-api/hotpath", - "tracedecay-global-db/hotpath", - "tracedecay-graph-db/hotpath", - "tracedecay-hooks/hotpath", - "tracedecay-lsp/hotpath", - "tracedecay-private-fs/hotpath", - "tracedecay-query/hotpath", - "tracedecay-runtime-core/hotpath", - "tracedecay-rusqlite-runtime/hotpath", - "tracedecay-sdk/hotpath", - "tracedecay-semantic/hotpath", - "tracedecay-sessions/hotpath", - "tracedecay-temporal-query/hotpath", - "tracedecay-usecases/hotpath", -] -hotpath-alloc = [ - "hotpath", - "hotpath/hotpath-alloc", - "tracedecay-agent-hosts/hotpath-alloc", - "tracedecay-api/hotpath-alloc", - "tracedecay-application/hotpath-alloc", - "tracedecay-automation/hotpath-alloc", - "tracedecay-capture/hotpath-alloc", - "tracedecay-code-extraction/hotpath-alloc", - "tracedecay-code-index/hotpath-alloc", - "tracedecay-dashboard-api/hotpath-alloc", - "tracedecay-global-db/hotpath-alloc", - "tracedecay-graph-db/hotpath-alloc", - "tracedecay-hooks/hotpath-alloc", - "tracedecay-lsp/hotpath-alloc", - "tracedecay-private-fs/hotpath-alloc", - "tracedecay-query/hotpath-alloc", - "tracedecay-runtime-core/hotpath-alloc", - "tracedecay-rusqlite-runtime/hotpath-alloc", - "tracedecay-sdk/hotpath-alloc", - "tracedecay-semantic/hotpath-alloc", - "tracedecay-sessions/hotpath-alloc", - "tracedecay-temporal-query/hotpath-alloc", - "tracedecay-usecases/hotpath-alloc", -] -hotpath-cpu = [ - "hotpath", - "hotpath/hotpath-cpu", - "tracedecay-agent-hosts/hotpath-cpu", - "tracedecay-api/hotpath-cpu", - "tracedecay-application/hotpath-cpu", - "tracedecay-automation/hotpath-cpu", - "tracedecay-capture/hotpath-cpu", - "tracedecay-code-extraction/hotpath-cpu", - "tracedecay-code-index/hotpath-cpu", - "tracedecay-dashboard-api/hotpath-cpu", - "tracedecay-global-db/hotpath-cpu", - "tracedecay-graph-db/hotpath-cpu", - "tracedecay-hooks/hotpath-cpu", - "tracedecay-lsp/hotpath-cpu", - "tracedecay-private-fs/hotpath-cpu", - "tracedecay-query/hotpath-cpu", - "tracedecay-runtime-core/hotpath-cpu", - "tracedecay-rusqlite-runtime/hotpath-cpu", - "tracedecay-sdk/hotpath-cpu", - "tracedecay-semantic/hotpath-cpu", - "tracedecay-sessions/hotpath-cpu", - "tracedecay-temporal-query/hotpath-cpu", - "tracedecay-usecases/hotpath-cpu", -] -# Binary-only: the live query server runs in this process, so no library crate -# needs a passthrough for it. -hotpath-mcp = ["hotpath", "hotpath/hotpath-mcp"] -production = [ - "token-counting", - "lite", - "full", - "semantic-fastembed", -] - -# Exact token counting for the Savings & Cost dashboard (tiktoken BPE). -# Embeds the o200k_base/cl100k_base vocabularies (~4 MB of binary weight); -# vocab decoding is lazy (first count pays it, idle servers never do). -# Disable for a leaner binary — cost estimation falls back to chars/4. -token-counting = ["tracedecay-agent-hosts/token-counting", "tracedecay-dashboard-api/token-counting"] - -# Lite tier (11 languages) — always compiled, no feature flag needed: -# Rust, Go, Java, Scala, TypeScript/JavaScript, Python, C, C++, Kotlin, C#, Swift. -# Markdown joins them: documentation is architecture content, every repository -# has it, and a build that indexes code but not its docs is not a shippable -# tier. Its grammar lives in the (monolithic) large bundle, so `lite` now links -# that bundle — the compile-weight cost of making docs unconditional. -lite = ["tracedecay-code-index/lite"] - -medium = ["tracedecay-code-index/medium"] -full = ["tracedecay-code-index/full"] - -# These aliases are intentionally repeated at the binary boundary: Cargo -# cannot expose a dependency feature as a caller-selectable local feature. -# Tier membership remains owned by tracedecay-code-extraction and reaches this -# package through the aggregate forwards above. -lang-dart = ["tracedecay-code-index/lang-dart"] -lang-pascal = ["tracedecay-code-index/lang-pascal"] -lang-php = ["tracedecay-code-index/lang-php"] -lang-ruby = ["tracedecay-code-index/lang-ruby"] -lang-bash = ["tracedecay-code-index/lang-bash"] -lang-protobuf = ["tracedecay-code-index/lang-protobuf"] -lang-powershell = ["tracedecay-code-index/lang-powershell"] -lang-nix = ["tracedecay-code-index/lang-nix"] -lang-vbnet = ["tracedecay-code-index/lang-vbnet"] -lang-lua = ["tracedecay-code-index/lang-lua"] -lang-zig = ["tracedecay-code-index/lang-zig"] -lang-objc = ["tracedecay-code-index/lang-objc"] -lang-perl = ["tracedecay-code-index/lang-perl"] -lang-batch = ["tracedecay-code-index/lang-batch"] -lang-fortran = ["tracedecay-code-index/lang-fortran"] -lang-cobol = ["tracedecay-code-index/lang-cobol"] -lang-msbasic2 = ["tracedecay-code-index/lang-msbasic2"] -lang-gwbasic = ["tracedecay-code-index/lang-gwbasic"] -lang-qbasic = ["tracedecay-code-index/lang-qbasic"] -lang-dockerfile = ["tracedecay-code-index/lang-dockerfile"] -lang-glsl = ["tracedecay-code-index/lang-glsl"] -lang-wgsl = ["tracedecay-code-index/lang-wgsl"] -lang-hlsl = ["tracedecay-code-index/lang-hlsl"] -lang-metal = ["tracedecay-code-index/lang-metal"] -lang-markdown = ["tracedecay-code-index/lang-markdown"] -lang-r = ["tracedecay-code-index/lang-r"] -lang-sql = ["tracedecay-code-index/lang-sql"] -lang-julia = ["tracedecay-code-index/lang-julia"] -lang-haskell = ["tracedecay-code-index/lang-haskell"] -lang-ocaml = ["tracedecay-code-index/lang-ocaml"] -lang-clojure = ["tracedecay-code-index/lang-clojure"] -lang-erlang = ["tracedecay-code-index/lang-erlang"] -lang-elixir = ["tracedecay-code-index/lang-elixir"] -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"] -test-transport = [ - "tracedecay-rusqlite-runtime/test-transport", - "tracedecay-runtime-core/test-transport", - "tracedecay-agent-hosts/test-transport", - "tracedecay-dashboard-api/test-transport", - "tracedecay-usecases/test-transport", - # The observation-seed fixture bridge (`dashboard::observation_seed`) is - # test-transport-gated and drives the global-db session-temporal refresh - # helpers; plain builds (no dev-dep feature unification) need the forward. - "tracedecay-global-db/test-helpers", - # The graph-projection fixture bridge - # (`dashboard::graph_projection_fixture`) publishes the hermetic code-graph - # generation dashboard neighbor reads take their adjacency from. - "tracedecay-code-index/test-helpers", -] - -# SEMANTIC FastEmbed adapter (Plan 31). Bundles ORT while leaving FastEmbed's -# image defaults disabled. Runtime inference still loads only from locally -# verified artifact bytes; daemon-owned acquisition uses hf-hub against the -# immutable catalog pins, never query-time ambient cache discovery. The -# adapter itself lives in `tracedecay-semantic`, which owns the pins. -semantic-fastembed = [ - "tracedecay-semantic/semantic-fastembed", - "tracedecay-usecases/semantic-fastembed", -] - -[lib] -name = "tracedecay" - -# Plan 36 portability: symlink-alias snapshot capture (test-transport only). -[[test]] -name = "git_index_snapshot_root_canonicalization" -path = "tests/git_index_snapshot_root_canonicalization.rs" -required-features = ["test-transport"] - -# Integration harnesses that intentionally exercise in-process daemon/test -# transport seams stay out of the default production feature graph. -[[test]] -name = "dashboard_api_test" -path = "tests/dashboard_api_test/main.rs" -required-features = ["test-transport"] - -[[test]] -name = "daemon_fault_harness_test" -path = "tests/daemon_fault_harness_test.rs" -required-features = ["test-transport"] - -# The PartialEffect leg parks a real fact commit at the daemon's durable commit -# boundary, which is the `test-transport` fact-commit barrier. -[[test]] -name = "typed_terminal_restart_acceptance" -path = "tests/typed_terminal_restart_acceptance.rs" -required-features = ["test-transport"] - -[[test]] -name = "graph_rebuild_status_test" -path = "tests/graph_rebuild_status_test.rs" -required-features = ["test-transport"] - -[[test]] -name = "serve_proxy_lifecycle_test" -path = "tests/serve_proxy_lifecycle_test.rs" -required-features = ["test-transport"] - -# Drives a live daemon, the real stdio MCP server, and the real CLI listing to -# grade every declared surface for a mount in both directions. -[[test]] -name = "v2_surface_mount_conformance" -path = "tests/v2_surface_mount_conformance.rs" -required-features = ["test-transport"] - -[dependencies] -axum = "0.8" -hotpath.workspace = true -hyper = { version = "1", features = ["http1", "server"] } -hyper-util = { version = "0.1", features = ["service", "tokio"] } -tower = "0.5" -tree-sitter = "0.26" -constant_time_eq = "0.5.0" -tracedecay-agent-hosts = { path = "crates/tracedecay-agent-hosts", version = "0.1.0" } -tracedecay-api = { path = "crates/tracedecay-api", version = "0.1.0" } -tracedecay-application = { path = "crates/tracedecay-application", version = "0.1.0", features = ["native-git"] } -tracedecay-automation = { path = "crates/tracedecay-automation", version = "0.1.0" } -tracedecay-capture = { path = "crates/tracedecay-capture", version = "0.1.0" } -tracedecay-code-extraction = { path = "crates/tracedecay-code-extraction", version = "0.1.0", default-features = false } -tracedecay-code-index = { path = "crates/tracedecay-code-index", version = "0.1.0", default-features = false } -tracedecay-dashboard-api = { path = "crates/tracedecay-dashboard-api", version = "0.1.0" } -tracedecay-domain = { path = "crates/tracedecay-domain", version = "0.1.0" } -tracedecay-host-integration = { path = "crates/tracedecay-host-integration", version = "0.1.0" } -tracedecay-hooks = { path = "crates/tracedecay-hooks", version = "0.1.0" } -tracedecay-jsonrpc = { path = "crates/tracedecay-jsonrpc", version = "0.1.0" } -tracedecay-lsp = { path = "crates/tracedecay-lsp", version = "0.1.0" } -tracedecay-global-db = { path = "crates/tracedecay-global-db", version = "0.1.0" } -tracedecay-graph-db = { path = "crates/tracedecay-graph-db", version = "0.1.0" } -tracedecay-policy = { path = "crates/tracedecay-policy", version = "0.1.0" } -tracedecay-private-fs = { path = "crates/tracedecay-private-fs", version = "0.1.0" } -tracedecay-query = { path = "crates/tracedecay-query", version = "0.1.0" } -tracedecay-runtime-core = { path = "crates/tracedecay-runtime-core", version = "0.1.0" } -tracedecay-search-eval = { path = "crates/tracedecay-search-eval", version = "0.1.0" } -tracedecay-semantic = { path = "crates/tracedecay-semantic", version = "0.1.0" } -tracedecay-sessions = { path = "crates/tracedecay-sessions", version = "0.1.0" } -tracedecay-temporal-query = { path = "crates/tracedecay-temporal-query", version = "0.1.0" } -tracedecay-rusqlite-runtime = { path = "crates/tracedecay-rusqlite-runtime", version = "0.1.0" } -tracedecay-sdk = { path = "crates/tracedecay-sdk", version = "0.1.0" } -rusqlite = { version = "0.40.1", default-features = false, features = ["backup"] } -tracedecay-store = { path = "crates/tracedecay-store", version = "0.1.0" } -tracedecay-tool-catalog = { path = "crates/tracedecay-tool-catalog", version = "0.1.0" } -tracedecay-usecases = { path = "crates/tracedecay-usecases", version = "0.1.0" } -clap = { version = "4.6", features = ["derive"] } -semver = "1" -serde = { version = "1", features = ["derive"] } -serde_json = "1" -base64 = "0.22" -toml = "1" -ureq = { version = "3", features = ["json"] } -url = "2" -tokio = { version = "1", features = ["full"] } -tokio-stream = { version = "0.1", features = ["sync"] } -thiserror = "2" -tracing = "0.1" -tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt"] } -sha2 = "0.11" -glob = "0.3" -walkdir = "2" -ignore = "0.4" -gix = { version = "=0.86.0", default-features = false, features = ["revision", "blob-diff", "parallel", "sha1", "sha256", "status"] } -dirs = "6" -hex = "0.4" -rayon = "1" -getrandom = "0.2" -self-replace = "1" -memmap2 = "0.9" -crossterm = "0.28" -fs2 = "0.4" -same-file = "1" -sysinfo = { version = "0.32", default-features = false, features = ["system"] } -open = "5.3" -# Raw filesystem watcher for the daemon git-metadata watcher (src/daemon/git_watch.rs). -# We deliberately use the raw watcher (not notify-debouncer-full) and debounce -# ourselves so a monorepo's git-ref churn coalesces into a single sync. -notify = "6" -zeroize = "1.9.0" -keyring = { version = "4.1.5", features = ["v1"] } -tempfile = "3" -cap-std = "4.0.2" -cap-fs-ext = "4.0.2" -schemars = "1.2.1" -futures-util = "0.3.33" -tokio-util = { version = "0.7.19", features = ["codec"] } -rmcp = { version = "3.0.1", default-features = false, features = ["server"] } -rustls = { version = "0.23", default-features = false, features = ["ring", "std", "tls12"] } -tokio-rustls = { version = "0.26", default-features = false, features = ["ring", "tls12"] } - -[target.'cfg(not(windows))'.dependencies] -flate2 = "1" -tar = "0.4" - -[target.'cfg(target_os = "linux")'.dev-dependencies] -xattr = "1" - -# `statfs(2)` for daemon store-locality detection (src/daemon/store_runtime/ -# resolver.rs). Linux reads `/proc/self/mountinfo` instead; macOS has no such -# file, and `MNT_LOCAL` is the kernel's direct answer to "is this volume local". -[target.'cfg(any(target_os = "macos", all(target_os = "linux", target_env = "gnu")))'.dependencies] -libc = "0.2" - -[target.'cfg(windows)'.dependencies] -zip = { version = "8", default-features = false, features = ["deflate"] } -windows = { version = "0.62.2", features = [ - "Win32_Foundation", - "Win32_System_Com", - "Win32_System_Ole", - "Win32_System_TaskScheduler", - "Win32_System_Variant", -] } - -[build-dependencies] -serde_json = "1" - -[dev-dependencies] -sha2 = "0.11" -hex = "0.4" -regex = "1.12.3" -filetime = "0.2" -criterion = { version = "0.5", features = ["async_tokio", "html_reports"] } -# test-util enables tokio::test(start_paused = true) so timer-driven unit -# tests (daemon restart-grace windows) run on virtual time instead of real -# sleeps. -tokio = { version = "1", features = ["full", "test-util"] } -jsonschema = { version = "0.46.8", default-features = false } -tracedecay-sdk = { path = "crates/tracedecay-sdk", version = "0.1.0" } -# Test builds opt into the query kernel's `*_for_test` constructors; the -# feature stays off for production builds. -tracedecay-query = { path = "crates/tracedecay-query", version = "0.1.0", features = ["test-helpers"] } -# The dev edge keeps code-index's default grammar profile active so the -# default and explicit-production feature graphs resolve identically -# (mirrors code-index's own default-features dev edge on code-extraction). -tracedecay-code-index = { path = "crates/tracedecay-code-index", version = "0.1.0", features = ["test-helpers"] } -tracedecay-semantic = { path = "crates/tracedecay-semantic", version = "0.1.0", features = ["test-helpers"] } -tracedecay-temporal-query = { path = "crates/tracedecay-temporal-query", version = "0.1.0", features = ["test-helpers"] } -# Same policy for the extracted global-db harness the root test suite drives. -tracedecay-global-db = { path = "crates/tracedecay-global-db", version = "0.1.0", features = ["test-helpers"] } -# The root's cfg(test) host-admission support composes the dashboard test -# authority, which lives behind the dashboard-api test-transport feature. -tracedecay-dashboard-api = { path = "crates/tracedecay-dashboard-api", version = "0.1.0", features = ["test-transport"] } -tracedecay-runtime-core = { path = "crates/tracedecay-runtime-core", version = "0.1.0", features = ["test-helpers"] } -tracedecay-sessions = { path = "crates/tracedecay-sessions", version = "0.1.0", features = ["test-helpers"] } -tracedecay-usecases = { path = "crates/tracedecay-usecases", version = "0.1.0", features = ["test-helpers"] } - -[lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = ["cfg(tracedecay_observation_fault_harness)"] } - -[[bench]] -name = "large_repos" -harness = false -required-features = ["test-transport"] - -[[bench]] -name = "queries" -required-features = ["test-transport"] - -[[bench]] -name = "session_temporal" -harness = false -# The custom benchmark CLI is not a libtest harness and cannot answer the -# `--list --format terse` probe used by `cargo test` and nextest. -test = false - [profile.bench] opt-level = 3 debug = false diff --git a/crates/tracedecay-agent-hosts/build.rs b/crates/tracedecay-agent-hosts/build.rs index d7203f9344..f139fb33aa 100644 --- a/crates/tracedecay-agent-hosts/build.rs +++ b/crates/tracedecay-agent-hosts/build.rs @@ -24,7 +24,7 @@ const REPO_ROOT_FROM_CRATE: &str = "../.."; // pointed at the repository root, not this crate's directory: a crate // subdirectory is never its own git worktree top level, so `resolve` would // otherwise report an empty identity by design. -#[path = "../../src/version/build_identity.rs"] +#[path = "../tracedecay/src/version/build_identity.rs"] mod build_identity; // The product version this crate stamps into host-visible artifacts comes from @@ -302,22 +302,22 @@ fn bake_build_identity() { for path in build_identity::watch_paths(&repo_root) { println!("cargo::rerun-if-changed={}", path.display()); } - println!("cargo::rerun-if-changed={REPO_ROOT_FROM_CRATE}/src/version/build_identity.rs"); + println!("cargo::rerun-if-changed=../tracedecay/src/version/build_identity.rs"); println!( "cargo::rustc-env=TRACEDECAY_GIT_SHA={}", identity.sha.as_deref().unwrap_or("unknown") ); } -/// Bakes the root package's version into `TRACEDECAY_PRODUCT_VERSION`. +/// Bakes the workspace product version into `TRACEDECAY_PRODUCT_VERSION`. /// /// `env!("CARGO_PKG_VERSION")` is resolved per compiled crate, so inside this /// library it is this crate's own version rather than the version of the /// `tracedecay` product a user installed. Everything this crate stamps into a /// place a host can see — plugin manifests, plugin cache paths, staleness /// warnings, provenance headers — is compared against that product version, so -/// it is read here from the one place that authors it: the root package's -/// `version` in the workspace-root `Cargo.toml`. +/// it is read here from the one place that authors it: +/// `[workspace.package].version` in the workspace-root `Cargo.toml`. /// /// An unresolvable root manifest is fatal on purpose. Falling back to this /// crate's `CARGO_PKG_VERSION` is exactly the silent mismatch this exists to @@ -331,9 +331,9 @@ fn bake_product_version() { println!("cargo::rerun-if-changed=src/product_version/root_manifest.rs"); let Some(version) = root_manifest::resolve(&repo_root) else { panic!( - "{} must declare the `{}` package's version; it is the product version this crate stamps", + "{} must declare a literal version in {}; it is the product version this crate stamps", manifest_path.display(), - root_manifest::ROOT_PACKAGE_NAME, + root_manifest::PRODUCT_VERSION_TABLE, ); }; println!("cargo::rustc-env=TRACEDECAY_PRODUCT_VERSION={version}"); diff --git a/crates/tracedecay-agent-hosts/src/product_version.rs b/crates/tracedecay-agent-hosts/src/product_version.rs index c3dbad52aa..daea4d271f 100644 --- a/crates/tracedecay-agent-hosts/src/product_version.rs +++ b/crates/tracedecay-agent-hosts/src/product_version.rs @@ -7,21 +7,21 @@ //! writes is compared by hosts (and by the root crate's tests) against the //! product version, so the sub-crate version there is simply wrong. //! -//! [`PRODUCT_VERSION`] is that product version. `build.rs` reads the root -//! package's `version` out of the workspace-root `Cargo.toml` — the single +//! [`PRODUCT_VERSION`] is that product version. `build.rs` reads +//! `[workspace.package].version` out of the workspace-root `Cargo.toml` — the single //! authoring point Release Please owns — and bakes it into //! `TRACEDECAY_PRODUCT_VERSION`, exactly the way it bakes `TRACEDECAY_GIT_SHA` //! for the same reason. There is no literal version in this crate's source. -/// Reads the root package's version out of the workspace-root manifest. +/// Reads the product version out of the workspace-root manifest. /// /// `build.rs` compiles this same module through a `#[path]` declaration, so /// the parser that bakes [`PRODUCT_VERSION`] is the parser the tests below /// verify it against rather than a second copy that can drift. pub mod root_manifest; -/// The TraceDecay product version: the `version` of the root `tracedecay` -/// package, baked in by `build.rs`. +/// The TraceDecay product version from the workspace authority, baked in by +/// `build.rs`. /// /// Use this — never `env!("CARGO_PKG_VERSION")` — for anything a host, a /// deployed plugin manifest, or a user-visible path will compare against an @@ -38,13 +38,13 @@ mod tests { std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../..") } - /// The drift guard. A release bump of the root package that failed to + /// The drift guard. A release bump of the workspace product that failed to /// reach this binary would otherwise only show up as hosts silently /// comparing plugin manifests against the wrong version. #[test] - fn the_baked_version_is_the_root_packages_version() { + fn the_baked_version_is_the_workspace_product_version() { let authored = root_manifest::resolve(&repo_root()) - .expect("the workspace-root manifest must declare the root package version"); + .expect("the workspace-root manifest must declare the product version"); assert_eq!( PRODUCT_VERSION, authored, diff --git a/crates/tracedecay-agent-hosts/src/product_version/root_manifest.rs b/crates/tracedecay-agent-hosts/src/product_version/root_manifest.rs index 7e8180cce0..ebb726445a 100644 --- a/crates/tracedecay-agent-hosts/src/product_version/root_manifest.rs +++ b/crates/tracedecay-agent-hosts/src/product_version/root_manifest.rs @@ -7,55 +7,52 @@ /// File name of the workspace-root manifest that owns the product version. pub const ROOT_MANIFEST_FILE: &str = "Cargo.toml"; -/// Name of the root package whose `version` is the TraceDecay product version. -pub const ROOT_PACKAGE_NAME: &str = "tracedecay"; +/// Workspace table whose literal `version` is the TraceDecay product version. +pub const PRODUCT_VERSION_TABLE: &str = "[workspace.package]"; /// Path of the workspace-root manifest below `repo_root`. /// /// Handed to Cargo as a `rerun-if-changed` trigger so a release bump of the -/// root package rebuilds this crate instead of leaving a stale version baked +/// workspace product version rebuilds this crate instead of leaving a stale version baked /// into plugin manifests and cache paths. pub fn manifest_path(repo_root: &std::path::Path) -> std::path::PathBuf { repo_root.join(ROOT_MANIFEST_FILE) } -/// The root package's version, read from the workspace-root manifest below +/// The product version, read from the workspace-root manifest below /// `repo_root`. /// -/// `None` when the manifest is missing or unreadable, when it does not declare -/// the expected root package, or when that package has no literal `version`. +/// `None` when the manifest is missing or unreadable, or when +/// `[workspace.package]` has no unambiguous literal `version`. /// Every one of those means the value this crate would otherwise stamp is not /// the product version, so callers must fail loudly rather than substitute /// their own `CARGO_PKG_VERSION` — that substitution is precisely the silent /// drift this module exists to prevent. pub fn resolve(repo_root: &std::path::Path) -> Option { let manifest = std::fs::read_to_string(manifest_path(repo_root)).ok()?; - if package_field(&manifest, "name")? != ROOT_PACKAGE_NAME { - return None; - } - Some(package_field(&manifest, "version")?.to_string()) + Some(workspace_package_field(&manifest, "version")?.to_string()) } -/// The first literal string assigned to `key` inside the manifest's `[package]` -/// table. +/// The only literal string assigned to `key` inside `[workspace.package]`. /// /// Deliberately a line scanner rather than a TOML parse: this crate's build /// script has no build dependencies, and the two fields it needs are plain /// basic strings in a hand-maintained manifest. Inherited values /// (`version.workspace = true`) are not literals and are reported as absent, /// which the caller surfaces as a failure instead of a wrong stamp. -pub fn package_field<'a>(manifest: &'a str, key: &str) -> Option<&'a str> { - let mut in_package = false; +pub fn workspace_package_field<'a>(manifest: &'a str, key: &str) -> Option<&'a str> { + let mut in_workspace_package = false; + let mut value = None; for line in manifest.lines() { let line = line.trim(); if line.starts_with('#') { continue; } if line.starts_with('[') { - in_package = line == "[package]"; + in_workspace_package = line == PRODUCT_VERSION_TABLE; continue; } - if !in_package { + if !in_workspace_package { continue; } let Some(rest) = line.strip_prefix(key) else { @@ -70,14 +67,17 @@ pub fn package_field<'a>(manifest: &'a str, key: &str) -> Option<&'a str> { // absent rather than searched past: the assignment was found, and any // later match would belong to a different key. let rest = rest.trim_start().strip_prefix('"')?; - return rest.split('"').next(); + let literal = rest.split('"').next()?; + if value.replace(literal).is_some() { + return None; + } } - None + value } #[cfg(test)] mod tests { - use super::{ROOT_PACKAGE_NAME, package_field, resolve}; + use super::{ROOT_MANIFEST_FILE, resolve, workspace_package_field}; const MANIFEST: &str = "\ [workspace] @@ -99,27 +99,26 @@ version = \"1\" "; #[test] - fn the_package_table_wins_over_every_other_table() { - assert_eq!(package_field(MANIFEST, "version"), Some("0.0.67")); - assert_eq!(package_field(MANIFEST, "name"), Some(ROOT_PACKAGE_NAME)); + fn the_workspace_package_table_wins_over_every_other_table() { + assert_eq!(workspace_package_field(MANIFEST, "version"), Some("9.9.9")); } #[test] fn an_inherited_version_is_not_a_literal_this_can_stamp() { - let manifest = "[package]\nname = \"tracedecay\"\nversion.workspace = true\n"; - assert_eq!(package_field(manifest, "version"), None); + let manifest = "[workspace.package]\nversion.workspace = true\n"; + assert_eq!(workspace_package_field(manifest, "version"), None); } #[test] fn a_key_that_is_only_a_prefix_is_not_the_field() { - let manifest = "[package]\nversions = \"nope\"\nversion = \"1.2.3\"\n"; - assert_eq!(package_field(manifest, "version"), Some("1.2.3")); + let manifest = "[workspace.package]\nversions = \"nope\"\nversion = \"1.2.3\"\n"; + assert_eq!(workspace_package_field(manifest, "version"), Some("1.2.3")); } #[test] - fn a_manifest_without_a_package_table_has_no_product_version() { + fn a_manifest_without_a_workspace_package_table_has_no_product_version() { assert_eq!( - package_field("[workspace]\nversion = \"1\"\n", "version"), + workspace_package_field("[workspace]\nversion = \"1\"\n", "version"), None ); } @@ -130,10 +129,10 @@ version = \"1\" assert_eq!(resolve(dir.path()), None); } - /// A crate directory is not the workspace root; resolving against the wrong - /// root must report nothing rather than some other package's version. + /// A crate directory is not the workspace root; resolving against a + /// package-only manifest must report nothing rather than that package's version. #[test] - fn a_manifest_for_a_different_package_is_refused() { + fn a_package_manifest_without_workspace_authority_is_refused() { let dir = tempfile::tempdir().expect("temp dir"); std::fs::write( dir.path().join("Cargo.toml"), @@ -144,9 +143,21 @@ version = \"1\" } #[test] - fn the_root_package_version_round_trips_through_a_file() { + fn the_workspace_product_version_round_trips_through_a_file() { let dir = tempfile::tempdir().expect("temp dir"); std::fs::write(dir.path().join("Cargo.toml"), MANIFEST).expect("write manifest"); - assert_eq!(resolve(dir.path()).as_deref(), Some("0.0.67")); + assert_eq!(resolve(dir.path()).as_deref(), Some("9.9.9")); + } + + #[test] + fn a_virtual_workspace_product_version_round_trips_through_a_file() { + let directory = tempfile::tempdir().expect("temporary directory"); + std::fs::write( + directory.path().join(ROOT_MANIFEST_FILE), + "[workspace]\nresolver = \"3\"\n\n[workspace.package]\nversion = \"0.1.0-beta.38\"\n", + ) + .expect("write manifest"); + + assert_eq!(resolve(directory.path()).as_deref(), Some("0.1.0-beta.38")); } } diff --git a/crates/tracedecay-cli/Cargo.toml b/crates/tracedecay-cli/Cargo.toml index 3fa79e231d..3f320057fe 100644 --- a/crates/tracedecay-cli/Cargo.toml +++ b/crates/tracedecay-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tracedecay-cli" -version = "0.1.0-beta.37" +version.workspace = true publish = false edition.workspace = true description = "TraceDecay command-line interface and daemon binary" @@ -95,7 +95,7 @@ serde_json = "1" sha2 = "0.11" tokio = { version = "1", features = ["full"] } tokio-util = { version = "0.7.19", features = ["codec"] } -tracedecay = { path = "../..", version = "0.1.0-beta.37", default-features = false } +tracedecay = { path = "../tracedecay", version = "0.1.0-beta.37", default-features = false } tracedecay-agent-hosts = { path = "../tracedecay-agent-hosts", version = "0.1.0" } tracedecay-api = { path = "../tracedecay-api", version = "0.1.0" } tracedecay-application = { path = "../tracedecay-application", version = "0.1.0", features = ["native-git"] } @@ -124,6 +124,7 @@ tempfile = "3" tokio = { version = "1", features = ["full", "test-util"] } toml = "1" tower = "0.5" +tracedecay = { path = "../tracedecay", version = "0.1.0-beta.37", default-features = false, features = ["test-helpers"] } tracedecay-global-db = { path = "../tracedecay-global-db", version = "0.1.0", features = ["test-helpers"] } tracedecay-runtime-core = { path = "../tracedecay-runtime-core", version = "0.1.0", features = ["test-helpers"] } ureq = { version = "3", features = ["json"] } diff --git a/crates/tracedecay-cli/src/agent_cmd.rs b/crates/tracedecay-cli/src/agent_cmd.rs index b25f05413a..762b02a6fb 100644 --- a/crates/tracedecay-cli/src/agent_cmd.rs +++ b/crates/tracedecay-cli/src/agent_cmd.rs @@ -8,8 +8,8 @@ use serde::{Deserialize, Serialize}; use sha2::{Digest, Sha256}; use tracedecay::agents::host_component_registration::CatalogHostComponentRegistrationAuthority; -use tracedecay::user_config::UserConfig; use tracedecay_private_fs::framed_log::{DirectorySyncPolicy, atomic_write, sync_parent_directory}; +use tracedecay_usecases::user_config::UserConfig; mod automation; pub(crate) use automation::CodexAutomationInstall; @@ -82,7 +82,7 @@ pub(crate) async fn handle_host_bundle_component_command( .map_err(|error| tracedecay::errors::TraceDecayError::Config { message: format!("could not resolve host lifecycle root: {error}"), })?; - let mut user_config = tracedecay::user_config::UserConfig::load(); + let mut user_config = tracedecay_usecases::user_config::UserConfig::load(); let explicitly_scoped = agent.is_some(); let agent_ids = match agent { Some(agent) => vec![agent], @@ -301,8 +301,8 @@ fn apply_host_bundle_artifact_action_at( message: "artifact backup/restore requires exactly one canonical component".to_string(), }); }; - let operation_id = tracedecay::request_identity::mint_global_operation_id( - tracedecay::request_identity::GlobalOperationIdentityKind::HostArtifact, + let operation_id = tracedecay_usecases::request_identity::mint_global_operation_id( + tracedecay_usecases::request_identity::GlobalOperationIdentityKind::HostArtifact, ) .map_err(|error| tracedecay::errors::TraceDecayError::Config { message: format!("could not generate host artifact operation id: {error}"), @@ -399,8 +399,8 @@ fn component_set_request( ) -> tracedecay::errors::Result< tracedecay::agents::host_bundle_v2::HostComponentSetExecutionRequestV1, > { - let operation_id = tracedecay::request_identity::mint_global_operation_id( - tracedecay::request_identity::GlobalOperationIdentityKind::HostComponentSet, + let operation_id = tracedecay_usecases::request_identity::mint_global_operation_id( + tracedecay_usecases::request_identity::GlobalOperationIdentityKind::HostComponentSet, ) .map_err(|error| tracedecay::errors::TraceDecayError::Config { message: format!("could not generate host lifecycle operation id: {error}"), @@ -1122,8 +1122,8 @@ fn feedback_request( operation: tracedecay::agents::host_bundle_v2::HostBundleLifecycleOpV1, confirmed: bool, ) -> tracedecay::errors::Result { - let operation_id = tracedecay::request_identity::mint_global_operation_id( - tracedecay::request_identity::GlobalOperationIdentityKind::HostFeedbackRollback, + let operation_id = tracedecay_usecases::request_identity::mint_global_operation_id( + tracedecay_usecases::request_identity::GlobalOperationIdentityKind::HostFeedbackRollback, ) .map_err(|error| tracedecay::errors::TraceDecayError::Config { message: format!("could not generate feedback rollback operation id: {error}"), diff --git a/crates/tracedecay-cli/src/commands/settings.rs b/crates/tracedecay-cli/src/commands/settings.rs index 2b44776db2..def75e626a 100644 --- a/crates/tracedecay-cli/src/commands/settings.rs +++ b/crates/tracedecay-cli/src/commands/settings.rs @@ -4,7 +4,6 @@ use tracedecay::application_surface::{ApplicationSurfaceOperation, ApplicationSu use tracedecay::daemon_client::{ DaemonInvocationClient, RequestedOutputFormat, invocation_now_micros, }; -use tracedecay::request_identity::{GlobalRequestSurface, mint_global_request_id}; use tracedecay_application::{ ApplicationEnvelope, ApplicationOutcome, CancellationSignal, ComponentConfigurationState, Deadline, EffectReceipt, ResolvedSetting, @@ -19,6 +18,7 @@ use tracedecay_domain::configuration::{ ConfigurationValueV1, SettingKey, USER_UPLOAD_ENABLED_SETTING_KEY, UserProfileId, }; use tracedecay_domain::{ProjectId, UtcMicros, canonical_sha256}; +use tracedecay_usecases::request_identity::{GlobalRequestSurface, mint_global_request_id}; use super::daemon::daemon_tool_json; diff --git a/crates/tracedecay-cli/src/global.rs b/crates/tracedecay-cli/src/global.rs index 62c6881be5..a7790987a3 100644 --- a/crates/tracedecay-cli/src/global.rs +++ b/crates/tracedecay-cli/src/global.rs @@ -61,7 +61,7 @@ fn elapsed_since(now: i64, recorded_at: i64) -> i64 { /// `force` = true on status/sync commands (always attempt), false on others /// (only flush if stale > 30s). pub(crate) fn try_flush( - config: &mut tracedecay::user_config::UserConfig, + config: &mut tracedecay_usecases::user_config::UserConfig, force: bool, upload_enabled: bool, ) { @@ -96,7 +96,7 @@ pub(crate) fn try_flush( /// parallel). If `skip_suppression` is false, the warning is suppressed for 15 /// minutes after it was last shown; if true it is always shown (used for status). pub(crate) fn check_for_update( - config: &mut tracedecay::user_config::UserConfig, + config: &mut tracedecay_usecases::user_config::UserConfig, skip_cache: bool, skip_suppression: bool, ) { @@ -724,10 +724,10 @@ mod gather_tests { #[test] fn canonical_upload_denial_overrides_stale_legacy_metadata() { - let mut config = tracedecay::user_config::UserConfig { + let mut config = tracedecay_usecases::user_config::UserConfig { upload_enabled: true, pending_upload: 42, - ..tracedecay::user_config::UserConfig::default() + ..tracedecay_usecases::user_config::UserConfig::default() }; try_flush(&mut config, true, false); diff --git a/crates/tracedecay-cli/src/main.rs b/crates/tracedecay-cli/src/main.rs index 8d02ffb072..5b2e86d108 100644 --- a/crates/tracedecay-cli/src/main.rs +++ b/crates/tracedecay-cli/src/main.rs @@ -619,13 +619,13 @@ async fn run_startup_preamble(command: &Commands) { let startup_policy = CommandStartupPolicy::for_command(command); // Check first-run before any config save creates the file. - let is_first_run = tracedecay::user_config::UserConfig::is_fresh(); + let is_first_run = tracedecay_usecases::user_config::UserConfig::is_fresh(); let is_force_flush = matches!( command, Commands::Init { .. } | Commands::Sync { .. } | Commands::Status { .. } ); - let mut user_config = tracedecay::user_config::UserConfig::load(); + let mut user_config = tracedecay_usecases::user_config::UserConfig::load(); // Skip the worldwide-counter flush on hot startup paths. `try_flush` // makes a synchronous HTTP call which can add seconds to // `tracedecay serve` startup on slow networks — long enough to blow the diff --git a/crates/tracedecay-cli/src/startup_tests.rs b/crates/tracedecay-cli/src/startup_tests.rs index 854312d066..167dd3bd70 100644 --- a/crates/tracedecay-cli/src/startup_tests.rs +++ b/crates/tracedecay-cli/src/startup_tests.rs @@ -12,7 +12,7 @@ use super::{ use clap::{CommandFactory, Parser}; use std::iter; use std::path::PathBuf; -use tracedecay::user_config::UserConfig; +use tracedecay_usecases::user_config::UserConfig; fn parse_command(args: &[&str]) -> Commands { Cli::try_parse_from(iter::once("tracedecay").chain(args.iter().copied())) diff --git a/crates/tracedecay-cli/src/status_cmd.rs b/crates/tracedecay-cli/src/status_cmd.rs index 548642ff28..942a29c529 100644 --- a/crates/tracedecay-cli/src/status_cmd.rs +++ b/crates/tracedecay-cli/src/status_cmd.rs @@ -232,7 +232,7 @@ async fn handle_status_command_within( "timed out waiting for canonical worldwide-counter upload setting before status deadline" .to_string(), })??; - let mut config = tracedecay::user_config::UserConfig::load(); + let mut config = tracedecay_usecases::user_config::UserConfig::load(); let now = current_unix_timestamp(); let stdout_is_terminal = std::io::stdout().is_terminal(); let stderr_is_terminal = std::io::stderr().is_terminal(); diff --git a/crates/tracedecay-cli/src/tool_command.rs b/crates/tracedecay-cli/src/tool_command.rs index d55ffb0613..7b21646f68 100644 --- a/crates/tracedecay-cli/src/tool_command.rs +++ b/crates/tracedecay-cli/src/tool_command.rs @@ -61,10 +61,10 @@ use tracedecay::mcp::tools::{ LegacyToolCompatibilityOwner, RESERVED_FLAGS_FOOTER, ToolDefinition, get_tool_definitions, render_tool_cli_help, short_tool_name, }; -use tracedecay::request_identity::{GlobalRequestSurface, mint_global_request_id}; use tracedecay_application::{CancellationSignal, Deadline}; use tracedecay_domain::UtcMicros; use tracedecay_tool_catalog::BindingSurface; +use tracedecay_usecases::request_identity::{GlobalRequestSurface, mint_global_request_id}; use crate::cli::dispatch::resolve_cli_application_surface; use crate::commands::{recover_truncated_mcp_result, reject_truncation_envelope}; diff --git a/crates/tracedecay-cli/src/update_cmd.rs b/crates/tracedecay-cli/src/update_cmd.rs index 90f2761094..c817cc171e 100644 --- a/crates/tracedecay-cli/src/update_cmd.rs +++ b/crates/tracedecay-cli/src/update_cmd.rs @@ -18,7 +18,7 @@ use std::path::{Path, PathBuf}; use std::time::Duration; use tracedecay::upgrade::UpgradeOutcome; -use tracedecay::user_config::UserConfig; +use tracedecay_usecases::user_config::UserConfig; // Exceeds the daemon's sequential 15s client drain, 2s task abort, and 45s // server-shutdown bounds with margin for service-manager/process-exit latency. @@ -823,7 +823,7 @@ mod tests { drop(held); } - use tracedecay::user_config::UserConfig; + use tracedecay_usecases::user_config::UserConfig; fn config_err(message: &str) -> tracedecay::errors::TraceDecayError { tracedecay::errors::TraceDecayError::Config { diff --git a/crates/tracedecay-cli/tests/core_cli_suite/cli_non_interactive_test.rs b/crates/tracedecay-cli/tests/core_cli_suite/cli_non_interactive_test.rs index 969d5cc1d4..13af359844 100644 --- a/crates/tracedecay-cli/tests/core_cli_suite/cli_non_interactive_test.rs +++ b/crates/tracedecay-cli/tests/core_cli_suite/cli_non_interactive_test.rs @@ -1484,7 +1484,7 @@ fn wipe_all_is_schema_independent_and_removes_every_profile_database_root() { let config_path = profile.join("config.toml"); let identity_path = profile.join("profile-identity.json"); std::fs::create_dir_all(&profile).unwrap(); - let config = toml::to_string_pretty(&tracedecay::user_config::UserConfig::default()) + let config = toml::to_string_pretty(&tracedecay_usecases::user_config::UserConfig::default()) .unwrap() .into_bytes(); std::fs::write(&config_path, &config).unwrap(); diff --git a/crates/tracedecay-cli/tests/core_cli_suite/main.rs b/crates/tracedecay-cli/tests/core_cli_suite/main.rs index ac127a82e5..6123fbd252 100644 --- a/crates/tracedecay-cli/tests/core_cli_suite/main.rs +++ b/crates/tracedecay-cli/tests/core_cli_suite/main.rs @@ -8,7 +8,7 @@ mod cli_help_test; mod cli_non_interactive_test; -#[path = "../../../../tests/common/mod.rs"] +#[path = "../../../tracedecay/tests/common/mod.rs"] mod common; mod config_test; mod gain_test; diff --git a/crates/tracedecay-cli/tests/core_cli_suite/user_config_test.rs b/crates/tracedecay-cli/tests/core_cli_suite/user_config_test.rs index e422426ac7..183fcc043b 100644 --- a/crates/tracedecay-cli/tests/core_cli_suite/user_config_test.rs +++ b/crates/tracedecay-cli/tests/core_cli_suite/user_config_test.rs @@ -1,4 +1,4 @@ -use tracedecay::user_config::UserConfig; +use tracedecay_usecases::user_config::UserConfig; #[test] fn defaults_when_no_file() { @@ -61,13 +61,13 @@ fn unknown_fields_ignored() { #[test] fn old_daemon_debounce_field_still_deserializes() { let toml = r#"daemon_debounce = "30s""#; - let cfg: tracedecay::user_config::UserConfig = toml::from_str(toml).unwrap(); + let cfg: tracedecay_usecases::user_config::UserConfig = toml::from_str(toml).unwrap(); assert_eq!(cfg.watcher_debounce, "30s"); } #[test] fn new_watcher_debounce_field_works() { let toml = r#"watcher_debounce = "45s""#; - let cfg: tracedecay::user_config::UserConfig = toml::from_str(toml).unwrap(); + let cfg: tracedecay_usecases::user_config::UserConfig = toml::from_str(toml).unwrap(); assert_eq!(cfg.watcher_debounce, "45s"); } diff --git a/crates/tracedecay-cli/tests/work_route_exposure_conformance.rs b/crates/tracedecay-cli/tests/work_route_exposure_conformance.rs index 9fb5ebeaab..0e3f5a1646 100644 --- a/crates/tracedecay-cli/tests/work_route_exposure_conformance.rs +++ b/crates/tracedecay-cli/tests/work_route_exposure_conformance.rs @@ -32,7 +32,7 @@ //! (`ExecutableBindingV1::request_schema`), so no handwritten payload mirror can //! drift from the wire contract. -#[path = "../../../tests/common/mod.rs"] +#[path = "../../tracedecay/tests/common/mod.rs"] mod common; #[path = "work_route_exposure_conformance/work_evidence.rs"] diff --git a/crates/tracedecay-query/Cargo.toml b/crates/tracedecay-query/Cargo.toml index 5cfa13d71f..f15a85112b 100644 --- a/crates/tracedecay-query/Cargo.toml +++ b/crates/tracedecay-query/Cargo.toml @@ -73,8 +73,8 @@ tempfile = "3" # Test-only: the relocated search-quality suites build lexical/exact fixtures # through the code-index intake and the extracted language registry, which # needs the bundled lite grammar tier (Rust). -tracedecay-code-extraction = { path = "../tracedecay-code-extraction", features = ["lite"] } -tracedecay-code-index = { path = "../tracedecay-code-index", default-features = false, features = ["lite", "test-helpers"] } +tracedecay-code-extraction = { path = "../tracedecay-code-extraction", version = "0.1.0", features = ["lite"] } +tracedecay-code-index = { path = "../tracedecay-code-index", version = "0.1.0", default-features = false, features = ["lite", "test-helpers"] } tracedecay-graph-db = { path = "../tracedecay-graph-db", version = "0.1.0", features = ["test-helpers"] } tracedecay-runtime-core = { path = "../tracedecay-runtime-core", version = "0.1.0" } diff --git a/crates/tracedecay/Cargo.toml b/crates/tracedecay/Cargo.toml new file mode 100644 index 0000000000..b845c1c5b5 --- /dev/null +++ b/crates/tracedecay/Cargo.toml @@ -0,0 +1,588 @@ +[package] +name = "tracedecay" +version.workspace = true +publish = false +edition.workspace = true +description = "Local semantic code intelligence, project memory, and workflow context for AI coding agents." +license = "MIT" +repository = "https://github.com/ScriptedAlchemy/tracedecay" +homepage = "https://github.com/ScriptedAlchemy/tracedecay" +readme = "../../README.md" +keywords = ["code-intelligence", "knowledge-graph", "mcp", "tree-sitter", "semantic-search"] +categories = ["development-tools", "command-line-utilities"] +# Explicit source-archive whitelist retained for local distribution validation. +# Frontend sources are deliberately excluded: build.rs embeds the canonical +# prebuilt dashboard/app-dist. Keep that packaged-asset check in build.rs in +# sync if the dashboard entries below change. +include = [ + "/CHANGELOG.md", + "/LICENSE", + "/README.md", + "/rust-toolchain.toml", + "/.cargo/config.toml", + "/build.rs", + "/build-support/dashboard_manifest.rs", + "/src/**", + "/benches/**", + "/examples/**", + "/tests/fixtures/analytics/**", + "/tests/fixtures/packaged_host_events/**", + "/tests/fixtures/provider_normalization/**", + "/tests/fixtures/redundancy_eval_labeled.json", + "/tests/fixtures/search_quality/query-semantic-candidate-workload-v1.json", + "/tests/fixtures/transcript_golden/cline_like/**", + "/benchmark_data/queries/default.toml", + "/benchmark_data/claude-observation/**", + "/benchmark_data/session-temporal/**", + "/benchmark_data/query-code-index/**", + "/benchmark_data/search-quality/query-fallback-report-v1.json", + "/scripts/run-session-temporal-benchmark.sh", + "/plugin/.claude-plugin/**", + "/plugin/.cursor-plugin/**", + "/plugin/.codex-plugin/**", + "/plugin/.kimi-plugin/**", + "/plugin/.lsp.json", + "/plugin/.mcp.json", + "/plugin/README*.md", + "/plugin/agents/**", + "/plugin/commands/**", + "/plugin/hooks/**", + "/plugin/mcp-cursor.json", + "/plugin/opencode/**", + "/plugin/overlays/**", + "/plugin/rules/**", + "/plugin/skills/**", + "/plugin/cursor-native-extension/package.json", + "/plugin/cursor-native-extension/README.md", + "/plugin/cursor-native-extension/LICENSE", + "/plugin/cursor-native-extension/embedded/extension.js", + "/vendor/**", + "/dashboard/app-dist/**", + "/dashboard/hermes-wrapper/manifest.json", + "/dashboard/hermes-wrapper/plugin_api.py", + "/dashboard/hermes-wrapper/src/**", +] + +[features] +# Default and explicitly selected production artifacts resolve through the +# same feature. Release packaging selects exactly `production`; profiling is a +# separate feature-enabled build because Hotpath 0.24 has no runtime-off mode. +# `--all-features` is test-only because it includes `test-transport`. +default = ["production"] + +# Opt-in profiling. Never in `default` and never in `production`: with no +# profiling feature selected every hotpath macro expands to a no-op, so the +# instrumented call sites below compile identically in both modes. +# +# `hotpath` alone gives wall-clock timing. The other three layer on top of it: +# `hotpath-alloc` installs the counting global allocator, `hotpath-cpu` adds +# on-CPU sampling, and `hotpath-mcp` exposes the live query server (port 6771 +# by default, `HOTPATH_MCP_PORT` overrides). `hotpath/tokio` is required by +# `hotpath::tokio_runtime!`, which this binary registers with the explicit +# runtime handle it builds in `async_main`. +# +# The per-crate passthroughs matter because the profiling features change what +# `#[hotpath::measure]` expands to: a library crate compiled without them +# reports no allocation or CPU samples even when the binary enables profiling. +hotpath = [ + "hotpath/hotpath", + "hotpath/tokio", + # The daemon serves its HTTP application surface with axum 0.8 and reaches + # GitHub through ureq 3, and hotpath instruments both natively. Matching the + # versions we already depend on, so no second HTTP stack is introduced. + "hotpath/axum-0-8", + "hotpath/ureq-3", + "tracedecay-agent-hosts/hotpath", + "tracedecay-api/hotpath", + "tracedecay-application/hotpath", + "tracedecay-automation/hotpath", + "tracedecay-capture/hotpath", + "tracedecay-code-extraction/hotpath", + "tracedecay-code-index/hotpath", + "tracedecay-dashboard-api/hotpath", + "tracedecay-global-db/hotpath", + "tracedecay-graph-db/hotpath", + "tracedecay-hooks/hotpath", + "tracedecay-lsp/hotpath", + "tracedecay-private-fs/hotpath", + "tracedecay-query/hotpath", + "tracedecay-runtime-core/hotpath", + "tracedecay-rusqlite-runtime/hotpath", + "tracedecay-sdk/hotpath", + "tracedecay-semantic/hotpath", + "tracedecay-sessions/hotpath", + "tracedecay-temporal-query/hotpath", + "tracedecay-usecases/hotpath", +] +hotpath-alloc = [ + "hotpath", + "hotpath/hotpath-alloc", + "tracedecay-agent-hosts/hotpath-alloc", + "tracedecay-api/hotpath-alloc", + "tracedecay-application/hotpath-alloc", + "tracedecay-automation/hotpath-alloc", + "tracedecay-capture/hotpath-alloc", + "tracedecay-code-extraction/hotpath-alloc", + "tracedecay-code-index/hotpath-alloc", + "tracedecay-dashboard-api/hotpath-alloc", + "tracedecay-global-db/hotpath-alloc", + "tracedecay-graph-db/hotpath-alloc", + "tracedecay-hooks/hotpath-alloc", + "tracedecay-lsp/hotpath-alloc", + "tracedecay-private-fs/hotpath-alloc", + "tracedecay-query/hotpath-alloc", + "tracedecay-runtime-core/hotpath-alloc", + "tracedecay-rusqlite-runtime/hotpath-alloc", + "tracedecay-sdk/hotpath-alloc", + "tracedecay-semantic/hotpath-alloc", + "tracedecay-sessions/hotpath-alloc", + "tracedecay-temporal-query/hotpath-alloc", + "tracedecay-usecases/hotpath-alloc", +] +hotpath-cpu = [ + "hotpath", + "hotpath/hotpath-cpu", + "tracedecay-agent-hosts/hotpath-cpu", + "tracedecay-api/hotpath-cpu", + "tracedecay-application/hotpath-cpu", + "tracedecay-automation/hotpath-cpu", + "tracedecay-capture/hotpath-cpu", + "tracedecay-code-extraction/hotpath-cpu", + "tracedecay-code-index/hotpath-cpu", + "tracedecay-dashboard-api/hotpath-cpu", + "tracedecay-global-db/hotpath-cpu", + "tracedecay-graph-db/hotpath-cpu", + "tracedecay-hooks/hotpath-cpu", + "tracedecay-lsp/hotpath-cpu", + "tracedecay-private-fs/hotpath-cpu", + "tracedecay-query/hotpath-cpu", + "tracedecay-runtime-core/hotpath-cpu", + "tracedecay-rusqlite-runtime/hotpath-cpu", + "tracedecay-sdk/hotpath-cpu", + "tracedecay-semantic/hotpath-cpu", + "tracedecay-sessions/hotpath-cpu", + "tracedecay-temporal-query/hotpath-cpu", + "tracedecay-usecases/hotpath-cpu", +] +# Binary-only: the live query server runs in this process, so no library crate +# needs a passthrough for it. +hotpath-mcp = ["hotpath", "hotpath/hotpath-mcp"] +production = [ + "token-counting", + "lite", + "full", + "semantic-fastembed", +] + +# Exact token counting for the Savings & Cost dashboard (tiktoken BPE). +# Embeds the o200k_base/cl100k_base vocabularies (~4 MB of binary weight); +# vocab decoding is lazy (first count pays it, idle servers never do). +# Disable for a leaner binary — cost estimation falls back to chars/4. +token-counting = ["tracedecay-agent-hosts/token-counting", "tracedecay-dashboard-api/token-counting"] + +# Lite tier (11 languages) — always compiled, no feature flag needed: +# Rust, Go, Java, Scala, TypeScript/JavaScript, Python, C, C++, Kotlin, C#, Swift. +# Markdown joins them: documentation is architecture content, every repository +# has it, and a build that indexes code but not its docs is not a shippable +# tier. Its grammar lives in the (monolithic) large bundle, so `lite` now links +# that bundle — the compile-weight cost of making docs unconditional. +lite = ["tracedecay-code-index/lite"] + +medium = ["tracedecay-code-index/medium"] +full = ["tracedecay-code-index/full"] + +# These aliases are intentionally repeated at the binary boundary: Cargo +# cannot expose a dependency feature as a caller-selectable local feature. +# Tier membership remains owned by tracedecay-code-extraction and reaches this +# package through the aggregate forwards above. +lang-dart = ["tracedecay-code-index/lang-dart"] +lang-pascal = ["tracedecay-code-index/lang-pascal"] +lang-php = ["tracedecay-code-index/lang-php"] +lang-ruby = ["tracedecay-code-index/lang-ruby"] +lang-bash = ["tracedecay-code-index/lang-bash"] +lang-protobuf = ["tracedecay-code-index/lang-protobuf"] +lang-powershell = ["tracedecay-code-index/lang-powershell"] +lang-nix = ["tracedecay-code-index/lang-nix"] +lang-vbnet = ["tracedecay-code-index/lang-vbnet"] +lang-lua = ["tracedecay-code-index/lang-lua"] +lang-zig = ["tracedecay-code-index/lang-zig"] +lang-objc = ["tracedecay-code-index/lang-objc"] +lang-perl = ["tracedecay-code-index/lang-perl"] +lang-batch = ["tracedecay-code-index/lang-batch"] +lang-fortran = ["tracedecay-code-index/lang-fortran"] +lang-cobol = ["tracedecay-code-index/lang-cobol"] +lang-msbasic2 = ["tracedecay-code-index/lang-msbasic2"] +lang-gwbasic = ["tracedecay-code-index/lang-gwbasic"] +lang-qbasic = ["tracedecay-code-index/lang-qbasic"] +lang-dockerfile = ["tracedecay-code-index/lang-dockerfile"] +lang-glsl = ["tracedecay-code-index/lang-glsl"] +lang-wgsl = ["tracedecay-code-index/lang-wgsl"] +lang-hlsl = ["tracedecay-code-index/lang-hlsl"] +lang-metal = ["tracedecay-code-index/lang-metal"] +lang-markdown = ["tracedecay-code-index/lang-markdown"] +lang-r = ["tracedecay-code-index/lang-r"] +lang-sql = ["tracedecay-code-index/lang-sql"] +lang-julia = ["tracedecay-code-index/lang-julia"] +lang-haskell = ["tracedecay-code-index/lang-haskell"] +lang-ocaml = ["tracedecay-code-index/lang-ocaml"] +lang-clojure = ["tracedecay-code-index/lang-clojure"] +lang-erlang = ["tracedecay-code-index/lang-erlang"] +lang-elixir = ["tracedecay-code-index/lang-elixir"] +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"] +# 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 +# out of a default or `production` build: they compile only under `cfg(test)` +# or when a consumer asks for them explicitly. +test-helpers = [] + +test-transport = [ + "test-helpers", + "tracedecay-rusqlite-runtime/test-transport", + "tracedecay-runtime-core/test-transport", + "tracedecay-agent-hosts/test-transport", + "tracedecay-dashboard-api/test-transport", + "tracedecay-usecases/test-transport", + # The observation-seed fixture bridge (`dashboard::observation_seed`) is + # test-transport-gated and drives the global-db session-temporal refresh + # helpers; plain builds (no dev-dep feature unification) need the forward. + "tracedecay-global-db/test-helpers", + # The graph-projection fixture bridge + # (`dashboard::graph_projection_fixture`) publishes the hermetic code-graph + # generation dashboard neighbor reads take their adjacency from. + "tracedecay-code-index/test-helpers", +] + +# SEMANTIC FastEmbed adapter (Plan 31). Bundles ORT while leaving FastEmbed's +# image defaults disabled. Runtime inference still loads only from locally +# verified artifact bytes; daemon-owned acquisition uses hf-hub against the +# immutable catalog pins, never query-time ambient cache discovery. The +# adapter itself lives in `tracedecay-semantic`, which owns the pins. +semantic-fastembed = [ + "tracedecay-semantic/semantic-fastembed", + "tracedecay-usecases/semantic-fastembed", +] + +[lib] +name = "tracedecay" + +# Plan 36 portability: symlink-alias snapshot capture (test-transport only). +[[test]] +name = "git_index_snapshot_root_canonicalization" +path = "tests/git_index_snapshot_root_canonicalization.rs" +required-features = ["test-transport"] + +# Integration harnesses that intentionally exercise in-process daemon/test +# transport seams stay out of the default production feature graph. +[[test]] +name = "dashboard_api_test" +path = "tests/dashboard_api_test/main.rs" +required-features = ["test-transport"] + +[[test]] +name = "daemon_fault_harness_test" +path = "tests/daemon_fault_harness_test.rs" +required-features = ["test-transport"] + +# The PartialEffect leg parks a real fact commit at the daemon's durable commit +# boundary, which is the `test-transport` fact-commit barrier. +[[test]] +name = "typed_terminal_restart_acceptance" +path = "tests/typed_terminal_restart_acceptance.rs" +required-features = ["test-transport"] + +[[test]] +name = "graph_rebuild_status_test" +path = "tests/graph_rebuild_status_test.rs" +required-features = ["test-transport"] + +[[test]] +name = "serve_proxy_lifecycle_test" +path = "tests/serve_proxy_lifecycle_test.rs" +required-features = ["test-transport"] + +# Drives a live daemon, the real stdio MCP server, and the real CLI listing to +# grade every declared surface for a mount in both directions. +[[test]] +name = "v2_surface_mount_conformance" +path = "tests/v2_surface_mount_conformance.rs" +required-features = ["test-transport"] + +# Shared with the extracted rusqlite-runtime package's restart/parity tests; +# keep one repository-level source while preserving this package target. +[[test]] +name = "storage_runtime_rusqlite_suite" +path = "../../tests/storage_runtime_rusqlite_suite/main.rs" + +[dependencies] +axum = "0.8" +hotpath.workspace = true +hyper = { version = "1", features = ["http1", "server"] } +hyper-util = { version = "0.1", features = ["service", "tokio"] } +tower = "0.5" +tree-sitter = "0.26" +constant_time_eq = "0.5.0" +tracedecay-agent-hosts = { path = "../tracedecay-agent-hosts", version = "0.1.0" } +tracedecay-api = { path = "../tracedecay-api", version = "0.1.0" } +tracedecay-application = { path = "../tracedecay-application", version = "0.1.0", features = ["native-git"] } +tracedecay-automation = { path = "../tracedecay-automation", version = "0.1.0" } +tracedecay-capture = { path = "../tracedecay-capture", version = "0.1.0" } +tracedecay-code-extraction = { path = "../tracedecay-code-extraction", version = "0.1.0", default-features = false } +tracedecay-code-index = { path = "../tracedecay-code-index", version = "0.1.0", default-features = false } +tracedecay-dashboard-api = { path = "../tracedecay-dashboard-api", version = "0.1.0" } +tracedecay-domain = { path = "../tracedecay-domain", version = "0.1.0" } +tracedecay-host-integration = { path = "../tracedecay-host-integration", version = "0.1.0" } +tracedecay-hooks = { path = "../tracedecay-hooks", version = "0.1.0" } +tracedecay-jsonrpc = { path = "../tracedecay-jsonrpc", version = "0.1.0" } +tracedecay-lsp = { path = "../tracedecay-lsp", version = "0.1.0" } +tracedecay-global-db = { path = "../tracedecay-global-db", version = "0.1.0" } +tracedecay-graph-db = { path = "../tracedecay-graph-db", version = "0.1.0" } +tracedecay-policy = { path = "../tracedecay-policy", version = "0.1.0" } +tracedecay-private-fs = { path = "../tracedecay-private-fs", version = "0.1.0" } +tracedecay-query = { path = "../tracedecay-query", version = "0.1.0" } +tracedecay-runtime-core = { path = "../tracedecay-runtime-core", version = "0.1.0" } +tracedecay-search-eval = { path = "../tracedecay-search-eval", version = "0.1.0" } +tracedecay-semantic = { path = "../tracedecay-semantic", version = "0.1.0" } +tracedecay-sessions = { path = "../tracedecay-sessions", version = "0.1.0" } +tracedecay-temporal-query = { path = "../tracedecay-temporal-query", version = "0.1.0" } +tracedecay-rusqlite-runtime = { path = "../tracedecay-rusqlite-runtime", version = "0.1.0" } +tracedecay-sdk = { path = "../tracedecay-sdk", version = "0.1.0" } +rusqlite = { version = "0.40.1", default-features = false, features = ["backup"] } +tracedecay-store = { path = "../tracedecay-store", version = "0.1.0" } +tracedecay-tool-catalog = { path = "../tracedecay-tool-catalog", version = "0.1.0" } +tracedecay-usecases = { path = "../tracedecay-usecases", version = "0.1.0" } +clap = { version = "4.6", features = ["derive"] } +semver = "1" +serde = { version = "1", features = ["derive"] } +serde_json = "1" +base64 = "0.22" +toml = "1" +ureq = { version = "3", features = ["json"] } +url = "2" +tokio = { version = "1", features = ["full"] } +tokio-stream = { version = "0.1", features = ["sync"] } +thiserror = "2" +tracing = "0.1" +tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt"] } +sha2 = "0.11" +glob = "0.3" +walkdir = "2" +ignore = "0.4" +gix = { version = "=0.86.0", default-features = false, features = ["revision", "blob-diff", "parallel", "sha1", "sha256", "status"] } +dirs = "6" +hex = "0.4" +rayon = "1" +getrandom = "0.2" +self-replace = "1" +memmap2 = "0.9" +crossterm = "0.28" +fs2 = "0.4" +same-file = "1" +sysinfo = { version = "0.32", default-features = false, features = ["system"] } +open = "5.3" +# Raw filesystem watcher for the daemon git-metadata watcher (src/daemon/git_watch.rs). +# We deliberately use the raw watcher (not notify-debouncer-full) and debounce +# ourselves so a monorepo's git-ref churn coalesces into a single sync. +notify = "6" +zeroize = "1.9.0" +keyring = { version = "4.1.5", features = ["v1"] } +tempfile = "3" +cap-std = "4.0.2" +cap-fs-ext = "4.0.2" +schemars = "1.2.1" +futures-util = "0.3.33" +tokio-util = { version = "0.7.19", features = ["codec"] } +rmcp = { version = "3.0.1", default-features = false, features = ["server"] } +rustls = { version = "0.23", default-features = false, features = ["ring", "std", "tls12"] } +tokio-rustls = { version = "0.26", default-features = false, features = ["ring", "tls12"] } + +[target.'cfg(not(windows))'.dependencies] +flate2 = "1" +tar = "0.4" + +[target.'cfg(target_os = "linux")'.dev-dependencies] +xattr = "1" + +# `statfs(2)` for daemon store-locality detection (src/daemon/store_runtime/ +# resolver.rs). Linux reads `/proc/self/mountinfo` instead; macOS has no such +# file, and `MNT_LOCAL` is the kernel's direct answer to "is this volume local". +[target.'cfg(any(target_os = "macos", all(target_os = "linux", target_env = "gnu")))'.dependencies] +libc = "0.2" + +[target.'cfg(windows)'.dependencies] +zip = { version = "8", default-features = false, features = ["deflate"] } +windows = { version = "0.62.2", features = [ + "Win32_Foundation", + "Win32_System_Com", + "Win32_System_Ole", + "Win32_System_TaskScheduler", + "Win32_System_Variant", +] } + +[build-dependencies] +serde_json = "1" + +[dev-dependencies] +sha2 = "0.11" +hex = "0.4" +regex = "1.12.3" +filetime = "0.2" +criterion = { version = "0.5", features = ["async_tokio", "html_reports"] } +# test-util enables tokio::test(start_paused = true) so timer-driven unit +# tests (daemon restart-grace windows) run on virtual time instead of real +# sleeps. +tokio = { version = "1", features = ["full", "test-util"] } +jsonschema = { version = "0.46.8", default-features = false } +tracedecay-sdk = { path = "../tracedecay-sdk", version = "0.1.0" } +# Test builds opt into the query kernel's `*_for_test` constructors; the +# feature stays off for production builds. +tracedecay-query = { path = "../tracedecay-query", version = "0.1.0", features = ["test-helpers"] } +# The dev edge keeps code-index's default grammar profile active so the +# default and explicit-production feature graphs resolve identically +# (mirrors code-index's own default-features dev edge on code-extraction). +tracedecay-code-index = { path = "../tracedecay-code-index", version = "0.1.0", features = ["test-helpers"] } +tracedecay-semantic = { path = "../tracedecay-semantic", version = "0.1.0", features = ["test-helpers"] } +tracedecay-temporal-query = { path = "../tracedecay-temporal-query", version = "0.1.0", features = ["test-helpers"] } +# Same policy for the extracted global-db harness the root test suite drives. +tracedecay-global-db = { path = "../tracedecay-global-db", version = "0.1.0", features = ["test-helpers"] } +# The root's cfg(test) host-admission support composes the dashboard test +# authority, which lives behind the dashboard-api test-transport feature. +tracedecay-dashboard-api = { path = "../tracedecay-dashboard-api", version = "0.1.0", features = ["test-transport"] } +tracedecay-runtime-core = { path = "../tracedecay-runtime-core", version = "0.1.0", features = ["test-helpers"] } +tracedecay-sessions = { path = "../tracedecay-sessions", version = "0.1.0", features = ["test-helpers"] } +tracedecay-usecases = { path = "../tracedecay-usecases", version = "0.1.0", features = ["test-helpers"] } + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ["cfg(tracedecay_observation_fault_harness)"] } + +[[bench]] +name = "large_repos" +path = "benches/large_repos.rs" +harness = false +required-features = ["test-transport"] + +[[bench]] +name = "queries" +path = "benches/queries.rs" +required-features = ["test-transport"] + +[[bench]] +name = "session_temporal" +path = "benches/session_temporal.rs" +harness = false +# The custom benchmark CLI is not a libtest harness and cannot answer the +# `--list --format terse` probe used by `cargo test` and nextest. +test = false + +[[test]] +name = "advisory_runtime_acceptance" +path = "tests/advisory_runtime_acceptance.rs" +required-features = ["test-helpers"] + +[[test]] +name = "agent_suite" +path = "tests/agent_suite/main.rs" +required-features = ["test-helpers"] + +[[test]] +name = "application_production_reachability" +path = "tests/application_production_reachability.rs" +required-features = ["test-helpers"] + +[[test]] +name = "automation_runner_test" +path = "tests/automation_runner_test/main.rs" +required-features = ["test-helpers"] + +[[test]] +name = "cross_host_handoff_test" +path = "tests/cross_host_handoff_test.rs" +required-features = ["test-helpers"] + +[[test]] +name = "daemon_runtime_acceptance" +path = "tests/daemon_runtime_acceptance.rs" +required-features = ["test-helpers"] + +[[test]] +name = "daemon_suite" +path = "tests/daemon_suite/main.rs" +required-features = ["test-helpers"] + +[[test]] +name = "grafeo_restart_acceptance" +path = "tests/grafeo_restart_acceptance.rs" +required-features = ["test-helpers"] + +[[test]] +name = "hermes_suite" +path = "tests/hermes_suite/main.rs" +required-features = ["test-helpers"] + +[[test]] +name = "hooks_lsp_suite" +path = "tests/hooks_lsp_suite/main.rs" +required-features = ["test-helpers"] + +[[test]] +name = "host_event_fixture_test" +path = "tests/host_event_fixture_test.rs" +required-features = ["test-helpers"] + +[[test]] +name = "lifecycle_production_authority_test" +path = "tests/lifecycle_production_authority_test.rs" +required-features = ["test-helpers"] + +[[test]] +name = "mcp_suite" +path = "tests/mcp_suite/main.rs" +required-features = ["test-helpers"] + +[[test]] +name = "memory_suite" +path = "tests/memory_suite/main.rs" +required-features = ["test-helpers"] + +[[test]] +name = "private_route_restart_acceptance" +path = "tests/private_route_restart_acceptance.rs" +required-features = ["test-helpers"] + +[[test]] +name = "runtime_surface_acceptance" +path = "tests/runtime_surface_acceptance.rs" +required-features = ["test-helpers"] + +[[test]] +name = "search_eval_cli_test" +path = "tests/search_eval_cli_test.rs" +required-features = ["test-helpers"] + +[[test]] +name = "search_quality_suite" +path = "tests/search_quality_suite/main.rs" +required-features = ["test-helpers"] + +[[test]] +name = "session_suite" +path = "tests/session_suite/main.rs" +required-features = ["test-helpers"] + +[[test]] +name = "storage_suite" +path = "tests/storage_suite/main.rs" +required-features = ["test-helpers"] + +[[test]] +name = "tool_client_transport" +path = "tests/tool_client_transport.rs" +required-features = ["test-helpers"] + +[[test]] +name = "windows_durable_behavior" +path = "tests/windows_durable_behavior.rs" +required-features = ["test-helpers"] diff --git a/benches/large_repos.rs b/crates/tracedecay/benches/large_repos.rs similarity index 100% rename from benches/large_repos.rs rename to crates/tracedecay/benches/large_repos.rs diff --git a/benches/queries.rs b/crates/tracedecay/benches/queries.rs similarity index 100% rename from benches/queries.rs rename to crates/tracedecay/benches/queries.rs diff --git a/benches/repos.rs b/crates/tracedecay/benches/repos.rs similarity index 100% rename from benches/repos.rs rename to crates/tracedecay/benches/repos.rs diff --git a/benches/session_temporal.rs b/crates/tracedecay/benches/session_temporal.rs similarity index 100% rename from benches/session_temporal.rs rename to crates/tracedecay/benches/session_temporal.rs diff --git a/build-support/dashboard_manifest.rs b/crates/tracedecay/build-support/dashboard_manifest.rs similarity index 100% rename from build-support/dashboard_manifest.rs rename to crates/tracedecay/build-support/dashboard_manifest.rs diff --git a/build.rs b/crates/tracedecay/build.rs similarity index 74% rename from build.rs rename to crates/tracedecay/build.rs index 2ead4992cb..d3659cfa52 100644 --- a/build.rs +++ b/crates/tracedecay/build.rs @@ -1,9 +1,9 @@ -//! Root build script: embeds the dashboard dist and bakes the build's commit +//! Composition-library build script: embeds the dashboard dist and bakes the build's commit //! identity. The plugin-bundle manifest moved to //! `crates/tracedecay-agent-hosts/build.rs` with the `agents`/`automation` //! subsystems. //! -//! Rerun-edge contract. Cargo recompiles the whole root crate whenever this +//! Rerun-edge contract. Cargo recompiles the composition crate whenever this //! script reruns, regardless of whether the generated output changed, so every //! `rerun-if-changed` path below costs a full root rebuild when it moves and //! must be load-bearing. Two rules follow: @@ -11,7 +11,7 @@ //! - This script must never watch `dashboard/app-dist`, which Rsbuild cleans //! and rewrites. Only frontend source and configuration inputs are watched. //! - Moving this dashboard generator into a dependency would not shield the -//! root from churn: a dependency's build-script rerun recompiles its +//! composition crate from churn: a dependency's build-script rerun recompiles its //! dependents unconditionally. use std::{ @@ -21,7 +21,7 @@ use std::{ fs, hash::{Hash, Hasher}, io, - path::Path, + path::{Path, PathBuf}, process::Command, }; @@ -43,15 +43,51 @@ const DASHBOARD_BUILD_INPUTS: &[&str] = &[ "dashboard/tsconfig.json", ]; +const REPOSITORY_ROOT_FROM_CRATE: &str = "../.."; + +fn repository_root(manifest_dir: &Path) -> Result> { + let checked_out_root = manifest_dir.join(REPOSITORY_ROOT_FROM_CRATE); + let repository_root = + if manifest_dir.join("dashboard").is_dir() && manifest_dir.join("plugin").is_dir() { + manifest_dir.to_path_buf() + } else { + checked_out_root + }; + for sentinel in ["Cargo.toml", "dashboard", "plugin"] { + if !repository_root.join(sentinel).exists() { + return Err(format!( + "TraceDecay repository root {} is missing required sentinel {sentinel}", + repository_root.display() + ) + .into()); + } + } + Ok(repository_root) +} + /// Builds the dashboard with Rsbuild when frontend sources are present, then /// embeds exactly the files listed in Rsbuild's asset manifest. Packaged crates /// omit the frontend sources and consume their prebuilt app-dist as-is. -fn build_and_embed_dashboard_app() -> Result<(), Box> { - let dashboard = Path::new("dashboard"); +fn build_and_embed_dashboard_app( + manifest_dir: &Path, + repository_root: &Path, +) -> Result<(), Box> { + let package_local_dashboard = manifest_dir.join("dashboard"); + let (dashboard, include_root) = if package_local_dashboard.is_dir() { + (package_local_dashboard, "/dashboard/app-dist") + } else { + ( + repository_root.join("dashboard"), + "/../../dashboard/app-dist", + ) + }; let app_dist = dashboard.join("app-dist"); for input in DASHBOARD_BUILD_INPUTS { - println!("cargo::rerun-if-changed={input}"); + println!( + "cargo::rerun-if-changed={}", + repository_root.join(input).display() + ); } println!("cargo::rerun-if-env-changed=TRACEDECAY_DASHBOARD_CONTRACT_SCHEMA_OUT"); println!("cargo::rerun-if-env-changed=TRACEDECAY_SKIP_DASHBOARD_BUILD"); @@ -70,9 +106,9 @@ fn build_and_embed_dashboard_app() -> Result<(), Box> { ); } else if sources_present { if !dashboard.join("node_modules").is_dir() { - run_npm(dashboard, &["ci"])?; + run_npm(&dashboard, &["ci"])?; } - run_npm(dashboard, &["run", "build"])?; + run_npm(&dashboard, &["run", "build"])?; } dashboard_manifest::dashboard_asset_paths(&app_dist)? }; @@ -100,7 +136,7 @@ fn build_and_embed_dashboard_app() -> Result<(), Box> { "txt" => "text/plain; charset=utf-8", _ => "application/octet-stream", }; - let include_path = format!("/dashboard/app-dist/{relative}"); + let include_path = format!("{include_root}/{relative}"); let _ = writeln!( code, " AppAsset {{ path: {relative:?}, contents: include_bytes!(concat!(env!(\"CARGO_MANIFEST_DIR\"), {include_path:?})), content_type: {content_type:?} }}," @@ -138,7 +174,10 @@ fn run_npm(dir: &Path, args: &[&str]) -> io::Result<()> { } fn main() -> Result<(), Box> { - build_and_embed_dashboard_app()?; + let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR"); + let manifest_dir = Path::new(&manifest_dir); + let repository_root = repository_root(manifest_dir)?; + build_and_embed_dashboard_app(manifest_dir, &repository_root)?; // The plugin-bundle manifest (`$OUT_DIR/plugin_bundle_generated.rs`) moved // to `crates/tracedecay-agent-hosts/build.rs` along with its only consumer, // `agents::plugin_bundle`. Its `plugin/`-relative paths are rebased there. @@ -147,9 +186,8 @@ fn main() -> Result<(), Box> { // (so a stale installed plugin is distinguishable from the binary that // should have generated it) and the SemVer build metadata the binary // reports as its own version. Git metadata tracks commits and staging. - let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR"); - let identity = resolve(Path::new(&manifest_dir)); - for path in watch_paths(Path::new(&manifest_dir)) { + let identity = resolve(&repository_root); + for path in watch_paths(&repository_root) { println!("cargo::rerun-if-changed={}", path.display()); } println!("cargo::rerun-if-changed=src/version/build_identity.rs"); diff --git a/examples/bench_extract.rs b/crates/tracedecay/examples/bench_extract.rs similarity index 100% rename from examples/bench_extract.rs rename to crates/tracedecay/examples/bench_extract.rs diff --git a/src/accounting/classifier.rs b/crates/tracedecay/src/accounting/classifier.rs similarity index 100% rename from src/accounting/classifier.rs rename to crates/tracedecay/src/accounting/classifier.rs diff --git a/src/accounting/mod.rs b/crates/tracedecay/src/accounting/mod.rs similarity index 100% rename from src/accounting/mod.rs rename to crates/tracedecay/src/accounting/mod.rs diff --git a/src/agents.rs b/crates/tracedecay/src/agents.rs similarity index 100% rename from src/agents.rs rename to crates/tracedecay/src/agents.rs diff --git a/src/analytics.rs b/crates/tracedecay/src/analytics.rs similarity index 100% rename from src/analytics.rs rename to crates/tracedecay/src/analytics.rs diff --git a/src/analytics_bridge.rs b/crates/tracedecay/src/analytics_bridge.rs similarity index 100% rename from src/analytics_bridge.rs rename to crates/tracedecay/src/analytics_bridge.rs diff --git a/src/application_output/json.rs b/crates/tracedecay/src/application_output/json.rs similarity index 100% rename from src/application_output/json.rs rename to crates/tracedecay/src/application_output/json.rs diff --git a/src/application_output/markdown.rs b/crates/tracedecay/src/application_output/markdown.rs similarity index 100% rename from src/application_output/markdown.rs rename to crates/tracedecay/src/application_output/markdown.rs diff --git a/src/application_output/mod.rs b/crates/tracedecay/src/application_output/mod.rs similarity index 100% rename from src/application_output/mod.rs rename to crates/tracedecay/src/application_output/mod.rs diff --git a/src/application_output/view.rs b/crates/tracedecay/src/application_output/view.rs similarity index 100% rename from src/application_output/view.rs rename to crates/tracedecay/src/application_output/view.rs diff --git a/src/application_surface.rs b/crates/tracedecay/src/application_surface.rs similarity index 99% rename from src/application_surface.rs rename to crates/tracedecay/src/application_surface.rs index c54c492358..323ffe71f1 100644 --- a/src/application_surface.rs +++ b/crates/tracedecay/src/application_surface.rs @@ -69,7 +69,6 @@ use crate::daemon_client::{ DispatchError, DispatchInput, DispatchedInvocation, InvocationCancellationPolicy, InvocationControls, RequestedOutputFormat, ResolvedBinding, ScopeSelector, resolve_dispatch, }; -use crate::request_identity::{GlobalRequestSurface, mint_global_request_id}; use tracedecay_usecases::feedback::observations::{ FeedbackArgumentRejectionClassV1, FeedbackDeliveryRouteV1, FeedbackOperationV1, FeedbackOutcomeV1, FeedbackRejectedArgumentV1, FeedbackSourceEventV1, FeedbackSseLifecycleV1, @@ -84,6 +83,7 @@ use tracedecay_usecases::primitives::{ QualifiedNamePrimitiveRequest, SourceBodyPrimitiveRequest, SourceOutlinePrimitiveRequest, StorageStatusPrimitiveRequest, }; +use tracedecay_usecases::request_identity::{GlobalRequestSurface, mint_global_request_id}; mod configuration_wire; mod handoff; diff --git a/src/application_surface/configuration_wire.rs b/crates/tracedecay/src/application_surface/configuration_wire.rs similarity index 100% rename from src/application_surface/configuration_wire.rs rename to crates/tracedecay/src/application_surface/configuration_wire.rs diff --git a/src/application_surface/git_surface.rs b/crates/tracedecay/src/application_surface/git_surface.rs similarity index 100% rename from src/application_surface/git_surface.rs rename to crates/tracedecay/src/application_surface/git_surface.rs diff --git a/src/application_surface/handoff.rs b/crates/tracedecay/src/application_surface/handoff.rs similarity index 100% rename from src/application_surface/handoff.rs rename to crates/tracedecay/src/application_surface/handoff.rs diff --git a/src/application_surface/multi_root_http.rs b/crates/tracedecay/src/application_surface/multi_root_http.rs similarity index 100% rename from src/application_surface/multi_root_http.rs rename to crates/tracedecay/src/application_surface/multi_root_http.rs diff --git a/src/application_surface/registered_http.rs b/crates/tracedecay/src/application_surface/registered_http.rs similarity index 100% rename from src/application_surface/registered_http.rs rename to crates/tracedecay/src/application_surface/registered_http.rs diff --git a/src/application_surface/request_control.rs b/crates/tracedecay/src/application_surface/request_control.rs similarity index 100% rename from src/application_surface/request_control.rs rename to crates/tracedecay/src/application_surface/request_control.rs diff --git a/src/application_surface/retained.rs b/crates/tracedecay/src/application_surface/retained.rs similarity index 100% rename from src/application_surface/retained.rs rename to crates/tracedecay/src/application_surface/retained.rs diff --git a/src/application_surface/retained_http_identity_tests.rs b/crates/tracedecay/src/application_surface/retained_http_identity_tests.rs similarity index 100% rename from src/application_surface/retained_http_identity_tests.rs rename to crates/tracedecay/src/application_surface/retained_http_identity_tests.rs diff --git a/src/application_surface/tests.rs b/crates/tracedecay/src/application_surface/tests.rs similarity index 100% rename from src/application_surface/tests.rs rename to crates/tracedecay/src/application_surface/tests.rs diff --git a/src/application_surface/work.rs b/crates/tracedecay/src/application_surface/work.rs similarity index 100% rename from src/application_surface/work.rs rename to crates/tracedecay/src/application_surface/work.rs diff --git a/src/application_surface/workflow.rs b/crates/tracedecay/src/application_surface/workflow.rs similarity index 100% rename from src/application_surface/workflow.rs rename to crates/tracedecay/src/application_surface/workflow.rs diff --git a/src/bench.rs b/crates/tracedecay/src/bench.rs similarity index 98% rename from src/bench.rs rename to crates/tracedecay/src/bench.rs index 1fb466abf0..481e4af46a 100644 --- a/src/bench.rs +++ b/crates/tracedecay/src/bench.rs @@ -59,7 +59,7 @@ 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( diff --git a/src/bin/tracedecay-search-eval-direct.rs b/crates/tracedecay/src/bin/tracedecay-search-eval-direct.rs similarity index 97% rename from src/bin/tracedecay-search-eval-direct.rs rename to crates/tracedecay/src/bin/tracedecay-search-eval-direct.rs index 0cb4f260d9..3582ae8632 100644 --- a/src/bin/tracedecay-search-eval-direct.rs +++ b/crates/tracedecay/src/bin/tracedecay-search-eval-direct.rs @@ -385,8 +385,15 @@ mod tests { #[test] fn default_validation_uses_byte_pinned_activation_workload() { - let summary = validate_requested_workload(&PathBuf::from(env!("CARGO_MANIFEST_DIR")), None) - .expect("checked-in activation workload validates"); + let summary = validate_requested_workload( + &PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .parent() + .and_then(std::path::Path::parent) + .expect("workspace root above crates/tracedecay") + .to_owned(), + None, + ) + .expect("checked-in activation workload validates"); assert_eq!(summary.status, DirectEvaluationStatusV1::Pass); assert_eq!( diff --git a/src/bin/tracedecay-search-eval.rs b/crates/tracedecay/src/bin/tracedecay-search-eval.rs similarity index 100% rename from src/bin/tracedecay-search-eval.rs rename to crates/tracedecay/src/bin/tracedecay-search-eval.rs diff --git a/src/branch.rs b/crates/tracedecay/src/branch.rs similarity index 100% rename from src/branch.rs rename to crates/tracedecay/src/branch.rs diff --git a/src/branch/admin.rs b/crates/tracedecay/src/branch/admin.rs similarity index 100% rename from src/branch/admin.rs rename to crates/tracedecay/src/branch/admin.rs diff --git a/src/branch/admin/tests.rs b/crates/tracedecay/src/branch/admin/tests.rs similarity index 100% rename from src/branch/admin/tests.rs rename to crates/tracedecay/src/branch/admin/tests.rs diff --git a/src/branch/snapshots.rs b/crates/tracedecay/src/branch/snapshots.rs similarity index 100% rename from src/branch/snapshots.rs rename to crates/tracedecay/src/branch/snapshots.rs diff --git a/src/branch/tests.rs b/crates/tracedecay/src/branch/tests.rs similarity index 100% rename from src/branch/tests.rs rename to crates/tracedecay/src/branch/tests.rs diff --git a/src/branch_meta.rs b/crates/tracedecay/src/branch_meta.rs similarity index 100% rename from src/branch_meta.rs rename to crates/tracedecay/src/branch_meta.rs diff --git a/src/catalog_composition.rs b/crates/tracedecay/src/catalog_composition.rs similarity index 100% rename from src/catalog_composition.rs rename to crates/tracedecay/src/catalog_composition.rs diff --git a/src/client_identity.rs b/crates/tracedecay/src/client_identity.rs similarity index 100% rename from src/client_identity.rs rename to crates/tracedecay/src/client_identity.rs diff --git a/src/cloud.rs b/crates/tracedecay/src/cloud.rs similarity index 100% rename from src/cloud.rs rename to crates/tracedecay/src/cloud.rs diff --git a/src/config.rs b/crates/tracedecay/src/config.rs similarity index 99% rename from src/config.rs rename to crates/tracedecay/src/config.rs index 53ac51ae3a..adb1c8c655 100644 --- a/src/config.rs +++ b/crates/tracedecay/src/config.rs @@ -36,7 +36,6 @@ use tracedecay_usecases::configuration::ConfigurationControlStore; pub use tracedecay_global_db::configuration::{registry, resolver}; pub use tracedecay_usecases::config::retrieval; -pub mod scope_control; pub mod topology; pub(crate) mod work_executable_binding; @@ -1110,15 +1109,16 @@ async fn open_runtime_configuration_from_store( ConfigurationRevisionId::new("configuration.initial.canonical.v1").map_err( |error| config_error(format!("invalid initial configuration revision: {error}")), )?; - let daemon_binding = scope_control::daemon_owned_project_source_binding( - &target.project_id, - &target.project_root, - ) - .map_err(|error| { - config_error(format!( - "daemon project source binding could not be derived: {error}" - )) - })?; + let daemon_binding = + tracedecay_usecases::config::scope_control::daemon_owned_project_source_binding( + &target.project_id, + &target.project_root, + ) + .map_err(|error| { + config_error(format!( + "daemon project source binding could not be derived: {error}" + )) + })?; let source_bindings_key = SettingKey::new(SOURCE_BINDINGS_SETTING_KEY).map_err(|error| { config_error(format!("invalid source bindings setting key: {error}")) @@ -1144,15 +1144,16 @@ async fn open_runtime_configuration_from_store( .await .map_err(map_configuration_error)?; } - let daemon_binding = scope_control::daemon_owned_project_source_binding( - &target.project_id, - &target.project_root, - ) - .map_err(|error| { - config_error(format!( - "daemon project source binding could not be derived: {error}" - )) - })?; + let daemon_binding = + tracedecay_usecases::config::scope_control::daemon_owned_project_source_binding( + &target.project_id, + &target.project_root, + ) + .map_err(|error| { + config_error(format!( + "daemon project source binding could not be derived: {error}" + )) + })?; let current = store.current().await.map_err(map_configuration_error)?; let mut current = match store .converge_registered_additive_defaults(¤t.revision_id, now_micros()) diff --git a/src/config/tests.rs b/crates/tracedecay/src/config/tests.rs similarity index 99% rename from src/config/tests.rs rename to crates/tracedecay/src/config/tests.rs index 00d252908a..f49e322206 100644 --- a/src/config/tests.rs +++ b/crates/tracedecay/src/config/tests.rs @@ -1619,12 +1619,12 @@ mod runtime_configuration_cutover { "returning to the primary must not repair linked-worktree churn" ); assert_eq!( - crate::config::scope_control::daemon_owned_project_source_binding( + tracedecay_usecases::config::scope_control::daemon_owned_project_source_binding( &project_id, &primary, ) .expect("primary binding"), - crate::config::scope_control::daemon_owned_project_source_binding( + tracedecay_usecases::config::scope_control::daemon_owned_project_source_binding( &project_id, &linked, ) @@ -1722,16 +1722,18 @@ mod runtime_configuration_cutover { // One binding belongs to a different registered project; the other // matches this project's authority but carries a foreign binding id // and a drifted locator digest. - let other_binding = crate::config::scope_control::daemon_owned_project_source_binding( - &other_project, - &checkout, - ) - .expect("build other-project binding"); - let drifted = crate::config::scope_control::daemon_owned_project_source_binding( - &project_id, - &elsewhere, - ) - .expect("build drifted daemon binding"); + let other_binding = + tracedecay_usecases::config::scope_control::daemon_owned_project_source_binding( + &other_project, + &checkout, + ) + .expect("build other-project binding"); + let drifted = + tracedecay_usecases::config::scope_control::daemon_owned_project_source_binding( + &project_id, + &elsewhere, + ) + .expect("build drifted daemon binding"); let foreign = ScopeSourceBinding::new( SourceBindingId::new("binding.operator.project-open".to_owned()) .expect("foreign binding id"), diff --git a/src/config/topology.rs b/crates/tracedecay/src/config/topology.rs similarity index 100% rename from src/config/topology.rs rename to crates/tracedecay/src/config/topology.rs diff --git a/src/config/work_executable_binding.rs b/crates/tracedecay/src/config/work_executable_binding.rs similarity index 100% rename from src/config/work_executable_binding.rs rename to crates/tracedecay/src/config/work_executable_binding.rs diff --git a/src/context/formatter.rs b/crates/tracedecay/src/context/formatter.rs similarity index 100% rename from src/context/formatter.rs rename to crates/tracedecay/src/context/formatter.rs diff --git a/src/context/mod.rs b/crates/tracedecay/src/context/mod.rs similarity index 67% rename from src/context/mod.rs rename to crates/tracedecay/src/context/mod.rs index fb14e0038b..cadabc411c 100644 --- a/src/context/mod.rs +++ b/crates/tracedecay/src/context/mod.rs @@ -4,15 +4,6 @@ pub mod formatter; /// Re-ranking of search candidates using structural signals. pub mod ranking; -/// Cross-session cache backing `tracedecay_read`. -pub mod read_cache; - -/// Mode dispatchers (`full`, `lines`, `map`, `signatures`) for `tracedecay_read`. -pub mod read_modes; - -/// Shared source-read path, rendering, context, and cache authority. -pub(crate) mod source_read; - pub(crate) use formatter::{ CONTEXT_CODE_HEADING, CONTEXT_ENTRY_POINTS_HEADING, CONTEXT_EXTENSION_POINTS_HEADING, CONTEXT_INDEX_COVERAGE_HINT_HEADING, CONTEXT_MEMORY_FEEDBACK_HINT, diff --git a/src/context/ranking.rs b/crates/tracedecay/src/context/ranking.rs similarity index 100% rename from src/context/ranking.rs rename to crates/tracedecay/src/context/ranking.rs diff --git a/src/daemon.rs b/crates/tracedecay/src/daemon.rs similarity index 99% rename from src/daemon.rs rename to crates/tracedecay/src/daemon.rs index 82844163be..1b56db078c 100644 --- a/src/daemon.rs +++ b/crates/tracedecay/src/daemon.rs @@ -194,7 +194,6 @@ pub(crate) use dashboard_configuration_test_runtime::{ dashboard_configuration_authorities_for_test, register_dashboard_test_retained_runtime, }; pub(crate) mod query_authority_provider; -#[cfg(any(test, feature = "test-transport"))] #[cfg(test)] pub(crate) mod retained_test_support; mod semantic_activation_reconciler; diff --git a/src/daemon/adoption_observation.rs b/crates/tracedecay/src/daemon/adoption_observation.rs similarity index 100% rename from src/daemon/adoption_observation.rs rename to crates/tracedecay/src/daemon/adoption_observation.rs diff --git a/src/daemon/authority.rs b/crates/tracedecay/src/daemon/authority.rs similarity index 100% rename from src/daemon/authority.rs rename to crates/tracedecay/src/daemon/authority.rs diff --git a/src/daemon/authority/windows_acl.rs b/crates/tracedecay/src/daemon/authority/windows_acl.rs similarity index 100% rename from src/daemon/authority/windows_acl.rs rename to crates/tracedecay/src/daemon/authority/windows_acl.rs diff --git a/src/daemon/automation_effect.rs b/crates/tracedecay/src/daemon/automation_effect.rs similarity index 100% rename from src/daemon/automation_effect.rs rename to crates/tracedecay/src/daemon/automation_effect.rs diff --git a/src/daemon/automation_effect/authority.rs b/crates/tracedecay/src/daemon/automation_effect/authority.rs similarity index 100% rename from src/daemon/automation_effect/authority.rs rename to crates/tracedecay/src/daemon/automation_effect/authority.rs diff --git a/src/daemon/automation_effect/contract.rs b/crates/tracedecay/src/daemon/automation_effect/contract.rs similarity index 100% rename from src/daemon/automation_effect/contract.rs rename to crates/tracedecay/src/daemon/automation_effect/contract.rs diff --git a/src/daemon/automation_effect/input.rs b/crates/tracedecay/src/daemon/automation_effect/input.rs similarity index 100% rename from src/daemon/automation_effect/input.rs rename to crates/tracedecay/src/daemon/automation_effect/input.rs diff --git a/src/daemon/automation_effect/journal.rs b/crates/tracedecay/src/daemon/automation_effect/journal.rs similarity index 100% rename from src/daemon/automation_effect/journal.rs rename to crates/tracedecay/src/daemon/automation_effect/journal.rs diff --git a/src/daemon/automation_effect/journal/tests.rs b/crates/tracedecay/src/daemon/automation_effect/journal/tests.rs similarity index 100% rename from src/daemon/automation_effect/journal/tests.rs rename to crates/tracedecay/src/daemon/automation_effect/journal/tests.rs diff --git a/src/daemon/automation_effect/problem.rs b/crates/tracedecay/src/daemon/automation_effect/problem.rs similarity index 100% rename from src/daemon/automation_effect/problem.rs rename to crates/tracedecay/src/daemon/automation_effect/problem.rs diff --git a/src/daemon/automation_effect/projection.rs b/crates/tracedecay/src/daemon/automation_effect/projection.rs similarity index 100% rename from src/daemon/automation_effect/projection.rs rename to crates/tracedecay/src/daemon/automation_effect/projection.rs diff --git a/src/daemon/automation_effect/projection/tests.rs b/crates/tracedecay/src/daemon/automation_effect/projection/tests.rs similarity index 100% rename from src/daemon/automation_effect/projection/tests.rs rename to crates/tracedecay/src/daemon/automation_effect/projection/tests.rs diff --git a/src/daemon/automation_effect/recovery_index.rs b/crates/tracedecay/src/daemon/automation_effect/recovery_index.rs similarity index 100% rename from src/daemon/automation_effect/recovery_index.rs rename to crates/tracedecay/src/daemon/automation_effect/recovery_index.rs diff --git a/src/daemon/automation_effect/retirement.rs b/crates/tracedecay/src/daemon/automation_effect/retirement.rs similarity index 100% rename from src/daemon/automation_effect/retirement.rs rename to crates/tracedecay/src/daemon/automation_effect/retirement.rs diff --git a/src/daemon/automation_observation.rs b/crates/tracedecay/src/daemon/automation_observation.rs similarity index 100% rename from src/daemon/automation_observation.rs rename to crates/tracedecay/src/daemon/automation_observation.rs diff --git a/src/daemon/bootstrap.rs b/crates/tracedecay/src/daemon/bootstrap.rs similarity index 100% rename from src/daemon/bootstrap.rs rename to crates/tracedecay/src/daemon/bootstrap.rs diff --git a/src/daemon/bootstrap_route.rs b/crates/tracedecay/src/daemon/bootstrap_route.rs similarity index 100% rename from src/daemon/bootstrap_route.rs rename to crates/tracedecay/src/daemon/bootstrap_route.rs diff --git a/src/daemon/branch_add.rs b/crates/tracedecay/src/daemon/branch_add.rs similarity index 100% rename from src/daemon/branch_add.rs rename to crates/tracedecay/src/daemon/branch_add.rs diff --git a/src/daemon/branch_admin.rs b/crates/tracedecay/src/daemon/branch_admin.rs similarity index 100% rename from src/daemon/branch_admin.rs rename to crates/tracedecay/src/daemon/branch_admin.rs diff --git a/src/daemon/branch_admin/project_retirement.rs b/crates/tracedecay/src/daemon/branch_admin/project_retirement.rs similarity index 100% rename from src/daemon/branch_admin/project_retirement.rs rename to crates/tracedecay/src/daemon/branch_admin/project_retirement.rs diff --git a/src/daemon/branch_admin/remote_deletion_lifecycle.rs b/crates/tracedecay/src/daemon/branch_admin/remote_deletion_lifecycle.rs similarity index 100% rename from src/daemon/branch_admin/remote_deletion_lifecycle.rs rename to crates/tracedecay/src/daemon/branch_admin/remote_deletion_lifecycle.rs diff --git a/src/daemon/branch_admin/remote_deletion_lifecycle/runtime_retirement.rs b/crates/tracedecay/src/daemon/branch_admin/remote_deletion_lifecycle/runtime_retirement.rs similarity index 100% rename from src/daemon/branch_admin/remote_deletion_lifecycle/runtime_retirement.rs rename to crates/tracedecay/src/daemon/branch_admin/remote_deletion_lifecycle/runtime_retirement.rs diff --git a/src/daemon/branch_admin/remote_recovery_lifecycle.rs b/crates/tracedecay/src/daemon/branch_admin/remote_recovery_lifecycle.rs similarity index 100% rename from src/daemon/branch_admin/remote_recovery_lifecycle.rs rename to crates/tracedecay/src/daemon/branch_admin/remote_recovery_lifecycle.rs diff --git a/src/daemon/branch_admin/session_runtime_shutdown.rs b/crates/tracedecay/src/daemon/branch_admin/session_runtime_shutdown.rs similarity index 100% rename from src/daemon/branch_admin/session_runtime_shutdown.rs rename to crates/tracedecay/src/daemon/branch_admin/session_runtime_shutdown.rs diff --git a/src/daemon/broker_stream_transport.rs b/crates/tracedecay/src/daemon/broker_stream_transport.rs similarity index 100% rename from src/daemon/broker_stream_transport.rs rename to crates/tracedecay/src/daemon/broker_stream_transport.rs diff --git a/src/daemon/callable_code_authorization.rs b/crates/tracedecay/src/daemon/callable_code_authorization.rs similarity index 100% rename from src/daemon/callable_code_authorization.rs rename to crates/tracedecay/src/daemon/callable_code_authorization.rs diff --git a/src/daemon/code_index_branch_diff.rs b/crates/tracedecay/src/daemon/code_index_branch_diff.rs similarity index 100% rename from src/daemon/code_index_branch_diff.rs rename to crates/tracedecay/src/daemon/code_index_branch_diff.rs diff --git a/src/daemon/code_index_executor.rs b/crates/tracedecay/src/daemon/code_index_executor.rs similarity index 99% rename from src/daemon/code_index_executor.rs rename to crates/tracedecay/src/daemon/code_index_executor.rs index b9a9763aca..51ca2d78ad 100644 --- a/src/daemon/code_index_executor.rs +++ b/crates/tracedecay/src/daemon/code_index_executor.rs @@ -360,7 +360,12 @@ pub(super) fn code_index_text_search_display_binding( let anchor = candidate.candidate.anchor_id.as_str(); if let Some(symbol) = anchor.strip_prefix("code-symbol:") { - if occurrence.symbol.as_ref().map(|value| value.as_str()) != Some(symbol) { + if occurrence + .symbol + .as_ref() + .map(tracedecay_domain::SymbolOccurrenceId::as_str) + != Some(symbol) + { return Err(HydrationUnavailableV1::Invalid); } } else if anchor.strip_prefix("code-chunk:") != Some(chunk_id.as_str()) { diff --git a/src/daemon/code_index_scheduler.rs b/crates/tracedecay/src/daemon/code_index_scheduler.rs similarity index 99% rename from src/daemon/code_index_scheduler.rs rename to crates/tracedecay/src/daemon/code_index_scheduler.rs index 370828f855..070d914c5e 100644 --- a/src/daemon/code_index_scheduler.rs +++ b/crates/tracedecay/src/daemon/code_index_scheduler.rs @@ -90,14 +90,14 @@ use crate::{ }, ports::RetrievalPortError, }, - retention::code_index_generations::{ - DurableCodeTextArtifactDescriptorV1, DurableGenerationIndexEntryV1, - DurablePublicationPointerV1, DurableSealedCodeGenerationIdentityV1, - MAX_DURABLE_GENERATION_INDEX_BYTES_V1, MAX_DURABLE_GENERATION_INDEX_ENTRIES_V1, - acquire_code_generation_store_lock, attach_verified_text_artifact_under_lock, - code_text_artifact_path, code_text_artifacts_root, durable_generation_index_digest, - retain_bounded_generation_index, withdraw_verified_text_artifact_under_lock, - }, +}; +use tracedecay_usecases::retention::code_index_generations::{ + DurableCodeTextArtifactDescriptorV1, DurableGenerationIndexEntryV1, + DurablePublicationPointerV1, DurableSealedCodeGenerationIdentityV1, + MAX_DURABLE_GENERATION_INDEX_BYTES_V1, MAX_DURABLE_GENERATION_INDEX_ENTRIES_V1, + acquire_code_generation_store_lock, attach_verified_text_artifact_under_lock, + code_text_artifact_path, code_text_artifacts_root, durable_generation_index_digest, + retain_bounded_generation_index, withdraw_verified_text_artifact_under_lock, }; const MAX_PENDING_HINTS: usize = 1_024; @@ -131,7 +131,7 @@ pub(in crate::daemon) fn scoped_code_index_store_root( store_root: &Path, canonical_project_root: &Path, ) -> PathBuf { - crate::retention::code_index_generations::scoped_code_index_store_root( + tracedecay_usecases::retention::code_index_generations::scoped_code_index_store_root( store_root, canonical_project_root, ) diff --git a/src/daemon/code_index_scheduler/activation.rs b/crates/tracedecay/src/daemon/code_index_scheduler/activation.rs similarity index 100% rename from src/daemon/code_index_scheduler/activation.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/activation.rs diff --git a/src/daemon/code_index_scheduler/activation_tests.rs b/crates/tracedecay/src/daemon/code_index_scheduler/activation_tests.rs similarity index 99% rename from src/daemon/code_index_scheduler/activation_tests.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/activation_tests.rs index fe02484915..6212c660f8 100644 --- a/src/daemon/code_index_scheduler/activation_tests.rs +++ b/crates/tracedecay/src/daemon/code_index_scheduler/activation_tests.rs @@ -519,7 +519,7 @@ fn a_corrupt_sealed_generation_fails_closed_on_every_request() { fs::write(&sealed_path, &corrupted).expect("write corrupted generation"); let pointer_path = store.path().join("active-code-generation-v1.json"); - let mut pointer: crate::retention::code_index_generations::DurablePublicationPointerV1 = + let mut pointer: tracedecay_usecases::retention::code_index_generations::DurablePublicationPointerV1 = serde_json::from_slice(&fs::read(&pointer_path).expect("read pointer")) .expect("parse pointer"); let restamped_digest = format!("sha256:{}", super::sha256_hex(corrupted.as_bytes())); @@ -533,7 +533,7 @@ fn a_corrupt_sealed_generation_fails_closed_on_every_request() { } } pointer.generation_index_digest = Some( - crate::retention::code_index_generations::durable_generation_index_digest( + tracedecay_usecases::retention::code_index_generations::durable_generation_index_digest( &pointer.generation_index, pointer.generation_index_truncated, ) diff --git a/src/daemon/code_index_scheduler/branch_generations.rs b/crates/tracedecay/src/daemon/code_index_scheduler/branch_generations.rs similarity index 99% rename from src/daemon/code_index_scheduler/branch_generations.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/branch_generations.rs index e8a68dc39f..83a87ab722 100644 --- a/src/daemon/code_index_scheduler/branch_generations.rs +++ b/crates/tracedecay/src/daemon/code_index_scheduler/branch_generations.rs @@ -133,7 +133,7 @@ impl DaemonCodeIndexPublicationStoreV1 { return Err(reason); } let load = - |entry: &crate::retention::code_index_generations::DurableGenerationIndexEntryV1, + |entry: &tracedecay_usecases::retention::code_index_generations::DurableGenerationIndexEntryV1, revision: &GitOidV1, tree: &GitOidV1, reference: &RefId| { @@ -934,7 +934,7 @@ mod tests { /// while keeping every entry, so the test isolates the flag itself from the /// question of which entries survived. fn latch_generation_index_truncation(scoped_store: &Path) { - use crate::retention::code_index_generations::{ + use tracedecay_usecases::retention::code_index_generations::{ DurablePublicationPointerV1, durable_generation_index_digest, }; diff --git a/src/daemon/code_index_scheduler/cadence.rs b/crates/tracedecay/src/daemon/code_index_scheduler/cadence.rs similarity index 100% rename from src/daemon/code_index_scheduler/cadence.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/cadence.rs diff --git a/src/daemon/code_index_scheduler/classification.rs b/crates/tracedecay/src/daemon/code_index_scheduler/classification.rs similarity index 100% rename from src/daemon/code_index_scheduler/classification.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/classification.rs diff --git a/src/daemon/code_index_scheduler/freshness_witness.rs b/crates/tracedecay/src/daemon/code_index_scheduler/freshness_witness.rs similarity index 100% rename from src/daemon/code_index_scheduler/freshness_witness.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/freshness_witness.rs diff --git a/src/daemon/code_index_scheduler/git_tree_capture.rs b/crates/tracedecay/src/daemon/code_index_scheduler/git_tree_capture.rs similarity index 99% rename from src/daemon/code_index_scheduler/git_tree_capture.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/git_tree_capture.rs index b872ea78b8..49dc772159 100644 --- a/src/daemon/code_index_scheduler/git_tree_capture.rs +++ b/crates/tracedecay/src/daemon/code_index_scheduler/git_tree_capture.rs @@ -142,6 +142,9 @@ impl CaptureProgressV1 { } #[cfg(feature = "hotpath")] + // Cadence arithmetic on the capture hot loop; the profiling build must not + // pay a call for it. + #[allow(clippy::inline_always)] #[inline(always)] fn publish_at_cadence(&self, observation_count: u64, force: bool) { if !force && !Self::cadence_is_due(observation_count) { @@ -162,6 +165,9 @@ impl CaptureProgressV1 { } #[cfg(feature = "hotpath")] + // Cadence arithmetic on the capture hot loop; the profiling build must not + // pay a call for it. + #[allow(clippy::inline_always)] #[inline(always)] fn cadence_is_due(observation_count: u64) -> bool { observation_count != 0 && observation_count.is_multiple_of(CAPTURE_PROGRESS_UPDATE_PERIOD) diff --git a/src/daemon/code_index_scheduler/graph_activation.rs b/crates/tracedecay/src/daemon/code_index_scheduler/graph_activation.rs similarity index 100% rename from src/daemon/code_index_scheduler/graph_activation.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/graph_activation.rs diff --git a/src/daemon/code_index_scheduler/identity.rs b/crates/tracedecay/src/daemon/code_index_scheduler/identity.rs similarity index 100% rename from src/daemon/code_index_scheduler/identity.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/identity.rs diff --git a/src/daemon/code_index_scheduler/ignored_dependencies.rs b/crates/tracedecay/src/daemon/code_index_scheduler/ignored_dependencies.rs similarity index 100% rename from src/daemon/code_index_scheduler/ignored_dependencies.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/ignored_dependencies.rs diff --git a/src/daemon/code_index_scheduler/ignored_dependencies_tests.rs b/crates/tracedecay/src/daemon/code_index_scheduler/ignored_dependencies_tests.rs similarity index 100% rename from src/daemon/code_index_scheduler/ignored_dependencies_tests.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/ignored_dependencies_tests.rs diff --git a/src/daemon/code_index_scheduler/ignored_dependencies_tests/branch_publication_tests.rs b/crates/tracedecay/src/daemon/code_index_scheduler/ignored_dependencies_tests/branch_publication_tests.rs similarity index 100% rename from src/daemon/code_index_scheduler/ignored_dependencies_tests/branch_publication_tests.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/ignored_dependencies_tests/branch_publication_tests.rs diff --git a/src/daemon/code_index_scheduler/ignored_dependencies_tests/cancellation_tests.rs b/crates/tracedecay/src/daemon/code_index_scheduler/ignored_dependencies_tests/cancellation_tests.rs similarity index 100% rename from src/daemon/code_index_scheduler/ignored_dependencies_tests/cancellation_tests.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/ignored_dependencies_tests/cancellation_tests.rs diff --git a/src/daemon/code_index_scheduler/ignored_dependencies_tests/flight_tests.rs b/crates/tracedecay/src/daemon/code_index_scheduler/ignored_dependencies_tests/flight_tests.rs similarity index 100% rename from src/daemon/code_index_scheduler/ignored_dependencies_tests/flight_tests.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/ignored_dependencies_tests/flight_tests.rs diff --git a/src/daemon/code_index_scheduler/ignored_dependencies_tests/retained_roster_tests.rs b/crates/tracedecay/src/daemon/code_index_scheduler/ignored_dependencies_tests/retained_roster_tests.rs similarity index 100% rename from src/daemon/code_index_scheduler/ignored_dependencies_tests/retained_roster_tests.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/ignored_dependencies_tests/retained_roster_tests.rs diff --git a/src/daemon/code_index_scheduler/memory_tests.rs b/crates/tracedecay/src/daemon/code_index_scheduler/memory_tests.rs similarity index 100% rename from src/daemon/code_index_scheduler/memory_tests.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/memory_tests.rs diff --git a/src/daemon/code_index_scheduler/observability.rs b/crates/tracedecay/src/daemon/code_index_scheduler/observability.rs similarity index 100% rename from src/daemon/code_index_scheduler/observability.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/observability.rs diff --git a/src/daemon/code_index_scheduler/overlay_ephemerality_tests.rs b/crates/tracedecay/src/daemon/code_index_scheduler/overlay_ephemerality_tests.rs similarity index 100% rename from src/daemon/code_index_scheduler/overlay_ephemerality_tests.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/overlay_ephemerality_tests.rs diff --git a/src/daemon/code_index_scheduler/privacy.rs b/crates/tracedecay/src/daemon/code_index_scheduler/privacy.rs similarity index 100% rename from src/daemon/code_index_scheduler/privacy.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/privacy.rs diff --git a/src/daemon/code_index_scheduler/queries.rs b/crates/tracedecay/src/daemon/code_index_scheduler/queries.rs similarity index 100% rename from src/daemon/code_index_scheduler/queries.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/queries.rs diff --git a/src/daemon/code_index_scheduler/queries/graph_control.rs b/crates/tracedecay/src/daemon/code_index_scheduler/queries/graph_control.rs similarity index 100% rename from src/daemon/code_index_scheduler/queries/graph_control.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/queries/graph_control.rs diff --git a/src/daemon/code_index_scheduler/query_runtime.rs b/crates/tracedecay/src/daemon/code_index_scheduler/query_runtime.rs similarity index 99% rename from src/daemon/code_index_scheduler/query_runtime.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/query_runtime.rs index 32ace18ff4..a8a91d3531 100644 --- a/src/daemon/code_index_scheduler/query_runtime.rs +++ b/crates/tracedecay/src/daemon/code_index_scheduler/query_runtime.rs @@ -37,7 +37,7 @@ use tracedecay_query::retrieval::{ const QUERY_FALLBACK_PROFILE_ID: &str = "query-fallback"; const QUERY_FALLBACK_WORKLOAD_JSON: &str = include_str!( - "../../../tests/fixtures/search_quality/query-semantic-candidate-workload-v1.json" + "../../../../../tests/fixtures/search_quality/query-semantic-candidate-workload-v1.json" ); /// Immutable evidence that a configured authority accepted one exact query diff --git a/src/daemon/code_index_scheduler/registry.rs b/crates/tracedecay/src/daemon/code_index_scheduler/registry.rs similarity index 99% rename from src/daemon/code_index_scheduler/registry.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/registry.rs index 43b49847e6..906d52131f 100644 --- a/src/daemon/code_index_scheduler/registry.rs +++ b/crates/tracedecay/src/daemon/code_index_scheduler/registry.rs @@ -4508,20 +4508,20 @@ impl tracedecay_usecases::feedback::cycle_production::ProductionFeedbackDocument /// published record with `ImpactTargetFileMismatch` / `GenerationMismatch`, /// because the saved-edit cycle's impact target is minted here as /// `file.daemon.` under this generation. -impl crate::diagnostics_publication::CodeIndexPublicationIdentityPortV1 +impl tracedecay_usecases::diagnostics_publication::CodeIndexPublicationIdentityPortV1 for CodeIndexSchedulerRegistryV1 { fn resolve( &self, project_root: PathBuf, - ) -> crate::diagnostics_publication::CodeIndexPublicationIdentityFuture<'_> { + ) -> tracedecay_usecases::diagnostics_publication::CodeIndexPublicationIdentityFuture<'_> { let registry = self.clone(); Box::pin(async move { let root = project_root.canonicalize().ok()?; let current = registry.latest_complete_ready(&root).await?; let snapshot = current.generation.snapshot(); Some( - crate::diagnostics_publication::CodeIndexPublicationIdentityV1::new( + tracedecay_usecases::diagnostics_publication::CodeIndexPublicationIdentityV1::new( current.generation.manifest().generation_id.clone(), current.generation.manifest().seal.sealed_at, snapshot.repository.clone(), diff --git a/src/daemon/code_index_scheduler/registry/cold_read_wake_tests.rs b/crates/tracedecay/src/daemon/code_index_scheduler/registry/cold_read_wake_tests.rs similarity index 100% rename from src/daemon/code_index_scheduler/registry/cold_read_wake_tests.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/registry/cold_read_wake_tests.rs diff --git a/src/daemon/code_index_scheduler/registry/ignored_dependencies.rs b/crates/tracedecay/src/daemon/code_index_scheduler/registry/ignored_dependencies.rs similarity index 100% rename from src/daemon/code_index_scheduler/registry/ignored_dependencies.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/registry/ignored_dependencies.rs diff --git a/src/daemon/code_index_scheduler/registry/lsp_projection.rs b/crates/tracedecay/src/daemon/code_index_scheduler/registry/lsp_projection.rs similarity index 100% rename from src/daemon/code_index_scheduler/registry/lsp_projection.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/registry/lsp_projection.rs diff --git a/src/daemon/code_index_scheduler/registry/resident_memory.rs b/crates/tracedecay/src/daemon/code_index_scheduler/registry/resident_memory.rs similarity index 90% rename from src/daemon/code_index_scheduler/registry/resident_memory.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/registry/resident_memory.rs index 5b730fe36c..8a4733958f 100644 --- a/src/daemon/code_index_scheduler/registry/resident_memory.rs +++ b/crates/tracedecay/src/daemon/code_index_scheduler/registry/resident_memory.rs @@ -20,6 +20,10 @@ impl CodeIndexSchedulerRegistryV1 { ) } + // Reached from the `test-transport` dashboard and configuration fixture + // runtimes, which compile without `cfg(test)`. The gate names those two + // callers exactly: widening it to `test-helpers` would compile this into + // builds where nothing calls it, which `-D warnings` rejects as dead code. #[cfg(any(test, feature = "test-transport"))] pub fn with_resident_memory( max_worktrees: usize, diff --git a/src/daemon/code_index_scheduler/registry/runtime_generation_census_tests.rs b/crates/tracedecay/src/daemon/code_index_scheduler/registry/runtime_generation_census_tests.rs similarity index 100% rename from src/daemon/code_index_scheduler/registry/runtime_generation_census_tests.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/registry/runtime_generation_census_tests.rs diff --git a/src/daemon/code_index_scheduler/registry/scope_identity.rs b/crates/tracedecay/src/daemon/code_index_scheduler/registry/scope_identity.rs similarity index 100% rename from src/daemon/code_index_scheduler/registry/scope_identity.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/registry/scope_identity.rs diff --git a/src/daemon/code_index_scheduler/registry/watch_ingress.rs b/crates/tracedecay/src/daemon/code_index_scheduler/registry/watch_ingress.rs similarity index 100% rename from src/daemon/code_index_scheduler/registry/watch_ingress.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/registry/watch_ingress.rs diff --git a/src/daemon/code_index_scheduler/semantic_query_runtime.rs b/crates/tracedecay/src/daemon/code_index_scheduler/semantic_query_runtime.rs similarity index 100% rename from src/daemon/code_index_scheduler/semantic_query_runtime.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/semantic_query_runtime.rs diff --git a/src/daemon/code_index_scheduler/semantic_vector_graph.rs b/crates/tracedecay/src/daemon/code_index_scheduler/semantic_vector_graph.rs similarity index 99% rename from src/daemon/code_index_scheduler/semantic_vector_graph.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/semantic_vector_graph.rs index a34a27000b..9b4d905ce1 100644 --- a/src/daemon/code_index_scheduler/semantic_vector_graph.rs +++ b/crates/tracedecay/src/daemon/code_index_scheduler/semantic_vector_graph.rs @@ -27,7 +27,7 @@ use tracedecay_store::{ SemanticVectorStageResumeOutcome, StoreRuntimeBindingV1, StoreShardIdV1, }; -use crate::store::vector_generations::GraphVectorGenerationStoreV1; +use tracedecay_usecases::store::vector_generations::GraphVectorGenerationStoreV1; use crate::daemon::store_runtime::session_registry::DaemonSessionRuntimeRegistryV1; use tracedecay_usecases::semantic_runtime::{ @@ -266,7 +266,7 @@ pub(crate) async fn retire_one_project_vector_generation( fn release_vector_reservation( store: &GraphVectorGenerationStoreV1, reservation: Option, -) -> Result<(), crate::store::vector_generations::VectorGenerationStoreErrorV1> { +) -> Result<(), tracedecay_usecases::store::vector_generations::VectorGenerationStoreErrorV1> { if let Some(reservation) = reservation { store.release_reserved_generation(reservation)?; } @@ -570,7 +570,9 @@ impl DaemonSemanticVectorGraphProviderV1 { worktree, source_generation, tracedecay_store::SemanticVectorCodeScopeHash::new( - crate::retention::code_index_generations::code_index_scope_hash(&self.project_root), + tracedecay_usecases::retention::code_index_generations::code_index_scope_hash( + &self.project_root, + ), ) .map_err(|error| SemanticVectorGraphErrorV1::Rejected(error.to_string()))?, source_dependency, diff --git a/src/daemon/code_index_scheduler/semantic_vector_graph/retention_inventory.rs b/crates/tracedecay/src/daemon/code_index_scheduler/semantic_vector_graph/retention_inventory.rs similarity index 96% rename from src/daemon/code_index_scheduler/semantic_vector_graph/retention_inventory.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/semantic_vector_graph/retention_inventory.rs index cabe9d320d..e94ba3169f 100644 --- a/src/daemon/code_index_scheduler/semantic_vector_graph/retention_inventory.rs +++ b/crates/tracedecay/src/daemon/code_index_scheduler/semantic_vector_graph/retention_inventory.rs @@ -80,11 +80,13 @@ impl ProjectVectorRetentionFailure { } } -impl From +impl From for ProjectVectorRetentionFailure { - fn from(error: crate::store::vector_generations::VectorGenerationStoreErrorV1) -> Self { - use crate::store::vector_generations::VectorGenerationStoreErrorV1; + fn from( + error: tracedecay_usecases::store::vector_generations::VectorGenerationStoreErrorV1, + ) -> Self { + use tracedecay_usecases::store::vector_generations::VectorGenerationStoreErrorV1; match error { VectorGenerationStoreErrorV1::ResetRequired(message) => Self::ResetRequired(message), VectorGenerationStoreErrorV1::Corrupt(message) => Self::Corrupt(message), @@ -215,7 +217,7 @@ mod tests { ProjectSemanticVectorCodeScopeLiveness, ProjectSemanticVectorSourceLiveness, ProjectVectorRetentionFailure, }; - use crate::store::vector_generations::VectorGenerationStoreErrorV1; + use tracedecay_usecases::store::vector_generations::VectorGenerationStoreErrorV1; #[test] fn vector_store_reset_and_corruption_remain_typed() { diff --git a/src/daemon/code_index_scheduler/tests.rs b/crates/tracedecay/src/daemon/code_index_scheduler/tests.rs similarity index 99% rename from src/daemon/code_index_scheduler/tests.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/tests.rs index 0a4e6506b4..edffdde84e 100644 --- a/src/daemon/code_index_scheduler/tests.rs +++ b/crates/tracedecay/src/daemon/code_index_scheduler/tests.rs @@ -294,10 +294,10 @@ fn retention_generations( } fn remove_historical_pointer_entries(store_root: &Path) { - use crate::retention::code_index_generations::durable_generation_index_digest; + use tracedecay_usecases::retention::code_index_generations::durable_generation_index_digest; let pointer_path = store_root.join("active-code-generation-v1.json"); - let mut pointer: crate::retention::code_index_generations::DurablePublicationPointerV1 = + let mut pointer: tracedecay_usecases::retention::code_index_generations::DurablePublicationPointerV1 = serde_json::from_slice(&std::fs::read(&pointer_path).expect("read publication pointer")) .expect("decode publication pointer"); pointer @@ -320,7 +320,7 @@ fn remove_historical_pointer_entries(store_root: &Path) { #[test] fn code_generation_retention_preserves_every_pointer_addressable_generation() { - use crate::retention::code_index_generations::{ + use tracedecay_usecases::retention::code_index_generations::{ CodeGenerationRetentionModeV1, DEFAULT_SUPERSEDED_GENERATION_FLOOR, run_code_generation_retention, }; @@ -360,7 +360,7 @@ fn code_generation_retention_preserves_every_pointer_addressable_generation() { #[test] fn bounded_pointer_history_collects_evicted_clean_and_dirty_generations() { - use crate::retention::code_index_generations::{ + use tracedecay_usecases::retention::code_index_generations::{ CodeGenerationRetentionModeV1, DEFAULT_SUPERSEDED_GENERATION_FLOOR, DurablePublicationPointerV1, MAX_DURABLE_GENERATION_INDEX_BYTES_V1, MAX_DURABLE_GENERATION_INDEX_ENTRIES_V1, run_code_generation_retention, @@ -445,7 +445,7 @@ fn bounded_pointer_history_collects_evicted_clean_and_dirty_generations() { #[test] fn code_generation_retention_dry_run_reports_without_deleting() { - use crate::retention::code_index_generations::{ + use tracedecay_usecases::retention::code_index_generations::{ CodeGenerationRetentionModeV1, DEFAULT_SUPERSEDED_GENERATION_FLOOR, run_code_generation_retention, }; @@ -497,7 +497,7 @@ fn code_generation_retention_dry_run_reports_without_deleting() { #[test] fn code_generation_retention_never_sweeps_vector_readable_source() { - use crate::retention::code_index_generations::{ + use tracedecay_usecases::retention::code_index_generations::{ CodeGenerationRetentionModeV1, DEFAULT_SUPERSEDED_GENERATION_FLOOR, run_code_generation_retention, }; @@ -554,7 +554,7 @@ fn code_generation_retention_never_sweeps_vector_readable_source() { #[test] fn code_generation_retention_emits_durable_reclaim_receipt() { - use crate::retention::code_index_generations::{ + use tracedecay_usecases::retention::code_index_generations::{ CodeGenerationRetentionModeV1, DEFAULT_SUPERSEDED_GENERATION_FLOOR, observe_code_generation_retention, run_code_generation_retention, }; @@ -634,14 +634,14 @@ fn execute_scope_retention_with_test_binding_cleanup( store_root: &Path, live_roots: &BTreeSet, minimum_stranding_age_secs: i64, - mode: crate::retention::code_index_generations::CodeGenerationRetentionModeV1, + mode: tracedecay_usecases::retention::code_index_generations::CodeGenerationRetentionModeV1, now_secs: i64, completed_at: UtcMicros, ) -> Result< - crate::retention::code_index_generations::ScopeRootRetentionReportV1, - crate::retention::code_index_generations::CodeGenerationRetentionErrorV1, + tracedecay_usecases::retention::code_index_generations::ScopeRootRetentionReportV1, + tracedecay_usecases::retention::code_index_generations::CodeGenerationRetentionErrorV1, > { - use crate::retention::code_index_generations::{ + use tracedecay_usecases::retention::code_index_generations::{ CodeGenerationRetentionModeV1, ScopeRootAuthorityReceiptV1, ScopeRootBindingCleanupReplayV1, ScopeRootCandidateBindingV1, ScopeRootLivenessProofV1, complete_scope_root_binding_cleanup, execute_scope_root_retention, @@ -671,7 +671,9 @@ fn execute_scope_retention_with_test_binding_cleanup( let proof = ScopeRootLivenessProofV1::new( live_roots .iter() - .map(|root| crate::retention::code_index_generations::code_index_scope_hash(root)) + .map(|root| { + tracedecay_usecases::retention::code_index_generations::code_index_scope_hash(root) + }) .collect(), receipt("registry", '1'), receipt("git", '2'), @@ -723,7 +725,7 @@ fn execute_scope_retention_with_test_binding_cleanup( #[test] fn stranded_code_index_scope_is_collected_while_its_live_sibling_is_untouched() { - use crate::retention::code_index_generations::{ + use tracedecay_usecases::retention::code_index_generations::{ CodeGenerationRetentionModeV1, DEFAULT_STRANDED_SCOPE_MINIMUM_AGE_SECS, }; @@ -774,7 +776,7 @@ fn stranded_code_index_scope_is_collected_while_its_live_sibling_is_untouched() #[test] fn code_index_scope_matching_a_live_worktree_is_never_collected() { - use crate::retention::code_index_generations::{ + use tracedecay_usecases::retention::code_index_generations::{ DEFAULT_STRANDED_SCOPE_MINIMUM_AGE_SECS, plan_scope_root_retention, }; @@ -806,7 +808,7 @@ fn code_index_scope_matching_a_live_worktree_is_never_collected() { #[test] fn code_index_scope_with_a_pending_generation_journal_is_refused() { - use crate::retention::code_index_generations::{ + use tracedecay_usecases::retention::code_index_generations::{ CodeGenerationRetentionModeV1, DEFAULT_STRANDED_SCOPE_MINIMUM_AGE_SECS, StrandedScopeRefusalV1, }; @@ -860,7 +862,7 @@ fn code_index_scope_with_a_pending_generation_journal_is_refused() { #[test] fn freshly_stranded_code_index_scope_is_retained_until_the_age_gate_passes() { - use crate::retention::code_index_generations::{ + use tracedecay_usecases::retention::code_index_generations::{ CodeGenerationRetentionModeV1, DEFAULT_STRANDED_SCOPE_MINIMUM_AGE_SECS, }; @@ -898,7 +900,7 @@ fn freshly_stranded_code_index_scope_is_retained_until_the_age_gate_passes() { #[test] fn scope_reconciliation_refuses_to_collect_without_a_proven_live_root_set() { - use crate::retention::code_index_generations::{ + use tracedecay_usecases::retention::code_index_generations::{ CodeGenerationRetentionModeV1, DEFAULT_STRANDED_SCOPE_MINIMUM_AGE_SECS, plan_scope_root_retention, }; @@ -939,15 +941,15 @@ fn scope_reconciliation_refuses_to_collect_without_a_proven_live_root_set() { /// entries are what the census costs; bytes are not. #[test] fn oversized_generations_still_produce_a_complete_retention_finding() { - use crate::retention::code_index_generations::{ - DEFAULT_SUPERSEDED_GENERATION_FLOOR, GenerationDigestVerificationV1, - plan_code_generation_retention_with_verification, - }; use tracedecay_application::doctor::DoctorCoverageCompletenessV1; use tracedecay_application::storage::{ CodeGenerationRetentionRecordV1, StorageByteSizeV1, StoreKeyV1, code_generation_retention_finding, }; + use tracedecay_usecases::retention::code_index_generations::{ + DEFAULT_SUPERSEDED_GENERATION_FLOOR, GenerationDigestVerificationV1, + plan_code_generation_retention_with_verification, + }; const ONE_GIB: u64 = 1024 * 1024 * 1024; @@ -967,7 +969,7 @@ fn oversized_generations_still_produce_a_complete_retention_finding() { file.set_len(ONE_GIB).expect("grow sealed generation"); } let pointer_path = store.path().join("active-code-generation-v1.json"); - let mut pointer: crate::retention::code_index_generations::DurablePublicationPointerV1 = + let mut pointer: tracedecay_usecases::retention::code_index_generations::DurablePublicationPointerV1 = serde_json::from_slice(&std::fs::read(&pointer_path).expect("read publication pointer")) .expect("decode publication pointer"); // Every generation stays pointer-addressable — this test is about census @@ -977,7 +979,7 @@ fn oversized_generations_still_produce_a_complete_retention_finding() { entry.size_bytes = ONE_GIB; } pointer.generation_index_digest = Some( - crate::retention::code_index_generations::durable_generation_index_digest( + tracedecay_usecases::retention::code_index_generations::durable_generation_index_digest( &pointer.generation_index, pointer.generation_index_truncated, ) @@ -2660,7 +2662,7 @@ fn text_artifact_publication_serializes_pointer_attachment_with_retention() { use std::sync::{Condvar, Mutex, mpsc}; use std::thread; - use crate::retention::code_index_generations::{ + use tracedecay_usecases::retention::code_index_generations::{ CodeGenerationRetentionModeV1, DEFAULT_SUPERSEDED_GENERATION_FLOOR, execute_code_generation_retention, plan_code_generation_retention, }; @@ -2976,7 +2978,7 @@ fn active_text_artifact_path(store_root: &Path) -> PathBuf { } fn rewrite_active_text_artifact_format_revision(store_root: &Path, revision: u64) -> PathBuf { - use crate::retention::code_index_generations::{ + use tracedecay_usecases::retention::code_index_generations::{ DurablePublicationPointerV1, durable_generation_index_digest, }; @@ -8759,11 +8761,6 @@ async fn compiler_diagnostics_published_under_registry_identity_are_admitted_by_ { use std::collections::{BTreeMap, BTreeSet}; - use crate::diagnostics_publication::{ - CodeIndexPublicationIdentityPortV1, CompilerDiagnosticPublicationOutcomeV1, - publish_compiler_diagnostics_through_code_index_v1, - }; - use crate::diagnostics_store::DiagnosticsStore; use tracedecay_domain::feedback::{ FeedbackCycleId, FeedbackCycleResultV1, FeedbackCycleTerminationV1, FeedbackDiagnosticClassificationV1, FeedbackDiagnosticProducerV1, @@ -8773,6 +8770,11 @@ async fn compiler_diagnostics_published_under_registry_identity_are_admitted_by_ }; use tracedecay_domain::{ComponentVersion, ContentDigest, DiagnosticSeverityV1, SourceSpan}; use tracedecay_lsp::{AdmittedRoot, DiagnosticSource, LspRuntimeFailure, LspRuntimeFuture}; + use tracedecay_usecases::diagnostics_publication::{ + CodeIndexPublicationIdentityPortV1, CompilerDiagnosticPublicationOutcomeV1, + publish_compiler_diagnostics_through_code_index_v1, + }; + use tracedecay_usecases::diagnostics_store::DiagnosticsStore; use tracedecay_usecases::lsp_runtime::{ DiagnosticsStoreLspFeedbackProjection, LspCodeIndexProjectionIdentityPort, LspFeedbackDiagnosticProjectionPort, LspFeedbackDocumentSnapshot, @@ -8850,7 +8852,7 @@ async fn compiler_diagnostics_published_under_registry_identity_are_admitted_by_ .await .expect("open diagnostics database"); - let parsed = crate::diagnose::parse_cargo_output( + let parsed = tracedecay_usecases::diagnose::parse_cargo_output( "error[E0308]: mismatched types\n --> src/lib.rs:2:22\n", ); assert_eq!(parsed.len(), 1, "fixture cargo output must parse"); @@ -9094,11 +9096,11 @@ async fn compiler_diagnostics_published_under_registry_identity_are_admitted_by_ /// the LSP projection could only refuse. #[tokio::test] async fn compiler_publication_without_a_resolver_is_named_not_guessed() { - use crate::diagnostics_publication::{ + use tracedecay_domain::ComponentVersion; + use tracedecay_usecases::diagnostics_publication::{ CompilerDiagnosticPublicationOutcomeV1, publish_compiler_diagnostics_through_code_index_v1, }; - use crate::diagnostics_store::DiagnosticsStore; - use tracedecay_domain::ComponentVersion; + use tracedecay_usecases::diagnostics_store::DiagnosticsStore; let fixture = GitFixture::new(&[("src/lib.rs", "pub fn alpha() -> u32 { 1 }\n")]); let database_root = TempDir::new().expect("database root"); @@ -9116,7 +9118,7 @@ async fn compiler_publication_without_a_resolver_is_named_not_guessed() { .expect("open diagnostics database"); let store = DiagnosticsStore::new(database.clone()); - let parsed = crate::diagnose::parse_cargo_output( + let parsed = tracedecay_usecases::diagnose::parse_cargo_output( "error[E0308]: mismatched types\n --> src/lib.rs:1:1\n", ); let outcome = publish_compiler_diagnostics_through_code_index_v1( diff --git a/src/daemon/code_index_scheduler/tests/noop_reconcile_tests.rs b/crates/tracedecay/src/daemon/code_index_scheduler/tests/noop_reconcile_tests.rs similarity index 100% rename from src/daemon/code_index_scheduler/tests/noop_reconcile_tests.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/tests/noop_reconcile_tests.rs diff --git a/src/daemon/code_index_scheduler/tests/semantic_schedule_order_tests.rs b/crates/tracedecay/src/daemon/code_index_scheduler/tests/semantic_schedule_order_tests.rs similarity index 100% rename from src/daemon/code_index_scheduler/tests/semantic_schedule_order_tests.rs rename to crates/tracedecay/src/daemon/code_index_scheduler/tests/semantic_schedule_order_tests.rs diff --git a/src/daemon/code_index_task_support.rs b/crates/tracedecay/src/daemon/code_index_task_support.rs similarity index 100% rename from src/daemon/code_index_task_support.rs rename to crates/tracedecay/src/daemon/code_index_task_support.rs diff --git a/src/daemon/connection_serving.rs b/crates/tracedecay/src/daemon/connection_serving.rs similarity index 100% rename from src/daemon/connection_serving.rs rename to crates/tracedecay/src/daemon/connection_serving.rs diff --git a/src/daemon/context_scout_lifecycle.rs b/crates/tracedecay/src/daemon/context_scout_lifecycle.rs similarity index 100% rename from src/daemon/context_scout_lifecycle.rs rename to crates/tracedecay/src/daemon/context_scout_lifecycle.rs diff --git a/src/daemon/context_scout_lifecycle/tests.rs b/crates/tracedecay/src/daemon/context_scout_lifecycle/tests.rs similarity index 99% rename from src/daemon/context_scout_lifecycle/tests.rs rename to crates/tracedecay/src/daemon/context_scout_lifecycle/tests.rs index c93e1ecaf3..9481ec2829 100644 --- a/src/daemon/context_scout_lifecycle/tests.rs +++ b/crates/tracedecay/src/daemon/context_scout_lifecycle/tests.rs @@ -219,7 +219,7 @@ fn wrong_session_fails_closed() { #[test] fn checked_in_native_fixture_without_complete_lifecycle_fails_closed() { let fixture = include_str!( - "../../../tests/fixtures/provider_normalization/codex/agent_message.expected_envelope.json" + "../../../../../tests/fixtures/provider_normalization/codex/agent_message.expected_envelope.json" ) .replace("$STABLE_RECORD_ID", "message.native.fixture"); let observation = serde_json::from_str::(&fixture).unwrap(); diff --git a/src/daemon/core_admission.rs b/crates/tracedecay/src/daemon/core_admission.rs similarity index 100% rename from src/daemon/core_admission.rs rename to crates/tracedecay/src/daemon/core_admission.rs diff --git a/src/daemon/core_client.rs b/crates/tracedecay/src/daemon/core_client.rs similarity index 100% rename from src/daemon/core_client.rs rename to crates/tracedecay/src/daemon/core_client.rs diff --git a/src/daemon/core_doctor.rs b/crates/tracedecay/src/daemon/core_doctor.rs similarity index 100% rename from src/daemon/core_doctor.rs rename to crates/tracedecay/src/daemon/core_doctor.rs diff --git a/src/daemon/core_doctor_schema.rs b/crates/tracedecay/src/daemon/core_doctor_schema.rs similarity index 100% rename from src/daemon/core_doctor_schema.rs rename to crates/tracedecay/src/daemon/core_doctor_schema.rs diff --git a/src/daemon/core_doctor_truthful_tests.rs b/crates/tracedecay/src/daemon/core_doctor_truthful_tests.rs similarity index 100% rename from src/daemon/core_doctor_truthful_tests.rs rename to crates/tracedecay/src/daemon/core_doctor_truthful_tests.rs diff --git a/src/daemon/core_handshake.rs b/crates/tracedecay/src/daemon/core_handshake.rs similarity index 100% rename from src/daemon/core_handshake.rs rename to crates/tracedecay/src/daemon/core_handshake.rs diff --git a/src/daemon/core_hooks.rs b/crates/tracedecay/src/daemon/core_hooks.rs similarity index 100% rename from src/daemon/core_hooks.rs rename to crates/tracedecay/src/daemon/core_hooks.rs diff --git a/src/daemon/core_lifecycle.rs b/crates/tracedecay/src/daemon/core_lifecycle.rs similarity index 100% rename from src/daemon/core_lifecycle.rs rename to crates/tracedecay/src/daemon/core_lifecycle.rs diff --git a/src/daemon/core_logging.rs b/crates/tracedecay/src/daemon/core_logging.rs similarity index 100% rename from src/daemon/core_logging.rs rename to crates/tracedecay/src/daemon/core_logging.rs diff --git a/src/daemon/core_proxy.rs b/crates/tracedecay/src/daemon/core_proxy.rs similarity index 100% rename from src/daemon/core_proxy.rs rename to crates/tracedecay/src/daemon/core_proxy.rs diff --git a/src/daemon/dashboard_automation.rs b/crates/tracedecay/src/daemon/dashboard_automation.rs similarity index 100% rename from src/daemon/dashboard_automation.rs rename to crates/tracedecay/src/daemon/dashboard_automation.rs diff --git a/src/daemon/dashboard_automation/retained_curator.rs b/crates/tracedecay/src/daemon/dashboard_automation/retained_curator.rs similarity index 100% rename from src/daemon/dashboard_automation/retained_curator.rs rename to crates/tracedecay/src/daemon/dashboard_automation/retained_curator.rs diff --git a/src/daemon/dashboard_configuration_test_runtime.rs b/crates/tracedecay/src/daemon/dashboard_configuration_test_runtime.rs similarity index 100% rename from src/daemon/dashboard_configuration_test_runtime.rs rename to crates/tracedecay/src/daemon/dashboard_configuration_test_runtime.rs diff --git a/src/daemon/database_owner_registry.rs b/crates/tracedecay/src/daemon/database_owner_registry.rs similarity index 100% rename from src/daemon/database_owner_registry.rs rename to crates/tracedecay/src/daemon/database_owner_registry.rs diff --git a/src/daemon/doctor_kernel.rs b/crates/tracedecay/src/daemon/doctor_kernel.rs similarity index 99% rename from src/daemon/doctor_kernel.rs rename to crates/tracedecay/src/daemon/doctor_kernel.rs index cef5abfc71..d0ce34d884 100644 --- a/src/daemon/doctor_kernel.rs +++ b/crates/tracedecay/src/daemon/doctor_kernel.rs @@ -28,7 +28,6 @@ use std::sync::Arc; use std::time::{SystemTime, UNIX_EPOCH}; use crate::config::PinnedRuntimeConfiguration; -use crate::request_identity::{GlobalRequestSurface, mint_global_request_id}; use tracedecay_application::doctor::{ AdvisoryFeedbackDoctorPort, AdvisoryFeedbackFindingReadV1, AdvisoryFeedbackReadV1, AdvisoryFeedbackSummaryReadV1, CodeIndexMountDoctorPort, CodeIndexMountReadV1, @@ -46,6 +45,7 @@ use tracedecay_application::{ ApplicationContractError, CancellationContext, CapabilityGrantId, CapabilityGrantSnapshot, Deadline, DisclosureClass, RequestContext, now_micros, }; +use tracedecay_usecases::request_identity::{GlobalRequestSurface, mint_global_request_id}; use super::maintenance::GuardedStoreTelemetryPort; @@ -1002,15 +1002,15 @@ pub(super) async fn collect_code_generation_retention_findings( code_index_store_root: &Path, project_root: &Path, ) -> DoctorStorageFamilyReadV1 { - use crate::retention::code_index_generations::{ - DEFAULT_STRANDED_SCOPE_MINIMUM_AGE_SECS, DEFAULT_SUPERSEDED_GENERATION_FLOOR, - GenerationDigestVerificationV1, ScopeRootRetentionPlanV1, - plan_code_generation_retention_with_verification, plan_scope_root_retention, - }; use tracedecay_application::storage::{ CodeGenerationRetentionRecordV1, SemanticVectorRetentionRecordV1, StorageByteSizeV1, StoreKeyV1, code_generation_retention_finding, semantic_vector_retention_finding, }; + use tracedecay_usecases::retention::code_index_generations::{ + DEFAULT_STRANDED_SCOPE_MINIMUM_AGE_SECS, DEFAULT_SUPERSEDED_GENERATION_FLOOR, + GenerationDigestVerificationV1, ScopeRootRetentionPlanV1, + plan_code_generation_retention_with_verification, plan_scope_root_retention, + }; if !code_index_store_root .join("active-code-generation-v1.json") diff --git a/src/daemon/doctor_kernel/tests.rs b/crates/tracedecay/src/daemon/doctor_kernel/tests.rs similarity index 100% rename from src/daemon/doctor_kernel/tests.rs rename to crates/tracedecay/src/daemon/doctor_kernel/tests.rs diff --git a/src/daemon/engine.rs b/crates/tracedecay/src/daemon/engine.rs similarity index 100% rename from src/daemon/engine.rs rename to crates/tracedecay/src/daemon/engine.rs diff --git a/src/daemon/engine/shutdown.rs b/crates/tracedecay/src/daemon/engine/shutdown.rs similarity index 100% rename from src/daemon/engine/shutdown.rs rename to crates/tracedecay/src/daemon/engine/shutdown.rs diff --git a/src/daemon/git_transactions/journal.rs b/crates/tracedecay/src/daemon/git_transactions/journal.rs similarity index 100% rename from src/daemon/git_transactions/journal.rs rename to crates/tracedecay/src/daemon/git_transactions/journal.rs diff --git a/src/daemon/git_transactions/mod.rs b/crates/tracedecay/src/daemon/git_transactions/mod.rs similarity index 100% rename from src/daemon/git_transactions/mod.rs rename to crates/tracedecay/src/daemon/git_transactions/mod.rs diff --git a/src/daemon/git_transactions/native.rs b/crates/tracedecay/src/daemon/git_transactions/native.rs similarity index 99% rename from src/daemon/git_transactions/native.rs rename to crates/tracedecay/src/daemon/git_transactions/native.rs index 50716c787c..809896b203 100644 --- a/src/daemon/git_transactions/native.rs +++ b/crates/tracedecay/src/daemon/git_transactions/native.rs @@ -29,7 +29,7 @@ use crate::git_index_transactions::{ FixedGitIndexRunner, GIT_INDEX_ADAPTER_REVISION, NativeGitIndexError, NativeIndexLock, ValidatedIndexPatch, }; -use crate::git_intelligence::NativeGitIntelligence; +use tracedecay_usecases::git_intelligence::NativeGitIntelligence; use super::service::NativeGitIndexApplyOutcomeV1; use super::{ diff --git a/src/daemon/git_transactions/owner.rs b/crates/tracedecay/src/daemon/git_transactions/owner.rs similarity index 100% rename from src/daemon/git_transactions/owner.rs rename to crates/tracedecay/src/daemon/git_transactions/owner.rs diff --git a/src/daemon/git_transactions/queue.rs b/crates/tracedecay/src/daemon/git_transactions/queue.rs similarity index 100% rename from src/daemon/git_transactions/queue.rs rename to crates/tracedecay/src/daemon/git_transactions/queue.rs diff --git a/src/daemon/git_transactions/recovery.rs b/crates/tracedecay/src/daemon/git_transactions/recovery.rs similarity index 100% rename from src/daemon/git_transactions/recovery.rs rename to crates/tracedecay/src/daemon/git_transactions/recovery.rs diff --git a/src/daemon/git_transactions/registry.rs b/crates/tracedecay/src/daemon/git_transactions/registry.rs similarity index 100% rename from src/daemon/git_transactions/registry.rs rename to crates/tracedecay/src/daemon/git_transactions/registry.rs diff --git a/src/daemon/git_transactions/service.rs b/crates/tracedecay/src/daemon/git_transactions/service.rs similarity index 100% rename from src/daemon/git_transactions/service.rs rename to crates/tracedecay/src/daemon/git_transactions/service.rs diff --git a/src/daemon/git_transactions/store.rs b/crates/tracedecay/src/daemon/git_transactions/store.rs similarity index 100% rename from src/daemon/git_transactions/store.rs rename to crates/tracedecay/src/daemon/git_transactions/store.rs diff --git a/src/daemon/git_transactions/test_support.rs b/crates/tracedecay/src/daemon/git_transactions/test_support.rs similarity index 100% rename from src/daemon/git_transactions/test_support.rs rename to crates/tracedecay/src/daemon/git_transactions/test_support.rs diff --git a/src/daemon/git_transactions/tests.rs b/crates/tracedecay/src/daemon/git_transactions/tests.rs similarity index 100% rename from src/daemon/git_transactions/tests.rs rename to crates/tracedecay/src/daemon/git_transactions/tests.rs diff --git a/src/daemon/git_transactions/transport_tests.rs b/crates/tracedecay/src/daemon/git_transactions/transport_tests.rs similarity index 100% rename from src/daemon/git_transactions/transport_tests.rs rename to crates/tracedecay/src/daemon/git_transactions/transport_tests.rs diff --git a/src/daemon/git_watch.rs b/crates/tracedecay/src/daemon/git_watch.rs similarity index 100% rename from src/daemon/git_watch.rs rename to crates/tracedecay/src/daemon/git_watch.rs diff --git a/src/daemon/git_watch/admission.rs b/crates/tracedecay/src/daemon/git_watch/admission.rs similarity index 100% rename from src/daemon/git_watch/admission.rs rename to crates/tracedecay/src/daemon/git_watch/admission.rs diff --git a/src/daemon/git_watch/backstop.rs b/crates/tracedecay/src/daemon/git_watch/backstop.rs similarity index 100% rename from src/daemon/git_watch/backstop.rs rename to crates/tracedecay/src/daemon/git_watch/backstop.rs diff --git a/src/daemon/git_watch/health.rs b/crates/tracedecay/src/daemon/git_watch/health.rs similarity index 100% rename from src/daemon/git_watch/health.rs rename to crates/tracedecay/src/daemon/git_watch/health.rs diff --git a/src/daemon/git_watch/identity.rs b/crates/tracedecay/src/daemon/git_watch/identity.rs similarity index 100% rename from src/daemon/git_watch/identity.rs rename to crates/tracedecay/src/daemon/git_watch/identity.rs diff --git a/src/daemon/git_watch/overflow.rs b/crates/tracedecay/src/daemon/git_watch/overflow.rs similarity index 100% rename from src/daemon/git_watch/overflow.rs rename to crates/tracedecay/src/daemon/git_watch/overflow.rs diff --git a/src/daemon/git_watch/ownership.rs b/crates/tracedecay/src/daemon/git_watch/ownership.rs similarity index 100% rename from src/daemon/git_watch/ownership.rs rename to crates/tracedecay/src/daemon/git_watch/ownership.rs diff --git a/src/daemon/git_watch/state.rs b/crates/tracedecay/src/daemon/git_watch/state.rs similarity index 100% rename from src/daemon/git_watch/state.rs rename to crates/tracedecay/src/daemon/git_watch/state.rs diff --git a/src/daemon/git_watch/store_maintenance.rs b/crates/tracedecay/src/daemon/git_watch/store_maintenance.rs similarity index 96% rename from src/daemon/git_watch/store_maintenance.rs rename to crates/tracedecay/src/daemon/git_watch/store_maintenance.rs index 0fcaba9de7..a3fcd73991 100644 --- a/src/daemon/git_watch/store_maintenance.rs +++ b/crates/tracedecay/src/daemon/git_watch/store_maintenance.rs @@ -29,12 +29,18 @@ const MAX_GIT_WORKTREES_PER_SCOPE_INVENTORY: usize = 256; struct ScopeRootProofInputsV1 { live_roots: std::collections::BTreeSet, - registered_roots: crate::retention::code_index_generations::ScopeRootAuthorityReceiptV1, - git_worktrees: crate::retention::code_index_generations::ScopeRootAuthorityReceiptV1, - mounted_leases: crate::retention::code_index_generations::ScopeRootAuthorityReceiptV1, - configuration_roots: crate::retention::code_index_generations::ScopeRootAuthorityReceiptV1, - vector_census: crate::retention::code_index_generations::ScopeRootAuthorityReceiptV1, - vector_dependencies: crate::retention::code_index_generations::ScopeRootAuthorityReceiptV1, + registered_roots: + tracedecay_usecases::retention::code_index_generations::ScopeRootAuthorityReceiptV1, + git_worktrees: + tracedecay_usecases::retention::code_index_generations::ScopeRootAuthorityReceiptV1, + mounted_leases: + tracedecay_usecases::retention::code_index_generations::ScopeRootAuthorityReceiptV1, + configuration_roots: + tracedecay_usecases::retention::code_index_generations::ScopeRootAuthorityReceiptV1, + vector_census: + tracedecay_usecases::retention::code_index_generations::ScopeRootAuthorityReceiptV1, + vector_dependencies: + tracedecay_usecases::retention::code_index_generations::ScopeRootAuthorityReceiptV1, vector_sources: std::collections::BTreeSet, } @@ -44,14 +50,18 @@ impl ScopeRootProofInputsV1 { scope_hash: String, source_scope: tracedecay_store::StoreShardIdV1, vector_revision: tracedecay_store::SemanticVectorStageCensusRevision, - ) -> Result - { + ) -> Result< + tracedecay_usecases::retention::code_index_generations::ScopeRootLivenessProofV1, + &'static str, + > { let live_scope_hashes = self .live_roots .iter() - .map(|root| crate::retention::code_index_generations::code_index_scope_hash(root)) + .map(|root| { + tracedecay_usecases::retention::code_index_generations::code_index_scope_hash(root) + }) .collect(); - crate::retention::code_index_generations::ScopeRootLivenessProofV1::new( + tracedecay_usecases::retention::code_index_generations::ScopeRootLivenessProofV1::new( live_scope_hashes, self.registered_roots.clone(), self.git_worktrees.clone(), @@ -59,7 +69,7 @@ impl ScopeRootProofInputsV1 { self.configuration_roots.clone(), self.vector_census.clone(), self.vector_dependencies.clone(), - crate::retention::code_index_generations::ScopeRootCandidateBindingV1 { + tracedecay_usecases::retention::code_index_generations::ScopeRootCandidateBindingV1 { scope_hash, source_scope, vector_census_revision: vector_revision.get().to_string(), @@ -462,7 +472,7 @@ async fn apply_code_generation_retention( vector_inventory: VectorRetentionInventoryV1, cancellation: &tracedecay_usecases::context::CancellationToken, ) -> bool { - use crate::retention::code_index_generations::{ + use tracedecay_usecases::retention::code_index_generations::{ CodeGenerationRetentionErrorV1, CodeGenerationRetentionModeV1, DEFAULT_SUPERSEDED_GENERATION_FLOOR, execute_code_generation_retention_cancellable, prepare_next_code_generation_retention_cancellable, @@ -521,7 +531,7 @@ async fn apply_code_generation_retention( let plan = match plan { Ok(Ok(plan)) => plan, Ok(Err( - crate::retention::code_index_generations::CodeGenerationRetentionErrorV1::Cancelled, + tracedecay_usecases::retention::code_index_generations::CodeGenerationRetentionErrorV1::Cancelled, )) => { log_code_generation_retention_degraded("retention_cancelled"); return false; @@ -778,7 +788,7 @@ fn git_worktree_root_inventory( ) -> Result< ( std::collections::BTreeSet, - crate::retention::code_index_generations::ScopeRootAuthorityReceiptV1, + tracedecay_usecases::retention::code_index_generations::ScopeRootAuthorityReceiptV1, ), &'static str, > { @@ -823,11 +833,12 @@ fn git_worktree_root_inventory( ); let digest = tracedecay_domain::canonical_sha256(&material) .map_err(|_| "git_worktree_inventory_digest_failed")?; - let receipt = crate::retention::code_index_generations::ScopeRootAuthorityReceiptV1 { - revision: digest.as_str().to_owned(), - terminal_count, - digest: digest.as_str().to_owned(), - }; + let receipt = + tracedecay_usecases::retention::code_index_generations::ScopeRootAuthorityReceiptV1 { + revision: digest.as_str().to_owned(), + terminal_count, + digest: digest.as_str().to_owned(), + }; let mut roots = std::collections::BTreeSet::new(); for root in exact_roots { insert_live_root_variants(&mut roots, &root); @@ -875,7 +886,7 @@ async fn collect_scope_root_proof_inputs( )) .map_err(|_| "registered_enrollment_inventory_digest_failed")?; let registered_receipt = - crate::retention::code_index_generations::ScopeRootAuthorityReceiptV1 { + tracedecay_usecases::retention::code_index_generations::ScopeRootAuthorityReceiptV1 { revision: registered.inventory_digest.as_str().to_owned(), terminal_count: u64::try_from(enrolled_roots.len()) .map_err(|_| "registered_enrollment_count_overflow")?, @@ -904,11 +915,12 @@ async fn collect_scope_root_proof_inputs( &mounted_material, )) .map_err(|_| "mounted_root_inventory_digest_failed")?; - let mounted_receipt = crate::retention::code_index_generations::ScopeRootAuthorityReceiptV1 { - revision: mounted_digest.as_str().to_owned(), - terminal_count: mounted_count, - digest: mounted_digest.as_str().to_owned(), - }; + let mounted_receipt = + tracedecay_usecases::retention::code_index_generations::ScopeRootAuthorityReceiptV1 { + revision: mounted_digest.as_str().to_owned(), + terminal_count: mounted_count, + digest: mounted_digest.as_str().to_owned(), + }; for root in mounted { insert_live_root_variants(&mut live_roots, &root); } @@ -951,7 +963,7 @@ async fn collect_scope_root_proof_inputs( ) => return Err("scope_vector_inventory_denied"), }; let configuration_roots = - crate::retention::code_index_generations::ScopeRootAuthorityReceiptV1 { + tracedecay_usecases::retention::code_index_generations::ScopeRootAuthorityReceiptV1 { revision: configuration_receipt.revision().to_string(), terminal_count: configuration_receipt.root_binding_count(), digest: configuration_receipt.inventory_digest().as_str().to_owned(), @@ -963,7 +975,7 @@ async fn collect_scope_root_proof_inputs( )) .map_err(|_| "vector_dependency_inventory_digest_failed")?; let vector_dependencies = - crate::retention::code_index_generations::ScopeRootAuthorityReceiptV1 { + tracedecay_usecases::retention::code_index_generations::ScopeRootAuthorityReceiptV1 { revision: configured_root_receipt.revision().to_string(), terminal_count: configured_root_receipt.root_count(), digest: vector_dependency_digest.as_str().to_owned(), @@ -975,11 +987,12 @@ async fn collect_scope_root_proof_inputs( .and_then(|count| count.checked_add(vector_receipt.counts.published)) .and_then(|count| count.checked_add(vector_receipt.counts.cancelled)) .ok_or("vector_census_count_overflow")?; - let vector_census = crate::retention::code_index_generations::ScopeRootAuthorityReceiptV1 { - revision: vector_receipt.revision.get().to_string(), - terminal_count: vector_count, - digest: vector_receipt.record_digest.as_str().to_owned(), - }; + let vector_census = + tracedecay_usecases::retention::code_index_generations::ScopeRootAuthorityReceiptV1 { + revision: vector_receipt.revision.get().to_string(), + terminal_count: vector_count, + digest: vector_receipt.record_digest.as_str().to_owned(), + }; Ok(ScopeRootProofInputsV1 { live_roots, @@ -1013,7 +1026,7 @@ pub(super) async fn run_code_index_scope_reconciliation( schedulers: &CodeIndexSchedulerRegistryV1, observations: &crate::daemon::maintenance::StoreTelemetrySamplingRegistry, ) -> bool { - use crate::retention::code_index_generations::{ + use tracedecay_usecases::retention::code_index_generations::{ CodeGenerationRetentionModeV1, DEFAULT_STRANDED_SCOPE_MINIMUM_AGE_SECS, complete_scope_root_binding_cleanup, execute_scope_root_retention, plan_scope_root_retention, plan_scope_root_retention_with_liveness_proof, @@ -1570,7 +1583,7 @@ fn log_code_index_scope_reconciliation_degraded(failure: &str) { /// generations and silently reclaim nothing, which is the failure this pass /// exists to end. pub(super) fn code_index_store_root(data_root: &Path, project_root: &Path) -> PathBuf { - crate::retention::code_index_generations::scoped_code_index_store_root( + tracedecay_usecases::retention::code_index_generations::scoped_code_index_store_root( &code_index_scope_store_root(data_root), project_root, ) diff --git a/src/daemon/git_watch/store_maintenance/graph_replay.rs b/crates/tracedecay/src/daemon/git_watch/store_maintenance/graph_replay.rs similarity index 98% rename from src/daemon/git_watch/store_maintenance/graph_replay.rs rename to crates/tracedecay/src/daemon/git_watch/store_maintenance/graph_replay.rs index dd9f3408c8..efa80fd16f 100644 --- a/src/daemon/git_watch/store_maintenance/graph_replay.rs +++ b/crates/tracedecay/src/daemon/git_watch/store_maintenance/graph_replay.rs @@ -1,7 +1,7 @@ use std::path::Path; use super::{TraceDecay, log_daemon_event}; -use crate::retention::code_index_generations::{ +use tracedecay_usecases::retention::code_index_generations::{ code_generation_graph_replay_release_page, complete_code_generation_graph_replay_release, }; diff --git a/src/daemon/git_watch/store_maintenance/vector_retention_tests.rs b/crates/tracedecay/src/daemon/git_watch/store_maintenance/vector_retention_tests.rs similarity index 99% rename from src/daemon/git_watch/store_maintenance/vector_retention_tests.rs rename to crates/tracedecay/src/daemon/git_watch/store_maintenance/vector_retention_tests.rs index 919b35e41c..1fb8f58fe0 100644 --- a/src/daemon/git_watch/store_maintenance/vector_retention_tests.rs +++ b/crates/tracedecay/src/daemon/git_watch/store_maintenance/vector_retention_tests.rs @@ -12,10 +12,10 @@ use tempfile::TempDir; use crate::daemon::code_index_scheduler::CodeIndexSchedulerRegistryV1; use crate::daemon::code_index_scheduler::semantic_vector_graph::ProjectVectorReadableSources; use crate::daemon::maintenance::{SemanticVectorRetentionReadV1, StoreTelemetrySamplingRegistry}; -use crate::retention::code_index_generations::{ +use crate::tracedecay::TraceDecay; +use tracedecay_usecases::retention::code_index_generations::{ DurableGenerationIndexEntryV1, DurablePublicationPointerV1, durable_generation_index_digest, }; -use crate::tracedecay::TraceDecay; use super::{ VectorRetentionInventoryV1, apply_code_generation_retention, classify_vector_readable_sources, diff --git a/src/daemon/git_watch/tests.rs b/crates/tracedecay/src/daemon/git_watch/tests.rs similarity index 99% rename from src/daemon/git_watch/tests.rs rename to crates/tracedecay/src/daemon/git_watch/tests.rs index c9f3890802..da96b7531c 100644 --- a/src/daemon/git_watch/tests.rs +++ b/crates/tracedecay/src/daemon/git_watch/tests.rs @@ -204,7 +204,7 @@ fn scope_fixture_git(root: &Path, args: &[&str]) { /// Missing one would classify a scope in daily use as stranded. #[test] fn live_code_index_roots_cover_every_linked_worktree() { - use crate::retention::code_index_generations::code_index_scope_hash; + use tracedecay_usecases::retention::code_index_generations::code_index_scope_hash; let tmp = tempfile::TempDir::new().expect("repository root"); let primary = tmp.path().join("primary"); diff --git a/src/daemon/git_watch/tests/lifecycle.rs b/crates/tracedecay/src/daemon/git_watch/tests/lifecycle.rs similarity index 100% rename from src/daemon/git_watch/tests/lifecycle.rs rename to crates/tracedecay/src/daemon/git_watch/tests/lifecycle.rs diff --git a/src/daemon/git_watch/watch_plan.rs b/crates/tracedecay/src/daemon/git_watch/watch_plan.rs similarity index 100% rename from src/daemon/git_watch/watch_plan.rs rename to crates/tracedecay/src/daemon/git_watch/watch_plan.rs diff --git a/src/daemon/github_credential_lifecycle.rs b/crates/tracedecay/src/daemon/github_credential_lifecycle.rs similarity index 99% rename from src/daemon/github_credential_lifecycle.rs rename to crates/tracedecay/src/daemon/github_credential_lifecycle.rs index 811a59ea32..98a7fd2968 100644 --- a/src/daemon/github_credential_lifecycle.rs +++ b/crates/tracedecay/src/daemon/github_credential_lifecycle.rs @@ -404,7 +404,7 @@ fn load_configured_repositories(profile_root: &Path) -> ConfiguredGitHubReposito let Ok(contents) = std::fs::read_to_string(&path) else { return ConfiguredGitHubRepositoriesV1::default(); }; - crate::user_config::parse_or_warn_default(&path, &contents) + tracedecay_usecases::user_config::parse_or_warn_default(&path, &contents) } fn valid_locator(value: &str) -> bool { diff --git a/src/daemon/graph_resolution.rs b/crates/tracedecay/src/daemon/graph_resolution.rs similarity index 100% rename from src/daemon/graph_resolution.rs rename to crates/tracedecay/src/daemon/graph_resolution.rs diff --git a/src/daemon/hook_v2_replay.rs b/crates/tracedecay/src/daemon/hook_v2_replay.rs similarity index 100% rename from src/daemon/hook_v2_replay.rs rename to crates/tracedecay/src/daemon/hook_v2_replay.rs diff --git a/src/daemon/http_application.rs b/crates/tracedecay/src/daemon/http_application.rs similarity index 99% rename from src/daemon/http_application.rs rename to crates/tracedecay/src/daemon/http_application.rs index 0171447720..61461a0bfe 100644 --- a/src/daemon/http_application.rs +++ b/crates/tracedecay/src/daemon/http_application.rs @@ -47,7 +47,7 @@ use tracedecay_application::{ use tracedecay_domain::{EnrollmentGrantV1, ProjectId}; use crate::errors::{Result, TraceDecayError}; -use crate::request_identity::{GlobalRequestSurface, mint_global_request_id}; +use tracedecay_usecases::request_identity::{GlobalRequestSurface, mint_global_request_id}; const MAX_HTTP_APPLICATION_PROJECT_ROUTERS: usize = 8; const MAX_HTTP_APPLICATION_COLD_RESOLUTIONS: usize = 8; diff --git a/src/daemon/http_application_router.rs b/crates/tracedecay/src/daemon/http_application_router.rs similarity index 100% rename from src/daemon/http_application_router.rs rename to crates/tracedecay/src/daemon/http_application_router.rs diff --git a/src/daemon/http_application_tests.rs b/crates/tracedecay/src/daemon/http_application_tests.rs similarity index 100% rename from src/daemon/http_application_tests.rs rename to crates/tracedecay/src/daemon/http_application_tests.rs diff --git a/src/daemon/http_application_tests/remote_tls.rs b/crates/tracedecay/src/daemon/http_application_tests/remote_tls.rs similarity index 99% rename from src/daemon/http_application_tests/remote_tls.rs rename to crates/tracedecay/src/daemon/http_application_tests/remote_tls.rs index af0029226d..538b64d352 100644 --- a/src/daemon/http_application_tests/remote_tls.rs +++ b/crates/tracedecay/src/daemon/http_application_tests/remote_tls.rs @@ -26,19 +26,19 @@ use crate::daemon::http_application::{ }; const REMOTE_TLS_CERTIFICATE: &[u8] = - include_bytes!("../../../tests/fixtures/remote_tls/localhost.crt.pem"); + include_bytes!("../../../../../tests/fixtures/remote_tls/localhost.crt.pem"); const REMOTE_TLS_LEAF_CERTIFICATE: &[u8] = - include_bytes!("../../../tests/fixtures/remote_tls/localhost-leaf.crt.pem"); + include_bytes!("../../../../../tests/fixtures/remote_tls/localhost-leaf.crt.pem"); const REMOTE_TLS_PRIVATE_KEY: &[u8] = - include_bytes!("../../../tests/fixtures/remote_tls/localhost.key.pem"); + include_bytes!("../../../../../tests/fixtures/remote_tls/localhost.key.pem"); const REMOTE_TLS_CA_TRUE_CERTIFICATE: &[u8] = - include_bytes!("../../../tests/fixtures/remote_tls/ca-true.crt.pem"); + include_bytes!("../../../../../tests/fixtures/remote_tls/ca-true.crt.pem"); const REMOTE_TLS_CLIENT_AUTH_CERTIFICATE: &[u8] = - include_bytes!("../../../tests/fixtures/remote_tls/client-auth-only.crt.pem"); + include_bytes!("../../../../../tests/fixtures/remote_tls/client-auth-only.crt.pem"); const REMOTE_TLS_WRONG_IP_CERTIFICATE: &[u8] = - include_bytes!("../../../tests/fixtures/remote_tls/wrong-ip.crt.pem"); + include_bytes!("../../../../../tests/fixtures/remote_tls/wrong-ip.crt.pem"); const REMOTE_TLS_ALTERNATE_ROOT_CERTIFICATE: &[u8] = - include_bytes!("../../../tests/fixtures/remote_tls/alternate-root.crt.pem"); + include_bytes!("../../../../../tests/fixtures/remote_tls/alternate-root.crt.pem"); fn remote_tls_fixture( temporary: &tempfile::TempDir, diff --git a/src/daemon/invocation_dispatch.rs b/crates/tracedecay/src/daemon/invocation_dispatch.rs similarity index 100% rename from src/daemon/invocation_dispatch.rs rename to crates/tracedecay/src/daemon/invocation_dispatch.rs diff --git a/src/daemon/invocation_executor.rs b/crates/tracedecay/src/daemon/invocation_executor.rs similarity index 99% rename from src/daemon/invocation_executor.rs rename to crates/tracedecay/src/daemon/invocation_executor.rs index c9ca9cb9e4..29c8e9e2cd 100644 --- a/src/daemon/invocation_executor.rs +++ b/crates/tracedecay/src/daemon/invocation_executor.rs @@ -716,8 +716,8 @@ impl crate::daemon_client::DaemonInvocationExecutor for InProcessDaemonInvocatio event: tracedecay_usecases::feedback::observations::FeedbackSourceEventV1, ) -> crate::daemon_client::DaemonInvocationExecutorFuture<'_, Result<()>> { Box::pin(async move { - let request_id = crate::request_identity::mint_global_request_id( - crate::request_identity::GlobalRequestSurface::FeedbackObservation, + let request_id = tracedecay_usecases::request_identity::mint_global_request_id( + tracedecay_usecases::request_identity::GlobalRequestSurface::FeedbackObservation, ) .map_err(|error| TraceDecayError::Config { message: error.to_string(), diff --git a/src/daemon/invocation_executor/controlled_invocation_tests.rs b/crates/tracedecay/src/daemon/invocation_executor/controlled_invocation_tests.rs similarity index 100% rename from src/daemon/invocation_executor/controlled_invocation_tests.rs rename to crates/tracedecay/src/daemon/invocation_executor/controlled_invocation_tests.rs diff --git a/src/daemon/invocation_state.rs b/crates/tracedecay/src/daemon/invocation_state.rs similarity index 100% rename from src/daemon/invocation_state.rs rename to crates/tracedecay/src/daemon/invocation_state.rs diff --git a/src/daemon/invocation_state/project_invocation.rs b/crates/tracedecay/src/daemon/invocation_state/project_invocation.rs similarity index 100% rename from src/daemon/invocation_state/project_invocation.rs rename to crates/tracedecay/src/daemon/invocation_state/project_invocation.rs diff --git a/src/daemon/lcm_authority.rs b/crates/tracedecay/src/daemon/lcm_authority.rs similarity index 100% rename from src/daemon/lcm_authority.rs rename to crates/tracedecay/src/daemon/lcm_authority.rs diff --git a/src/daemon/lcm_authority/mount.rs b/crates/tracedecay/src/daemon/lcm_authority/mount.rs similarity index 100% rename from src/daemon/lcm_authority/mount.rs rename to crates/tracedecay/src/daemon/lcm_authority/mount.rs diff --git a/src/daemon/lcm_authority/receipt.rs b/crates/tracedecay/src/daemon/lcm_authority/receipt.rs similarity index 100% rename from src/daemon/lcm_authority/receipt.rs rename to crates/tracedecay/src/daemon/lcm_authority/receipt.rs diff --git a/src/daemon/lcm_authority/tests.rs b/crates/tracedecay/src/daemon/lcm_authority/tests.rs similarity index 100% rename from src/daemon/lcm_authority/tests.rs rename to crates/tracedecay/src/daemon/lcm_authority/tests.rs diff --git a/src/daemon/lcm_effects.rs b/crates/tracedecay/src/daemon/lcm_effects.rs similarity index 100% rename from src/daemon/lcm_effects.rs rename to crates/tracedecay/src/daemon/lcm_effects.rs diff --git a/src/daemon/lcm_summarization.rs b/crates/tracedecay/src/daemon/lcm_summarization.rs similarity index 100% rename from src/daemon/lcm_summarization.rs rename to crates/tracedecay/src/daemon/lcm_summarization.rs diff --git a/src/daemon/lcm_summarization/provider_capabilities.rs b/crates/tracedecay/src/daemon/lcm_summarization/provider_capabilities.rs similarity index 100% rename from src/daemon/lcm_summarization/provider_capabilities.rs rename to crates/tracedecay/src/daemon/lcm_summarization/provider_capabilities.rs diff --git a/src/daemon/lsp_sessions.rs b/crates/tracedecay/src/daemon/lsp_sessions.rs similarity index 100% rename from src/daemon/lsp_sessions.rs rename to crates/tracedecay/src/daemon/lsp_sessions.rs diff --git a/src/daemon/maintenance.rs b/crates/tracedecay/src/daemon/maintenance.rs similarity index 99% rename from src/daemon/maintenance.rs rename to crates/tracedecay/src/daemon/maintenance.rs index e97eefd959..7039a76ddb 100644 --- a/src/daemon/maintenance.rs +++ b/crates/tracedecay/src/daemon/maintenance.rs @@ -22,7 +22,7 @@ use tracedecay_domain::{ManifestDigest, UtcMicros}; use super::branch_admin::StoreAdministration; use crate::db::DatabaseStorageTelemetryHandle; -use crate::request_identity::{GlobalRequestSurface, mint_global_request_id}; +use tracedecay_usecases::request_identity::{GlobalRequestSurface, mint_global_request_id}; pub(super) mod generation; diff --git a/src/daemon/maintenance/generation.rs b/crates/tracedecay/src/daemon/maintenance/generation.rs similarity index 100% rename from src/daemon/maintenance/generation.rs rename to crates/tracedecay/src/daemon/maintenance/generation.rs diff --git a/src/daemon/maintenance_tasks.rs b/crates/tracedecay/src/daemon/maintenance_tasks.rs similarity index 100% rename from src/daemon/maintenance_tasks.rs rename to crates/tracedecay/src/daemon/maintenance_tasks.rs diff --git a/src/daemon/native_integration/journey_tests.rs b/crates/tracedecay/src/daemon/native_integration/journey_tests.rs similarity index 100% rename from src/daemon/native_integration/journey_tests.rs rename to crates/tracedecay/src/daemon/native_integration/journey_tests.rs diff --git a/src/daemon/native_integration/mod.rs b/crates/tracedecay/src/daemon/native_integration/mod.rs similarity index 100% rename from src/daemon/native_integration/mod.rs rename to crates/tracedecay/src/daemon/native_integration/mod.rs diff --git a/src/daemon/native_integration/registry.rs b/crates/tracedecay/src/daemon/native_integration/registry.rs similarity index 100% rename from src/daemon/native_integration/registry.rs rename to crates/tracedecay/src/daemon/native_integration/registry.rs diff --git a/src/daemon/native_integration/stack_hook_wakeup.rs b/crates/tracedecay/src/daemon/native_integration/stack_hook_wakeup.rs similarity index 100% rename from src/daemon/native_integration/stack_hook_wakeup.rs rename to crates/tracedecay/src/daemon/native_integration/stack_hook_wakeup.rs diff --git a/src/daemon/native_integration/stack_runtime.rs b/crates/tracedecay/src/daemon/native_integration/stack_runtime.rs similarity index 100% rename from src/daemon/native_integration/stack_runtime.rs rename to crates/tracedecay/src/daemon/native_integration/stack_runtime.rs diff --git a/src/daemon/native_integration/stack_signals.rs b/crates/tracedecay/src/daemon/native_integration/stack_signals.rs similarity index 100% rename from src/daemon/native_integration/stack_signals.rs rename to crates/tracedecay/src/daemon/native_integration/stack_signals.rs diff --git a/src/daemon/native_integration/store.rs b/crates/tracedecay/src/daemon/native_integration/store.rs similarity index 100% rename from src/daemon/native_integration/store.rs rename to crates/tracedecay/src/daemon/native_integration/store.rs diff --git a/src/daemon/native_integration/worktree.rs b/crates/tracedecay/src/daemon/native_integration/worktree.rs similarity index 100% rename from src/daemon/native_integration/worktree.rs rename to crates/tracedecay/src/daemon/native_integration/worktree.rs diff --git a/src/daemon/native_integration/worktree_cleanup.rs b/crates/tracedecay/src/daemon/native_integration/worktree_cleanup.rs similarity index 100% rename from src/daemon/native_integration/worktree_cleanup.rs rename to crates/tracedecay/src/daemon/native_integration/worktree_cleanup.rs diff --git a/src/daemon/pr_autotrack.rs b/crates/tracedecay/src/daemon/pr_autotrack.rs similarity index 100% rename from src/daemon/pr_autotrack.rs rename to crates/tracedecay/src/daemon/pr_autotrack.rs diff --git a/src/daemon/pr_autotrack/runtime.rs b/crates/tracedecay/src/daemon/pr_autotrack/runtime.rs similarity index 100% rename from src/daemon/pr_autotrack/runtime.rs rename to crates/tracedecay/src/daemon/pr_autotrack/runtime.rs diff --git a/src/daemon/pr_autotrack/tests.rs b/crates/tracedecay/src/daemon/pr_autotrack/tests.rs similarity index 100% rename from src/daemon/pr_autotrack/tests.rs rename to crates/tracedecay/src/daemon/pr_autotrack/tests.rs diff --git a/src/daemon/privacy_remediation.rs b/crates/tracedecay/src/daemon/privacy_remediation.rs similarity index 100% rename from src/daemon/privacy_remediation.rs rename to crates/tracedecay/src/daemon/privacy_remediation.rs diff --git a/src/daemon/production_harness.rs b/crates/tracedecay/src/daemon/production_harness.rs similarity index 99% rename from src/daemon/production_harness.rs rename to crates/tracedecay/src/daemon/production_harness.rs index 0729ce5437..11fd3da3a9 100644 --- a/src/daemon/production_harness.rs +++ b/crates/tracedecay/src/daemon/production_harness.rs @@ -40,6 +40,9 @@ struct ProductionProjectHarnessResourcesV1 { store_administration: StoreAdministration, invocation: DaemonInvocationState, _project_open_gates: Arc>, + // Read by the `cfg(test)` capacity journey; under `test-transport` alone the + // harness still must own the registry for its lifetime, so it reads as dead. + #[cfg_attr(not(test), allow(dead_code))] http_application_registry: http_application::DaemonHttpApplicationRegistry, servers: HashMap>, _database_scope: crate::db::DaemonDatabaseScope, diff --git a/src/daemon/production_harness/configuration_idempotency_journey_test.rs b/crates/tracedecay/src/daemon/production_harness/configuration_idempotency_journey_test.rs similarity index 98% rename from src/daemon/production_harness/configuration_idempotency_journey_test.rs rename to crates/tracedecay/src/daemon/production_harness/configuration_idempotency_journey_test.rs index 42fce33678..c754a8e5bb 100644 --- a/src/daemon/production_harness/configuration_idempotency_journey_test.rs +++ b/crates/tracedecay/src/daemon/production_harness/configuration_idempotency_journey_test.rs @@ -95,8 +95,8 @@ async fn cli_configuration_set( observed_at.0 + i64::try_from(maximum_millis).expect("deadline fits") * 1_000, )) .expect("configuration deadline"); - let request_id = crate::request_identity::mint_global_request_id( - crate::request_identity::GlobalRequestSurface::Cli, + let request_id = tracedecay_usecases::request_identity::mint_global_request_id( + tracedecay_usecases::request_identity::GlobalRequestSurface::Cli, ) .expect("CLI request id"); let cancellation = @@ -185,14 +185,14 @@ async fn configuration_batch_via_surface( .expect("configuration deadline"); let request_surface = match surface { tracedecay_tool_catalog::BindingSurface::Cli => { - crate::request_identity::GlobalRequestSurface::Cli + tracedecay_usecases::request_identity::GlobalRequestSurface::Cli } tracedecay_tool_catalog::BindingSurface::Dashboard => { - crate::request_identity::GlobalRequestSurface::DashboardSettings + tracedecay_usecases::request_identity::GlobalRequestSurface::DashboardSettings } other => panic!("unsupported configuration batch test surface: {other:?}"), }; - let request_id = crate::request_identity::mint_global_request_id(request_surface) + let request_id = tracedecay_usecases::request_identity::mint_global_request_id(request_surface) .expect("surface request id"); if surface == tracedecay_tool_catalog::BindingSurface::Dashboard { return crate::application_surface::resolve_dashboard_application_surface( diff --git a/src/daemon/production_harness/delivery_read_gate_journey_test.rs b/crates/tracedecay/src/daemon/production_harness/delivery_read_gate_journey_test.rs similarity index 100% rename from src/daemon/production_harness/delivery_read_gate_journey_test.rs rename to crates/tracedecay/src/daemon/production_harness/delivery_read_gate_journey_test.rs diff --git a/src/daemon/production_harness/generation_retention_test.rs b/crates/tracedecay/src/daemon/production_harness/generation_retention_test.rs similarity index 99% rename from src/daemon/production_harness/generation_retention_test.rs rename to crates/tracedecay/src/daemon/production_harness/generation_retention_test.rs index 06709fd4a8..107aceb295 100644 --- a/src/daemon/production_harness/generation_retention_test.rs +++ b/crates/tracedecay/src/daemon/production_harness/generation_retention_test.rs @@ -19,13 +19,13 @@ use tracedecay_semantic::projector::{PreparedVectorGenerationV1, ProjectedChunkV use super::journey_test_support::git; use super::*; -use crate::retention::code_index_generations::{ +use tracedecay_usecases::retention::code_index_generations::{ DEFAULT_SUPERSEDED_GENERATION_FLOOR, prepare_next_code_generation_retention_cancellable, }; -use crate::store::vector_generations::{ +use tracedecay_usecases::semantic_runtime::project_semantic_retained_vector_generations; +use tracedecay_usecases::store::vector_generations::{ GraphVectorGenerationStoreV1, SemanticVectorStageDescriptorV1, VectorGenerationPlanV1, }; -use tracedecay_usecases::semantic_runtime::project_semantic_retained_vector_generations; fn id(value: &str) -> T where @@ -715,7 +715,7 @@ async fn linked_worktree_scope_retention_crash_replay_and_pure_inventory_journey &primary_graph.hook_store_layout().data_root, ) .join( - crate::retention::code_index_generations::code_index_scope_hash( + tracedecay_usecases::retention::code_index_generations::code_index_scope_hash( linked_graph.project_root(), ), ); @@ -914,7 +914,7 @@ async fn linked_worktree_scope_retention_crash_replay_and_pure_inventory_journey .hook_store_layout() .data_root, ) - .join(crate::retention::code_index_generations::code_index_scope_hash(&primary)); + .join(tracedecay_usecases::retention::code_index_generations::code_index_scope_hash(&primary)); let _ = run_generation_cadence(&collector, &primary).await; assert!( !linked_scope.exists(), diff --git a/src/daemon/production_harness/journey_test_support.rs b/crates/tracedecay/src/daemon/production_harness/journey_test_support.rs similarity index 100% rename from src/daemon/production_harness/journey_test_support.rs rename to crates/tracedecay/src/daemon/production_harness/journey_test_support.rs diff --git a/src/daemon/production_harness/project_server_capacity_journey_test.rs b/crates/tracedecay/src/daemon/production_harness/project_server_capacity_journey_test.rs similarity index 100% rename from src/daemon/production_harness/project_server_capacity_journey_test.rs rename to crates/tracedecay/src/daemon/production_harness/project_server_capacity_journey_test.rs diff --git a/src/daemon/production_harness/semantic_activation_journey_test.rs b/crates/tracedecay/src/daemon/production_harness/semantic_activation_journey_test.rs similarity index 99% rename from src/daemon/production_harness/semantic_activation_journey_test.rs rename to crates/tracedecay/src/daemon/production_harness/semantic_activation_journey_test.rs index 0ee8157016..bc0fdd8856 100644 --- a/src/daemon/production_harness/semantic_activation_journey_test.rs +++ b/crates/tracedecay/src/daemon/production_harness/semantic_activation_journey_test.rs @@ -240,8 +240,8 @@ pub(super) async fn evaluate_native_profile( // vector generation is a `sha256:` digest, which cannot be embedded // in a daemon request token; doing so truthfully fails at request // validation before the evaluator is reached. - let request_id = crate::request_identity::mint_global_request_id( - crate::request_identity::GlobalRequestSurface::SemanticEvaluation, + let request_id = tracedecay_usecases::request_identity::mint_global_request_id( + tracedecay_usecases::request_identity::GlobalRequestSurface::SemanticEvaluation, ) .expect("mint a production semantic-evaluation request id"); let response = resources diff --git a/src/daemon/production_harness/semantic_availability_journey_test.rs b/crates/tracedecay/src/daemon/production_harness/semantic_availability_journey_test.rs similarity index 100% rename from src/daemon/production_harness/semantic_availability_journey_test.rs rename to crates/tracedecay/src/daemon/production_harness/semantic_availability_journey_test.rs diff --git a/src/daemon/production_harness/semantic_index_fixture_check_test.rs b/crates/tracedecay/src/daemon/production_harness/semantic_index_fixture_check_test.rs similarity index 95% rename from src/daemon/production_harness/semantic_index_fixture_check_test.rs rename to crates/tracedecay/src/daemon/production_harness/semantic_index_fixture_check_test.rs index 663a2b97c0..0d76d72e2b 100644 --- a/src/daemon/production_harness/semantic_index_fixture_check_test.rs +++ b/crates/tracedecay/src/daemon/production_harness/semantic_index_fixture_check_test.rs @@ -30,12 +30,21 @@ use super::semantic_availability_journey_test::{ }; use super::*; +/// The workspace root above `crates/tracedecay`. The semantic fixtures and the +/// shared model cache this check reads are workspace-level, not package-level. +fn workspace_root() -> &'static Path { + Path::new(env!("CARGO_MANIFEST_DIR")) + .parent() + .and_then(Path::parent) + .expect("workspace root above crates/tracedecay") +} + /// Distinctive symbol from `tests/fixtures/semantic_index/src/inventory.rs`. const PROBE_SYMBOL: &str = "reserve_inventory_for_checkout"; fn model_cache_dir() -> PathBuf { std::env::var_os("TRACEDECAY_FASTEMBED_MODEL_CACHE").map_or_else( - || Path::new(env!("CARGO_MANIFEST_DIR")).join("target/fastembed-model-cache"), + || workspace_root().join("target/fastembed-model-cache"), PathBuf::from, ) } @@ -98,8 +107,7 @@ fn copy_fixture_tree(source: &Path, destination: &Path) { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn isolated_fixture_repo_embeds_and_indexes_without_activation() { - let fixture_source = - Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/semantic_index"); + let fixture_source = workspace_root().join("tests/fixtures/semantic_index"); let cache = model_cache_dir(); let catalog = crate::semantic_code::production_fastembed_catalog(); let model = catalog diff --git a/src/daemon/profile_host_admission_replay.rs b/crates/tracedecay/src/daemon/profile_host_admission_replay.rs similarity index 100% rename from src/daemon/profile_host_admission_replay.rs rename to crates/tracedecay/src/daemon/profile_host_admission_replay.rs diff --git a/src/daemon/profile_identity.rs b/crates/tracedecay/src/daemon/profile_identity.rs similarity index 100% rename from src/daemon/profile_identity.rs rename to crates/tracedecay/src/daemon/profile_identity.rs diff --git a/src/daemon/project_composition.rs b/crates/tracedecay/src/daemon/project_composition.rs similarity index 100% rename from src/daemon/project_composition.rs rename to crates/tracedecay/src/daemon/project_composition.rs diff --git a/src/daemon/project_composition/code_index_activation.rs b/crates/tracedecay/src/daemon/project_composition/code_index_activation.rs similarity index 100% rename from src/daemon/project_composition/code_index_activation.rs rename to crates/tracedecay/src/daemon/project_composition/code_index_activation.rs diff --git a/src/daemon/project_composition/runtime.rs b/crates/tracedecay/src/daemon/project_composition/runtime.rs similarity index 100% rename from src/daemon/project_composition/runtime.rs rename to crates/tracedecay/src/daemon/project_composition/runtime.rs diff --git a/src/daemon/project_composition/session_database_admission.rs b/crates/tracedecay/src/daemon/project_composition/session_database_admission.rs similarity index 100% rename from src/daemon/project_composition/session_database_admission.rs rename to crates/tracedecay/src/daemon/project_composition/session_database_admission.rs diff --git a/src/daemon/project_delivery_mount.rs b/crates/tracedecay/src/daemon/project_delivery_mount.rs similarity index 100% rename from src/daemon/project_delivery_mount.rs rename to crates/tracedecay/src/daemon/project_delivery_mount.rs diff --git a/src/daemon/project_open_admission.rs b/crates/tracedecay/src/daemon/project_open_admission.rs similarity index 100% rename from src/daemon/project_open_admission.rs rename to crates/tracedecay/src/daemon/project_open_admission.rs diff --git a/src/daemon/project_open_admission/lsp_upgrade_tests.rs b/crates/tracedecay/src/daemon/project_open_admission/lsp_upgrade_tests.rs similarity index 100% rename from src/daemon/project_open_admission/lsp_upgrade_tests.rs rename to crates/tracedecay/src/daemon/project_open_admission/lsp_upgrade_tests.rs diff --git a/src/daemon/project_open_admission/quiescence_tests.rs b/crates/tracedecay/src/daemon/project_open_admission/quiescence_tests.rs similarity index 100% rename from src/daemon/project_open_admission/quiescence_tests.rs rename to crates/tracedecay/src/daemon/project_open_admission/quiescence_tests.rs diff --git a/src/daemon/project_open_handshake.rs b/crates/tracedecay/src/daemon/project_open_handshake.rs similarity index 99% rename from src/daemon/project_open_handshake.rs rename to crates/tracedecay/src/daemon/project_open_handshake.rs index 119c4a97df..2e53593c7a 100644 --- a/src/daemon/project_open_handshake.rs +++ b/crates/tracedecay/src/daemon/project_open_handshake.rs @@ -190,7 +190,8 @@ fn tool_call_open_refusal_response( }; let id = request.id.clone()?; let tool_name = request.params.as_ref()?.get("name")?.as_str()?; - let request_id = crate::request_identity::mcp_connection_request_id(&id, connection_scope)?; + let request_id = + tracedecay_usecases::request_identity::mcp_connection_request_id(&id, connection_scope)?; let envelope = crate::application_surface::mcp_project_open_reset_refusal( tool_name, request_id, authority, reason, )?; diff --git a/src/daemon/project_open_orchestration.rs b/crates/tracedecay/src/daemon/project_open_orchestration.rs similarity index 100% rename from src/daemon/project_open_orchestration.rs rename to crates/tracedecay/src/daemon/project_open_orchestration.rs diff --git a/src/daemon/project_open_owners.rs b/crates/tracedecay/src/daemon/project_open_owners.rs similarity index 99% rename from src/daemon/project_open_owners.rs rename to crates/tracedecay/src/daemon/project_open_owners.rs index a2ecd564f1..5378550138 100644 --- a/src/daemon/project_open_owners.rs +++ b/crates/tracedecay/src/daemon/project_open_owners.rs @@ -35,7 +35,7 @@ use super::{ DaemonContextScoutRuntimeRegistrationError, DaemonFeedbackRuntimeRegistrationError, DaemonInvocationState, }; -use crate::request_identity::{PreviewIdentityDomain, derive_preview_identity}; +use tracedecay_usecases::request_identity::{PreviewIdentityDomain, derive_preview_identity}; const SOURCE_EDIT_PRIVACY_KEY_EPOCH_V1: u64 = 1; use crate::daemon::git_transactions::DaemonGitIndexTransactionServiceRegistry; diff --git a/src/daemon/project_open_owners/advisory_runtime.rs b/crates/tracedecay/src/daemon/project_open_owners/advisory_runtime.rs similarity index 100% rename from src/daemon/project_open_owners/advisory_runtime.rs rename to crates/tracedecay/src/daemon/project_open_owners/advisory_runtime.rs diff --git a/src/daemon/project_open_owners/advisory_runtime/deferred.rs b/crates/tracedecay/src/daemon/project_open_owners/advisory_runtime/deferred.rs similarity index 100% rename from src/daemon/project_open_owners/advisory_runtime/deferred.rs rename to crates/tracedecay/src/daemon/project_open_owners/advisory_runtime/deferred.rs diff --git a/src/daemon/project_open_owners/advisory_runtime/model.rs b/crates/tracedecay/src/daemon/project_open_owners/advisory_runtime/model.rs similarity index 100% rename from src/daemon/project_open_owners/advisory_runtime/model.rs rename to crates/tracedecay/src/daemon/project_open_owners/advisory_runtime/model.rs diff --git a/src/daemon/project_open_owners/advisory_runtime/scout_journey_tests.rs b/crates/tracedecay/src/daemon/project_open_owners/advisory_runtime/scout_journey_tests.rs similarity index 100% rename from src/daemon/project_open_owners/advisory_runtime/scout_journey_tests.rs rename to crates/tracedecay/src/daemon/project_open_owners/advisory_runtime/scout_journey_tests.rs diff --git a/src/daemon/project_open_owners/advisory_runtime/tests.rs b/crates/tracedecay/src/daemon/project_open_owners/advisory_runtime/tests.rs similarity index 100% rename from src/daemon/project_open_owners/advisory_runtime/tests.rs rename to crates/tracedecay/src/daemon/project_open_owners/advisory_runtime/tests.rs diff --git a/src/daemon/project_open_owners/automation_effect_recovery.rs b/crates/tracedecay/src/daemon/project_open_owners/automation_effect_recovery.rs similarity index 100% rename from src/daemon/project_open_owners/automation_effect_recovery.rs rename to crates/tracedecay/src/daemon/project_open_owners/automation_effect_recovery.rs diff --git a/src/daemon/project_open_owners/code_index_reads.rs b/crates/tracedecay/src/daemon/project_open_owners/code_index_reads.rs similarity index 100% rename from src/daemon/project_open_owners/code_index_reads.rs rename to crates/tracedecay/src/daemon/project_open_owners/code_index_reads.rs diff --git a/src/daemon/project_open_owners/code_index_reads/ignored_dependency_admission.rs b/crates/tracedecay/src/daemon/project_open_owners/code_index_reads/ignored_dependency_admission.rs similarity index 100% rename from src/daemon/project_open_owners/code_index_reads/ignored_dependency_admission.rs rename to crates/tracedecay/src/daemon/project_open_owners/code_index_reads/ignored_dependency_admission.rs diff --git a/src/daemon/project_open_owners/code_index_reads/ignored_dependency_admission_tests.rs b/crates/tracedecay/src/daemon/project_open_owners/code_index_reads/ignored_dependency_admission_tests.rs similarity index 100% rename from src/daemon/project_open_owners/code_index_reads/ignored_dependency_admission_tests.rs rename to crates/tracedecay/src/daemon/project_open_owners/code_index_reads/ignored_dependency_admission_tests.rs diff --git a/src/daemon/project_open_owners/code_index_reads/scope_admission_tests.rs b/crates/tracedecay/src/daemon/project_open_owners/code_index_reads/scope_admission_tests.rs similarity index 100% rename from src/daemon/project_open_owners/code_index_reads/scope_admission_tests.rs rename to crates/tracedecay/src/daemon/project_open_owners/code_index_reads/scope_admission_tests.rs diff --git a/src/daemon/project_open_owners/lsp_registration.rs b/crates/tracedecay/src/daemon/project_open_owners/lsp_registration.rs similarity index 100% rename from src/daemon/project_open_owners/lsp_registration.rs rename to crates/tracedecay/src/daemon/project_open_owners/lsp_registration.rs diff --git a/src/daemon/project_open_owners/primitive_runtime.rs b/crates/tracedecay/src/daemon/project_open_owners/primitive_runtime.rs similarity index 100% rename from src/daemon/project_open_owners/primitive_runtime.rs rename to crates/tracedecay/src/daemon/project_open_owners/primitive_runtime.rs diff --git a/src/daemon/project_open_owners/query_authority_upgrade.rs b/crates/tracedecay/src/daemon/project_open_owners/query_authority_upgrade.rs similarity index 100% rename from src/daemon/project_open_owners/query_authority_upgrade.rs rename to crates/tracedecay/src/daemon/project_open_owners/query_authority_upgrade.rs diff --git a/src/daemon/project_open_owners/source_edit_owner.rs b/crates/tracedecay/src/daemon/project_open_owners/source_edit_owner.rs similarity index 100% rename from src/daemon/project_open_owners/source_edit_owner.rs rename to crates/tracedecay/src/daemon/project_open_owners/source_edit_owner.rs diff --git a/src/daemon/project_open_owners/work_grant_tests.rs b/crates/tracedecay/src/daemon/project_open_owners/work_grant_tests.rs similarity index 100% rename from src/daemon/project_open_owners/work_grant_tests.rs rename to crates/tracedecay/src/daemon/project_open_owners/work_grant_tests.rs diff --git a/src/daemon/project_routing.rs b/crates/tracedecay/src/daemon/project_routing.rs similarity index 100% rename from src/daemon/project_routing.rs rename to crates/tracedecay/src/daemon/project_routing.rs diff --git a/src/daemon/project_server_lifecycle.rs b/crates/tracedecay/src/daemon/project_server_lifecycle.rs similarity index 100% rename from src/daemon/project_server_lifecycle.rs rename to crates/tracedecay/src/daemon/project_server_lifecycle.rs diff --git a/src/daemon/projectless.rs b/crates/tracedecay/src/daemon/projectless.rs similarity index 99% rename from src/daemon/projectless.rs rename to crates/tracedecay/src/daemon/projectless.rs index 46b4bf0751..698c1b4c8d 100644 --- a/src/daemon/projectless.rs +++ b/crates/tracedecay/src/daemon/projectless.rs @@ -155,8 +155,7 @@ async fn projectless_tools_call_response_with_connection( tool_name, "tracedecay_admin_project" | "tracedecay_hook_runtime" | "tracedecay_admin_cli" ) - || tracedecay_application::RetainedSurfaceOperation::from_tool_name(&tool_name) - .is_some() + || tracedecay_application::RetainedSurfaceOperation::from_tool_name(tool_name).is_some() { tool_name } else { diff --git a/src/daemon/query_authority_provider.rs b/crates/tracedecay/src/daemon/query_authority_provider.rs similarity index 100% rename from src/daemon/query_authority_provider.rs rename to crates/tracedecay/src/daemon/query_authority_provider.rs diff --git a/src/daemon/query_authority_provider_activation_tests.rs b/crates/tracedecay/src/daemon/query_authority_provider_activation_tests.rs similarity index 100% rename from src/daemon/query_authority_provider_activation_tests.rs rename to crates/tracedecay/src/daemon/query_authority_provider_activation_tests.rs diff --git a/src/daemon/query_authority_provider_tests.rs b/crates/tracedecay/src/daemon/query_authority_provider_tests.rs similarity index 100% rename from src/daemon/query_authority_provider_tests.rs rename to crates/tracedecay/src/daemon/query_authority_provider_tests.rs diff --git a/src/daemon/query_mcp_admission.rs b/crates/tracedecay/src/daemon/query_mcp_admission.rs similarity index 100% rename from src/daemon/query_mcp_admission.rs rename to crates/tracedecay/src/daemon/query_mcp_admission.rs diff --git a/src/daemon/remote_deletion.rs b/crates/tracedecay/src/daemon/remote_deletion.rs similarity index 100% rename from src/daemon/remote_deletion.rs rename to crates/tracedecay/src/daemon/remote_deletion.rs diff --git a/src/daemon/remote_protocol.rs b/crates/tracedecay/src/daemon/remote_protocol.rs similarity index 100% rename from src/daemon/remote_protocol.rs rename to crates/tracedecay/src/daemon/remote_protocol.rs diff --git a/src/daemon/remote_protocol/observability.rs b/crates/tracedecay/src/daemon/remote_protocol/observability.rs similarity index 100% rename from src/daemon/remote_protocol/observability.rs rename to crates/tracedecay/src/daemon/remote_protocol/observability.rs diff --git a/src/daemon/remote_protocol_tests.rs b/crates/tracedecay/src/daemon/remote_protocol_tests.rs similarity index 100% rename from src/daemon/remote_protocol_tests.rs rename to crates/tracedecay/src/daemon/remote_protocol_tests.rs diff --git a/src/daemon/remote_query.rs b/crates/tracedecay/src/daemon/remote_query.rs similarity index 100% rename from src/daemon/remote_query.rs rename to crates/tracedecay/src/daemon/remote_query.rs diff --git a/src/daemon/remote_replay_transaction.rs b/crates/tracedecay/src/daemon/remote_replay_transaction.rs similarity index 100% rename from src/daemon/remote_replay_transaction.rs rename to crates/tracedecay/src/daemon/remote_replay_transaction.rs diff --git a/src/daemon/request_cancellation.rs b/crates/tracedecay/src/daemon/request_cancellation.rs similarity index 100% rename from src/daemon/request_cancellation.rs rename to crates/tracedecay/src/daemon/request_cancellation.rs diff --git a/src/daemon/retained_owner.rs b/crates/tracedecay/src/daemon/retained_owner.rs similarity index 100% rename from src/daemon/retained_owner.rs rename to crates/tracedecay/src/daemon/retained_owner.rs diff --git a/src/daemon/retained_owner/automation.rs b/crates/tracedecay/src/daemon/retained_owner/automation.rs similarity index 100% rename from src/daemon/retained_owner/automation.rs rename to crates/tracedecay/src/daemon/retained_owner/automation.rs diff --git a/src/daemon/retained_owner/lcm.rs b/crates/tracedecay/src/daemon/retained_owner/lcm.rs similarity index 100% rename from src/daemon/retained_owner/lcm.rs rename to crates/tracedecay/src/daemon/retained_owner/lcm.rs diff --git a/src/daemon/retained_owner/lcm/output.rs b/crates/tracedecay/src/daemon/retained_owner/lcm/output.rs similarity index 100% rename from src/daemon/retained_owner/lcm/output.rs rename to crates/tracedecay/src/daemon/retained_owner/lcm/output.rs diff --git a/src/daemon/retained_owner/lcm/retrieval.rs b/crates/tracedecay/src/daemon/retained_owner/lcm/retrieval.rs similarity index 100% rename from src/daemon/retained_owner/lcm/retrieval.rs rename to crates/tracedecay/src/daemon/retained_owner/lcm/retrieval.rs diff --git a/src/daemon/retained_owner/memory.rs b/crates/tracedecay/src/daemon/retained_owner/memory.rs similarity index 100% rename from src/daemon/retained_owner/memory.rs rename to crates/tracedecay/src/daemon/retained_owner/memory.rs diff --git a/src/daemon/retained_owner/memory_mapping.rs b/crates/tracedecay/src/daemon/retained_owner/memory_mapping.rs similarity index 100% rename from src/daemon/retained_owner/memory_mapping.rs rename to crates/tracedecay/src/daemon/retained_owner/memory_mapping.rs diff --git a/src/daemon/retained_owner/memory_mutation.rs b/crates/tracedecay/src/daemon/retained_owner/memory_mutation.rs similarity index 100% rename from src/daemon/retained_owner/memory_mutation.rs rename to crates/tracedecay/src/daemon/retained_owner/memory_mutation.rs diff --git a/src/daemon/retained_owner/memory_target.rs b/crates/tracedecay/src/daemon/retained_owner/memory_target.rs similarity index 100% rename from src/daemon/retained_owner/memory_target.rs rename to crates/tracedecay/src/daemon/retained_owner/memory_target.rs diff --git a/src/daemon/retained_owner/memory_tracking.rs b/crates/tracedecay/src/daemon/retained_owner/memory_tracking.rs similarity index 100% rename from src/daemon/retained_owner/memory_tracking.rs rename to crates/tracedecay/src/daemon/retained_owner/memory_tracking.rs diff --git a/src/daemon/retained_owner/profile.rs b/crates/tracedecay/src/daemon/retained_owner/profile.rs similarity index 100% rename from src/daemon/retained_owner/profile.rs rename to crates/tracedecay/src/daemon/retained_owner/profile.rs diff --git a/src/daemon/retained_owner/receipts.rs b/crates/tracedecay/src/daemon/retained_owner/receipts.rs similarity index 100% rename from src/daemon/retained_owner/receipts.rs rename to crates/tracedecay/src/daemon/retained_owner/receipts.rs diff --git a/src/daemon/retained_owner/session.rs b/crates/tracedecay/src/daemon/retained_owner/session.rs similarity index 100% rename from src/daemon/retained_owner/session.rs rename to crates/tracedecay/src/daemon/retained_owner/session.rs diff --git a/src/daemon/retained_owner/session/refresh.rs b/crates/tracedecay/src/daemon/retained_owner/session/refresh.rs similarity index 100% rename from src/daemon/retained_owner/session/refresh.rs rename to crates/tracedecay/src/daemon/retained_owner/session/refresh.rs diff --git a/src/daemon/retained_owner/session/retained_effect_tests.rs b/crates/tracedecay/src/daemon/retained_owner/session/retained_effect_tests.rs similarity index 100% rename from src/daemon/retained_owner/session/retained_effect_tests.rs rename to crates/tracedecay/src/daemon/retained_owner/session/retained_effect_tests.rs diff --git a/src/daemon/retained_owner/session_queries.rs b/crates/tracedecay/src/daemon/retained_owner/session_queries.rs similarity index 100% rename from src/daemon/retained_owner/session_queries.rs rename to crates/tracedecay/src/daemon/retained_owner/session_queries.rs diff --git a/src/daemon/retained_owner/session_refresh.rs b/crates/tracedecay/src/daemon/retained_owner/session_refresh.rs similarity index 100% rename from src/daemon/retained_owner/session_refresh.rs rename to crates/tracedecay/src/daemon/retained_owner/session_refresh.rs diff --git a/src/daemon/retained_test_support.rs b/crates/tracedecay/src/daemon/retained_test_support.rs similarity index 100% rename from src/daemon/retained_test_support.rs rename to crates/tracedecay/src/daemon/retained_test_support.rs diff --git a/src/daemon/scheduler.rs b/crates/tracedecay/src/daemon/scheduler.rs similarity index 100% rename from src/daemon/scheduler.rs rename to crates/tracedecay/src/daemon/scheduler.rs diff --git a/src/daemon/scheduler/automation_observation.rs b/crates/tracedecay/src/daemon/scheduler/automation_observation.rs similarity index 100% rename from src/daemon/scheduler/automation_observation.rs rename to crates/tracedecay/src/daemon/scheduler/automation_observation.rs diff --git a/src/daemon/scheduler/combined_effect.rs b/crates/tracedecay/src/daemon/scheduler/combined_effect.rs similarity index 100% rename from src/daemon/scheduler/combined_effect.rs rename to crates/tracedecay/src/daemon/scheduler/combined_effect.rs diff --git a/src/daemon/scheduler/effect_admission.rs b/crates/tracedecay/src/daemon/scheduler/effect_admission.rs similarity index 99% rename from src/daemon/scheduler/effect_admission.rs rename to crates/tracedecay/src/daemon/scheduler/effect_admission.rs index 8f1d2d9f62..8aa175856b 100644 --- a/src/daemon/scheduler/effect_admission.rs +++ b/crates/tracedecay/src/daemon/scheduler/effect_admission.rs @@ -715,8 +715,8 @@ pub(crate) fn scheduler_automation_request_id( ), }) } - None => crate::request_identity::mint_global_request_id( - crate::request_identity::GlobalRequestSurface::AutomationScheduler, + None => tracedecay_usecases::request_identity::mint_global_request_id( + tracedecay_usecases::request_identity::GlobalRequestSurface::AutomationScheduler, ) .map_err(|error| TraceDecayError::Config { message: format!("automation scheduler request identity is unavailable: {error}"), diff --git a/src/daemon/scheduler/host_receipt_review.rs b/crates/tracedecay/src/daemon/scheduler/host_receipt_review.rs similarity index 100% rename from src/daemon/scheduler/host_receipt_review.rs rename to crates/tracedecay/src/daemon/scheduler/host_receipt_review.rs diff --git a/src/daemon/scheduler/run_control.rs b/crates/tracedecay/src/daemon/scheduler/run_control.rs similarity index 100% rename from src/daemon/scheduler/run_control.rs rename to crates/tracedecay/src/daemon/scheduler/run_control.rs diff --git a/src/daemon/scheduler/termination.rs b/crates/tracedecay/src/daemon/scheduler/termination.rs similarity index 100% rename from src/daemon/scheduler/termination.rs rename to crates/tracedecay/src/daemon/scheduler/termination.rs diff --git a/src/daemon/semantic_activation_reconciler.rs b/crates/tracedecay/src/daemon/semantic_activation_reconciler.rs similarity index 100% rename from src/daemon/semantic_activation_reconciler.rs rename to crates/tracedecay/src/daemon/semantic_activation_reconciler.rs diff --git a/src/daemon/semantic_evaluation.rs b/crates/tracedecay/src/daemon/semantic_evaluation.rs similarity index 100% rename from src/daemon/semantic_evaluation.rs rename to crates/tracedecay/src/daemon/semantic_evaluation.rs diff --git a/src/daemon/service.rs b/crates/tracedecay/src/daemon/service.rs similarity index 100% rename from src/daemon/service.rs rename to crates/tracedecay/src/daemon/service.rs diff --git a/src/daemon/service/invocation.rs b/crates/tracedecay/src/daemon/service/invocation.rs similarity index 99% rename from src/daemon/service/invocation.rs rename to crates/tracedecay/src/daemon/service/invocation.rs index abc94a4705..250c3fa43e 100644 --- a/src/daemon/service/invocation.rs +++ b/crates/tracedecay/src/daemon/service/invocation.rs @@ -157,16 +157,16 @@ pub(crate) use crate::daemon_contract::{ use crate::db::Database; use crate::errors::TraceDecayError; use crate::production_semantic_authorities; -use crate::request_identity::{ - GlobalOpaqueIdentityKind, LogicalEffectIdempotencyDomain, derive_logical_effect_idempotency, - mint_global_opaque_id, -}; #[cfg(test)] use tracedecay_application::{ CancellationStage, MultiRootExecuteRequestV1, MultiRootScopeSetReadRequestV1, ProblemTerminality, }; use tracedecay_hooks::{HookBoundaryV1, HookEventEnvelopeV2, HookEventV2, HookScopeBindingV1}; +use tracedecay_usecases::request_identity::{ + GlobalOpaqueIdentityKind, LogicalEffectIdempotencyDomain, derive_logical_effect_idempotency, + mint_global_opaque_id, +}; // Structural split: production logic now lives in the child modules below; // this file remains the stable external path (`service::invocation::*`). diff --git a/src/daemon/service/invocation/administrative_effect.rs b/crates/tracedecay/src/daemon/service/invocation/administrative_effect.rs similarity index 100% rename from src/daemon/service/invocation/administrative_effect.rs rename to crates/tracedecay/src/daemon/service/invocation/administrative_effect.rs diff --git a/src/daemon/service/invocation/clock.rs b/crates/tracedecay/src/daemon/service/invocation/clock.rs similarity index 100% rename from src/daemon/service/invocation/clock.rs rename to crates/tracedecay/src/daemon/service/invocation/clock.rs diff --git a/src/daemon/service/invocation/configuration.rs b/crates/tracedecay/src/daemon/service/invocation/configuration.rs similarity index 100% rename from src/daemon/service/invocation/configuration.rs rename to crates/tracedecay/src/daemon/service/invocation/configuration.rs diff --git a/src/daemon/service/invocation/configuration/settlement.rs b/crates/tracedecay/src/daemon/service/invocation/configuration/settlement.rs similarity index 100% rename from src/daemon/service/invocation/configuration/settlement.rs rename to crates/tracedecay/src/daemon/service/invocation/configuration/settlement.rs diff --git a/src/daemon/service/invocation/dispatch.rs b/crates/tracedecay/src/daemon/service/invocation/dispatch.rs similarity index 100% rename from src/daemon/service/invocation/dispatch.rs rename to crates/tracedecay/src/daemon/service/invocation/dispatch.rs diff --git a/src/daemon/service/invocation/feedback.rs b/crates/tracedecay/src/daemon/service/invocation/feedback.rs similarity index 100% rename from src/daemon/service/invocation/feedback.rs rename to crates/tracedecay/src/daemon/service/invocation/feedback.rs diff --git a/src/daemon/service/invocation/git.rs b/crates/tracedecay/src/daemon/service/invocation/git.rs similarity index 100% rename from src/daemon/service/invocation/git.rs rename to crates/tracedecay/src/daemon/service/invocation/git.rs diff --git a/src/daemon/service/invocation/github_stack_signal.rs b/crates/tracedecay/src/daemon/service/invocation/github_stack_signal.rs similarity index 100% rename from src/daemon/service/invocation/github_stack_signal.rs rename to crates/tracedecay/src/daemon/service/invocation/github_stack_signal.rs diff --git a/src/daemon/service/invocation/handoff.rs b/crates/tracedecay/src/daemon/service/invocation/handoff.rs similarity index 100% rename from src/daemon/service/invocation/handoff.rs rename to crates/tracedecay/src/daemon/service/invocation/handoff.rs diff --git a/src/daemon/service/invocation/invocation_observability.rs b/crates/tracedecay/src/daemon/service/invocation/invocation_observability.rs similarity index 100% rename from src/daemon/service/invocation/invocation_observability.rs rename to crates/tracedecay/src/daemon/service/invocation/invocation_observability.rs diff --git a/src/daemon/service/invocation/lsp.rs b/crates/tracedecay/src/daemon/service/invocation/lsp.rs similarity index 100% rename from src/daemon/service/invocation/lsp.rs rename to crates/tracedecay/src/daemon/service/invocation/lsp.rs diff --git a/src/daemon/service/invocation/lsp/project_lifecycle.rs b/crates/tracedecay/src/daemon/service/invocation/lsp/project_lifecycle.rs similarity index 100% rename from src/daemon/service/invocation/lsp/project_lifecycle.rs rename to crates/tracedecay/src/daemon/service/invocation/lsp/project_lifecycle.rs diff --git a/src/daemon/service/invocation/lsp/workspace_admission.rs b/crates/tracedecay/src/daemon/service/invocation/lsp/workspace_admission.rs similarity index 100% rename from src/daemon/service/invocation/lsp/workspace_admission.rs rename to crates/tracedecay/src/daemon/service/invocation/lsp/workspace_admission.rs diff --git a/src/daemon/service/invocation/lsp/workspace_diagnostics.rs b/crates/tracedecay/src/daemon/service/invocation/lsp/workspace_diagnostics.rs similarity index 100% rename from src/daemon/service/invocation/lsp/workspace_diagnostics.rs rename to crates/tracedecay/src/daemon/service/invocation/lsp/workspace_diagnostics.rs diff --git a/src/daemon/service/invocation/lsp_delivery.rs b/crates/tracedecay/src/daemon/service/invocation/lsp_delivery.rs similarity index 100% rename from src/daemon/service/invocation/lsp_delivery.rs rename to crates/tracedecay/src/daemon/service/invocation/lsp_delivery.rs diff --git a/src/daemon/service/invocation/native_integration.rs b/crates/tracedecay/src/daemon/service/invocation/native_integration.rs similarity index 100% rename from src/daemon/service/invocation/native_integration.rs rename to crates/tracedecay/src/daemon/service/invocation/native_integration.rs diff --git a/src/daemon/service/invocation/observability_producer.rs b/crates/tracedecay/src/daemon/service/invocation/observability_producer.rs similarity index 100% rename from src/daemon/service/invocation/observability_producer.rs rename to crates/tracedecay/src/daemon/service/invocation/observability_producer.rs diff --git a/src/daemon/service/invocation/observatory.rs b/crates/tracedecay/src/daemon/service/invocation/observatory.rs similarity index 100% rename from src/daemon/service/invocation/observatory.rs rename to crates/tracedecay/src/daemon/service/invocation/observatory.rs diff --git a/src/daemon/service/invocation/primitive.rs b/crates/tracedecay/src/daemon/service/invocation/primitive.rs similarity index 100% rename from src/daemon/service/invocation/primitive.rs rename to crates/tracedecay/src/daemon/service/invocation/primitive.rs diff --git a/src/daemon/service/invocation/primitive/context_scout_registry.rs b/crates/tracedecay/src/daemon/service/invocation/primitive/context_scout_registry.rs similarity index 100% rename from src/daemon/service/invocation/primitive/context_scout_registry.rs rename to crates/tracedecay/src/daemon/service/invocation/primitive/context_scout_registry.rs diff --git a/src/daemon/service/invocation/registrars.rs b/crates/tracedecay/src/daemon/service/invocation/registrars.rs similarity index 100% rename from src/daemon/service/invocation/registrars.rs rename to crates/tracedecay/src/daemon/service/invocation/registrars.rs diff --git a/src/daemon/service/invocation/registrars/lsp.rs b/crates/tracedecay/src/daemon/service/invocation/registrars/lsp.rs similarity index 100% rename from src/daemon/service/invocation/registrars/lsp.rs rename to crates/tracedecay/src/daemon/service/invocation/registrars/lsp.rs diff --git a/src/daemon/service/invocation/retained.rs b/crates/tracedecay/src/daemon/service/invocation/retained.rs similarity index 100% rename from src/daemon/service/invocation/retained.rs rename to crates/tracedecay/src/daemon/service/invocation/retained.rs diff --git a/src/daemon/service/invocation/semantic_evaluation.rs b/crates/tracedecay/src/daemon/service/invocation/semantic_evaluation.rs similarity index 100% rename from src/daemon/service/invocation/semantic_evaluation.rs rename to crates/tracedecay/src/daemon/service/invocation/semantic_evaluation.rs diff --git a/src/daemon/service/invocation/tests/configuration_registrars_tests.rs b/crates/tracedecay/src/daemon/service/invocation/tests/configuration_registrars_tests.rs similarity index 100% rename from src/daemon/service/invocation/tests/configuration_registrars_tests.rs rename to crates/tracedecay/src/daemon/service/invocation/tests/configuration_registrars_tests.rs diff --git a/src/daemon/service/invocation/tests/configuration_tests.rs b/crates/tracedecay/src/daemon/service/invocation/tests/configuration_tests.rs similarity index 100% rename from src/daemon/service/invocation/tests/configuration_tests.rs rename to crates/tracedecay/src/daemon/service/invocation/tests/configuration_tests.rs diff --git a/src/daemon/service/invocation/tests/dispatch_tests.rs b/crates/tracedecay/src/daemon/service/invocation/tests/dispatch_tests.rs similarity index 100% rename from src/daemon/service/invocation/tests/dispatch_tests.rs rename to crates/tracedecay/src/daemon/service/invocation/tests/dispatch_tests.rs diff --git a/src/daemon/service/invocation/tests/feedback_tests.rs b/crates/tracedecay/src/daemon/service/invocation/tests/feedback_tests.rs similarity index 100% rename from src/daemon/service/invocation/tests/feedback_tests.rs rename to crates/tracedecay/src/daemon/service/invocation/tests/feedback_tests.rs diff --git a/src/daemon/service/invocation/tests/git_tests.rs b/crates/tracedecay/src/daemon/service/invocation/tests/git_tests.rs similarity index 100% rename from src/daemon/service/invocation/tests/git_tests.rs rename to crates/tracedecay/src/daemon/service/invocation/tests/git_tests.rs diff --git a/src/daemon/service/invocation/tests/handoff_tests.rs b/crates/tracedecay/src/daemon/service/invocation/tests/handoff_tests.rs similarity index 100% rename from src/daemon/service/invocation/tests/handoff_tests.rs rename to crates/tracedecay/src/daemon/service/invocation/tests/handoff_tests.rs diff --git a/src/daemon/service/invocation/tests/invocation_observability_tests.rs b/crates/tracedecay/src/daemon/service/invocation/tests/invocation_observability_tests.rs similarity index 100% rename from src/daemon/service/invocation/tests/invocation_observability_tests.rs rename to crates/tracedecay/src/daemon/service/invocation/tests/invocation_observability_tests.rs diff --git a/src/daemon/service/invocation/tests/lsp_lease_tests.rs b/crates/tracedecay/src/daemon/service/invocation/tests/lsp_lease_tests.rs similarity index 100% rename from src/daemon/service/invocation/tests/lsp_lease_tests.rs rename to crates/tracedecay/src/daemon/service/invocation/tests/lsp_lease_tests.rs diff --git a/src/daemon/service/invocation/tests/lsp_tests.rs b/crates/tracedecay/src/daemon/service/invocation/tests/lsp_tests.rs similarity index 100% rename from src/daemon/service/invocation/tests/lsp_tests.rs rename to crates/tracedecay/src/daemon/service/invocation/tests/lsp_tests.rs diff --git a/src/daemon/service/invocation/tests/mod.rs b/crates/tracedecay/src/daemon/service/invocation/tests/mod.rs similarity index 100% rename from src/daemon/service/invocation/tests/mod.rs rename to crates/tracedecay/src/daemon/service/invocation/tests/mod.rs diff --git a/src/daemon/service/invocation/tests/primitive_tests.rs b/crates/tracedecay/src/daemon/service/invocation/tests/primitive_tests.rs similarity index 100% rename from src/daemon/service/invocation/tests/primitive_tests.rs rename to crates/tracedecay/src/daemon/service/invocation/tests/primitive_tests.rs diff --git a/src/daemon/service/invocation/tests/project_admission_tests.rs b/crates/tracedecay/src/daemon/service/invocation/tests/project_admission_tests.rs similarity index 100% rename from src/daemon/service/invocation/tests/project_admission_tests.rs rename to crates/tracedecay/src/daemon/service/invocation/tests/project_admission_tests.rs diff --git a/src/daemon/service/invocation/tests/project_lifecycle_tests.rs b/crates/tracedecay/src/daemon/service/invocation/tests/project_lifecycle_tests.rs similarity index 100% rename from src/daemon/service/invocation/tests/project_lifecycle_tests.rs rename to crates/tracedecay/src/daemon/service/invocation/tests/project_lifecycle_tests.rs diff --git a/src/daemon/service/invocation/tests/types_tests.rs b/crates/tracedecay/src/daemon/service/invocation/tests/types_tests.rs similarity index 100% rename from src/daemon/service/invocation/tests/types_tests.rs rename to crates/tracedecay/src/daemon/service/invocation/tests/types_tests.rs diff --git a/src/daemon/service/invocation/tests/work_evidence_journey_tests.rs b/crates/tracedecay/src/daemon/service/invocation/tests/work_evidence_journey_tests.rs similarity index 100% rename from src/daemon/service/invocation/tests/work_evidence_journey_tests.rs rename to crates/tracedecay/src/daemon/service/invocation/tests/work_evidence_journey_tests.rs diff --git a/src/daemon/service/invocation/tests/work_tests.rs b/crates/tracedecay/src/daemon/service/invocation/tests/work_tests.rs similarity index 100% rename from src/daemon/service/invocation/tests/work_tests.rs rename to crates/tracedecay/src/daemon/service/invocation/tests/work_tests.rs diff --git a/src/daemon/service/invocation/types.rs b/crates/tracedecay/src/daemon/service/invocation/types.rs similarity index 100% rename from src/daemon/service/invocation/types.rs rename to crates/tracedecay/src/daemon/service/invocation/types.rs diff --git a/src/daemon/service/invocation/work.rs b/crates/tracedecay/src/daemon/service/invocation/work.rs similarity index 100% rename from src/daemon/service/invocation/work.rs rename to crates/tracedecay/src/daemon/service/invocation/work.rs diff --git a/src/daemon/service/invocation/work/attempt_operations.rs b/crates/tracedecay/src/daemon/service/invocation/work/attempt_operations.rs similarity index 100% rename from src/daemon/service/invocation/work/attempt_operations.rs rename to crates/tracedecay/src/daemon/service/invocation/work/attempt_operations.rs diff --git a/src/daemon/service/invocation/work/evidence_retrieval.rs b/crates/tracedecay/src/daemon/service/invocation/work/evidence_retrieval.rs similarity index 100% rename from src/daemon/service/invocation/work/evidence_retrieval.rs rename to crates/tracedecay/src/daemon/service/invocation/work/evidence_retrieval.rs diff --git a/src/daemon/service/invocation/work/intelligence.rs b/crates/tracedecay/src/daemon/service/invocation/work/intelligence.rs similarity index 100% rename from src/daemon/service/invocation/work/intelligence.rs rename to crates/tracedecay/src/daemon/service/invocation/work/intelligence.rs diff --git a/src/daemon/service/invocation/work/leak_adjudication.rs b/crates/tracedecay/src/daemon/service/invocation/work/leak_adjudication.rs similarity index 100% rename from src/daemon/service/invocation/work/leak_adjudication.rs rename to crates/tracedecay/src/daemon/service/invocation/work/leak_adjudication.rs diff --git a/src/daemon/service/invocation/work/outcome.rs b/crates/tracedecay/src/daemon/service/invocation/work/outcome.rs similarity index 100% rename from src/daemon/service/invocation/work/outcome.rs rename to crates/tracedecay/src/daemon/service/invocation/work/outcome.rs diff --git a/src/daemon/service/invocation/work/preparation.rs b/crates/tracedecay/src/daemon/service/invocation/work/preparation.rs similarity index 100% rename from src/daemon/service/invocation/work/preparation.rs rename to crates/tracedecay/src/daemon/service/invocation/work/preparation.rs diff --git a/src/daemon/service/invocation/work/request_dispatch.rs b/crates/tracedecay/src/daemon/service/invocation/work/request_dispatch.rs similarity index 100% rename from src/daemon/service/invocation/work/request_dispatch.rs rename to crates/tracedecay/src/daemon/service/invocation/work/request_dispatch.rs diff --git a/src/daemon/service/invocation/work/workflow_census.rs b/crates/tracedecay/src/daemon/service/invocation/work/workflow_census.rs similarity index 100% rename from src/daemon/service/invocation/work/workflow_census.rs rename to crates/tracedecay/src/daemon/service/invocation/work/workflow_census.rs diff --git a/src/daemon/service/invocation/work/workflow_dispatch.rs b/crates/tracedecay/src/daemon/service/invocation/work/workflow_dispatch.rs similarity index 100% rename from src/daemon/service/invocation/work/workflow_dispatch.rs rename to crates/tracedecay/src/daemon/service/invocation/work/workflow_dispatch.rs diff --git a/src/daemon/service/invocation/work/workflow_effect_journal.rs b/crates/tracedecay/src/daemon/service/invocation/work/workflow_effect_journal.rs similarity index 100% rename from src/daemon/service/invocation/work/workflow_effect_journal.rs rename to crates/tracedecay/src/daemon/service/invocation/work/workflow_effect_journal.rs diff --git a/src/daemon/service/invocation/work/workflow_fan_out.rs b/crates/tracedecay/src/daemon/service/invocation/work/workflow_fan_out.rs similarity index 100% rename from src/daemon/service/invocation/work/workflow_fan_out.rs rename to crates/tracedecay/src/daemon/service/invocation/work/workflow_fan_out.rs diff --git a/src/daemon/service/invocation/work/workflow_fan_out/recovery.rs b/crates/tracedecay/src/daemon/service/invocation/work/workflow_fan_out/recovery.rs similarity index 100% rename from src/daemon/service/invocation/work/workflow_fan_out/recovery.rs rename to crates/tracedecay/src/daemon/service/invocation/work/workflow_fan_out/recovery.rs diff --git a/src/daemon/service/invocation/work/workflow_run_control.rs b/crates/tracedecay/src/daemon/service/invocation/work/workflow_run_control.rs similarity index 100% rename from src/daemon/service/invocation/work/workflow_run_control.rs rename to crates/tracedecay/src/daemon/service/invocation/work/workflow_run_control.rs diff --git a/src/daemon/service/invocation/work_attempt_exec.rs b/crates/tracedecay/src/daemon/service/invocation/work_attempt_exec.rs similarity index 100% rename from src/daemon/service/invocation/work_attempt_exec.rs rename to crates/tracedecay/src/daemon/service/invocation/work_attempt_exec.rs diff --git a/src/daemon/service/invocation/work_attempt_exec/operation_resource.rs b/crates/tracedecay/src/daemon/service/invocation/work_attempt_exec/operation_resource.rs similarity index 100% rename from src/daemon/service/invocation/work_attempt_exec/operation_resource.rs rename to crates/tracedecay/src/daemon/service/invocation/work_attempt_exec/operation_resource.rs diff --git a/src/daemon/service/invocation/work_attempt_exec/provider_output.rs b/crates/tracedecay/src/daemon/service/invocation/work_attempt_exec/provider_output.rs similarity index 100% rename from src/daemon/service/invocation/work_attempt_exec/provider_output.rs rename to crates/tracedecay/src/daemon/service/invocation/work_attempt_exec/provider_output.rs diff --git a/src/daemon/service/invocation/work_attempt_exec/tests.rs b/crates/tracedecay/src/daemon/service/invocation/work_attempt_exec/tests.rs similarity index 100% rename from src/daemon/service/invocation/work_attempt_exec/tests.rs rename to crates/tracedecay/src/daemon/service/invocation/work_attempt_exec/tests.rs diff --git a/src/daemon/service/invocation/work_blocked_interval_recovery.rs b/crates/tracedecay/src/daemon/service/invocation/work_blocked_interval_recovery.rs similarity index 100% rename from src/daemon/service/invocation/work_blocked_interval_recovery.rs rename to crates/tracedecay/src/daemon/service/invocation/work_blocked_interval_recovery.rs diff --git a/src/daemon/service/invocation/work_routing.rs b/crates/tracedecay/src/daemon/service/invocation/work_routing.rs similarity index 100% rename from src/daemon/service/invocation/work_routing.rs rename to crates/tracedecay/src/daemon/service/invocation/work_routing.rs diff --git a/src/daemon/service/multi_root.rs b/crates/tracedecay/src/daemon/service/multi_root.rs similarity index 100% rename from src/daemon/service/multi_root.rs rename to crates/tracedecay/src/daemon/service/multi_root.rs diff --git a/src/daemon/service/probe.rs b/crates/tracedecay/src/daemon/service/probe.rs similarity index 100% rename from src/daemon/service/probe.rs rename to crates/tracedecay/src/daemon/service/probe.rs diff --git a/src/daemon/service/project_runtime.rs b/crates/tracedecay/src/daemon/service/project_runtime.rs similarity index 100% rename from src/daemon/service/project_runtime.rs rename to crates/tracedecay/src/daemon/service/project_runtime.rs diff --git a/src/daemon/service/project_runtime/observability.rs b/crates/tracedecay/src/daemon/service/project_runtime/observability.rs similarity index 100% rename from src/daemon/service/project_runtime/observability.rs rename to crates/tracedecay/src/daemon/service/project_runtime/observability.rs diff --git a/src/daemon/service/project_runtime/observability_tests.rs b/crates/tracedecay/src/daemon/service/project_runtime/observability_tests.rs similarity index 100% rename from src/daemon/service/project_runtime/observability_tests.rs rename to crates/tracedecay/src/daemon/service/project_runtime/observability_tests.rs diff --git a/src/daemon/service/project_runtime/recovery_tests.rs b/crates/tracedecay/src/daemon/service/project_runtime/recovery_tests.rs similarity index 100% rename from src/daemon/service/project_runtime/recovery_tests.rs rename to crates/tracedecay/src/daemon/service/project_runtime/recovery_tests.rs diff --git a/src/daemon/service/project_runtime/request_snapshot.rs b/crates/tracedecay/src/daemon/service/project_runtime/request_snapshot.rs similarity index 100% rename from src/daemon/service/project_runtime/request_snapshot.rs rename to crates/tracedecay/src/daemon/service/project_runtime/request_snapshot.rs diff --git a/src/daemon/service/project_runtime/shutdown.rs b/crates/tracedecay/src/daemon/service/project_runtime/shutdown.rs similarity index 100% rename from src/daemon/service/project_runtime/shutdown.rs rename to crates/tracedecay/src/daemon/service/project_runtime/shutdown.rs diff --git a/src/daemon/service/project_runtime/tests.rs b/crates/tracedecay/src/daemon/service/project_runtime/tests.rs similarity index 100% rename from src/daemon/service/project_runtime/tests.rs rename to crates/tracedecay/src/daemon/service/project_runtime/tests.rs diff --git a/src/daemon/service/runner.rs b/crates/tracedecay/src/daemon/service/runner.rs similarity index 100% rename from src/daemon/service/runner.rs rename to crates/tracedecay/src/daemon/service/runner.rs diff --git a/src/daemon/service/tests.rs b/crates/tracedecay/src/daemon/service/tests.rs similarity index 100% rename from src/daemon/service/tests.rs rename to crates/tracedecay/src/daemon/service/tests.rs diff --git a/src/daemon/service/unit_file.rs b/crates/tracedecay/src/daemon/service/unit_file.rs similarity index 100% rename from src/daemon/service/unit_file.rs rename to crates/tracedecay/src/daemon/service/unit_file.rs diff --git a/src/daemon/service/windows_task.rs b/crates/tracedecay/src/daemon/service/windows_task.rs similarity index 100% rename from src/daemon/service/windows_task.rs rename to crates/tracedecay/src/daemon/service/windows_task.rs diff --git a/src/daemon/session_retrieval.rs b/crates/tracedecay/src/daemon/session_retrieval.rs similarity index 100% rename from src/daemon/session_retrieval.rs rename to crates/tracedecay/src/daemon/session_retrieval.rs diff --git a/src/daemon/session_retrieval/admitted.rs b/crates/tracedecay/src/daemon/session_retrieval/admitted.rs similarity index 100% rename from src/daemon/session_retrieval/admitted.rs rename to crates/tracedecay/src/daemon/session_retrieval/admitted.rs diff --git a/src/daemon/session_retrieval/contract.rs b/crates/tracedecay/src/daemon/session_retrieval/contract.rs similarity index 100% rename from src/daemon/session_retrieval/contract.rs rename to crates/tracedecay/src/daemon/session_retrieval/contract.rs diff --git a/src/daemon/session_retrieval/lcm.rs b/crates/tracedecay/src/daemon/session_retrieval/lcm.rs similarity index 100% rename from src/daemon/session_retrieval/lcm.rs rename to crates/tracedecay/src/daemon/session_retrieval/lcm.rs diff --git a/src/daemon/session_retrieval/primitive.rs b/crates/tracedecay/src/daemon/session_retrieval/primitive.rs similarity index 100% rename from src/daemon/session_retrieval/primitive.rs rename to crates/tracedecay/src/daemon/session_retrieval/primitive.rs diff --git a/src/daemon/session_retrieval/serving_status.rs b/crates/tracedecay/src/daemon/session_retrieval/serving_status.rs similarity index 100% rename from src/daemon/session_retrieval/serving_status.rs rename to crates/tracedecay/src/daemon/session_retrieval/serving_status.rs diff --git a/src/daemon/session_retrieval/tests.rs b/crates/tracedecay/src/daemon/session_retrieval/tests.rs similarity index 100% rename from src/daemon/session_retrieval/tests.rs rename to crates/tracedecay/src/daemon/session_retrieval/tests.rs diff --git a/src/daemon/session_sync.rs b/crates/tracedecay/src/daemon/session_sync.rs similarity index 100% rename from src/daemon/session_sync.rs rename to crates/tracedecay/src/daemon/session_sync.rs diff --git a/src/daemon/session_sync/git_topology.rs b/crates/tracedecay/src/daemon/session_sync/git_topology.rs similarity index 99% rename from src/daemon/session_sync/git_topology.rs rename to crates/tracedecay/src/daemon/session_sync/git_topology.rs index 8affbf3bfd..606c698d98 100644 --- a/src/daemon/session_sync/git_topology.rs +++ b/crates/tracedecay/src/daemon/session_sync/git_topology.rs @@ -16,8 +16,8 @@ use tracedecay_runtime_core::git_repository::GitRepositoryAuthority; use tracedecay_rusqlite_runtime::repository::AuthorizedScopeSetSqliteStorage; use tracedecay_store::FactReadControl; -use crate::git_intelligence::{GIT_HISTORY_MAX_COUNT_LIMIT, NativeGitIntelligence}; use crate::global_db::RegisteredGlobalDbLeaseV1; +use tracedecay_usecases::git_intelligence::{GIT_HISTORY_MAX_COUNT_LIMIT, NativeGitIntelligence}; use super::{DaemonSessionSyncService, SessionSyncProjectContext, work::SessionSyncInterruption}; diff --git a/src/daemon/session_sync/project_lifecycle.rs b/crates/tracedecay/src/daemon/session_sync/project_lifecycle.rs similarity index 100% rename from src/daemon/session_sync/project_lifecycle.rs rename to crates/tracedecay/src/daemon/session_sync/project_lifecycle.rs diff --git a/src/daemon/session_sync/project_lifecycle_tests.rs b/crates/tracedecay/src/daemon/session_sync/project_lifecycle_tests.rs similarity index 100% rename from src/daemon/session_sync/project_lifecycle_tests.rs rename to crates/tracedecay/src/daemon/session_sync/project_lifecycle_tests.rs diff --git a/src/daemon/session_sync/work.rs b/crates/tracedecay/src/daemon/session_sync/work.rs similarity index 100% rename from src/daemon/session_sync/work.rs rename to crates/tracedecay/src/daemon/session_sync/work.rs diff --git a/src/daemon/session_sync_tests.rs b/crates/tracedecay/src/daemon/session_sync_tests.rs similarity index 99% rename from src/daemon/session_sync_tests.rs rename to crates/tracedecay/src/daemon/session_sync_tests.rs index 294445ff57..951d8e83f5 100644 --- a/src/daemon/session_sync_tests.rs +++ b/crates/tracedecay/src/daemon/session_sync_tests.rs @@ -602,12 +602,12 @@ async fn persisted_declared_topology_survives_registry_restart_and_session_sync_ reference: Some(feature_ref), }, ]; - let projection = crate::git_intelligence::NativeGitIntelligence::new( + let projection = tracedecay_usecases::git_intelligence::NativeGitIntelligence::new( roots[0].clone(), repository.clone(), main_worktree.clone(), ) - .topology_projection(crate::git_intelligence::GIT_HISTORY_MAX_COUNT_LIMIT) + .topology_projection(tracedecay_usecases::git_intelligence::GIT_HISTORY_MAX_COUNT_LIMIT) .expect("native topology projection") .with_declared_topology(vec![branch_binding], occupancies) .expect("declared topology projection"); diff --git a/src/daemon/session_temporal_refresh_scheduler.rs b/crates/tracedecay/src/daemon/session_temporal_refresh_scheduler.rs similarity index 100% rename from src/daemon/session_temporal_refresh_scheduler.rs rename to crates/tracedecay/src/daemon/session_temporal_refresh_scheduler.rs diff --git a/src/daemon/session_temporal_refresh_scheduler/history.rs b/crates/tracedecay/src/daemon/session_temporal_refresh_scheduler/history.rs similarity index 100% rename from src/daemon/session_temporal_refresh_scheduler/history.rs rename to crates/tracedecay/src/daemon/session_temporal_refresh_scheduler/history.rs diff --git a/src/daemon/session_temporal_refresh_scheduler/projector.rs b/crates/tracedecay/src/daemon/session_temporal_refresh_scheduler/projector.rs similarity index 100% rename from src/daemon/session_temporal_refresh_scheduler/projector.rs rename to crates/tracedecay/src/daemon/session_temporal_refresh_scheduler/projector.rs diff --git a/src/daemon/session_temporal_refresh_scheduler/registry.rs b/crates/tracedecay/src/daemon/session_temporal_refresh_scheduler/registry.rs similarity index 100% rename from src/daemon/session_temporal_refresh_scheduler/registry.rs rename to crates/tracedecay/src/daemon/session_temporal_refresh_scheduler/registry.rs diff --git a/src/daemon/session_temporal_refresh_scheduler/retained_history_tests.rs b/crates/tracedecay/src/daemon/session_temporal_refresh_scheduler/retained_history_tests.rs similarity index 100% rename from src/daemon/session_temporal_refresh_scheduler/retained_history_tests.rs rename to crates/tracedecay/src/daemon/session_temporal_refresh_scheduler/retained_history_tests.rs diff --git a/src/daemon/session_temporal_refresh_scheduler/tests.rs b/crates/tracedecay/src/daemon/session_temporal_refresh_scheduler/tests.rs similarity index 100% rename from src/daemon/session_temporal_refresh_scheduler/tests.rs rename to crates/tracedecay/src/daemon/session_temporal_refresh_scheduler/tests.rs diff --git a/src/daemon/session_temporal_refresh_scheduler/wake.rs b/crates/tracedecay/src/daemon/session_temporal_refresh_scheduler/wake.rs similarity index 100% rename from src/daemon/session_temporal_refresh_scheduler/wake.rs rename to crates/tracedecay/src/daemon/session_temporal_refresh_scheduler/wake.rs diff --git a/src/daemon/session_temporal_refresh_scheduler/worker.rs b/crates/tracedecay/src/daemon/session_temporal_refresh_scheduler/worker.rs similarity index 100% rename from src/daemon/session_temporal_refresh_scheduler/worker.rs rename to crates/tracedecay/src/daemon/session_temporal_refresh_scheduler/worker.rs diff --git a/src/daemon/shutdown_coordination.rs b/crates/tracedecay/src/daemon/shutdown_coordination.rs similarity index 100% rename from src/daemon/shutdown_coordination.rs rename to crates/tracedecay/src/daemon/shutdown_coordination.rs diff --git a/src/daemon/shutdown_orchestration.rs b/crates/tracedecay/src/daemon/shutdown_orchestration.rs similarity index 100% rename from src/daemon/shutdown_orchestration.rs rename to crates/tracedecay/src/daemon/shutdown_orchestration.rs diff --git a/src/daemon/store_runtime.rs b/crates/tracedecay/src/daemon/store_runtime.rs similarity index 100% rename from src/daemon/store_runtime.rs rename to crates/tracedecay/src/daemon/store_runtime.rs diff --git a/src/daemon/store_runtime/session_registry.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry.rs similarity index 100% rename from src/daemon/store_runtime/session_registry.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry.rs diff --git a/src/daemon/store_runtime/session_registry/code_graph.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/code_graph.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/code_graph.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/code_graph.rs diff --git a/src/daemon/store_runtime/session_registry/code_graph/graph_attachment.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/code_graph/graph_attachment.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/code_graph/graph_attachment.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/code_graph/graph_attachment.rs diff --git a/src/daemon/store_runtime/session_registry/code_graph/memory_runtime.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/code_graph/memory_runtime.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/code_graph/memory_runtime.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/code_graph/memory_runtime.rs diff --git a/src/daemon/store_runtime/session_registry/code_graph/sealed_publication_tests.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/code_graph/sealed_publication_tests.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/code_graph/sealed_publication_tests.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/code_graph/sealed_publication_tests.rs diff --git a/src/daemon/store_runtime/session_registry/code_graph/seals.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/code_graph/seals.rs similarity index 97% rename from src/daemon/store_runtime/session_registry/code_graph/seals.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/code_graph/seals.rs index 468d206551..f62a204ce3 100644 --- a/src/daemon/store_runtime/session_registry/code_graph/seals.rs +++ b/crates/tracedecay/src/daemon/store_runtime/session_registry/code_graph/seals.rs @@ -190,7 +190,10 @@ pub(super) fn finalize_project_graph_replay_unlink( pub(super) fn lock_project_graph_replay_pool( replay_root: &Path, check: &dyn Fn() -> Result<(), GraphDbError>, -) -> Result { +) -> Result< + tracedecay_usecases::retention::code_index_generations::CodeGenerationStoreLockV1, + GraphDbError, +> { tracedecay_runtime_core::storage::PrivateStoreIo::create_private_directory(replay_root) .map_err(|error| { let message = @@ -208,10 +211,13 @@ pub(super) fn lock_project_graph_replay_pool( fn lock_code_generation_store( root: &Path, check: &dyn Fn() -> Result<(), GraphDbError>, -) -> Result { +) -> Result< + tracedecay_usecases::retention::code_index_generations::CodeGenerationStoreLockV1, + GraphDbError, +> { loop { check()?; - match crate::retention::code_index_generations::try_acquire_code_generation_store_lock(root) + match tracedecay_usecases::retention::code_index_generations::try_acquire_code_generation_store_lock(root) .map_err(|error| GraphDbError::unavailable(error.to_string()))? { Some(lock) => return Ok(lock), diff --git a/src/daemon/store_runtime/session_registry/code_graph/semantic_vector.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/code_graph/semantic_vector.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/code_graph/semantic_vector.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/code_graph/semantic_vector.rs diff --git a/src/daemon/store_runtime/session_registry/code_graph_manifest.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/code_graph_manifest.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/code_graph_manifest.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/code_graph_manifest.rs diff --git a/src/daemon/store_runtime/session_registry/code_reads.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/code_reads.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/code_reads.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/code_reads.rs diff --git a/src/daemon/store_runtime/session_registry/graph_shutdown_contract_tests.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/graph_shutdown_contract_tests.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/graph_shutdown_contract_tests.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/graph_shutdown_contract_tests.rs diff --git a/src/daemon/store_runtime/session_registry/maintenance.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/maintenance.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/maintenance.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/maintenance.rs diff --git a/src/daemon/store_runtime/session_registry/memory_graph_reconciliation_tasks.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/memory_graph_reconciliation_tasks.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/memory_graph_reconciliation_tasks.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/memory_graph_reconciliation_tasks.rs diff --git a/src/daemon/store_runtime/session_registry/mounts.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/mounts.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/mounts.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/mounts.rs diff --git a/src/daemon/store_runtime/session_registry/profile_memory.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/profile_memory.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/profile_memory.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/profile_memory.rs diff --git a/src/daemon/store_runtime/session_registry/project_memory_relation_graph_contract_tests.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/project_memory_relation_graph_contract_tests.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/project_memory_relation_graph_contract_tests.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/project_memory_relation_graph_contract_tests.rs diff --git a/src/daemon/store_runtime/session_registry/remote_recovery.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/remote_recovery.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/remote_recovery.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/remote_recovery.rs diff --git a/src/daemon/store_runtime/session_registry/remote_recovery/artifacts.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/remote_recovery/artifacts.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/remote_recovery/artifacts.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/remote_recovery/artifacts.rs diff --git a/src/daemon/store_runtime/session_registry/remote_recovery/publication.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/remote_recovery/publication.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/remote_recovery/publication.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/remote_recovery/publication.rs diff --git a/src/daemon/store_runtime/session_registry/remote_recovery/publication/quarantine.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/remote_recovery/publication/quarantine.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/remote_recovery/publication/quarantine.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/remote_recovery/publication/quarantine.rs diff --git a/src/daemon/store_runtime/session_registry/remote_recovery/support.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/remote_recovery/support.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/remote_recovery/support.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/remote_recovery/support.rs diff --git a/src/daemon/store_runtime/session_registry/retained_hook_tasks.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/retained_hook_tasks.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/retained_hook_tasks.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/retained_hook_tasks.rs diff --git a/src/daemon/store_runtime/session_registry/terminal_tasks.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/terminal_tasks.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/terminal_tasks.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/terminal_tasks.rs diff --git a/src/daemon/store_runtime/session_registry/tests.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/tests.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/tests.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/tests.rs diff --git a/src/daemon/store_runtime/session_registry/verified_graph_runtime_port_contract_tests.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/verified_graph_runtime_port_contract_tests.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/verified_graph_runtime_port_contract_tests.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/verified_graph_runtime_port_contract_tests.rs diff --git a/src/daemon/store_runtime/session_registry/verified_graph_runtime_port_contract_tests/concurrency.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/verified_graph_runtime_port_contract_tests/concurrency.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/verified_graph_runtime_port_contract_tests/concurrency.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/verified_graph_runtime_port_contract_tests/concurrency.rs diff --git a/src/daemon/store_runtime/session_registry/verified_graph_runtime_port_contract_tests/mount_scope.rs b/crates/tracedecay/src/daemon/store_runtime/session_registry/verified_graph_runtime_port_contract_tests/mount_scope.rs similarity index 100% rename from src/daemon/store_runtime/session_registry/verified_graph_runtime_port_contract_tests/mount_scope.rs rename to crates/tracedecay/src/daemon/store_runtime/session_registry/verified_graph_runtime_port_contract_tests/mount_scope.rs diff --git a/src/daemon/store_shutdown.rs b/crates/tracedecay/src/daemon/store_shutdown.rs similarity index 100% rename from src/daemon/store_shutdown.rs rename to crates/tracedecay/src/daemon/store_shutdown.rs diff --git a/src/daemon/store_writer_gate.rs b/crates/tracedecay/src/daemon/store_writer_gate.rs similarity index 100% rename from src/daemon/store_writer_gate.rs rename to crates/tracedecay/src/daemon/store_writer_gate.rs diff --git a/src/daemon/tests.rs b/crates/tracedecay/src/daemon/tests.rs similarity index 99% rename from src/daemon/tests.rs rename to crates/tracedecay/src/daemon/tests.rs index 62e306a8fc..fca32ef7b7 100644 --- a/src/daemon/tests.rs +++ b/crates/tracedecay/src/daemon/tests.rs @@ -542,8 +542,8 @@ async fn apply_project_automation_patch_via_surface( observed_at.0 + i64::try_from(maximum_millis).expect("deadline fits") * 1_000, )) .expect("configuration deadline"); - let request_id = crate::request_identity::mint_global_request_id( - crate::request_identity::GlobalRequestSurface::Cli, + let request_id = tracedecay_usecases::request_identity::mint_global_request_id( + tracedecay_usecases::request_identity::GlobalRequestSurface::Cli, ) .expect("surface request id"); let idempotency_key = tracedecay_domain::configuration::ConfigurationIdempotencyKey::new( diff --git a/src/daemon/tests/bootstrap.rs b/crates/tracedecay/src/daemon/tests/bootstrap.rs similarity index 100% rename from src/daemon/tests/bootstrap.rs rename to crates/tracedecay/src/daemon/tests/bootstrap.rs diff --git a/src/daemon/tests/code_index_hydration.rs b/crates/tracedecay/src/daemon/tests/code_index_hydration.rs similarity index 100% rename from src/daemon/tests/code_index_hydration.rs rename to crates/tracedecay/src/daemon/tests/code_index_hydration.rs diff --git a/src/daemon/tests/handshake.rs b/crates/tracedecay/src/daemon/tests/handshake.rs similarity index 100% rename from src/daemon/tests/handshake.rs rename to crates/tracedecay/src/daemon/tests/handshake.rs diff --git a/src/daemon/tests/invocation_ownership.rs b/crates/tracedecay/src/daemon/tests/invocation_ownership.rs similarity index 100% rename from src/daemon/tests/invocation_ownership.rs rename to crates/tracedecay/src/daemon/tests/invocation_ownership.rs diff --git a/src/daemon/tests/lifecycle.rs b/crates/tracedecay/src/daemon/tests/lifecycle.rs similarity index 100% rename from src/daemon/tests/lifecycle.rs rename to crates/tracedecay/src/daemon/tests/lifecycle.rs diff --git a/src/daemon/tests/logging.rs b/crates/tracedecay/src/daemon/tests/logging.rs similarity index 100% rename from src/daemon/tests/logging.rs rename to crates/tracedecay/src/daemon/tests/logging.rs diff --git a/src/daemon/tests/multi_root_journey.rs b/crates/tracedecay/src/daemon/tests/multi_root_journey.rs similarity index 100% rename from src/daemon/tests/multi_root_journey.rs rename to crates/tracedecay/src/daemon/tests/multi_root_journey.rs diff --git a/src/daemon/tests/ownership.rs b/crates/tracedecay/src/daemon/tests/ownership.rs similarity index 100% rename from src/daemon/tests/ownership.rs rename to crates/tracedecay/src/daemon/tests/ownership.rs diff --git a/src/daemon/tests/remote_project_deletion.rs b/crates/tracedecay/src/daemon/tests/remote_project_deletion.rs similarity index 100% rename from src/daemon/tests/remote_project_deletion.rs rename to crates/tracedecay/src/daemon/tests/remote_project_deletion.rs diff --git a/src/daemon/tests/remote_project_recovery.rs b/crates/tracedecay/src/daemon/tests/remote_project_recovery.rs similarity index 100% rename from src/daemon/tests/remote_project_recovery.rs rename to crates/tracedecay/src/daemon/tests/remote_project_recovery.rs diff --git a/src/daemon/tests/replay.rs b/crates/tracedecay/src/daemon/tests/replay.rs similarity index 100% rename from src/daemon/tests/replay.rs rename to crates/tracedecay/src/daemon/tests/replay.rs diff --git a/src/daemon/tests/restart_proxy.rs b/crates/tracedecay/src/daemon/tests/restart_proxy.rs similarity index 100% rename from src/daemon/tests/restart_proxy.rs rename to crates/tracedecay/src/daemon/tests/restart_proxy.rs diff --git a/src/daemon/tests/rmcp_route.rs b/crates/tracedecay/src/daemon/tests/rmcp_route.rs similarity index 100% rename from src/daemon/tests/rmcp_route.rs rename to crates/tracedecay/src/daemon/tests/rmcp_route.rs diff --git a/src/daemon/tests/runtime_identity.rs b/crates/tracedecay/src/daemon/tests/runtime_identity.rs similarity index 100% rename from src/daemon/tests/runtime_identity.rs rename to crates/tracedecay/src/daemon/tests/runtime_identity.rs diff --git a/src/daemon/tests/scheduler_config.rs b/crates/tracedecay/src/daemon/tests/scheduler_config.rs similarity index 100% rename from src/daemon/tests/scheduler_config.rs rename to crates/tracedecay/src/daemon/tests/scheduler_config.rs diff --git a/src/daemon/tests/scheduler_config/paused_tick.rs b/crates/tracedecay/src/daemon/tests/scheduler_config/paused_tick.rs similarity index 100% rename from src/daemon/tests/scheduler_config/paused_tick.rs rename to crates/tracedecay/src/daemon/tests/scheduler_config/paused_tick.rs diff --git a/src/daemon/tests/scheduler_shutdown.rs b/crates/tracedecay/src/daemon/tests/scheduler_shutdown.rs similarity index 100% rename from src/daemon/tests/scheduler_shutdown.rs rename to crates/tracedecay/src/daemon/tests/scheduler_shutdown.rs diff --git a/src/daemon/tests/socket.rs b/crates/tracedecay/src/daemon/tests/socket.rs similarity index 100% rename from src/daemon/tests/socket.rs rename to crates/tracedecay/src/daemon/tests/socket.rs diff --git a/src/daemon/transport.rs b/crates/tracedecay/src/daemon/transport.rs similarity index 100% rename from src/daemon/transport.rs rename to crates/tracedecay/src/daemon/transport.rs diff --git a/src/daemon/wire_io.rs b/crates/tracedecay/src/daemon/wire_io.rs similarity index 100% rename from src/daemon/wire_io.rs rename to crates/tracedecay/src/daemon/wire_io.rs diff --git a/src/daemon/work_evidence_retrieval.rs b/crates/tracedecay/src/daemon/work_evidence_retrieval.rs similarity index 100% rename from src/daemon/work_evidence_retrieval.rs rename to crates/tracedecay/src/daemon/work_evidence_retrieval.rs diff --git a/src/daemon/work_evidence_retrieval/continuation_tests.rs b/crates/tracedecay/src/daemon/work_evidence_retrieval/continuation_tests.rs similarity index 100% rename from src/daemon/work_evidence_retrieval/continuation_tests.rs rename to crates/tracedecay/src/daemon/work_evidence_retrieval/continuation_tests.rs diff --git a/src/daemon_client.rs b/crates/tracedecay/src/daemon_client.rs similarity index 99% rename from src/daemon_client.rs rename to crates/tracedecay/src/daemon_client.rs index ffa8fc22d3..181751c323 100644 --- a/src/daemon_client.rs +++ b/crates/tracedecay/src/daemon_client.rs @@ -24,10 +24,10 @@ use tracedecay_tool_catalog::{ SurfaceOperationName, }; -use crate::request_identity::{ +use tracedecay_usecases::feedback::observations::{FeedbackDeliveryRouteV1, FeedbackSourceEventV1}; +use tracedecay_usecases::request_identity::{ ConnectionLocalRequestSequence, GlobalRequestSurface, mint_global_request_id, }; -use tracedecay_usecases::feedback::observations::{FeedbackDeliveryRouteV1, FeedbackSourceEventV1}; pub type ScopeSelector = InvocationTarget; diff --git a/src/daemon_client/controlled_invocation.rs b/crates/tracedecay/src/daemon_client/controlled_invocation.rs similarity index 100% rename from src/daemon_client/controlled_invocation.rs rename to crates/tracedecay/src/daemon_client/controlled_invocation.rs diff --git a/src/daemon_client/controlled_invocation_tests.rs b/crates/tracedecay/src/daemon_client/controlled_invocation_tests.rs similarity index 100% rename from src/daemon_client/controlled_invocation_tests.rs rename to crates/tracedecay/src/daemon_client/controlled_invocation_tests.rs diff --git a/src/daemon_client/lsp_session.rs b/crates/tracedecay/src/daemon_client/lsp_session.rs similarity index 100% rename from src/daemon_client/lsp_session.rs rename to crates/tracedecay/src/daemon_client/lsp_session.rs diff --git a/src/daemon_contract.rs b/crates/tracedecay/src/daemon_contract.rs similarity index 100% rename from src/daemon_contract.rs rename to crates/tracedecay/src/daemon_contract.rs diff --git a/src/daemon_contract/git_surface.rs b/crates/tracedecay/src/daemon_contract/git_surface.rs similarity index 100% rename from src/daemon_contract/git_surface.rs rename to crates/tracedecay/src/daemon_contract/git_surface.rs diff --git a/src/daemon_contract/problem_response.rs b/crates/tracedecay/src/daemon_contract/problem_response.rs similarity index 100% rename from src/daemon_contract/problem_response.rs rename to crates/tracedecay/src/daemon_contract/problem_response.rs diff --git a/src/dashboard.rs b/crates/tracedecay/src/dashboard.rs similarity index 100% rename from src/dashboard.rs rename to crates/tracedecay/src/dashboard.rs index 3dec6fbe37..0e8f092eef 100644 --- a/src/dashboard.rs +++ b/crates/tracedecay/src/dashboard.rs @@ -31,30 +31,6 @@ pub fn spa_router() -> axum::Router { assets::spa_router() } -#[cfg(test)] -mod spa_router_tests { - use axum::{ - body::Body, - http::{Request, StatusCode}, - }; - use tower::ServiceExt; - - #[tokio::test] - async fn unknown_api_paths_never_receive_the_single_page_app() { - let response = super::spa_router() - .oneshot( - Request::builder() - .uri("/api/not-a-real-route") - .body(Body::empty()) - .expect("request"), - ) - .await - .expect("SPA router response"); - - assert_eq!(response.status(), StatusCode::NOT_FOUND); - } -} - /// Installs the canonical root-owned registered schema port before dashboard /// integration fixtures open any database authority. #[cfg(feature = "test-transport")] @@ -401,3 +377,27 @@ pub async fn record_project_span_for_test( message: error.to_string(), }) } + +#[cfg(test)] +mod spa_router_tests { + use axum::{ + body::Body, + http::{Request, StatusCode}, + }; + use tower::ServiceExt; + + #[tokio::test] + async fn unknown_api_paths_never_receive_the_single_page_app() { + let response = super::spa_router() + .oneshot( + Request::builder() + .uri("/api/not-a-real-route") + .body(Body::empty()) + .expect("request"), + ) + .await + .expect("SPA router response"); + + assert_eq!(response.status(), StatusCode::NOT_FOUND); + } +} diff --git a/src/dashboard/assets.rs b/crates/tracedecay/src/dashboard/assets.rs similarity index 100% rename from src/dashboard/assets.rs rename to crates/tracedecay/src/dashboard/assets.rs diff --git a/src/dashboard/observation_seed.rs b/crates/tracedecay/src/dashboard/observation_seed.rs similarity index 100% rename from src/dashboard/observation_seed.rs rename to crates/tracedecay/src/dashboard/observation_seed.rs diff --git a/src/db.rs b/crates/tracedecay/src/db.rs similarity index 100% rename from src/db.rs rename to crates/tracedecay/src/db.rs diff --git a/src/diagnostics/cache.rs b/crates/tracedecay/src/diagnostics/cache.rs similarity index 100% rename from src/diagnostics/cache.rs rename to crates/tracedecay/src/diagnostics/cache.rs diff --git a/src/diagnostics/fingerprint.rs b/crates/tracedecay/src/diagnostics/fingerprint.rs similarity index 100% rename from src/diagnostics/fingerprint.rs rename to crates/tracedecay/src/diagnostics/fingerprint.rs diff --git a/src/diagnostics/lsp/mod.rs b/crates/tracedecay/src/diagnostics/lsp/mod.rs similarity index 100% rename from src/diagnostics/lsp/mod.rs rename to crates/tracedecay/src/diagnostics/lsp/mod.rs diff --git a/src/diagnostics/lsp/semantic.rs b/crates/tracedecay/src/diagnostics/lsp/semantic.rs similarity index 100% rename from src/diagnostics/lsp/semantic.rs rename to crates/tracedecay/src/diagnostics/lsp/semantic.rs diff --git a/src/diagnostics/mod.rs b/crates/tracedecay/src/diagnostics/mod.rs similarity index 100% rename from src/diagnostics/mod.rs rename to crates/tracedecay/src/diagnostics/mod.rs diff --git a/src/diagnostics/python.rs b/crates/tracedecay/src/diagnostics/python.rs similarity index 100% rename from src/diagnostics/python.rs rename to crates/tracedecay/src/diagnostics/python.rs diff --git a/src/diagnostics/rust.rs b/crates/tracedecay/src/diagnostics/rust.rs similarity index 100% rename from src/diagnostics/rust.rs rename to crates/tracedecay/src/diagnostics/rust.rs diff --git a/src/diagnostics/typescript.rs b/crates/tracedecay/src/diagnostics/typescript.rs similarity index 100% rename from src/diagnostics/typescript.rs rename to crates/tracedecay/src/diagnostics/typescript.rs diff --git a/src/display.rs b/crates/tracedecay/src/display.rs similarity index 100% rename from src/display.rs rename to crates/tracedecay/src/display.rs diff --git a/src/doctor.rs b/crates/tracedecay/src/doctor.rs similarity index 99% rename from src/doctor.rs rename to crates/tracedecay/src/doctor.rs index 701f5ee26c..adc1e0a32f 100644 --- a/src/doctor.rs +++ b/crates/tracedecay/src/doctor.rs @@ -18,8 +18,8 @@ use crate::application_surface::{ }; use crate::daemon_client::{DaemonInvocationClient, RequestedOutputFormat}; use crate::display::format_token_count; -use crate::request_identity::{GlobalRequestSurface, mint_global_request_id}; use tracedecay_application::{ConfigurationGetRequestV1, ConfigurationWireRequestV1}; +use tracedecay_usecases::request_identity::{GlobalRequestSurface, mint_global_request_id}; // Consumed by the unix-only daemon git-watch maintenance path; on other // targets only the module's tests reference it. @@ -669,10 +669,10 @@ fn check_user_config( "Worldwide counter upload setting unavailable from canonical configuration: {error}" )), } - if let Some(config_path) = crate::user_config::config_path() + if let Some(config_path) = tracedecay_usecases::user_config::config_path() && config_path.exists() { - let config = crate::user_config::UserConfig::load(); + let config = tracedecay_usecases::user_config::UserConfig::load(); if config.pending_upload > 0 { dc.info(&format!("Pending upload: {} tokens", config.pending_upload)); } diff --git a/src/doctor/registry_drift.rs b/crates/tracedecay/src/doctor/registry_drift.rs similarity index 100% rename from src/doctor/registry_drift.rs rename to crates/tracedecay/src/doctor/registry_drift.rs diff --git a/src/doctor/tests.rs b/crates/tracedecay/src/doctor/tests.rs similarity index 100% rename from src/doctor/tests.rs rename to crates/tracedecay/src/doctor/tests.rs diff --git a/src/errors.rs b/crates/tracedecay/src/errors.rs similarity index 100% rename from src/errors.rs rename to crates/tracedecay/src/errors.rs diff --git a/src/external_tools.rs b/crates/tracedecay/src/external_tools.rs similarity index 100% rename from src/external_tools.rs rename to crates/tracedecay/src/external_tools.rs diff --git a/src/git.rs b/crates/tracedecay/src/git.rs similarity index 100% rename from src/git.rs rename to crates/tracedecay/src/git.rs diff --git a/src/git_index_transactions.rs b/crates/tracedecay/src/git_index_transactions.rs similarity index 100% rename from src/git_index_transactions.rs rename to crates/tracedecay/src/git_index_transactions.rs diff --git a/src/git_index_transactions/patch.rs b/crates/tracedecay/src/git_index_transactions/patch.rs similarity index 100% rename from src/git_index_transactions/patch.rs rename to crates/tracedecay/src/git_index_transactions/patch.rs diff --git a/src/git_index_transactions/process.rs b/crates/tracedecay/src/git_index_transactions/process.rs similarity index 100% rename from src/git_index_transactions/process.rs rename to crates/tracedecay/src/git_index_transactions/process.rs diff --git a/src/git_index_transactions/safety.rs b/crates/tracedecay/src/git_index_transactions/safety.rs similarity index 100% rename from src/git_index_transactions/safety.rs rename to crates/tracedecay/src/git_index_transactions/safety.rs diff --git a/src/git_index_transactions/tests.rs b/crates/tracedecay/src/git_index_transactions/tests.rs similarity index 100% rename from src/git_index_transactions/tests.rs rename to crates/tracedecay/src/git_index_transactions/tests.rs diff --git a/src/global_db.rs b/crates/tracedecay/src/global_db.rs similarity index 100% rename from src/global_db.rs rename to crates/tracedecay/src/global_db.rs diff --git a/src/graph/git.rs b/crates/tracedecay/src/graph/git.rs similarity index 100% rename from src/graph/git.rs rename to crates/tracedecay/src/graph/git.rs diff --git a/src/graph/health.rs b/crates/tracedecay/src/graph/health.rs similarity index 99% rename from src/graph/health.rs rename to crates/tracedecay/src/graph/health.rs index 65f3336119..4cb20f7224 100644 --- a/src/graph/health.rs +++ b/crates/tracedecay/src/graph/health.rs @@ -9,7 +9,7 @@ pub mod test_risk; use std::collections::{HashMap, HashSet, VecDeque}; use std::hash::BuildHasher; -use super::scc::tarjan_scc; +use tracedecay_usecases::graph::scc::tarjan_scc; // The four structural-health value types are the shared authority in // `tracedecay-usecases`; re-export them so root callers keep a single type diff --git a/src/graph/health/test_risk.rs b/crates/tracedecay/src/graph/health/test_risk.rs similarity index 100% rename from src/graph/health/test_risk.rs rename to crates/tracedecay/src/graph/health/test_risk.rs diff --git a/src/graph/mod.rs b/crates/tracedecay/src/graph/mod.rs similarity index 55% rename from src/graph/mod.rs rename to crates/tracedecay/src/graph/mod.rs index 5d6ba50adb..656c81d6b1 100644 --- a/src/graph/mod.rs +++ b/crates/tracedecay/src/graph/mod.rs @@ -1,9 +1,3 @@ -/// Query operations for analyzing the code graph. -pub mod queries; - -/// Tarjan's strongly-connected-components algorithm. -pub mod scc; - /// Structural health analysis algorithms. pub mod health; @@ -13,4 +7,4 @@ pub mod git; /// AST-level functional-duplicate scanning over the code graph. pub mod redundancy_scan; -pub use queries::GraphQueryManager; +pub use tracedecay_usecases::graph::queries::GraphQueryManager; diff --git a/src/graph/redundancy_scan.rs b/crates/tracedecay/src/graph/redundancy_scan.rs similarity index 99% rename from src/graph/redundancy_scan.rs rename to crates/tracedecay/src/graph/redundancy_scan.rs index e34f0b6409..f482b7d62d 100644 --- a/src/graph/redundancy_scan.rs +++ b/crates/tracedecay/src/graph/redundancy_scan.rs @@ -1270,7 +1270,7 @@ mod tests { #[test] fn active_generation_classifies_semantic_only_pair_as_analogue() { let fixture: Value = serde_json::from_str(include_str!( - "../../tests/fixtures/redundancy_eval_labeled.json" + "../../../../tests/fixtures/redundancy_eval_labeled.json" )) .unwrap(); let labelled = fixture["cases"] diff --git a/src/hint_outcomes.rs b/crates/tracedecay/src/hint_outcomes.rs similarity index 100% rename from src/hint_outcomes.rs rename to crates/tracedecay/src/hint_outcomes.rs diff --git a/src/hooks.rs b/crates/tracedecay/src/hooks.rs similarity index 100% rename from src/hooks.rs rename to crates/tracedecay/src/hooks.rs diff --git a/src/host_admission.rs b/crates/tracedecay/src/host_admission.rs similarity index 100% rename from src/host_admission.rs rename to crates/tracedecay/src/host_admission.rs diff --git a/src/host_admission/accounting_test_support.rs b/crates/tracedecay/src/host_admission/accounting_test_support.rs similarity index 100% rename from src/host_admission/accounting_test_support.rs rename to crates/tracedecay/src/host_admission/accounting_test_support.rs diff --git a/src/host_admission/integration_test_support.rs b/crates/tracedecay/src/host_admission/integration_test_support.rs similarity index 98% rename from src/host_admission/integration_test_support.rs rename to crates/tracedecay/src/host_admission/integration_test_support.rs index ad18f681fa..5e8f20dbe4 100644 --- a/src/host_admission/integration_test_support.rs +++ b/crates/tracedecay/src/host_admission/integration_test_support.rs @@ -317,8 +317,8 @@ impl HostAdmissionTestRuntimeV1 { let binding_identity = binding .immutable_identity() .map_err(external_source_read_failed)?; - let idempotency_key = crate::request_identity::derive_logical_effect_idempotency( - crate::request_identity::LogicalEffectIdempotencyDomain::HostObservation, + let idempotency_key = tracedecay_usecases::request_identity::derive_logical_effect_idempotency( + tracedecay_usecases::request_identity::LogicalEffectIdempotencyDomain::HostObservation, observation.observation().observation_id(), ) .map_err(external_source_read_failed)?; diff --git a/src/host_admission/lcm_api_test_support.rs b/crates/tracedecay/src/host_admission/lcm_api_test_support.rs similarity index 100% rename from src/host_admission/lcm_api_test_support.rs rename to crates/tracedecay/src/host_admission/lcm_api_test_support.rs diff --git a/src/host_admission/lcm_fixture_test_support.rs b/crates/tracedecay/src/host_admission/lcm_fixture_test_support.rs similarity index 100% rename from src/host_admission/lcm_fixture_test_support.rs rename to crates/tracedecay/src/host_admission/lcm_fixture_test_support.rs diff --git a/src/host_admission/profile_registry_test_support.rs b/crates/tracedecay/src/host_admission/profile_registry_test_support.rs similarity index 100% rename from src/host_admission/profile_registry_test_support.rs rename to crates/tracedecay/src/host_admission/profile_registry_test_support.rs diff --git a/src/host_admission/session_test_support.rs b/crates/tracedecay/src/host_admission/session_test_support.rs similarity index 100% rename from src/host_admission/session_test_support.rs rename to crates/tracedecay/src/host_admission/session_test_support.rs diff --git a/src/host_admission/verified_graph_test_support.rs b/crates/tracedecay/src/host_admission/verified_graph_test_support.rs similarity index 100% rename from src/host_admission/verified_graph_test_support.rs rename to crates/tracedecay/src/host_admission/verified_graph_test_support.rs diff --git a/src/host_admission_test.rs b/crates/tracedecay/src/host_admission_test.rs similarity index 100% rename from src/host_admission_test.rs rename to crates/tracedecay/src/host_admission_test.rs diff --git a/src/lib.rs b/crates/tracedecay/src/lib.rs similarity index 95% rename from src/lib.rs rename to crates/tracedecay/src/lib.rs index 498bb1babd..85196b33e4 100644 --- a/src/lib.rs +++ b/crates/tracedecay/src/lib.rs @@ -50,6 +50,9 @@ pub mod analytics_bridge; pub mod application_output; pub mod application_surface; pub(crate) mod hint_outcomes; +// Fixture surface for integration tests, assembled by the composition root. +// Gated so a default or `production` build carries none of it. +#[cfg(any(test, feature = "test-helpers"))] pub mod host_admission; pub use tracedecay_code_index::ast_grep_search; pub mod bench; @@ -67,19 +70,14 @@ pub mod daemon_client; pub mod daemon_contract; pub mod dashboard; pub mod db; -pub mod diagnose; pub mod diagnostics; pub(crate) use diagnostics::lsp::semantic::production_semantic_authorities; -pub mod diagnostics_publication; -pub mod diagnostics_query; -pub mod diagnostics_store; pub mod display; pub mod doctor; pub mod errors; pub mod external_tools; pub mod git; mod git_index_transactions; -pub mod git_intelligence; pub use tracedecay_usecases::git_query; pub mod global_db; pub mod graph; @@ -96,7 +94,6 @@ pub mod profile_backup; pub mod profile_registry_maintenance; pub mod project_registry; pub mod redundancy; -pub mod request_identity; pub mod resolution; pub mod retention; pub mod runtime_identity; @@ -124,7 +121,6 @@ pub mod timeutil; pub mod tracedecay; pub mod types; pub mod upgrade; -pub mod user_config; pub mod version; pub mod work_cli; pub mod workflow_cli; diff --git a/src/lifecycle_lease.rs b/crates/tracedecay/src/lifecycle_lease.rs similarity index 100% rename from src/lifecycle_lease.rs rename to crates/tracedecay/src/lifecycle_lease.rs diff --git a/src/mcp/hook_events.rs b/crates/tracedecay/src/mcp/hook_events.rs similarity index 99% rename from src/mcp/hook_events.rs rename to crates/tracedecay/src/mcp/hook_events.rs index e265b9bae3..a65785536f 100644 --- a/src/mcp/hook_events.rs +++ b/crates/tracedecay/src/mcp/hook_events.rs @@ -123,7 +123,7 @@ impl HookEvent { format!( "{}:{}", self.agent.as_wire(), - crate::context::read_cache::digest_bytes(&identity) + tracedecay_usecases::context::read_cache::digest_bytes(&identity) ) } } diff --git a/src/mcp/mod.rs b/crates/tracedecay/src/mcp/mod.rs similarity index 100% rename from src/mcp/mod.rs rename to crates/tracedecay/src/mcp/mod.rs diff --git a/src/mcp/project_route.rs b/crates/tracedecay/src/mcp/project_route.rs similarity index 100% rename from src/mcp/project_route.rs rename to crates/tracedecay/src/mcp/project_route.rs diff --git a/src/mcp/response_handles.rs b/crates/tracedecay/src/mcp/response_handles.rs similarity index 100% rename from src/mcp/response_handles.rs rename to crates/tracedecay/src/mcp/response_handles.rs diff --git a/src/mcp/scope.rs b/crates/tracedecay/src/mcp/scope.rs similarity index 100% rename from src/mcp/scope.rs rename to crates/tracedecay/src/mcp/scope.rs diff --git a/src/mcp/server.rs b/crates/tracedecay/src/mcp/server.rs similarity index 99% rename from src/mcp/server.rs rename to crates/tracedecay/src/mcp/server.rs index 16b83dce6c..4fe2265be2 100644 --- a/src/mcp/server.rs +++ b/crates/tracedecay/src/mcp/server.rs @@ -18,7 +18,6 @@ use crate::mcp::response_handles::{cleanup_expired_response_handles, response_ha use crate::mcp::tool_analytics::{ McpToolAnalyticsEvent, hook_route_analytics_event, mcp_tool_analytics_event, }; -use crate::request_identity::McpConnectionIdentityAuthority; use crate::tracedecay::TraceDecay; use tracedecay_sessions::runtime::git_correlation::{ self as git_correlation, DEFAULT_SPAN_MERGE_GAP_SECS, DEFAULT_SPAN_OBSERVATION_DEBOUNCE_SECS, @@ -27,6 +26,7 @@ use tracedecay_sessions::runtime::git_correlation::{ use tracedecay_usecases::host_admission::{ HostAdmissionOutcome, HostAdmissionStatus, TerminalReason, is_wire_oversized_io_error, }; +use tracedecay_usecases::request_identity::McpConnectionIdentityAuthority; use super::hook_events::{self, HookAgent, HookEventPlan}; use super::tools::{ @@ -127,8 +127,9 @@ pub(crate) type CodeIndexReconcileSink = /// `CodeIndexSchedulerRegistryV1`; direct (non-daemon) servers leave it `None`, /// and a producer without it publishes nothing rather than minting its own file /// identity. -pub(crate) type CodeIndexPublicationIdentityResolver = - Arc; +pub(crate) type CodeIndexPublicationIdentityResolver = Arc< + dyn tracedecay_usecases::diagnostics_publication::CodeIndexPublicationIdentityPortV1 + 'static, +>; /// Code-index search boundary contracts, owned by the query kernel. /// @@ -607,6 +608,7 @@ impl McpServer { /// before it ever reaches the spool, which is a fixture gap rather than /// the daemon's behaviour. #[cfg(any(test, feature = "test-transport"))] + #[allow(clippy::expect_used)] #[doc(hidden)] pub(crate) async fn new_with_registered_test_context( mut context: McpServerConstructionContext, @@ -1353,7 +1355,7 @@ fn json_rpc_request_id_string(id: &Value) -> Option { } fn application_surface_request_id(id: &Value, connection_scope: &str) -> Option { - crate::request_identity::mcp_connection_request_id(id, connection_scope) + tracedecay_usecases::request_identity::mcp_connection_request_id(id, connection_scope) .map(|request_id| request_id.as_str().to_owned()) } diff --git a/src/mcp/server/background_refresh_writer_tests.rs b/crates/tracedecay/src/mcp/server/background_refresh_writer_tests.rs similarity index 100% rename from src/mcp/server/background_refresh_writer_tests.rs rename to crates/tracedecay/src/mcp/server/background_refresh_writer_tests.rs diff --git a/src/mcp/server/connection.rs b/crates/tracedecay/src/mcp/server/connection.rs similarity index 99% rename from src/mcp/server/connection.rs rename to crates/tracedecay/src/mcp/server/connection.rs index c68d9583c7..81c938692a 100644 --- a/src/mcp/server/connection.rs +++ b/crates/tracedecay/src/mcp/server/connection.rs @@ -919,7 +919,7 @@ impl McpServer { let delta = tokens_saved - last_flushed; match self.canonical_upload_enabled().await { Ok(upload_enabled) => { - let mut config = crate::user_config::UserConfig::load(); + let mut config = tracedecay_usecases::user_config::UserConfig::load(); config.pending_upload += delta; if upload_enabled && let Some(_total) = diff --git a/src/mcp/server/connection/response_delivery.rs b/crates/tracedecay/src/mcp/server/connection/response_delivery.rs similarity index 100% rename from src/mcp/server/connection/response_delivery.rs rename to crates/tracedecay/src/mcp/server/connection/response_delivery.rs diff --git a/src/mcp/server/construction.rs b/crates/tracedecay/src/mcp/server/construction.rs similarity index 100% rename from src/mcp/server/construction.rs rename to crates/tracedecay/src/mcp/server/construction.rs diff --git a/src/mcp/server/dispatch_settlement.rs b/crates/tracedecay/src/mcp/server/dispatch_settlement.rs similarity index 100% rename from src/mcp/server/dispatch_settlement.rs rename to crates/tracedecay/src/mcp/server/dispatch_settlement.rs diff --git a/src/mcp/server/freshness_tests.rs b/crates/tracedecay/src/mcp/server/freshness_tests.rs similarity index 100% rename from src/mcp/server/freshness_tests.rs rename to crates/tracedecay/src/mcp/server/freshness_tests.rs diff --git a/src/mcp/server/hook_boundary_failure_matrix_tests.rs b/crates/tracedecay/src/mcp/server/hook_boundary_failure_matrix_tests.rs similarity index 100% rename from src/mcp/server/hook_boundary_failure_matrix_tests.rs rename to crates/tracedecay/src/mcp/server/hook_boundary_failure_matrix_tests.rs diff --git a/src/mcp/server/hook_dispatch.rs b/crates/tracedecay/src/mcp/server/hook_dispatch.rs similarity index 100% rename from src/mcp/server/hook_dispatch.rs rename to crates/tracedecay/src/mcp/server/hook_dispatch.rs diff --git a/src/mcp/server/hook_writes.rs b/crates/tracedecay/src/mcp/server/hook_writes.rs similarity index 100% rename from src/mcp/server/hook_writes.rs rename to crates/tracedecay/src/mcp/server/hook_writes.rs diff --git a/src/mcp/server/host_admission_tests.rs b/crates/tracedecay/src/mcp/server/host_admission_tests.rs similarity index 100% rename from src/mcp/server/host_admission_tests.rs rename to crates/tracedecay/src/mcp/server/host_admission_tests.rs diff --git a/src/mcp/server/lcm_claude_recall_tests.rs b/crates/tracedecay/src/mcp/server/lcm_claude_recall_tests.rs similarity index 100% rename from src/mcp/server/lcm_claude_recall_tests.rs rename to crates/tracedecay/src/mcp/server/lcm_claude_recall_tests.rs diff --git a/src/mcp/server/ledger.rs b/crates/tracedecay/src/mcp/server/ledger.rs similarity index 99% rename from src/mcp/server/ledger.rs rename to crates/tracedecay/src/mcp/server/ledger.rs index 7e9137a491..ff40c75132 100644 --- a/src/mcp/server/ledger.rs +++ b/crates/tracedecay/src/mcp/server/ledger.rs @@ -293,7 +293,7 @@ impl McpServer { }; let success = tokio::task::spawn_blocking(move || { - let mut config = crate::user_config::UserConfig::load(); + let mut config = tracedecay_usecases::user_config::UserConfig::load(); config.pending_upload += delta; if upload_enabled && crate::cloud::flush_pending(config.pending_upload).is_some() { config.pending_upload = 0; diff --git a/src/mcp/server/lifecycle.rs b/crates/tracedecay/src/mcp/server/lifecycle.rs similarity index 100% rename from src/mcp/server/lifecycle.rs rename to crates/tracedecay/src/mcp/server/lifecycle.rs diff --git a/src/mcp/server/live_transcript_refresh.rs b/crates/tracedecay/src/mcp/server/live_transcript_refresh.rs similarity index 100% rename from src/mcp/server/live_transcript_refresh.rs rename to crates/tracedecay/src/mcp/server/live_transcript_refresh.rs diff --git a/src/mcp/server/project_host_admission_replay.rs b/crates/tracedecay/src/mcp/server/project_host_admission_replay.rs similarity index 100% rename from src/mcp/server/project_host_admission_replay.rs rename to crates/tracedecay/src/mcp/server/project_host_admission_replay.rs diff --git a/src/mcp/server/project_open_access.rs b/crates/tracedecay/src/mcp/server/project_open_access.rs similarity index 100% rename from src/mcp/server/project_open_access.rs rename to crates/tracedecay/src/mcp/server/project_open_access.rs diff --git a/src/mcp/server/project_registry.rs b/crates/tracedecay/src/mcp/server/project_registry.rs similarity index 100% rename from src/mcp/server/project_registry.rs rename to crates/tracedecay/src/mcp/server/project_registry.rs diff --git a/src/mcp/server/protocol.rs b/crates/tracedecay/src/mcp/server/protocol.rs similarity index 100% rename from src/mcp/server/protocol.rs rename to crates/tracedecay/src/mcp/server/protocol.rs diff --git a/src/mcp/server/query_scope_tests.rs b/crates/tracedecay/src/mcp/server/query_scope_tests.rs similarity index 100% rename from src/mcp/server/query_scope_tests.rs rename to crates/tracedecay/src/mcp/server/query_scope_tests.rs diff --git a/src/mcp/server/read_coalescing.rs b/crates/tracedecay/src/mcp/server/read_coalescing.rs similarity index 100% rename from src/mcp/server/read_coalescing.rs rename to crates/tracedecay/src/mcp/server/read_coalescing.rs diff --git a/src/mcp/server/requests.rs b/crates/tracedecay/src/mcp/server/requests.rs similarity index 100% rename from src/mcp/server/requests.rs rename to crates/tracedecay/src/mcp/server/requests.rs diff --git a/src/mcp/server/requests/tool_dispatch.rs b/crates/tracedecay/src/mcp/server/requests/tool_dispatch.rs similarity index 100% rename from src/mcp/server/requests/tool_dispatch.rs rename to crates/tracedecay/src/mcp/server/requests/tool_dispatch.rs diff --git a/src/mcp/server/rmcp.rs b/crates/tracedecay/src/mcp/server/rmcp.rs similarity index 100% rename from src/mcp/server/rmcp.rs rename to crates/tracedecay/src/mcp/server/rmcp.rs diff --git a/src/mcp/server/routing.rs b/crates/tracedecay/src/mcp/server/routing.rs similarity index 100% rename from src/mcp/server/routing.rs rename to crates/tracedecay/src/mcp/server/routing.rs diff --git a/src/mcp/server/session_refresh.rs b/crates/tracedecay/src/mcp/server/session_refresh.rs similarity index 100% rename from src/mcp/server/session_refresh.rs rename to crates/tracedecay/src/mcp/server/session_refresh.rs diff --git a/src/mcp/server/staleness.rs b/crates/tracedecay/src/mcp/server/staleness.rs similarity index 100% rename from src/mcp/server/staleness.rs rename to crates/tracedecay/src/mcp/server/staleness.rs diff --git a/src/mcp/server/staleness_banner_tests.rs b/crates/tracedecay/src/mcp/server/staleness_banner_tests.rs similarity index 100% rename from src/mcp/server/staleness_banner_tests.rs rename to crates/tracedecay/src/mcp/server/staleness_banner_tests.rs diff --git a/src/mcp/server/status_resource.rs b/crates/tracedecay/src/mcp/server/status_resource.rs similarity index 100% rename from src/mcp/server/status_resource.rs rename to crates/tracedecay/src/mcp/server/status_resource.rs diff --git a/src/mcp/server/tool_errors.rs b/crates/tracedecay/src/mcp/server/tool_errors.rs similarity index 100% rename from src/mcp/server/tool_errors.rs rename to crates/tracedecay/src/mcp/server/tool_errors.rs diff --git a/src/mcp/server/work_evidence_mount_tests.rs b/crates/tracedecay/src/mcp/server/work_evidence_mount_tests.rs similarity index 100% rename from src/mcp/server/work_evidence_mount_tests.rs rename to crates/tracedecay/src/mcp/server/work_evidence_mount_tests.rs diff --git a/src/mcp/server/workflow_index.rs b/crates/tracedecay/src/mcp/server/workflow_index.rs similarity index 100% rename from src/mcp/server/workflow_index.rs rename to crates/tracedecay/src/mcp/server/workflow_index.rs diff --git a/src/mcp/server/writer_test_support.rs b/crates/tracedecay/src/mcp/server/writer_test_support.rs similarity index 100% rename from src/mcp/server/writer_test_support.rs rename to crates/tracedecay/src/mcp/server/writer_test_support.rs diff --git a/src/mcp/tool_analytics.rs b/crates/tracedecay/src/mcp/tool_analytics.rs similarity index 100% rename from src/mcp/tool_analytics.rs rename to crates/tracedecay/src/mcp/tool_analytics.rs diff --git a/src/mcp/tool_call_deadline.rs b/crates/tracedecay/src/mcp/tool_call_deadline.rs similarity index 100% rename from src/mcp/tool_call_deadline.rs rename to crates/tracedecay/src/mcp/tool_call_deadline.rs diff --git a/src/mcp/tools/binding.rs b/crates/tracedecay/src/mcp/tools/binding.rs similarity index 100% rename from src/mcp/tools/binding.rs rename to crates/tracedecay/src/mcp/tools/binding.rs diff --git a/src/mcp/tools/binding/work.rs b/crates/tracedecay/src/mcp/tools/binding/work.rs similarity index 100% rename from src/mcp/tools/binding/work.rs rename to crates/tracedecay/src/mcp/tools/binding/work.rs diff --git a/src/mcp/tools/binding/workflow.rs b/crates/tracedecay/src/mcp/tools/binding/workflow.rs similarity index 100% rename from src/mcp/tools/binding/workflow.rs rename to crates/tracedecay/src/mcp/tools/binding/workflow.rs diff --git a/src/mcp/tools/definitions.rs b/crates/tracedecay/src/mcp/tools/definitions.rs similarity index 100% rename from src/mcp/tools/definitions.rs rename to crates/tracedecay/src/mcp/tools/definitions.rs diff --git a/src/mcp/tools/definitions/admin.rs b/crates/tracedecay/src/mcp/tools/definitions/admin.rs similarity index 100% rename from src/mcp/tools/definitions/admin.rs rename to crates/tracedecay/src/mcp/tools/definitions/admin.rs diff --git a/src/mcp/tools/definitions/analysis.rs b/crates/tracedecay/src/mcp/tools/definitions/analysis.rs similarity index 100% rename from src/mcp/tools/definitions/analysis.rs rename to crates/tracedecay/src/mcp/tools/definitions/analysis.rs diff --git a/src/mcp/tools/definitions/application.rs b/crates/tracedecay/src/mcp/tools/definitions/application.rs similarity index 100% rename from src/mcp/tools/definitions/application.rs rename to crates/tracedecay/src/mcp/tools/definitions/application.rs diff --git a/src/mcp/tools/definitions/application_schema.rs b/crates/tracedecay/src/mcp/tools/definitions/application_schema.rs similarity index 100% rename from src/mcp/tools/definitions/application_schema.rs rename to crates/tracedecay/src/mcp/tools/definitions/application_schema.rs diff --git a/src/mcp/tools/definitions/ast_grep.rs b/crates/tracedecay/src/mcp/tools/definitions/ast_grep.rs similarity index 100% rename from src/mcp/tools/definitions/ast_grep.rs rename to crates/tracedecay/src/mcp/tools/definitions/ast_grep.rs diff --git a/src/mcp/tools/definitions/edit.rs b/crates/tracedecay/src/mcp/tools/definitions/edit.rs similarity index 100% rename from src/mcp/tools/definitions/edit.rs rename to crates/tracedecay/src/mcp/tools/definitions/edit.rs diff --git a/src/mcp/tools/definitions/git.rs b/crates/tracedecay/src/mcp/tools/definitions/git.rs similarity index 100% rename from src/mcp/tools/definitions/git.rs rename to crates/tracedecay/src/mcp/tools/definitions/git.rs diff --git a/src/mcp/tools/definitions/git_scope.rs b/crates/tracedecay/src/mcp/tools/definitions/git_scope.rs similarity index 100% rename from src/mcp/tools/definitions/git_scope.rs rename to crates/tracedecay/src/mcp/tools/definitions/git_scope.rs diff --git a/src/mcp/tools/definitions/github_stack.rs b/crates/tracedecay/src/mcp/tools/definitions/github_stack.rs similarity index 100% rename from src/mcp/tools/definitions/github_stack.rs rename to crates/tracedecay/src/mcp/tools/definitions/github_stack.rs diff --git a/src/mcp/tools/definitions/graph.rs b/crates/tracedecay/src/mcp/tools/definitions/graph.rs similarity index 100% rename from src/mcp/tools/definitions/graph.rs rename to crates/tracedecay/src/mcp/tools/definitions/graph.rs diff --git a/src/mcp/tools/definitions/lcm.rs b/crates/tracedecay/src/mcp/tools/definitions/lcm.rs similarity index 100% rename from src/mcp/tools/definitions/lcm.rs rename to crates/tracedecay/src/mcp/tools/definitions/lcm.rs diff --git a/src/mcp/tools/definitions/memory.rs b/crates/tracedecay/src/mcp/tools/definitions/memory.rs similarity index 100% rename from src/mcp/tools/definitions/memory.rs rename to crates/tracedecay/src/mcp/tools/definitions/memory.rs diff --git a/src/mcp/tools/definitions/multi_root.rs b/crates/tracedecay/src/mcp/tools/definitions/multi_root.rs similarity index 100% rename from src/mcp/tools/definitions/multi_root.rs rename to crates/tracedecay/src/mcp/tools/definitions/multi_root.rs diff --git a/src/mcp/tools/definitions/native_integration.rs b/crates/tracedecay/src/mcp/tools/definitions/native_integration.rs similarity index 100% rename from src/mcp/tools/definitions/native_integration.rs rename to crates/tracedecay/src/mcp/tools/definitions/native_integration.rs diff --git a/src/mcp/tools/definitions/native_worktree.rs b/crates/tracedecay/src/mcp/tools/definitions/native_worktree.rs similarity index 100% rename from src/mcp/tools/definitions/native_worktree.rs rename to crates/tracedecay/src/mcp/tools/definitions/native_worktree.rs diff --git a/src/mcp/tools/definitions/observatory.rs b/crates/tracedecay/src/mcp/tools/definitions/observatory.rs similarity index 100% rename from src/mcp/tools/definitions/observatory.rs rename to crates/tracedecay/src/mcp/tools/definitions/observatory.rs diff --git a/src/mcp/tools/definitions/session.rs b/crates/tracedecay/src/mcp/tools/definitions/session.rs similarity index 100% rename from src/mcp/tools/definitions/session.rs rename to crates/tracedecay/src/mcp/tools/definitions/session.rs diff --git a/src/mcp/tools/definitions/skills.rs b/crates/tracedecay/src/mcp/tools/definitions/skills.rs similarity index 100% rename from src/mcp/tools/definitions/skills.rs rename to crates/tracedecay/src/mcp/tools/definitions/skills.rs diff --git a/src/mcp/tools/definitions/testing.rs b/crates/tracedecay/src/mcp/tools/definitions/testing.rs similarity index 100% rename from src/mcp/tools/definitions/testing.rs rename to crates/tracedecay/src/mcp/tools/definitions/testing.rs diff --git a/src/mcp/tools/definitions/tests.rs b/crates/tracedecay/src/mcp/tools/definitions/tests.rs similarity index 100% rename from src/mcp/tools/definitions/tests.rs rename to crates/tracedecay/src/mcp/tools/definitions/tests.rs diff --git a/src/mcp/tools/definitions/work.rs b/crates/tracedecay/src/mcp/tools/definitions/work.rs similarity index 100% rename from src/mcp/tools/definitions/work.rs rename to crates/tracedecay/src/mcp/tools/definitions/work.rs diff --git a/src/mcp/tools/definitions/workflow.rs b/crates/tracedecay/src/mcp/tools/definitions/workflow.rs similarity index 100% rename from src/mcp/tools/definitions/workflow.rs rename to crates/tracedecay/src/mcp/tools/definitions/workflow.rs diff --git a/src/mcp/tools/dispatch.rs b/crates/tracedecay/src/mcp/tools/dispatch.rs similarity index 100% rename from src/mcp/tools/dispatch.rs rename to crates/tracedecay/src/mcp/tools/dispatch.rs diff --git a/src/mcp/tools/handlers/admin_cli.rs b/crates/tracedecay/src/mcp/tools/handlers/admin_cli.rs similarity index 100% rename from src/mcp/tools/handlers/admin_cli.rs rename to crates/tracedecay/src/mcp/tools/handlers/admin_cli.rs diff --git a/src/mcp/tools/handlers/admin_project.rs b/crates/tracedecay/src/mcp/tools/handlers/admin_project.rs similarity index 100% rename from src/mcp/tools/handlers/admin_project.rs rename to crates/tracedecay/src/mcp/tools/handlers/admin_project.rs diff --git a/src/mcp/tools/handlers/analysis/circular.rs b/crates/tracedecay/src/mcp/tools/handlers/analysis/circular.rs similarity index 100% rename from src/mcp/tools/handlers/analysis/circular.rs rename to crates/tracedecay/src/mcp/tools/handlers/analysis/circular.rs diff --git a/src/mcp/tools/handlers/analysis/complexity.rs b/crates/tracedecay/src/mcp/tools/handlers/analysis/complexity.rs similarity index 100% rename from src/mcp/tools/handlers/analysis/complexity.rs rename to crates/tracedecay/src/mcp/tools/handlers/analysis/complexity.rs diff --git a/src/mcp/tools/handlers/analysis/constructors.rs b/crates/tracedecay/src/mcp/tools/handlers/analysis/constructors.rs similarity index 100% rename from src/mcp/tools/handlers/analysis/constructors.rs rename to crates/tracedecay/src/mcp/tools/handlers/analysis/constructors.rs diff --git a/src/mcp/tools/handlers/analysis/dead_code.rs b/crates/tracedecay/src/mcp/tools/handlers/analysis/dead_code.rs similarity index 100% rename from src/mcp/tools/handlers/analysis/dead_code.rs rename to crates/tracedecay/src/mcp/tools/handlers/analysis/dead_code.rs diff --git a/src/mcp/tools/handlers/analysis/diagnostics.rs b/crates/tracedecay/src/mcp/tools/handlers/analysis/diagnostics.rs similarity index 100% rename from src/mcp/tools/handlers/analysis/diagnostics.rs rename to crates/tracedecay/src/mcp/tools/handlers/analysis/diagnostics.rs diff --git a/src/mcp/tools/handlers/analysis/field_sites.rs b/crates/tracedecay/src/mcp/tools/handlers/analysis/field_sites.rs similarity index 100% rename from src/mcp/tools/handlers/analysis/field_sites.rs rename to crates/tracedecay/src/mcp/tools/handlers/analysis/field_sites.rs diff --git a/src/mcp/tools/handlers/analysis/hotspots.rs b/crates/tracedecay/src/mcp/tools/handlers/analysis/hotspots.rs similarity index 100% rename from src/mcp/tools/handlers/analysis/hotspots.rs rename to crates/tracedecay/src/mcp/tools/handlers/analysis/hotspots.rs diff --git a/src/mcp/tools/handlers/analysis/imports.rs b/crates/tracedecay/src/mcp/tools/handlers/analysis/imports.rs similarity index 100% rename from src/mcp/tools/handlers/analysis/imports.rs rename to crates/tracedecay/src/mcp/tools/handlers/analysis/imports.rs diff --git a/src/mcp/tools/handlers/analysis/lex.rs b/crates/tracedecay/src/mcp/tools/handlers/analysis/lex.rs similarity index 100% rename from src/mcp/tools/handlers/analysis/lex.rs rename to crates/tracedecay/src/mcp/tools/handlers/analysis/lex.rs diff --git a/src/mcp/tools/handlers/analysis/metrics.rs b/crates/tracedecay/src/mcp/tools/handlers/analysis/metrics.rs similarity index 100% rename from src/mcp/tools/handlers/analysis/metrics.rs rename to crates/tracedecay/src/mcp/tools/handlers/analysis/metrics.rs diff --git a/src/mcp/tools/handlers/analysis/mod.rs b/crates/tracedecay/src/mcp/tools/handlers/analysis/mod.rs similarity index 100% rename from src/mcp/tools/handlers/analysis/mod.rs rename to crates/tracedecay/src/mcp/tools/handlers/analysis/mod.rs diff --git a/src/mcp/tools/handlers/analysis/recursion.rs b/crates/tracedecay/src/mcp/tools/handlers/analysis/recursion.rs similarity index 96% rename from src/mcp/tools/handlers/analysis/recursion.rs rename to crates/tracedecay/src/mcp/tools/handlers/analysis/recursion.rs index 5d5868b380..e49b7e2753 100644 --- a/src/mcp/tools/handlers/analysis/recursion.rs +++ b/crates/tracedecay/src/mcp/tools/handlers/analysis/recursion.rs @@ -37,9 +37,9 @@ pub(crate) async fn handle_recursion( // shorter / more interesting cycles when the cap kicks in. We still need // every cyclic SCC enumerated before sorting (truncating early would bias // toward Tarjan emission order), but we cap the per-SCC path search. - let mut cyclic_sccs: Vec> = crate::graph::scc::tarjan_scc(&adj) + let mut cyclic_sccs: Vec> = tracedecay_usecases::graph::scc::tarjan_scc(&adj) .into_iter() - .filter(|scc| crate::graph::scc::is_cyclic_scc(scc, &adj)) + .filter(|scc| tracedecay_usecases::graph::scc::is_cyclic_scc(scc, &adj)) .collect(); cyclic_sccs.sort_by_key(Vec::len); diff --git a/src/mcp/tools/handlers/analysis/unmounted_files.rs b/crates/tracedecay/src/mcp/tools/handlers/analysis/unmounted_files.rs similarity index 98% rename from src/mcp/tools/handlers/analysis/unmounted_files.rs rename to crates/tracedecay/src/mcp/tools/handlers/analysis/unmounted_files.rs index a5e39efe25..e554953552 100644 --- a/src/mcp/tools/handlers/analysis/unmounted_files.rs +++ b/crates/tracedecay/src/mcp/tools/handlers/analysis/unmounted_files.rs @@ -473,7 +473,11 @@ mod tests { #[test] #[ignore = "walks the entire working tree; run explicitly for a dogfooding pass"] fn this_repository_has_no_unmounted_rust_files() { - let root = Path::new(env!("CARGO_MANIFEST_DIR")); + // Audits this repository, which is the workspace root above the package. + let root = Path::new(env!("CARGO_MANIFEST_DIR")) + .parent() + .and_then(Path::parent) + .expect("workspace root above crates/tracedecay"); let audit = audit_project(root).expect("audit"); for ecosystem in &audit.ecosystems { println!( diff --git a/src/mcp/tools/handlers/analysis/unmounted_files/rust.rs b/crates/tracedecay/src/mcp/tools/handlers/analysis/unmounted_files/rust.rs similarity index 100% rename from src/mcp/tools/handlers/analysis/unmounted_files/rust.rs rename to crates/tracedecay/src/mcp/tools/handlers/analysis/unmounted_files/rust.rs diff --git a/src/mcp/tools/handlers/analysis/unmounted_files/typescript.rs b/crates/tracedecay/src/mcp/tools/handlers/analysis/unmounted_files/typescript.rs similarity index 100% rename from src/mcp/tools/handlers/analysis/unmounted_files/typescript.rs rename to crates/tracedecay/src/mcp/tools/handlers/analysis/unmounted_files/typescript.rs diff --git a/src/mcp/tools/handlers/analysis/unsafe_patterns.rs b/crates/tracedecay/src/mcp/tools/handlers/analysis/unsafe_patterns.rs similarity index 100% rename from src/mcp/tools/handlers/analysis/unsafe_patterns.rs rename to crates/tracedecay/src/mcp/tools/handlers/analysis/unsafe_patterns.rs diff --git a/src/mcp/tools/handlers/analytics.rs b/crates/tracedecay/src/mcp/tools/handlers/analytics.rs similarity index 100% rename from src/mcp/tools/handlers/analytics.rs rename to crates/tracedecay/src/mcp/tools/handlers/analytics.rs diff --git a/src/mcp/tools/handlers/application_surface.rs b/crates/tracedecay/src/mcp/tools/handlers/application_surface.rs similarity index 99% rename from src/mcp/tools/handlers/application_surface.rs rename to crates/tracedecay/src/mcp/tools/handlers/application_surface.rs index 0ef804651b..1471eacd67 100644 --- a/src/mcp/tools/handlers/application_surface.rs +++ b/crates/tracedecay/src/mcp/tools/handlers/application_surface.rs @@ -17,8 +17,8 @@ use crate::mcp::tools::dispatch::{ resolve_mcp_application_surface_for_target, resolve_mcp_application_surface_with_controls_for_target, }; -use crate::request_identity::{GlobalRequestSurface, mint_global_request_id}; use crate::tracedecay::TraceDecay; +use tracedecay_usecases::request_identity::{GlobalRequestSurface, mint_global_request_id}; pub(super) fn request_id() -> Result { mint_global_request_id(GlobalRequestSurface::McpFallback).map_err(|_| TraceDecayError::Config { diff --git a/src/mcp/tools/handlers/ast_grep_search.rs b/crates/tracedecay/src/mcp/tools/handlers/ast_grep_search.rs similarity index 100% rename from src/mcp/tools/handlers/ast_grep_search.rs rename to crates/tracedecay/src/mcp/tools/handlers/ast_grep_search.rs diff --git a/src/mcp/tools/handlers/automation_runs.rs b/crates/tracedecay/src/mcp/tools/handlers/automation_runs.rs similarity index 100% rename from src/mcp/tools/handlers/automation_runs.rs rename to crates/tracedecay/src/mcp/tools/handlers/automation_runs.rs diff --git a/src/mcp/tools/handlers/configuration_dispatch_tests.rs b/crates/tracedecay/src/mcp/tools/handlers/configuration_dispatch_tests.rs similarity index 100% rename from src/mcp/tools/handlers/configuration_dispatch_tests.rs rename to crates/tracedecay/src/mcp/tools/handlers/configuration_dispatch_tests.rs diff --git a/src/mcp/tools/handlers/context_scout_control_dispatch_tests.rs b/crates/tracedecay/src/mcp/tools/handlers/context_scout_control_dispatch_tests.rs similarity index 100% rename from src/mcp/tools/handlers/context_scout_control_dispatch_tests.rs rename to crates/tracedecay/src/mcp/tools/handlers/context_scout_control_dispatch_tests.rs diff --git a/src/mcp/tools/handlers/dashboard.rs b/crates/tracedecay/src/mcp/tools/handlers/dashboard.rs similarity index 99% rename from src/mcp/tools/handlers/dashboard.rs rename to crates/tracedecay/src/mcp/tools/handlers/dashboard.rs index 34d1fc09c5..35b54e0f90 100644 --- a/src/mcp/tools/handlers/dashboard.rs +++ b/crates/tracedecay/src/mcp/tools/handlers/dashboard.rs @@ -109,8 +109,8 @@ impl DashboardProfileCodeIndexWorkerSettingsPort let project_root = self.project_root.clone(); let registrar = self.registrar.clone(); Box::pin(async move { - let request_id = crate::request_identity::mint_global_request_id( - crate::request_identity::GlobalRequestSurface::DashboardSettings, + let request_id = tracedecay_usecases::request_identity::mint_global_request_id( + tracedecay_usecases::request_identity::GlobalRequestSurface::DashboardSettings, ) .map_err(|_| DashboardCodeIndexWorkerSettingsErrorV1::Unavailable)?; let committed = registrar diff --git a/src/mcp/tools/handlers/dashboard/tests.rs b/crates/tracedecay/src/mcp/tools/handlers/dashboard/tests.rs similarity index 100% rename from src/mcp/tools/handlers/dashboard/tests.rs rename to crates/tracedecay/src/mcp/tools/handlers/dashboard/tests.rs diff --git a/src/mcp/tools/handlers/dashboard_delivery.rs b/crates/tracedecay/src/mcp/tools/handlers/dashboard_delivery.rs similarity index 100% rename from src/mcp/tools/handlers/dashboard_delivery.rs rename to crates/tracedecay/src/mcp/tools/handlers/dashboard_delivery.rs diff --git a/src/mcp/tools/handlers/dashboard_git_correlation.rs b/crates/tracedecay/src/mcp/tools/handlers/dashboard_git_correlation.rs similarity index 100% rename from src/mcp/tools/handlers/dashboard_git_correlation.rs rename to crates/tracedecay/src/mcp/tools/handlers/dashboard_git_correlation.rs diff --git a/src/mcp/tools/handlers/dashboard_lcm.rs b/crates/tracedecay/src/mcp/tools/handlers/dashboard_lcm.rs similarity index 100% rename from src/mcp/tools/handlers/dashboard_lcm.rs rename to crates/tracedecay/src/mcp/tools/handlers/dashboard_lcm.rs diff --git a/src/mcp/tools/handlers/dependency_hints.rs b/crates/tracedecay/src/mcp/tools/handlers/dependency_hints.rs similarity index 100% rename from src/mcp/tools/handlers/dependency_hints.rs rename to crates/tracedecay/src/mcp/tools/handlers/dependency_hints.rs diff --git a/src/mcp/tools/handlers/dispatch_controls.rs b/crates/tracedecay/src/mcp/tools/handlers/dispatch_controls.rs similarity index 100% rename from src/mcp/tools/handlers/dispatch_controls.rs rename to crates/tracedecay/src/mcp/tools/handlers/dispatch_controls.rs diff --git a/src/mcp/tools/handlers/dispatch_groups.rs b/crates/tracedecay/src/mcp/tools/handlers/dispatch_groups.rs similarity index 100% rename from src/mcp/tools/handlers/dispatch_groups.rs rename to crates/tracedecay/src/mcp/tools/handlers/dispatch_groups.rs diff --git a/src/mcp/tools/handlers/dispatch_groups/health_dispatch.rs b/crates/tracedecay/src/mcp/tools/handlers/dispatch_groups/health_dispatch.rs similarity index 100% rename from src/mcp/tools/handlers/dispatch_groups/health_dispatch.rs rename to crates/tracedecay/src/mcp/tools/handlers/dispatch_groups/health_dispatch.rs diff --git a/src/mcp/tools/handlers/dispatch_groups/retained_response.rs b/crates/tracedecay/src/mcp/tools/handlers/dispatch_groups/retained_response.rs similarity index 100% rename from src/mcp/tools/handlers/dispatch_groups/retained_response.rs rename to crates/tracedecay/src/mcp/tools/handlers/dispatch_groups/retained_response.rs diff --git a/src/mcp/tools/handlers/dispatch_test_support.rs b/crates/tracedecay/src/mcp/tools/handlers/dispatch_test_support.rs similarity index 100% rename from src/mcp/tools/handlers/dispatch_test_support.rs rename to crates/tracedecay/src/mcp/tools/handlers/dispatch_test_support.rs diff --git a/src/mcp/tools/handlers/dispatch_tests.rs b/crates/tracedecay/src/mcp/tools/handlers/dispatch_tests.rs similarity index 100% rename from src/mcp/tools/handlers/dispatch_tests.rs rename to crates/tracedecay/src/mcp/tools/handlers/dispatch_tests.rs diff --git a/src/mcp/tools/handlers/edit.rs b/crates/tracedecay/src/mcp/tools/handlers/edit.rs similarity index 100% rename from src/mcp/tools/handlers/edit.rs rename to crates/tracedecay/src/mcp/tools/handlers/edit.rs diff --git a/src/mcp/tools/handlers/git/affected.rs b/crates/tracedecay/src/mcp/tools/handlers/git/affected.rs similarity index 100% rename from src/mcp/tools/handlers/git/affected.rs rename to crates/tracedecay/src/mcp/tools/handlers/git/affected.rs diff --git a/src/mcp/tools/handlers/git/branch.rs b/crates/tracedecay/src/mcp/tools/handlers/git/branch.rs similarity index 100% rename from src/mcp/tools/handlers/git/branch.rs rename to crates/tracedecay/src/mcp/tools/handlers/git/branch.rs diff --git a/src/mcp/tools/handlers/git/context.rs b/crates/tracedecay/src/mcp/tools/handlers/git/context.rs similarity index 100% rename from src/mcp/tools/handlers/git/context.rs rename to crates/tracedecay/src/mcp/tools/handlers/git/context.rs diff --git a/src/mcp/tools/handlers/git/mod.rs b/crates/tracedecay/src/mcp/tools/handlers/git/mod.rs similarity index 100% rename from src/mcp/tools/handlers/git/mod.rs rename to crates/tracedecay/src/mcp/tools/handlers/git/mod.rs diff --git a/src/mcp/tools/handlers/git/pr_context_cursor.rs b/crates/tracedecay/src/mcp/tools/handlers/git/pr_context_cursor.rs similarity index 100% rename from src/mcp/tools/handlers/git/pr_context_cursor.rs rename to crates/tracedecay/src/mcp/tools/handlers/git/pr_context_cursor.rs diff --git a/src/mcp/tools/handlers/git/shell.rs b/crates/tracedecay/src/mcp/tools/handlers/git/shell.rs similarity index 100% rename from src/mcp/tools/handlers/git/shell.rs rename to crates/tracedecay/src/mcp/tools/handlers/git/shell.rs diff --git a/src/mcp/tools/handlers/graph.rs b/crates/tracedecay/src/mcp/tools/handlers/graph.rs similarity index 100% rename from src/mcp/tools/handlers/graph.rs rename to crates/tracedecay/src/mcp/tools/handlers/graph.rs diff --git a/src/mcp/tools/handlers/graph/context_support.rs b/crates/tracedecay/src/mcp/tools/handlers/graph/context_support.rs similarity index 100% rename from src/mcp/tools/handlers/graph/context_support.rs rename to crates/tracedecay/src/mcp/tools/handlers/graph/context_support.rs diff --git a/src/mcp/tools/handlers/graph/primitive_surface.rs b/crates/tracedecay/src/mcp/tools/handlers/graph/primitive_surface.rs similarity index 100% rename from src/mcp/tools/handlers/graph/primitive_surface.rs rename to crates/tracedecay/src/mcp/tools/handlers/graph/primitive_surface.rs diff --git a/src/mcp/tools/handlers/graph/search_evidence.rs b/crates/tracedecay/src/mcp/tools/handlers/graph/search_evidence.rs similarity index 100% rename from src/mcp/tools/handlers/graph/search_evidence.rs rename to crates/tracedecay/src/mcp/tools/handlers/graph/search_evidence.rs diff --git a/src/mcp/tools/handlers/graph/verified.rs b/crates/tracedecay/src/mcp/tools/handlers/graph/verified.rs similarity index 100% rename from src/mcp/tools/handlers/graph/verified.rs rename to crates/tracedecay/src/mcp/tools/handlers/graph/verified.rs diff --git a/src/mcp/tools/handlers/grep.rs b/crates/tracedecay/src/mcp/tools/handlers/grep.rs similarity index 100% rename from src/mcp/tools/handlers/grep.rs rename to crates/tracedecay/src/mcp/tools/handlers/grep.rs diff --git a/src/mcp/tools/handlers/health/dsm.rs b/crates/tracedecay/src/mcp/tools/handlers/health/dsm.rs similarity index 100% rename from src/mcp/tools/handlers/health/dsm.rs rename to crates/tracedecay/src/mcp/tools/handlers/health/dsm.rs diff --git a/src/mcp/tools/handlers/health/mod.rs b/crates/tracedecay/src/mcp/tools/handlers/health/mod.rs similarity index 100% rename from src/mcp/tools/handlers/health/mod.rs rename to crates/tracedecay/src/mcp/tools/handlers/health/mod.rs diff --git a/src/mcp/tools/handlers/health/reports.rs b/crates/tracedecay/src/mcp/tools/handlers/health/reports.rs similarity index 100% rename from src/mcp/tools/handlers/health/reports.rs rename to crates/tracedecay/src/mcp/tools/handlers/health/reports.rs diff --git a/src/mcp/tools/handlers/health/runtime.rs b/crates/tracedecay/src/mcp/tools/handlers/health/runtime.rs similarity index 100% rename from src/mcp/tools/handlers/health/runtime.rs rename to crates/tracedecay/src/mcp/tools/handlers/health/runtime.rs diff --git a/src/mcp/tools/handlers/health/test_map.rs b/crates/tracedecay/src/mcp/tools/handlers/health/test_map.rs similarity index 100% rename from src/mcp/tools/handlers/health/test_map.rs rename to crates/tracedecay/src/mcp/tools/handlers/health/test_map.rs diff --git a/src/mcp/tools/handlers/hook_runtime/admission.rs b/crates/tracedecay/src/mcp/tools/handlers/hook_runtime/admission.rs similarity index 100% rename from src/mcp/tools/handlers/hook_runtime/admission.rs rename to crates/tracedecay/src/mcp/tools/handlers/hook_runtime/admission.rs diff --git a/src/mcp/tools/handlers/hook_runtime/admission/tests.rs b/crates/tracedecay/src/mcp/tools/handlers/hook_runtime/admission/tests.rs similarity index 100% rename from src/mcp/tools/handlers/hook_runtime/admission/tests.rs rename to crates/tracedecay/src/mcp/tools/handlers/hook_runtime/admission/tests.rs diff --git a/src/mcp/tools/handlers/hook_runtime/context_scout.rs b/crates/tracedecay/src/mcp/tools/handlers/hook_runtime/context_scout.rs similarity index 100% rename from src/mcp/tools/handlers/hook_runtime/context_scout.rs rename to crates/tracedecay/src/mcp/tools/handlers/hook_runtime/context_scout.rs diff --git a/src/mcp/tools/handlers/hook_runtime/context_scout/tests.rs b/crates/tracedecay/src/mcp/tools/handlers/hook_runtime/context_scout/tests.rs similarity index 100% rename from src/mcp/tools/handlers/hook_runtime/context_scout/tests.rs rename to crates/tracedecay/src/mcp/tools/handlers/hook_runtime/context_scout/tests.rs diff --git a/src/mcp/tools/handlers/hook_runtime/entry_tests.rs b/crates/tracedecay/src/mcp/tools/handlers/hook_runtime/entry_tests.rs similarity index 100% rename from src/mcp/tools/handlers/hook_runtime/entry_tests.rs rename to crates/tracedecay/src/mcp/tools/handlers/hook_runtime/entry_tests.rs diff --git a/src/mcp/tools/handlers/hook_runtime/envelope.rs b/crates/tracedecay/src/mcp/tools/handlers/hook_runtime/envelope.rs similarity index 100% rename from src/mcp/tools/handlers/hook_runtime/envelope.rs rename to crates/tracedecay/src/mcp/tools/handlers/hook_runtime/envelope.rs diff --git a/src/mcp/tools/handlers/hook_runtime/envelope/tests.rs b/crates/tracedecay/src/mcp/tools/handlers/hook_runtime/envelope/tests.rs similarity index 100% rename from src/mcp/tools/handlers/hook_runtime/envelope/tests.rs rename to crates/tracedecay/src/mcp/tools/handlers/hook_runtime/envelope/tests.rs diff --git a/src/mcp/tools/handlers/hook_runtime/errors.rs b/crates/tracedecay/src/mcp/tools/handlers/hook_runtime/errors.rs similarity index 100% rename from src/mcp/tools/handlers/hook_runtime/errors.rs rename to crates/tracedecay/src/mcp/tools/handlers/hook_runtime/errors.rs diff --git a/src/mcp/tools/handlers/hook_runtime/errors/tests.rs b/crates/tracedecay/src/mcp/tools/handlers/hook_runtime/errors/tests.rs similarity index 100% rename from src/mcp/tools/handlers/hook_runtime/errors/tests.rs rename to crates/tracedecay/src/mcp/tools/handlers/hook_runtime/errors/tests.rs diff --git a/src/mcp/tools/handlers/hook_runtime/hermes.rs b/crates/tracedecay/src/mcp/tools/handlers/hook_runtime/hermes.rs similarity index 100% rename from src/mcp/tools/handlers/hook_runtime/hermes.rs rename to crates/tracedecay/src/mcp/tools/handlers/hook_runtime/hermes.rs diff --git a/src/mcp/tools/handlers/hook_runtime/hermes/tests.rs b/crates/tracedecay/src/mcp/tools/handlers/hook_runtime/hermes/tests.rs similarity index 100% rename from src/mcp/tools/handlers/hook_runtime/hermes/tests.rs rename to crates/tracedecay/src/mcp/tools/handlers/hook_runtime/hermes/tests.rs diff --git a/src/mcp/tools/handlers/hook_runtime/ingest.rs b/crates/tracedecay/src/mcp/tools/handlers/hook_runtime/ingest.rs similarity index 100% rename from src/mcp/tools/handlers/hook_runtime/ingest.rs rename to crates/tracedecay/src/mcp/tools/handlers/hook_runtime/ingest.rs diff --git a/src/mcp/tools/handlers/hook_runtime/ingest/kernels.rs b/crates/tracedecay/src/mcp/tools/handlers/hook_runtime/ingest/kernels.rs similarity index 100% rename from src/mcp/tools/handlers/hook_runtime/ingest/kernels.rs rename to crates/tracedecay/src/mcp/tools/handlers/hook_runtime/ingest/kernels.rs diff --git a/src/mcp/tools/handlers/hook_runtime/ingest/tests.rs b/crates/tracedecay/src/mcp/tools/handlers/hook_runtime/ingest/tests.rs similarity index 100% rename from src/mcp/tools/handlers/hook_runtime/ingest/tests.rs rename to crates/tracedecay/src/mcp/tools/handlers/hook_runtime/ingest/tests.rs diff --git a/src/mcp/tools/handlers/hook_runtime/mod.rs b/crates/tracedecay/src/mcp/tools/handlers/hook_runtime/mod.rs similarity index 100% rename from src/mcp/tools/handlers/hook_runtime/mod.rs rename to crates/tracedecay/src/mcp/tools/handlers/hook_runtime/mod.rs diff --git a/src/mcp/tools/handlers/hook_runtime/terminal.rs b/crates/tracedecay/src/mcp/tools/handlers/hook_runtime/terminal.rs similarity index 100% rename from src/mcp/tools/handlers/hook_runtime/terminal.rs rename to crates/tracedecay/src/mcp/tools/handlers/hook_runtime/terminal.rs diff --git a/src/mcp/tools/handlers/hook_runtime/test_support.rs b/crates/tracedecay/src/mcp/tools/handlers/hook_runtime/test_support.rs similarity index 100% rename from src/mcp/tools/handlers/hook_runtime/test_support.rs rename to crates/tracedecay/src/mcp/tools/handlers/hook_runtime/test_support.rs diff --git a/src/mcp/tools/handlers/info/body.rs b/crates/tracedecay/src/mcp/tools/handlers/info/body.rs similarity index 99% rename from src/mcp/tools/handlers/info/body.rs rename to crates/tracedecay/src/mcp/tools/handlers/info/body.rs index f22cba1b67..619cd2e234 100644 --- a/src/mcp/tools/handlers/info/body.rs +++ b/crates/tracedecay/src/mcp/tools/handlers/info/body.rs @@ -95,7 +95,7 @@ pub(crate) async fn handle_body( /// a location line, an optional signature, a token count, and a fenced code /// block tagged with the file's language extension. fn render_body_md(value: &Value) -> String { - use crate::context::read_modes::estimate_tokens; + use tracedecay_usecases::context::read_modes::estimate_tokens; let mut md = Md::new(); let matches = value.get("matches").and_then(Value::as_array); diff --git a/src/mcp/tools/handlers/info/config.rs b/crates/tracedecay/src/mcp/tools/handlers/info/config.rs similarity index 100% rename from src/mcp/tools/handlers/info/config.rs rename to crates/tracedecay/src/mcp/tools/handlers/info/config.rs diff --git a/src/mcp/tools/handlers/info/files.rs b/crates/tracedecay/src/mcp/tools/handlers/info/files.rs similarity index 100% rename from src/mcp/tools/handlers/info/files.rs rename to crates/tracedecay/src/mcp/tools/handlers/info/files.rs diff --git a/src/mcp/tools/handlers/info/mod.rs b/crates/tracedecay/src/mcp/tools/handlers/info/mod.rs similarity index 96% rename from src/mcp/tools/handlers/info/mod.rs rename to crates/tracedecay/src/mcp/tools/handlers/info/mod.rs index 9fb174d29a..e4ae6195ae 100644 --- a/src/mcp/tools/handlers/info/mod.rs +++ b/crates/tracedecay/src/mcp/tools/handlers/info/mod.rs @@ -45,8 +45,6 @@ use tracedecay_usecases::context::markdown_sections::{ SectionEnrichment, is_markdown_file, section_summary_lines, }; -use crate::context::read_modes::{LineRange, ReadMode}; -use crate::context::source_read::{SourceReadRequest, read_source, resolve_indexed_source_file}; use crate::errors::{Result, TraceDecayError}; use crate::global_db::{RegisteredGlobalDb, SessionIngestHealth}; use crate::path_tree::format_compact_annotated_path_list; @@ -54,6 +52,10 @@ use crate::project_registry::{ProjectRegistryView, render_project_registry_view} use crate::storage::{ProjectPath, StorageMode, StoreKind}; use crate::tracedecay::{BranchDiagnostics, TraceDecay}; use crate::types::NodeKind; +use tracedecay_usecases::context::read_modes::{LineRange, ReadMode}; +use tracedecay_usecases::context::source_read::{ + SourceReadRequest, read_source, resolve_indexed_source_file, +}; use self::verified::{ INFO_RELATION_LIMIT, all_symbols, end_line, indexed_files, info_graph_error, diff --git a/src/mcp/tools/handlers/info/outline.rs b/crates/tracedecay/src/mcp/tools/handlers/info/outline.rs similarity index 98% rename from src/mcp/tools/handlers/info/outline.rs rename to crates/tracedecay/src/mcp/tools/handlers/info/outline.rs index 82c5b5f8fc..2a4ae44fe8 100644 --- a/src/mcp/tools/handlers/info/outline.rs +++ b/crates/tracedecay/src/mcp/tools/handlers/info/outline.rs @@ -8,7 +8,7 @@ pub(crate) async fn handle_outline( graph: &crate::tracedecay::queries::graph::VerifiedGraphQuery, args: Value, ) -> Result { - use crate::context::read_modes::render_map; + use tracedecay_usecases::context::read_modes::render_map; let file = args.get("file") diff --git a/src/mcp/tools/handlers/info/port_order.rs b/crates/tracedecay/src/mcp/tools/handlers/info/port_order.rs similarity index 98% rename from src/mcp/tools/handlers/info/port_order.rs rename to crates/tracedecay/src/mcp/tools/handlers/info/port_order.rs index 3f993e888d..6f0068f821 100644 --- a/src/mcp/tools/handlers/info/port_order.rs +++ b/crates/tracedecay/src/mcp/tools/handlers/info/port_order.rs @@ -227,11 +227,11 @@ pub(crate) async fn handle_port_order( .collect(); cycle_adj.insert(node_id, kept); } - let sccs = crate::graph::scc::tarjan_scc(&cycle_adj); + let sccs = tracedecay_usecases::graph::scc::tarjan_scc(&cycle_adj); let mut cycles = Vec::::new(); for scc in sccs { - if !crate::graph::scc::is_cyclic_scc(&scc, &cycle_adj) { + if !tracedecay_usecases::graph::scc::is_cyclic_scc(&scc, &cycle_adj) { continue; } let scc_set: HashSet<&str> = scc.iter().copied().collect(); diff --git a/src/mcp/tools/handlers/info/port_status.rs b/crates/tracedecay/src/mcp/tools/handlers/info/port_status.rs similarity index 100% rename from src/mcp/tools/handlers/info/port_status.rs rename to crates/tracedecay/src/mcp/tools/handlers/info/port_status.rs diff --git a/src/mcp/tools/handlers/info/read.rs b/crates/tracedecay/src/mcp/tools/handlers/info/read.rs similarity index 100% rename from src/mcp/tools/handlers/info/read.rs rename to crates/tracedecay/src/mcp/tools/handlers/info/read.rs diff --git a/src/mcp/tools/handlers/info/registry.rs b/crates/tracedecay/src/mcp/tools/handlers/info/registry.rs similarity index 100% rename from src/mcp/tools/handlers/info/registry.rs rename to crates/tracedecay/src/mcp/tools/handlers/info/registry.rs diff --git a/src/mcp/tools/handlers/info/remote_status.rs b/crates/tracedecay/src/mcp/tools/handlers/info/remote_status.rs similarity index 100% rename from src/mcp/tools/handlers/info/remote_status.rs rename to crates/tracedecay/src/mcp/tools/handlers/info/remote_status.rs diff --git a/src/mcp/tools/handlers/info/signature_search.rs b/crates/tracedecay/src/mcp/tools/handlers/info/signature_search.rs similarity index 100% rename from src/mcp/tools/handlers/info/signature_search.rs rename to crates/tracedecay/src/mcp/tools/handlers/info/signature_search.rs diff --git a/src/mcp/tools/handlers/info/simplify_scan.rs b/crates/tracedecay/src/mcp/tools/handlers/info/simplify_scan.rs similarity index 100% rename from src/mcp/tools/handlers/info/simplify_scan.rs rename to crates/tracedecay/src/mcp/tools/handlers/info/simplify_scan.rs diff --git a/src/mcp/tools/handlers/info/status.rs b/crates/tracedecay/src/mcp/tools/handlers/info/status.rs similarity index 100% rename from src/mcp/tools/handlers/info/status.rs rename to crates/tracedecay/src/mcp/tools/handlers/info/status.rs diff --git a/src/mcp/tools/handlers/info/todos.rs b/crates/tracedecay/src/mcp/tools/handlers/info/todos.rs similarity index 100% rename from src/mcp/tools/handlers/info/todos.rs rename to crates/tracedecay/src/mcp/tools/handlers/info/todos.rs diff --git a/src/mcp/tools/handlers/info/type_hierarchy.rs b/crates/tracedecay/src/mcp/tools/handlers/info/type_hierarchy.rs similarity index 100% rename from src/mcp/tools/handlers/info/type_hierarchy.rs rename to crates/tracedecay/src/mcp/tools/handlers/info/type_hierarchy.rs diff --git a/src/mcp/tools/handlers/info/verified.rs b/crates/tracedecay/src/mcp/tools/handlers/info/verified.rs similarity index 100% rename from src/mcp/tools/handlers/info/verified.rs rename to crates/tracedecay/src/mcp/tools/handlers/info/verified.rs diff --git a/src/mcp/tools/handlers/mod.rs b/crates/tracedecay/src/mcp/tools/handlers/mod.rs similarity index 100% rename from src/mcp/tools/handlers/mod.rs rename to crates/tracedecay/src/mcp/tools/handlers/mod.rs diff --git a/src/mcp/tools/handlers/multi_root.rs b/crates/tracedecay/src/mcp/tools/handlers/multi_root.rs similarity index 99% rename from src/mcp/tools/handlers/multi_root.rs rename to crates/tracedecay/src/mcp/tools/handlers/multi_root.rs index 1ba80355a0..2a21d6d382 100644 --- a/src/mcp/tools/handlers/multi_root.rs +++ b/crates/tracedecay/src/mcp/tools/handlers/multi_root.rs @@ -21,7 +21,7 @@ use crate::daemon_contract::{ }; use crate::errors::{Result, TraceDecayError}; use crate::mcp::tools::ToolResult; -use crate::request_identity::{GlobalRequestSurface, mint_global_request_id}; +use tracedecay_usecases::request_identity::{GlobalRequestSurface, mint_global_request_id}; use super::tool_call_support::json_result; diff --git a/src/mcp/tools/handlers/project_registry.rs b/crates/tracedecay/src/mcp/tools/handlers/project_registry.rs similarity index 100% rename from src/mcp/tools/handlers/project_registry.rs rename to crates/tracedecay/src/mcp/tools/handlers/project_registry.rs diff --git a/src/mcp/tools/handlers/redundancy.rs b/crates/tracedecay/src/mcp/tools/handlers/redundancy.rs similarity index 100% rename from src/mcp/tools/handlers/redundancy.rs rename to crates/tracedecay/src/mcp/tools/handlers/redundancy.rs diff --git a/src/mcp/tools/handlers/retained_catalog.rs b/crates/tracedecay/src/mcp/tools/handlers/retained_catalog.rs similarity index 100% rename from src/mcp/tools/handlers/retained_catalog.rs rename to crates/tracedecay/src/mcp/tools/handlers/retained_catalog.rs diff --git a/src/mcp/tools/handlers/retained_timeout_dispatch_tests.rs b/crates/tracedecay/src/mcp/tools/handlers/retained_timeout_dispatch_tests.rs similarity index 100% rename from src/mcp/tools/handlers/retained_timeout_dispatch_tests.rs rename to crates/tracedecay/src/mcp/tools/handlers/retained_timeout_dispatch_tests.rs diff --git a/src/mcp/tools/handlers/runtime_generation_census_dispatch_tests.rs b/crates/tracedecay/src/mcp/tools/handlers/runtime_generation_census_dispatch_tests.rs similarity index 100% rename from src/mcp/tools/handlers/runtime_generation_census_dispatch_tests.rs rename to crates/tracedecay/src/mcp/tools/handlers/runtime_generation_census_dispatch_tests.rs diff --git a/src/mcp/tools/handlers/search_graph_independence_tests.rs b/crates/tracedecay/src/mcp/tools/handlers/search_graph_independence_tests.rs similarity index 100% rename from src/mcp/tools/handlers/search_graph_independence_tests.rs rename to crates/tracedecay/src/mcp/tools/handlers/search_graph_independence_tests.rs diff --git a/src/mcp/tools/handlers/session/mod.rs b/crates/tracedecay/src/mcp/tools/handlers/session/mod.rs similarity index 100% rename from src/mcp/tools/handlers/session/mod.rs rename to crates/tracedecay/src/mcp/tools/handlers/session/mod.rs diff --git a/src/mcp/tools/handlers/session/session_refresh.rs b/crates/tracedecay/src/mcp/tools/handlers/session/session_refresh.rs similarity index 100% rename from src/mcp/tools/handlers/session/session_refresh.rs rename to crates/tracedecay/src/mcp/tools/handlers/session/session_refresh.rs diff --git a/src/mcp/tools/handlers/session_authorities.rs b/crates/tracedecay/src/mcp/tools/handlers/session_authorities.rs similarity index 100% rename from src/mcp/tools/handlers/session_authorities.rs rename to crates/tracedecay/src/mcp/tools/handlers/session_authorities.rs diff --git a/src/mcp/tools/handlers/skills.rs b/crates/tracedecay/src/mcp/tools/handlers/skills.rs similarity index 100% rename from src/mcp/tools/handlers/skills.rs rename to crates/tracedecay/src/mcp/tools/handlers/skills.rs diff --git a/src/mcp/tools/handlers/support.rs b/crates/tracedecay/src/mcp/tools/handlers/support.rs similarity index 100% rename from src/mcp/tools/handlers/support.rs rename to crates/tracedecay/src/mcp/tools/handlers/support.rs diff --git a/src/mcp/tools/handlers/tool_call_support.rs b/crates/tracedecay/src/mcp/tools/handlers/tool_call_support.rs similarity index 100% rename from src/mcp/tools/handlers/tool_call_support.rs rename to crates/tracedecay/src/mcp/tools/handlers/tool_call_support.rs diff --git a/src/mcp/tools/handlers/tool_definition_tests.rs b/crates/tracedecay/src/mcp/tools/handlers/tool_definition_tests.rs similarity index 100% rename from src/mcp/tools/handlers/tool_definition_tests.rs rename to crates/tracedecay/src/mcp/tools/handlers/tool_definition_tests.rs diff --git a/src/mcp/tools/handlers/work.rs b/crates/tracedecay/src/mcp/tools/handlers/work.rs similarity index 99% rename from src/mcp/tools/handlers/work.rs rename to crates/tracedecay/src/mcp/tools/handlers/work.rs index 5351bfa991..c65e13521d 100644 --- a/src/mcp/tools/handlers/work.rs +++ b/crates/tracedecay/src/mcp/tools/handlers/work.rs @@ -15,7 +15,7 @@ use tracedecay_tool_catalog::OperationId; use crate::daemon_client::{DaemonInvocationExecutor, invocation_now_micros}; use crate::errors::{Result, TraceDecayError}; use crate::mcp::tools::ToolResult; -use crate::request_identity::{GlobalRequestSurface, mint_global_request_id}; +use tracedecay_usecases::request_identity::{GlobalRequestSurface, mint_global_request_id}; use super::tool_call_support::json_result; diff --git a/src/mcp/tools/handlers/workflow.rs b/crates/tracedecay/src/mcp/tools/handlers/workflow.rs similarity index 98% rename from src/mcp/tools/handlers/workflow.rs rename to crates/tracedecay/src/mcp/tools/handlers/workflow.rs index 25af43a2e8..1d78f5c6a2 100644 --- a/src/mcp/tools/handlers/workflow.rs +++ b/crates/tracedecay/src/mcp/tools/handlers/workflow.rs @@ -21,17 +21,17 @@ use tracedecay_domain::{CommitId, UtcMicros}; use tracedecay_domain::{RelationEdgeKindV1, SymbolOccurrenceId}; use url::Url; -use crate::diagnose::{Severity, parse_cargo_output}; -use crate::diagnostics_publication::CodeIndexPublicationIdentityPortV1; -use crate::diagnostics_query::DiagnosticsQuery; -use crate::diagnostics_store::DiagnosticsStore; use crate::errors::{Result, TraceDecayError}; use crate::graph::redundancy_scan::{RedundancyOptions, RedundancyScanV1, redundancy_scan}; -use crate::request_identity::{GlobalRequestSurface, mint_global_request_id}; use crate::tracedecay::{TraceDecay, is_test_file}; +use tracedecay_usecases::diagnose::{Severity, parse_cargo_output}; +use tracedecay_usecases::diagnostics_publication::CodeIndexPublicationIdentityPortV1; +use tracedecay_usecases::diagnostics_query::DiagnosticsQuery; +use tracedecay_usecases::diagnostics_store::DiagnosticsStore; use tracedecay_usecases::operation_stream::{ OperationEmitter, OperationEventError, operation_event_authority, }; +use tracedecay_usecases::request_identity::{GlobalRequestSurface, mint_global_request_id}; use super::super::ToolResult; use super::super::render; @@ -372,7 +372,7 @@ fn diagnostic_graph_problem(detail: &str) -> TraceDecayError { async fn publish_parsed_compiler_diagnostics( cg: &TraceDecay, code_index_identity: Option<&dyn CodeIndexPublicationIdentityPortV1>, - parsed: &[crate::diagnose::Diagnostic], + parsed: &[tracedecay_usecases::diagnose::Diagnostic], ) -> Value { use tracedecay_domain::ComponentVersion; @@ -392,7 +392,7 @@ async fn publish_parsed_compiler_diagnostics( let database = cg.dashboard_database_guard(); let store = DiagnosticsStore::new(database.as_ref().clone()); let outcome = - crate::diagnostics_publication::publish_compiler_diagnostics_through_code_index_v1( + tracedecay_usecases::diagnostics_publication::publish_compiler_diagnostics_through_code_index_v1( &root, code_index_identity, &store, @@ -407,11 +407,11 @@ async fn publish_parsed_compiler_diagnostics( /// Renders the typed publication outcome for the diagnose response. Every /// refusal keeps its name so an empty Problems list is explainable. fn compiler_publication_report( - outcome: &crate::diagnostics_publication::CompilerDiagnosticPublicationOutcomeV1, + outcome: &tracedecay_usecases::diagnostics_publication::CompilerDiagnosticPublicationOutcomeV1, ) -> Value { - use crate::diagnostics_publication::CompilerDiagnosticPublicationOutcomeV1 as Outcome; + use tracedecay_usecases::diagnostics_publication::CompilerDiagnosticPublicationOutcomeV1 as Outcome; - let names = |skips: &[crate::diagnostics_publication::CompilerDiagnosticResolutionSkipV1]| { + let names = |skips: &[tracedecay_usecases::diagnostics_publication::CompilerDiagnosticResolutionSkipV1]| { skips.iter().map(ToString::to_string).collect::>() }; match outcome { diff --git a/src/mcp/tools/handlers/workflow/affected_test_failure.rs b/crates/tracedecay/src/mcp/tools/handlers/workflow/affected_test_failure.rs similarity index 100% rename from src/mcp/tools/handlers/workflow/affected_test_failure.rs rename to crates/tracedecay/src/mcp/tools/handlers/workflow/affected_test_failure.rs diff --git a/src/mcp/tools/handlers/workflow/affected_tests_tests.rs b/crates/tracedecay/src/mcp/tools/handlers/workflow/affected_tests_tests.rs similarity index 98% rename from src/mcp/tools/handlers/workflow/affected_tests_tests.rs rename to crates/tracedecay/src/mcp/tools/handlers/workflow/affected_tests_tests.rs index ffd6b178cc..c0477214c6 100644 --- a/src/mcp/tools/handlers/workflow/affected_tests_tests.rs +++ b/crates/tracedecay/src/mcp/tools/handlers/workflow/affected_tests_tests.rs @@ -291,7 +291,7 @@ async fn directly_changed_test_file_dispatches_each_full_test_identity() { database .execute_write_batch( "seed managed test-run diagnostics schema", - crate::diagnostics_store::SCHEMA, + tracedecay_usecases::diagnostics_store::SCHEMA, ) .await .unwrap(); @@ -416,7 +416,7 @@ async fn nested_source_module_dispatches_the_crate_relative_test_identity() { database .execute_write_batch( "seed managed test-run diagnostics schema", - crate::diagnostics_store::SCHEMA, + tracedecay_usecases::diagnostics_store::SCHEMA, ) .await .unwrap(); @@ -593,7 +593,7 @@ async fn timed_out_test_runner_returns_a_terminal_receipt() { database .execute_write_batch( "seed timed managed test-run diagnostics schema", - crate::diagnostics_store::SCHEMA, + tracedecay_usecases::diagnostics_store::SCHEMA, ) .await .unwrap(); @@ -662,7 +662,7 @@ async fn cancellation_retains_results_completed_before_the_later_test() { database .execute_write_batch( "seed partial cancelled managed test-run schema", - crate::diagnostics_store::SCHEMA, + tracedecay_usecases::diagnostics_store::SCHEMA, ) .await .unwrap(); @@ -742,7 +742,7 @@ async fn vacuous_or_nonzero_test_output_is_a_failed_terminal() { database .execute_write_batch( "seed failed managed test-run diagnostics schema", - crate::diagnostics_store::SCHEMA, + tracedecay_usecases::diagnostics_store::SCHEMA, ) .await .unwrap(); @@ -824,7 +824,7 @@ async fn reported_passing_and_failing_tests_complete_with_observed_results() { database .execute_write_batch( "seed failing managed test-run result schema", - crate::diagnostics_store::SCHEMA, + tracedecay_usecases::diagnostics_store::SCHEMA, ) .await .unwrap(); diff --git a/src/mcp/tools/handlers/workflow/test_identity.rs b/crates/tracedecay/src/mcp/tools/handlers/workflow/test_identity.rs similarity index 100% rename from src/mcp/tools/handlers/workflow/test_identity.rs rename to crates/tracedecay/src/mcp/tools/handlers/workflow/test_identity.rs diff --git a/src/mcp/tools/handlers/workflow/test_request.rs b/crates/tracedecay/src/mcp/tools/handlers/workflow/test_request.rs similarity index 100% rename from src/mcp/tools/handlers/workflow/test_request.rs rename to crates/tracedecay/src/mcp/tools/handlers/workflow/test_request.rs diff --git a/src/mcp/tools/handlers/workflow/test_runner.rs b/crates/tracedecay/src/mcp/tools/handlers/workflow/test_runner.rs similarity index 100% rename from src/mcp/tools/handlers/workflow/test_runner.rs rename to crates/tracedecay/src/mcp/tools/handlers/workflow/test_runner.rs diff --git a/src/mcp/tools/handlers/workflow_family.rs b/crates/tracedecay/src/mcp/tools/handlers/workflow_family.rs similarity index 98% rename from src/mcp/tools/handlers/workflow_family.rs rename to crates/tracedecay/src/mcp/tools/handlers/workflow_family.rs index 094321bf9b..71045a15ac 100644 --- a/src/mcp/tools/handlers/workflow_family.rs +++ b/crates/tracedecay/src/mcp/tools/handlers/workflow_family.rs @@ -16,7 +16,7 @@ use tracedecay_tool_catalog::OperationId; use crate::daemon_client::{DaemonInvocationExecutor, invocation_now_micros}; use crate::errors::{Result, TraceDecayError}; use crate::mcp::tools::ToolResult; -use crate::request_identity::{GlobalRequestSurface, mint_global_request_id}; +use tracedecay_usecases::request_identity::{GlobalRequestSurface, mint_global_request_id}; use super::tool_call_support::json_result; diff --git a/src/mcp/tools/mod.rs b/crates/tracedecay/src/mcp/tools/mod.rs similarity index 100% rename from src/mcp/tools/mod.rs rename to crates/tracedecay/src/mcp/tools/mod.rs diff --git a/src/mcp/tools/plugin_conformance_tests.rs b/crates/tracedecay/src/mcp/tools/plugin_conformance_tests.rs similarity index 100% rename from src/mcp/tools/plugin_conformance_tests.rs rename to crates/tracedecay/src/mcp/tools/plugin_conformance_tests.rs diff --git a/src/mcp/tools/render.rs b/crates/tracedecay/src/mcp/tools/render.rs similarity index 100% rename from src/mcp/tools/render.rs rename to crates/tracedecay/src/mcp/tools/render.rs diff --git a/src/mcp/tools/render/tests.rs b/crates/tracedecay/src/mcp/tools/render/tests.rs similarity index 100% rename from src/mcp/tools/render/tests.rs rename to crates/tracedecay/src/mcp/tools/render/tests.rs diff --git a/src/mcp/tools/renderers.rs b/crates/tracedecay/src/mcp/tools/renderers.rs similarity index 100% rename from src/mcp/tools/renderers.rs rename to crates/tracedecay/src/mcp/tools/renderers.rs diff --git a/src/mcp/transport.rs b/crates/tracedecay/src/mcp/transport.rs similarity index 100% rename from src/mcp/transport.rs rename to crates/tracedecay/src/mcp/transport.rs diff --git a/src/monitor.rs b/crates/tracedecay/src/monitor.rs similarity index 100% rename from src/monitor.rs rename to crates/tracedecay/src/monitor.rs diff --git a/src/monitor/cost.rs b/crates/tracedecay/src/monitor/cost.rs similarity index 100% rename from src/monitor/cost.rs rename to crates/tracedecay/src/monitor/cost.rs diff --git a/src/path_scope.rs b/crates/tracedecay/src/path_scope.rs similarity index 100% rename from src/path_scope.rs rename to crates/tracedecay/src/path_scope.rs diff --git a/src/path_tree.rs b/crates/tracedecay/src/path_tree.rs similarity index 100% rename from src/path_tree.rs rename to crates/tracedecay/src/path_tree.rs diff --git a/src/privacy.rs b/crates/tracedecay/src/privacy.rs similarity index 100% rename from src/privacy.rs rename to crates/tracedecay/src/privacy.rs diff --git a/src/profile_backup.rs b/crates/tracedecay/src/profile_backup.rs similarity index 100% rename from src/profile_backup.rs rename to crates/tracedecay/src/profile_backup.rs diff --git a/src/profile_backup/error.rs b/crates/tracedecay/src/profile_backup/error.rs similarity index 100% rename from src/profile_backup/error.rs rename to crates/tracedecay/src/profile_backup/error.rs diff --git a/src/profile_backup/identity.rs b/crates/tracedecay/src/profile_backup/identity.rs similarity index 100% rename from src/profile_backup/identity.rs rename to crates/tracedecay/src/profile_backup/identity.rs diff --git a/src/profile_backup/snapshot.rs b/crates/tracedecay/src/profile_backup/snapshot.rs similarity index 100% rename from src/profile_backup/snapshot.rs rename to crates/tracedecay/src/profile_backup/snapshot.rs diff --git a/src/profile_backup/tests.rs b/crates/tracedecay/src/profile_backup/tests.rs similarity index 100% rename from src/profile_backup/tests.rs rename to crates/tracedecay/src/profile_backup/tests.rs diff --git a/src/profile_registry_maintenance.rs b/crates/tracedecay/src/profile_registry_maintenance.rs similarity index 100% rename from src/profile_registry_maintenance.rs rename to crates/tracedecay/src/profile_registry_maintenance.rs diff --git a/src/project_registry.rs b/crates/tracedecay/src/project_registry.rs similarity index 100% rename from src/project_registry.rs rename to crates/tracedecay/src/project_registry.rs diff --git a/src/redundancy.rs b/crates/tracedecay/src/redundancy.rs similarity index 100% rename from src/redundancy.rs rename to crates/tracedecay/src/redundancy.rs diff --git a/src/remote_command.rs b/crates/tracedecay/src/remote_command.rs similarity index 100% rename from src/remote_command.rs rename to crates/tracedecay/src/remote_command.rs diff --git a/src/resolution/mod.rs b/crates/tracedecay/src/resolution/mod.rs similarity index 100% rename from src/resolution/mod.rs rename to crates/tracedecay/src/resolution/mod.rs diff --git a/src/resolution/resolver.rs b/crates/tracedecay/src/resolution/resolver.rs similarity index 100% rename from src/resolution/resolver.rs rename to crates/tracedecay/src/resolution/resolver.rs diff --git a/src/retention.rs b/crates/tracedecay/src/retention.rs similarity index 99% rename from src/retention.rs rename to crates/tracedecay/src/retention.rs index ce6ee4995a..377247028c 100644 --- a/src/retention.rs +++ b/crates/tracedecay/src/retention.rs @@ -26,7 +26,6 @@ use crate::errors::{Result, TraceDecayError}; /// (plan 38, §6). pub mod branch_compaction; /// Exact-liveness mark-and-sweep for immutable derived code generations. -pub mod code_index_generations; /// Store-owned quarantine and collection for corruption/recovery artifacts /// found beside live databases (plan 38, §5). pub mod incident_debris; diff --git a/src/retention/branch_compaction.rs b/crates/tracedecay/src/retention/branch_compaction.rs similarity index 100% rename from src/retention/branch_compaction.rs rename to crates/tracedecay/src/retention/branch_compaction.rs diff --git a/src/retention/incident_debris.rs b/crates/tracedecay/src/retention/incident_debris.rs similarity index 100% rename from src/retention/incident_debris.rs rename to crates/tracedecay/src/retention/incident_debris.rs diff --git a/src/retention/orphan_stores.rs b/crates/tracedecay/src/retention/orphan_stores.rs similarity index 100% rename from src/retention/orphan_stores.rs rename to crates/tracedecay/src/retention/orphan_stores.rs diff --git a/src/retention/orphan_stores/fence.rs b/crates/tracedecay/src/retention/orphan_stores/fence.rs similarity index 100% rename from src/retention/orphan_stores/fence.rs rename to crates/tracedecay/src/retention/orphan_stores/fence.rs diff --git a/src/retention/orphan_stores/quarantine.rs b/crates/tracedecay/src/retention/orphan_stores/quarantine.rs similarity index 100% rename from src/retention/orphan_stores/quarantine.rs rename to crates/tracedecay/src/retention/orphan_stores/quarantine.rs diff --git a/src/retention/orphan_stores/tests.rs b/crates/tracedecay/src/retention/orphan_stores/tests.rs similarity index 100% rename from src/retention/orphan_stores/tests.rs rename to crates/tracedecay/src/retention/orphan_stores/tests.rs diff --git a/src/retention/orphan_stores/unregistered_page.rs b/crates/tracedecay/src/retention/orphan_stores/unregistered_page.rs similarity index 100% rename from src/retention/orphan_stores/unregistered_page.rs rename to crates/tracedecay/src/retention/orphan_stores/unregistered_page.rs diff --git a/src/retention/storage_report.rs b/crates/tracedecay/src/retention/storage_report.rs similarity index 99% rename from src/retention/storage_report.rs rename to crates/tracedecay/src/retention/storage_report.rs index 2e87f5e476..d194d7757a 100644 --- a/src/retention/storage_report.rs +++ b/crates/tracedecay/src/retention/storage_report.rs @@ -31,7 +31,7 @@ use tracedecay_runtime_core::sqlite_read_snapshot::{ BOUNDED_PROBE_BUSY_TIMEOUT, open_read_only_probe, pragma_u64, }; -use super::code_index_generations::{ +use tracedecay_usecases::retention::code_index_generations::{ CodeGenerationRetentionGenerationV1, DEFAULT_SUPERSEDED_GENERATION_FLOOR, GenerationDigestVerificationV1, plan_code_generation_retention_with_verification, scoped_code_index_store_root, diff --git a/src/runtime_identity.rs b/crates/tracedecay/src/runtime_identity.rs similarity index 100% rename from src/runtime_identity.rs rename to crates/tracedecay/src/runtime_identity.rs diff --git a/src/runtime_ports.rs b/crates/tracedecay/src/runtime_ports.rs similarity index 100% rename from src/runtime_ports.rs rename to crates/tracedecay/src/runtime_ports.rs diff --git a/src/runtime_telemetry.rs b/crates/tracedecay/src/runtime_telemetry.rs similarity index 100% rename from src/runtime_telemetry.rs rename to crates/tracedecay/src/runtime_telemetry.rs diff --git a/src/runtime_telemetry/store_runtime.rs b/crates/tracedecay/src/runtime_telemetry/store_runtime.rs similarity index 100% rename from src/runtime_telemetry/store_runtime.rs rename to crates/tracedecay/src/runtime_telemetry/store_runtime.rs diff --git a/src/search_eval.rs b/crates/tracedecay/src/search_eval.rs similarity index 100% rename from src/search_eval.rs rename to crates/tracedecay/src/search_eval.rs diff --git a/src/semantic_code.rs b/crates/tracedecay/src/semantic_code.rs similarity index 100% rename from src/semantic_code.rs rename to crates/tracedecay/src/semantic_code.rs diff --git a/src/serve.rs b/crates/tracedecay/src/serve.rs similarity index 100% rename from src/serve.rs rename to crates/tracedecay/src/serve.rs diff --git a/src/session_temporal_benchmark.rs b/crates/tracedecay/src/session_temporal_benchmark.rs similarity index 99% rename from src/session_temporal_benchmark.rs rename to crates/tracedecay/src/session_temporal_benchmark.rs index b972bba341..1c5f1029c9 100644 --- a/src/session_temporal_benchmark.rs +++ b/crates/tracedecay/src/session_temporal_benchmark.rs @@ -82,11 +82,15 @@ const DIGEST: [u8; 32] = [0x8b; 32]; 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"), + include_str!( + "../../../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"), + include_str!( + "../../../tests/fixtures/provider_normalization/codex/agent_message.input.json" + ), ), ]; @@ -1376,7 +1380,13 @@ fn sha256_file(path: &Path) -> BenchResult { } fn repository_root() -> PathBuf { + // The product package sits at `crates/tracedecay`; this benchmark reads git + // metadata and fixtures that live at the workspace root above it. PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .parent() + .and_then(Path::parent) + .expect("workspace root above crates/tracedecay") + .to_owned() } fn current_commit(root: &Path) -> BenchResult { diff --git a/src/session_temporal_benchmark/root_relation_fixture.rs b/crates/tracedecay/src/session_temporal_benchmark/root_relation_fixture.rs similarity index 100% rename from src/session_temporal_benchmark/root_relation_fixture.rs rename to crates/tracedecay/src/session_temporal_benchmark/root_relation_fixture.rs diff --git a/src/sessions/claude_observation_benchmark.rs b/crates/tracedecay/src/sessions/claude_observation_benchmark.rs similarity index 84% rename from src/sessions/claude_observation_benchmark.rs rename to crates/tracedecay/src/sessions/claude_observation_benchmark.rs index f5fcf16c8e..9e0d3a3e66 100644 --- a/src/sessions/claude_observation_benchmark.rs +++ b/crates/tracedecay/src/sessions/claude_observation_benchmark.rs @@ -37,47 +37,55 @@ const REDACTION_MARKER: &str = "[TraceDecay redacted:"; const PROVIDER_PIPELINE_SCOPE: &str = "production_parse_normalize_sanitize_commit_project_and_replay"; const WORKLOAD_MANIFEST: &str = - include_str!("../../benchmark_data/claude-observation/workload-v1.json"); + include_str!("../../../../benchmark_data/claude-observation/workload-v1.json"); const NATIVE_PROVIDER_FIXTURES: &[(&str, &str)] = &[ ( "tests/fixtures/provider_normalization/claude/assistant_tool_use.input.json", include_str!( - "../../tests/fixtures/provider_normalization/claude/assistant_tool_use.input.json" + "../../../../tests/fixtures/provider_normalization/claude/assistant_tool_use.input.json" ), ), ( "tests/fixtures/provider_normalization/codex/session_meta.input.json", - include_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/agent_message.input.json", - include_str!("../../tests/fixtures/provider_normalization/codex/agent_message.input.json"), + include_str!( + "../../../../tests/fixtures/provider_normalization/codex/agent_message.input.json" + ), ), ( "tests/fixtures/provider_normalization/cursor/tool_use.input.json", - include_str!("../../tests/fixtures/provider_normalization/cursor/tool_use.input.json"), + include_str!( + "../../../../tests/fixtures/provider_normalization/cursor/tool_use.input.json" + ), ), ( "tests/fixtures/provider_normalization/hermes/assistant_tool_call.input.json", include_str!( - "../../tests/fixtures/provider_normalization/hermes/assistant_tool_call.input.json" + "../../../../tests/fixtures/provider_normalization/hermes/assistant_tool_call.input.json" ), ), ( "tests/fixtures/provider_normalization/kiro/workspace_session.input.json", include_str!( - "../../tests/fixtures/provider_normalization/kiro/workspace_session.input.json" + "../../../../tests/fixtures/provider_normalization/kiro/workspace_session.input.json" ), ), ( "tests/fixtures/transcript_golden/cline_like/input/api_conversation_history.json", include_str!( - "../../tests/fixtures/transcript_golden/cline_like/input/api_conversation_history.json" + "../../../../tests/fixtures/transcript_golden/cline_like/input/api_conversation_history.json" ), ), ( "tests/fixtures/transcript_golden/cline_like/input/task_metadata.json", - include_str!("../../tests/fixtures/transcript_golden/cline_like/input/task_metadata.json"), + include_str!( + "../../../../tests/fixtures/transcript_golden/cline_like/input/task_metadata.json" + ), ), ]; const HARNESS_SOURCES: &[(&str, &str)] = &[ diff --git a/src/sessions/claude_observation_benchmark/artifact.rs b/crates/tracedecay/src/sessions/claude_observation_benchmark/artifact.rs similarity index 98% rename from src/sessions/claude_observation_benchmark/artifact.rs rename to crates/tracedecay/src/sessions/claude_observation_benchmark/artifact.rs index 7682dfd05a..c8d873e607 100644 --- a/src/sessions/claude_observation_benchmark/artifact.rs +++ b/crates/tracedecay/src/sessions/claude_observation_benchmark/artifact.rs @@ -796,7 +796,7 @@ pub(super) fn workload_identity() -> WorkloadIdentity { .map(|(path, _)| { ( *path, - fs::read(repository_root().join(path)) + fs::read(package_root().join(path)) .unwrap_or_else(|error| panic!("read benchmark harness {path}: {error}")), ) }) @@ -950,8 +950,20 @@ pub(super) fn status_output_is_dirty(output: &[u8]) -> bool { !output.is_empty() } +/// The product package directory. `HARNESS_SOURCES` records paths relative to +/// the package (`src/sessions/...`), which is a different anchor from the +/// workspace-level fixtures and benchmark data below. +pub(super) fn package_root() -> &'static Path { + Path::new(env!("CARGO_MANIFEST_DIR")) +} + pub(super) fn repository_root() -> &'static Path { + // The product package sits at `crates/tracedecay`; the fixtures, benchmark + // data, and git metadata this module reads all live at the workspace root. Path::new(env!("CARGO_MANIFEST_DIR")) + .parent() + .and_then(Path::parent) + .expect("workspace root above crates/tracedecay") } fn git_output(args: &[&str]) -> String { diff --git a/src/sessions/claude_observation_benchmark/baseline.rs b/crates/tracedecay/src/sessions/claude_observation_benchmark/baseline.rs similarity index 99% rename from src/sessions/claude_observation_benchmark/baseline.rs rename to crates/tracedecay/src/sessions/claude_observation_benchmark/baseline.rs index 44aac994f5..cbb084c377 100644 --- a/src/sessions/claude_observation_benchmark/baseline.rs +++ b/crates/tracedecay/src/sessions/claude_observation_benchmark/baseline.rs @@ -1,4 +1,4 @@ -use std::path::{Path, PathBuf}; +use std::path::PathBuf; use serde::{Deserialize, Serialize}; use serde_json::Value; @@ -384,7 +384,7 @@ fn fixture_measurement(host: &str) -> HookHostFixtureMeasurement { } fn repository_path(relative: &str) -> PathBuf { - Path::new(env!("CARGO_MANIFEST_DIR")).join(relative) + super::artifact::repository_root().join(relative) } fn canonical_json(value: &Value) -> Value { diff --git a/src/sessions/claude_observation_benchmark/manifest.rs b/crates/tracedecay/src/sessions/claude_observation_benchmark/manifest.rs similarity index 100% rename from src/sessions/claude_observation_benchmark/manifest.rs rename to crates/tracedecay/src/sessions/claude_observation_benchmark/manifest.rs diff --git a/src/sessions/claude_observation_benchmark/metrics.rs b/crates/tracedecay/src/sessions/claude_observation_benchmark/metrics.rs similarity index 100% rename from src/sessions/claude_observation_benchmark/metrics.rs rename to crates/tracedecay/src/sessions/claude_observation_benchmark/metrics.rs diff --git a/src/sessions/claude_observation_benchmark/model.rs b/crates/tracedecay/src/sessions/claude_observation_benchmark/model.rs similarity index 100% rename from src/sessions/claude_observation_benchmark/model.rs rename to crates/tracedecay/src/sessions/claude_observation_benchmark/model.rs diff --git a/src/sessions/claude_observation_benchmark/runner.rs b/crates/tracedecay/src/sessions/claude_observation_benchmark/runner.rs similarity index 100% rename from src/sessions/claude_observation_benchmark/runner.rs rename to crates/tracedecay/src/sessions/claude_observation_benchmark/runner.rs diff --git a/src/sessions/claude_observation_benchmark/tests.rs b/crates/tracedecay/src/sessions/claude_observation_benchmark/tests.rs similarity index 99% rename from src/sessions/claude_observation_benchmark/tests.rs rename to crates/tracedecay/src/sessions/claude_observation_benchmark/tests.rs index 2d4b709c7a..8f35ba18bb 100644 --- a/src/sessions/claude_observation_benchmark/tests.rs +++ b/crates/tracedecay/src/sessions/claude_observation_benchmark/tests.rs @@ -45,7 +45,7 @@ fn workload_manifest_matches_executable_contract() { #[test] fn checked_in_evidence_preserves_providerless_historical_results() { - let directory = Path::new(env!("CARGO_MANIFEST_DIR")).join("benchmark_data/claude-observation"); + let directory = super::artifact::repository_root().join("benchmark_data/claude-observation"); let acceptance = validate_evidence_directory(&directory, false).unwrap(); let index: serde_json::Value = serde_json::from_slice( &fs::read(directory.join("evidence-index.json")).expect("read evidence index"), diff --git a/src/sessions/ingest_tests.rs b/crates/tracedecay/src/sessions/ingest_tests.rs similarity index 100% rename from src/sessions/ingest_tests.rs rename to crates/tracedecay/src/sessions/ingest_tests.rs diff --git a/src/sessions/workflow_ingest_tests.rs b/crates/tracedecay/src/sessions/workflow_ingest_tests.rs similarity index 100% rename from src/sessions/workflow_ingest_tests.rs rename to crates/tracedecay/src/sessions/workflow_ingest_tests.rs diff --git a/src/sqlite_read_snapshot.rs b/crates/tracedecay/src/sqlite_read_snapshot.rs similarity index 100% rename from src/sqlite_read_snapshot.rs rename to crates/tracedecay/src/sqlite_read_snapshot.rs diff --git a/src/storage.rs b/crates/tracedecay/src/storage.rs similarity index 100% rename from src/storage.rs rename to crates/tracedecay/src/storage.rs diff --git a/src/store/git_correlation.rs b/crates/tracedecay/src/store/git_correlation.rs similarity index 100% rename from src/store/git_correlation.rs rename to crates/tracedecay/src/store/git_correlation.rs diff --git a/src/store/global_db.rs b/crates/tracedecay/src/store/global_db.rs similarity index 100% rename from src/store/global_db.rs rename to crates/tracedecay/src/store/global_db.rs diff --git a/src/store/mod.rs b/crates/tracedecay/src/store/mod.rs similarity index 96% rename from src/store/mod.rs rename to crates/tracedecay/src/store/mod.rs index f4b60daf50..85a09d1bd3 100644 --- a/src/store/mod.rs +++ b/crates/tracedecay/src/store/mod.rs @@ -11,7 +11,6 @@ pub mod global_db; pub use tracedecay_runtime_core::store::memory; pub mod session; mod session_ingest_authority; -pub(crate) mod vector_generations; pub mod workflow; pub use git_correlation::GlobalDbGitCorrelationStore; @@ -37,7 +36,7 @@ pub mod vector_generation_test_support { prepare_vector_generation_async, split_projection_request, }; - pub use super::vector_generations::{ + pub use tracedecay_usecases::store::vector_generations::{ GraphVectorGenerationStoreV1, PublishedVectorGenerationV1, VectorGenerationBuildIdV1, VectorGenerationIdV1, VectorGenerationPlanV1, VectorGenerationPublicationV1, VectorGenerationStateMachineV1, VectorGenerationStoreErrorV1, VectorProjectionCheckpointV1, diff --git a/src/store/session.rs b/crates/tracedecay/src/store/session.rs similarity index 100% rename from src/store/session.rs rename to crates/tracedecay/src/store/session.rs diff --git a/src/store/session_ingest_authority.rs b/crates/tracedecay/src/store/session_ingest_authority.rs similarity index 100% rename from src/store/session_ingest_authority.rs rename to crates/tracedecay/src/store/session_ingest_authority.rs diff --git a/src/store/workflow.rs b/crates/tracedecay/src/store/workflow.rs similarity index 100% rename from src/store/workflow.rs rename to crates/tracedecay/src/store/workflow.rs diff --git a/src/support/mod.rs b/crates/tracedecay/src/support/mod.rs similarity index 100% rename from src/support/mod.rs rename to crates/tracedecay/src/support/mod.rs diff --git a/src/support/weak_registry.rs b/crates/tracedecay/src/support/weak_registry.rs similarity index 100% rename from src/support/weak_registry.rs rename to crates/tracedecay/src/support/weak_registry.rs diff --git a/src/sync.rs b/crates/tracedecay/src/sync.rs similarity index 100% rename from src/sync.rs rename to crates/tracedecay/src/sync.rs diff --git a/src/text.rs b/crates/tracedecay/src/text.rs similarity index 100% rename from src/text.rs rename to crates/tracedecay/src/text.rs diff --git a/src/timeutil.rs b/crates/tracedecay/src/timeutil.rs similarity index 100% rename from src/timeutil.rs rename to crates/tracedecay/src/timeutil.rs diff --git a/src/tracedecay.rs b/crates/tracedecay/src/tracedecay.rs similarity index 100% rename from src/tracedecay.rs rename to crates/tracedecay/src/tracedecay.rs diff --git a/src/tracedecay/concrete_runtime_tests.rs b/crates/tracedecay/src/tracedecay/concrete_runtime_tests.rs similarity index 100% rename from src/tracedecay/concrete_runtime_tests.rs rename to crates/tracedecay/src/tracedecay/concrete_runtime_tests.rs diff --git a/src/tracedecay/diagnostics.rs b/crates/tracedecay/src/tracedecay/diagnostics.rs similarity index 100% rename from src/tracedecay/diagnostics.rs rename to crates/tracedecay/src/tracedecay/diagnostics.rs diff --git a/src/tracedecay/edits/ast_grep.rs b/crates/tracedecay/src/tracedecay/edits/ast_grep.rs similarity index 100% rename from src/tracedecay/edits/ast_grep.rs rename to crates/tracedecay/src/tracedecay/edits/ast_grep.rs diff --git a/src/tracedecay/edits/execute_tests.rs b/crates/tracedecay/src/tracedecay/edits/execute_tests.rs similarity index 100% rename from src/tracedecay/edits/execute_tests.rs rename to crates/tracedecay/src/tracedecay/edits/execute_tests.rs diff --git a/src/tracedecay/edits/file_authority.rs b/crates/tracedecay/src/tracedecay/edits/file_authority.rs similarity index 100% rename from src/tracedecay/edits/file_authority.rs rename to crates/tracedecay/src/tracedecay/edits/file_authority.rs diff --git a/src/tracedecay/edits/mod.rs b/crates/tracedecay/src/tracedecay/edits/mod.rs similarity index 100% rename from src/tracedecay/edits/mod.rs rename to crates/tracedecay/src/tracedecay/edits/mod.rs diff --git a/src/tracedecay/edits/plan.rs b/crates/tracedecay/src/tracedecay/edits/plan.rs similarity index 100% rename from src/tracedecay/edits/plan.rs rename to crates/tracedecay/src/tracedecay/edits/plan.rs diff --git a/src/tracedecay/edits/preview.rs b/crates/tracedecay/src/tracedecay/edits/preview.rs similarity index 100% rename from src/tracedecay/edits/preview.rs rename to crates/tracedecay/src/tracedecay/edits/preview.rs diff --git a/src/tracedecay/edits/primitives.rs b/crates/tracedecay/src/tracedecay/edits/primitives.rs similarity index 100% rename from src/tracedecay/edits/primitives.rs rename to crates/tracedecay/src/tracedecay/edits/primitives.rs diff --git a/src/tracedecay/edits/reconcile_tests.rs b/crates/tracedecay/src/tracedecay/edits/reconcile_tests.rs similarity index 100% rename from src/tracedecay/edits/reconcile_tests.rs rename to crates/tracedecay/src/tracedecay/edits/reconcile_tests.rs diff --git a/src/tracedecay/edits/rename.rs b/crates/tracedecay/src/tracedecay/edits/rename.rs similarity index 100% rename from src/tracedecay/edits/rename.rs rename to crates/tracedecay/src/tracedecay/edits/rename.rs diff --git a/src/tracedecay/edits/rename/graph_evidence.rs b/crates/tracedecay/src/tracedecay/edits/rename/graph_evidence.rs similarity index 100% rename from src/tracedecay/edits/rename/graph_evidence.rs rename to crates/tracedecay/src/tracedecay/edits/rename/graph_evidence.rs diff --git a/src/tracedecay/edits/rename/lexical.rs b/crates/tracedecay/src/tracedecay/edits/rename/lexical.rs similarity index 100% rename from src/tracedecay/edits/rename/lexical.rs rename to crates/tracedecay/src/tracedecay/edits/rename/lexical.rs diff --git a/src/tracedecay/edits/symbols.rs b/crates/tracedecay/src/tracedecay/edits/symbols.rs similarity index 100% rename from src/tracedecay/edits/symbols.rs rename to crates/tracedecay/src/tracedecay/edits/symbols.rs diff --git a/src/tracedecay/edits/test_support.rs b/crates/tracedecay/src/tracedecay/edits/test_support.rs similarity index 100% rename from src/tracedecay/edits/test_support.rs rename to crates/tracedecay/src/tracedecay/edits/test_support.rs diff --git a/src/tracedecay/facts.rs b/crates/tracedecay/src/tracedecay/facts.rs similarity index 100% rename from src/tracedecay/facts.rs rename to crates/tracedecay/src/tracedecay/facts.rs diff --git a/src/tracedecay/lifecycle/adoption.rs b/crates/tracedecay/src/tracedecay/lifecycle/adoption.rs similarity index 100% rename from src/tracedecay/lifecycle/adoption.rs rename to crates/tracedecay/src/tracedecay/lifecycle/adoption.rs diff --git a/src/tracedecay/lifecycle/branches.rs b/crates/tracedecay/src/tracedecay/lifecycle/branches.rs similarity index 100% rename from src/tracedecay/lifecycle/branches.rs rename to crates/tracedecay/src/tracedecay/lifecycle/branches.rs diff --git a/src/tracedecay/lifecycle/identity.rs b/crates/tracedecay/src/tracedecay/lifecycle/identity.rs similarity index 100% rename from src/tracedecay/lifecycle/identity.rs rename to crates/tracedecay/src/tracedecay/lifecycle/identity.rs diff --git a/src/tracedecay/lifecycle/mod.rs b/crates/tracedecay/src/tracedecay/lifecycle/mod.rs similarity index 100% rename from src/tracedecay/lifecycle/mod.rs rename to crates/tracedecay/src/tracedecay/lifecycle/mod.rs diff --git a/src/tracedecay/lifecycle/registry.rs b/crates/tracedecay/src/tracedecay/lifecycle/registry.rs similarity index 100% rename from src/tracedecay/lifecycle/registry.rs rename to crates/tracedecay/src/tracedecay/lifecycle/registry.rs diff --git a/src/tracedecay/move_symbol/fs_guards.rs b/crates/tracedecay/src/tracedecay/move_symbol/fs_guards.rs similarity index 100% rename from src/tracedecay/move_symbol/fs_guards.rs rename to crates/tracedecay/src/tracedecay/move_symbol/fs_guards.rs diff --git a/src/tracedecay/move_symbol/hints.rs b/crates/tracedecay/src/tracedecay/move_symbol/hints.rs similarity index 100% rename from src/tracedecay/move_symbol/hints.rs rename to crates/tracedecay/src/tracedecay/move_symbol/hints.rs diff --git a/src/tracedecay/move_symbol/mod.rs b/crates/tracedecay/src/tracedecay/move_symbol/mod.rs similarity index 100% rename from src/tracedecay/move_symbol/mod.rs rename to crates/tracedecay/src/tracedecay/move_symbol/mod.rs diff --git a/src/tracedecay/move_symbol/rendering.rs b/crates/tracedecay/src/tracedecay/move_symbol/rendering.rs similarity index 100% rename from src/tracedecay/move_symbol/rendering.rs rename to crates/tracedecay/src/tracedecay/move_symbol/rendering.rs diff --git a/src/tracedecay/move_symbol/rust_paths.rs b/crates/tracedecay/src/tracedecay/move_symbol/rust_paths.rs similarity index 100% rename from src/tracedecay/move_symbol/rust_paths.rs rename to crates/tracedecay/src/tracedecay/move_symbol/rust_paths.rs diff --git a/src/tracedecay/move_symbol/use_parsing.rs b/crates/tracedecay/src/tracedecay/move_symbol/use_parsing.rs similarity index 100% rename from src/tracedecay/move_symbol/use_parsing.rs rename to crates/tracedecay/src/tracedecay/move_symbol/use_parsing.rs diff --git a/src/tracedecay/project_runtime_port.rs b/crates/tracedecay/src/tracedecay/project_runtime_port.rs similarity index 100% rename from src/tracedecay/project_runtime_port.rs rename to crates/tracedecay/src/tracedecay/project_runtime_port.rs diff --git a/src/tracedecay/queries/graph.rs b/crates/tracedecay/src/tracedecay/queries/graph.rs similarity index 100% rename from src/tracedecay/queries/graph.rs rename to crates/tracedecay/src/tracedecay/queries/graph.rs diff --git a/src/tracedecay/queries/meta.rs b/crates/tracedecay/src/tracedecay/queries/meta.rs similarity index 100% rename from src/tracedecay/queries/meta.rs rename to crates/tracedecay/src/tracedecay/queries/meta.rs diff --git a/src/tracedecay/queries/mod.rs b/crates/tracedecay/src/tracedecay/queries/mod.rs similarity index 100% rename from src/tracedecay/queries/mod.rs rename to crates/tracedecay/src/tracedecay/queries/mod.rs diff --git a/src/types.rs b/crates/tracedecay/src/types.rs similarity index 100% rename from src/types.rs rename to crates/tracedecay/src/types.rs diff --git a/src/upgrade.rs b/crates/tracedecay/src/upgrade.rs similarity index 99% rename from src/upgrade.rs rename to crates/tracedecay/src/upgrade.rs index 5204dc304a..b47330003a 100644 --- a/src/upgrade.rs +++ b/crates/tracedecay/src/upgrade.rs @@ -17,7 +17,7 @@ use tracedecay_domain::canonical_text::sha256_hex; use crate::cloud::{self, InstallMethod}; use crate::errors::{Result, TraceDecayError}; -use crate::user_config::UserConfig; +use tracedecay_usecases::user_config::UserConfig; const GITHUB_REPO: &str = "ScriptedAlchemy/tracedecay"; diff --git a/src/version.rs b/crates/tracedecay/src/version.rs similarity index 100% rename from src/version.rs rename to crates/tracedecay/src/version.rs diff --git a/src/version/build_identity.rs b/crates/tracedecay/src/version/build_identity.rs similarity index 100% rename from src/version/build_identity.rs rename to crates/tracedecay/src/version/build_identity.rs diff --git a/src/work_cli.rs b/crates/tracedecay/src/work_cli.rs similarity index 99% rename from src/work_cli.rs rename to crates/tracedecay/src/work_cli.rs index d277a5119a..43a74ede12 100644 --- a/src/work_cli.rs +++ b/crates/tracedecay/src/work_cli.rs @@ -38,7 +38,7 @@ use crate::daemon_contract::{ WorkApplicationInvocationV1, WorkApplicationOutcomeV1, }; use crate::errors::{Result, TraceDecayError}; -use crate::request_identity::{GlobalRequestSurface, mint_global_request_id}; +use tracedecay_usecases::request_identity::{GlobalRequestSurface, mint_global_request_id}; const WORK_CLI_DEADLINE_MICROS: i64 = 120_000_000; diff --git a/src/workflow_cli.rs b/crates/tracedecay/src/workflow_cli.rs similarity index 99% rename from src/workflow_cli.rs rename to crates/tracedecay/src/workflow_cli.rs index 7969cdd8b0..b893facd9a 100644 --- a/src/workflow_cli.rs +++ b/crates/tracedecay/src/workflow_cli.rs @@ -30,7 +30,7 @@ use crate::daemon_contract::{ WorkflowApplicationInvocation, WorkflowApplicationOutcome, }; use crate::errors::{Result, TraceDecayError}; -use crate::request_identity::{GlobalRequestSurface, mint_global_request_id}; +use tracedecay_usecases::request_identity::{GlobalRequestSurface, mint_global_request_id}; fn workflow_cli_deadline(operation: WorkflowOperation, observed_at: UtcMicros) -> Result { let operation_id = diff --git a/src/worktree.rs b/crates/tracedecay/src/worktree.rs similarity index 100% rename from src/worktree.rs rename to crates/tracedecay/src/worktree.rs diff --git a/tests/advisory_runtime_acceptance.rs b/crates/tracedecay/tests/advisory_runtime_acceptance.rs similarity index 98% rename from tests/advisory_runtime_acceptance.rs rename to crates/tracedecay/tests/advisory_runtime_acceptance.rs index 7e4cb5423d..6df6f420d6 100644 --- a/tests/advisory_runtime_acceptance.rs +++ b/crates/tracedecay/tests/advisory_runtime_acceptance.rs @@ -289,7 +289,7 @@ fn github_source_access_uses_owner_bound_ureq_dtos() { #[tokio::test] async fn authentic_github_and_ci_responses_use_production_decoders() { let pull_request = captured_response(include_str!( - "../crates/tracedecay-usecases/src/advisory/fixtures/provider_branch_review/pull_request.json" + "../../../crates/tracedecay-usecases/src/advisory/fixtures/provider_branch_review/pull_request.json" )); let request = GitHubReviewReadRequestV1 { operation: GitHubReviewReadOperationV1::RestGetPullRequest, @@ -332,7 +332,7 @@ async fn authentic_github_and_ci_responses_use_production_decoders() { ..request.clone() }; let review = captured_response(include_str!( - "../crates/tracedecay-usecases/src/advisory/fixtures/provider_branch_review/review.json" + "../../../crates/tracedecay-usecases/src/advisory/fixtures/provider_branch_review/review.json" )); assert!( decoder @@ -361,7 +361,7 @@ async fn authentic_github_and_ci_responses_use_production_decoders() { ) .unwrap(); let thread = captured_response(include_str!( - "../crates/tracedecay-usecases/src/advisory/fixtures/provider_branch_review/review_thread.graphql.json" + "../../../crates/tracedecay-usecases/src/advisory/fixtures/provider_branch_review/review_thread.graphql.json" )); let thread_request = GitHubReviewReadRequestV1 { operation: GitHubReviewReadOperationV1::GraphQlQueryPullRequestReviewThreads, @@ -402,16 +402,16 @@ async fn authentic_github_and_ci_responses_use_production_decoders() { let ci = GitHubCiOfficialResponseDecoderV1::decode( include_str!( - "../crates/tracedecay-usecases/src/advisory/fixtures/provider_branch_review/workflow_run.json" + "../../../crates/tracedecay-usecases/src/advisory/fixtures/provider_branch_review/workflow_run.json" ), include_str!( - "../crates/tracedecay-usecases/src/advisory/fixtures/provider_branch_review/workflow_job.json" + "../../../crates/tracedecay-usecases/src/advisory/fixtures/provider_branch_review/workflow_job.json" ), include_str!( - "../crates/tracedecay-usecases/src/advisory/fixtures/provider_branch_review/check_run.json" + "../../../crates/tracedecay-usecases/src/advisory/fixtures/provider_branch_review/check_run.json" ), include_str!( - "../crates/tracedecay-usecases/src/advisory/fixtures/provider_branch_review/check_annotations.json" + "../../../crates/tracedecay-usecases/src/advisory/fixtures/provider_branch_review/check_annotations.json" ), ) .expect("authentic CI responses decode"); @@ -422,7 +422,7 @@ async fn authentic_github_and_ci_responses_use_production_decoders() { #[tokio::test] async fn corrupt_provider_identity_fails_production_decoder() { let mut pull_request = captured_response(include_str!( - "../crates/tracedecay-usecases/src/advisory/fixtures/provider_branch_review/pull_request.json" + "../../../crates/tracedecay-usecases/src/advisory/fixtures/provider_branch_review/pull_request.json" )); pull_request["id"] = json!(0); let request = GitHubReviewReadRequestV1 { @@ -617,7 +617,7 @@ async fn retained_review_body_expansion_rechecks_exact_scope_and_source_access() pull_request_id: GitHubPullRequestIdV1::new("4026204542").unwrap(), }; let fixture: Value = serde_json::from_str(include_str!( - "../crates/tracedecay-usecases/src/advisory/fixtures/provider_branch_review/review_comment.json" + "../../../crates/tracedecay-usecases/src/advisory/fixtures/provider_branch_review/review_comment.json" )) .unwrap(); let body = fixture.pointer("/response/body").unwrap().as_str().unwrap(); @@ -959,7 +959,7 @@ async fn packaged_host_ingest_delivers_a_registered_advisory_cycle() { ) .unwrap(); let mut event: Value = serde_json::from_str(include_str!( - "../crates/tracedecay-hooks/fixtures/host_events/cursor/after-file-edit.json" + "../../../crates/tracedecay-hooks/fixtures/host_events/cursor/after-file-edit.json" )) .unwrap(); event["conversation_id"] = json!("conversation-advisory-proximity"); @@ -1034,13 +1034,13 @@ async fn packaged_host_ingest_delivers_a_registered_advisory_cycle() { let codex_sessions = environment.home().join(".codex/sessions"); std::fs::create_dir_all(&codex_sessions).unwrap(); let mut codex_meta: Value = serde_json::from_str(include_str!( - "fixtures/provider_normalization/codex/session_meta.input.json" + "../../../tests/fixtures/provider_normalization/codex/session_meta.input.json" )) .unwrap(); codex_meta["payload"]["id"] = json!("session-advisory-proximity"); codex_meta["payload"]["cwd"] = json!(project.clone()); let codex_message: Value = serde_json::from_str(include_str!( - "fixtures/provider_normalization/codex/agent_message.input.json" + "../../../tests/fixtures/provider_normalization/codex/agent_message.input.json" )) .unwrap(); std::fs::write( @@ -1050,7 +1050,7 @@ async fn packaged_host_ingest_delivers_a_registered_advisory_cycle() { .unwrap(); let mut stop: Value = serde_json::from_str(include_str!( - "../crates/tracedecay-hooks/fixtures/host_events/codex/stop.json" + "../../../crates/tracedecay-hooks/fixtures/host_events/codex/stop.json" )) .unwrap(); stop["session_id"] = json!("session-advisory-proximity"); @@ -1682,7 +1682,7 @@ async fn one_saved_edit_cycle_returns_all_four_advisory_pillars_together() { // ---- Pillar 3: an existing GitHub review finding, through the production // decoder, sanitizer, and canonical anchor authority ---- let mut thread = captured_response(include_str!( - "../crates/tracedecay-usecases/src/advisory/fixtures/provider_branch_review/review_thread.graphql.json" + "../../../crates/tracedecay-usecases/src/advisory/fixtures/provider_branch_review/review_thread.graphql.json" )); let pull_request = thread .pointer_mut("/data/repository/pullRequest") diff --git a/tests/advisory_runtime_acceptance/code_graph.rs b/crates/tracedecay/tests/advisory_runtime_acceptance/code_graph.rs similarity index 100% rename from tests/advisory_runtime_acceptance/code_graph.rs rename to crates/tracedecay/tests/advisory_runtime_acceptance/code_graph.rs diff --git a/tests/agent_suite/agent_registry_test.rs b/crates/tracedecay/tests/agent_suite/agent_registry_test.rs similarity index 100% rename from tests/agent_suite/agent_registry_test.rs rename to crates/tracedecay/tests/agent_suite/agent_registry_test.rs diff --git a/tests/agent_suite/agent_targets_test.rs b/crates/tracedecay/tests/agent_suite/agent_targets_test.rs similarity index 100% rename from tests/agent_suite/agent_targets_test.rs rename to crates/tracedecay/tests/agent_suite/agent_targets_test.rs diff --git a/tests/agent_suite/claude_plugin_bundle_test.rs b/crates/tracedecay/tests/agent_suite/claude_plugin_bundle_test.rs similarity index 98% rename from tests/agent_suite/claude_plugin_bundle_test.rs rename to crates/tracedecay/tests/agent_suite/claude_plugin_bundle_test.rs index 700f917823..ede96558a5 100644 --- a/tests/agent_suite/claude_plugin_bundle_test.rs +++ b/crates/tracedecay/tests/agent_suite/claude_plugin_bundle_test.rs @@ -26,7 +26,7 @@ use tracedecay_agent_hosts::automation::skill_frontmatter::parse_skill_frontmatt /// agents; Claude's host-specific files are `README-claude.md`, `.mcp.json`, /// and `hooks/hooks-claude.json`). fn bundle_root() -> PathBuf { - Path::new(env!("CARGO_MANIFEST_DIR")).join("plugin") + crate::common::repository_path("plugin") } /// The 14 model-invocable skills the bundle ships (also the Codex skill set), @@ -412,7 +412,7 @@ fn claude_bundle_commands_have_valid_frontmatter_and_body() { #[test] fn claude_bundle_agents_are_byte_identical_to_the_source_of_truth() { let bundle_agents = bundle_root().join("agents"); - let manifest_root = Path::new(env!("CARGO_MANIFEST_DIR")); + let manifest_root = crate::common::repository_root(); let source_agents = manifest_root.join("plugin/agents"); assert!( !manifest_root.join("src/agents/claude_agents").exists(), @@ -456,7 +456,7 @@ fn claude_agents_allow_only_live_read_only_mcp_tools() { const DIRECT_PREFIX: &str = "mcp__tracedecay__"; const PLUGIN_PREFIX: &str = "mcp__plugin_tracedecay_graph__"; - let source_agents = Path::new(env!("CARGO_MANIFEST_DIR")).join("plugin/agents"); + let source_agents = crate::common::repository_path("plugin/agents"); let live_read_only: BTreeSet = tracedecay::agents::read_only_tool_names() .into_iter() .collect(); @@ -532,7 +532,7 @@ fn claude_agents_allow_only_live_read_only_mcp_tools() { #[test] fn cursor_and_codex_agents_are_generated_from_the_canonical_catalog() { - let root = Path::new(env!("CARGO_MANIFEST_DIR")); + let root = crate::common::repository_root(); assert!( !root.join("plugin/overlays/cursor/agents").exists(), "Cursor adapters must be generated, not hand-authored" diff --git a/tests/agent_suite/claude_plugin_schema_test.rs b/crates/tracedecay/tests/agent_suite/claude_plugin_schema_test.rs similarity index 92% rename from tests/agent_suite/claude_plugin_schema_test.rs rename to crates/tracedecay/tests/agent_suite/claude_plugin_schema_test.rs index 1a034c6a80..9546756829 100644 --- a/tests/agent_suite/claude_plugin_schema_test.rs +++ b/crates/tracedecay/tests/agent_suite/claude_plugin_schema_test.rs @@ -19,9 +19,12 @@ use crate::plugin_validation_support::{ assert_schema_valid, compile_schema, read_json_file, repo_path, }; -const HOOKS_SCHEMA: &str = include_str!("../fixtures/claude-schemas/hooks.schema.json"); -const PLUGIN_SCHEMA: &str = include_str!("../fixtures/claude-schemas/plugin.schema.json"); -const MARKETPLACE_SCHEMA: &str = include_str!("../fixtures/claude-schemas/marketplace.schema.json"); +const HOOKS_SCHEMA: &str = + include_str!("../../../../tests/fixtures/claude-schemas/hooks.schema.json"); +const PLUGIN_SCHEMA: &str = + include_str!("../../../../tests/fixtures/claude-schemas/plugin.schema.json"); +const MARKETPLACE_SCHEMA: &str = + include_str!("../../../../tests/fixtures/claude-schemas/marketplace.schema.json"); fn compile(schema_body: &str) -> Validator { let schema: Value = serde_json::from_str(schema_body).expect("vendored schema parses"); diff --git a/tests/agent_suite/cli_args_contract_test.rs b/crates/tracedecay/tests/agent_suite/cli_args_contract_test.rs similarity index 100% rename from tests/agent_suite/cli_args_contract_test.rs rename to crates/tracedecay/tests/agent_suite/cli_args_contract_test.rs diff --git a/tests/agent_suite/main.rs b/crates/tracedecay/tests/agent_suite/main.rs similarity index 100% rename from tests/agent_suite/main.rs rename to crates/tracedecay/tests/agent_suite/main.rs diff --git a/tests/agent_suite/managed_skill_archive_test.rs b/crates/tracedecay/tests/agent_suite/managed_skill_archive_test.rs similarity index 100% rename from tests/agent_suite/managed_skill_archive_test.rs rename to crates/tracedecay/tests/agent_suite/managed_skill_archive_test.rs diff --git a/tests/agent_suite/managed_skills_test.rs b/crates/tracedecay/tests/agent_suite/managed_skills_test.rs similarity index 100% rename from tests/agent_suite/managed_skills_test.rs rename to crates/tracedecay/tests/agent_suite/managed_skills_test.rs diff --git a/tests/agent_suite/plugin_config_schema_test.rs b/crates/tracedecay/tests/agent_suite/plugin_config_schema_test.rs similarity index 96% rename from tests/agent_suite/plugin_config_schema_test.rs rename to crates/tracedecay/tests/agent_suite/plugin_config_schema_test.rs index 7cc0138053..98068ab439 100644 --- a/tests/agent_suite/plugin_config_schema_test.rs +++ b/crates/tracedecay/tests/agent_suite/plugin_config_schema_test.rs @@ -26,8 +26,9 @@ use crate::plugin_validation_support::{ assert_schema_valid, compile_schema, read_json_file, repo_path, }; -const MCP_SCHEMA: &str = include_str!("../fixtures/cursor-schemas/mcp.schema.json"); -const HOOKS_SCHEMA: &str = include_str!("../fixtures/cursor-schemas/hooks.schema.json"); +const MCP_SCHEMA: &str = include_str!("../../../../tests/fixtures/cursor-schemas/mcp.schema.json"); +const HOOKS_SCHEMA: &str = + include_str!("../../../../tests/fixtures/cursor-schemas/hooks.schema.json"); fn compile(schema_body: &str) -> Validator { let schema: Value = serde_json::from_str(schema_body).expect("vendored schema parses"); diff --git a/tests/agent_suite/plugin_manifest_schema_test.rs b/crates/tracedecay/tests/agent_suite/plugin_manifest_schema_test.rs similarity index 98% rename from tests/agent_suite/plugin_manifest_schema_test.rs rename to crates/tracedecay/tests/agent_suite/plugin_manifest_schema_test.rs index 430d287fc0..1326b775b9 100644 --- a/tests/agent_suite/plugin_manifest_schema_test.rs +++ b/crates/tracedecay/tests/agent_suite/plugin_manifest_schema_test.rs @@ -21,7 +21,8 @@ use crate::plugin_validation_support::{ assert_schema_valid, compile_schema, read_json_file, repo_path, }; -const PLUGIN_SCHEMA: &str = include_str!("../fixtures/cursor-schemas/plugin.schema.json"); +const PLUGIN_SCHEMA: &str = + include_str!("../../../../tests/fixtures/cursor-schemas/plugin.schema.json"); /// Component paths declared in a manifest, with the manifest fields that /// declared them. Only string and string-array fields are path references; diff --git a/tests/agent_suite/plugin_validation_support.rs b/crates/tracedecay/tests/agent_suite/plugin_validation_support.rs similarity index 97% rename from tests/agent_suite/plugin_validation_support.rs rename to crates/tracedecay/tests/agent_suite/plugin_validation_support.rs index 4798bd066b..a30437aadd 100644 --- a/tests/agent_suite/plugin_validation_support.rs +++ b/crates/tracedecay/tests/agent_suite/plugin_validation_support.rs @@ -8,9 +8,9 @@ use tracedecay_agent_hosts::automation::skill_frontmatter::{ SkillFrontmatterValue, parse_skill_frontmatter, }; -/// A path relative to the repository root (`CARGO_MANIFEST_DIR`). +/// A path relative to the repository root. pub fn repo_path(relative: &str) -> PathBuf { - Path::new(env!("CARGO_MANIFEST_DIR")).join(relative) + crate::common::repository_path(relative) } pub fn read_json_file(path: &Path) -> Value { diff --git a/tests/agent_suite/shared_skill_contract_test.rs b/crates/tracedecay/tests/agent_suite/shared_skill_contract_test.rs similarity index 100% rename from tests/agent_suite/shared_skill_contract_test.rs rename to crates/tracedecay/tests/agent_suite/shared_skill_contract_test.rs diff --git a/tests/agent_suite/skill_lint_claude_test.rs b/crates/tracedecay/tests/agent_suite/skill_lint_claude_test.rs similarity index 100% rename from tests/agent_suite/skill_lint_claude_test.rs rename to crates/tracedecay/tests/agent_suite/skill_lint_claude_test.rs diff --git a/tests/agent_suite/skill_lint_cursor_test.rs b/crates/tracedecay/tests/agent_suite/skill_lint_cursor_test.rs similarity index 100% rename from tests/agent_suite/skill_lint_cursor_test.rs rename to crates/tracedecay/tests/agent_suite/skill_lint_cursor_test.rs diff --git a/tests/agent_suite/skill_materialization_test.rs b/crates/tracedecay/tests/agent_suite/skill_materialization_test.rs similarity index 100% rename from tests/agent_suite/skill_materialization_test.rs rename to crates/tracedecay/tests/agent_suite/skill_materialization_test.rs diff --git a/tests/agent_suite/skill_targets_test.rs b/crates/tracedecay/tests/agent_suite/skill_targets_test.rs similarity index 100% rename from tests/agent_suite/skill_targets_test.rs rename to crates/tracedecay/tests/agent_suite/skill_targets_test.rs diff --git a/tests/agent_suite/skill_usage_test.rs b/crates/tracedecay/tests/agent_suite/skill_usage_test.rs similarity index 100% rename from tests/agent_suite/skill_usage_test.rs rename to crates/tracedecay/tests/agent_suite/skill_usage_test.rs diff --git a/tests/agent_suite/tool_skill_coverage_test.rs b/crates/tracedecay/tests/agent_suite/tool_skill_coverage_test.rs similarity index 99% rename from tests/agent_suite/tool_skill_coverage_test.rs rename to crates/tracedecay/tests/agent_suite/tool_skill_coverage_test.rs index 8bfef92b04..ec03eb29fe 100644 --- a/tests/agent_suite/tool_skill_coverage_test.rs +++ b/crates/tracedecay/tests/agent_suite/tool_skill_coverage_test.rs @@ -160,7 +160,7 @@ fn skill_bodies(skills_roots: &[PathBuf]) -> Vec { #[test] fn every_mcp_tool_is_taught_by_at_least_one_bundled_skill() { - let plugin = Path::new(env!("CARGO_MANIFEST_DIR")).join("plugin"); + let plugin = crate::common::repository_path("plugin"); // Codex/Claude deploy the 30 canonical skills under plugin/skills. Cursor // deploys the 17 shared model-invocable skills plus the 13 workflow slugs // as native commands (`overlays/cursor/commands`). Both host views must diff --git a/tests/api_application_parity.rs b/crates/tracedecay/tests/api_application_parity.rs similarity index 99% rename from tests/api_application_parity.rs rename to crates/tracedecay/tests/api_application_parity.rs index 5f42e18410..d5402b3109 100644 --- a/tests/api_application_parity.rs +++ b/crates/tracedecay/tests/api_application_parity.rs @@ -33,8 +33,9 @@ use tracedecay_domain::{ }; use tracedecay_tool_catalog::{BindingSurface, ProfileId, SchemaId, SurfaceOperationName}; -const PARITY_FIXTURE: &str = - include_str!("../benchmark_data/transport-boundary/goldens/application-surface-parity.json"); +const PARITY_FIXTURE: &str = include_str!( + "../../../benchmark_data/transport-boundary/goldens/application-surface-parity.json" +); /// The operations whose decoded surface request carries a /// `CallableCodeSurfaceMeta`, and therefore a `cursor` continuation that every diff --git a/tests/application_production_reachability.rs b/crates/tracedecay/tests/application_production_reachability.rs similarity index 99% rename from tests/application_production_reachability.rs rename to crates/tracedecay/tests/application_production_reachability.rs index 0b02d7ae77..433eb242d9 100644 --- a/tests/application_production_reachability.rs +++ b/crates/tracedecay/tests/application_production_reachability.rs @@ -69,11 +69,11 @@ impl ProductionFixture { async fn production_fixture() -> ProductionFixture { let (environment, project) = common::IsolatedEnv::acquire().await; copy_dir( - &Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/context_eval_project"), + &common::repository_path("tests/fixtures/context_eval_project"), &project, ); copy_dir( - &Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/managed_run_overlay"), + &common::repository_path("tests/fixtures/managed_run_overlay"), &project, ); write_pagination_probe(&project); diff --git a/tests/automation_runner_test/backend.rs b/crates/tracedecay/tests/automation_runner_test/backend.rs similarity index 100% rename from tests/automation_runner_test/backend.rs rename to crates/tracedecay/tests/automation_runner_test/backend.rs diff --git a/tests/automation_runner_test/combined_review.rs b/crates/tracedecay/tests/automation_runner_test/combined_review.rs similarity index 100% rename from tests/automation_runner_test/combined_review.rs rename to crates/tracedecay/tests/automation_runner_test/combined_review.rs diff --git a/tests/automation_runner_test/config.rs b/crates/tracedecay/tests/automation_runner_test/config.rs similarity index 100% rename from tests/automation_runner_test/config.rs rename to crates/tracedecay/tests/automation_runner_test/config.rs diff --git a/tests/automation_runner_test/jobs.rs b/crates/tracedecay/tests/automation_runner_test/jobs.rs similarity index 100% rename from tests/automation_runner_test/jobs.rs rename to crates/tracedecay/tests/automation_runner_test/jobs.rs diff --git a/tests/automation_runner_test/main.rs b/crates/tracedecay/tests/automation_runner_test/main.rs similarity index 100% rename from tests/automation_runner_test/main.rs rename to crates/tracedecay/tests/automation_runner_test/main.rs diff --git a/tests/automation_runner_test/memory_curator.rs b/crates/tracedecay/tests/automation_runner_test/memory_curator.rs similarity index 100% rename from tests/automation_runner_test/memory_curator.rs rename to crates/tracedecay/tests/automation_runner_test/memory_curator.rs diff --git a/tests/automation_runner_test/memory_curator/backend_failures.rs b/crates/tracedecay/tests/automation_runner_test/memory_curator/backend_failures.rs similarity index 100% rename from tests/automation_runner_test/memory_curator/backend_failures.rs rename to crates/tracedecay/tests/automation_runner_test/memory_curator/backend_failures.rs diff --git a/tests/automation_runner_test/memory_curator/manual_trigger.rs b/crates/tracedecay/tests/automation_runner_test/memory_curator/manual_trigger.rs similarity index 100% rename from tests/automation_runner_test/memory_curator/manual_trigger.rs rename to crates/tracedecay/tests/automation_runner_test/memory_curator/manual_trigger.rs diff --git a/tests/automation_runner_test/memory_curator/pagination.rs b/crates/tracedecay/tests/automation_runner_test/memory_curator/pagination.rs similarity index 100% rename from tests/automation_runner_test/memory_curator/pagination.rs rename to crates/tracedecay/tests/automation_runner_test/memory_curator/pagination.rs diff --git a/tests/automation_runner_test/run_ledger.rs b/crates/tracedecay/tests/automation_runner_test/run_ledger.rs similarity index 100% rename from tests/automation_runner_test/run_ledger.rs rename to crates/tracedecay/tests/automation_runner_test/run_ledger.rs diff --git a/tests/automation_runner_test/runner.rs b/crates/tracedecay/tests/automation_runner_test/runner.rs similarity index 100% rename from tests/automation_runner_test/runner.rs rename to crates/tracedecay/tests/automation_runner_test/runner.rs diff --git a/tests/automation_runner_test/scheduler.rs b/crates/tracedecay/tests/automation_runner_test/scheduler.rs similarity index 100% rename from tests/automation_runner_test/scheduler.rs rename to crates/tracedecay/tests/automation_runner_test/scheduler.rs diff --git a/tests/automation_runner_test/session_reflector.rs b/crates/tracedecay/tests/automation_runner_test/session_reflector.rs similarity index 100% rename from tests/automation_runner_test/session_reflector.rs rename to crates/tracedecay/tests/automation_runner_test/session_reflector.rs diff --git a/tests/automation_runner_test/session_reflector/automatic_fact_receipts.rs b/crates/tracedecay/tests/automation_runner_test/session_reflector/automatic_fact_receipts.rs similarity index 100% rename from tests/automation_runner_test/session_reflector/automatic_fact_receipts.rs rename to crates/tracedecay/tests/automation_runner_test/session_reflector/automatic_fact_receipts.rs diff --git a/tests/automation_runner_test/skill_writer.rs b/crates/tracedecay/tests/automation_runner_test/skill_writer.rs similarity index 100% rename from tests/automation_runner_test/skill_writer.rs rename to crates/tracedecay/tests/automation_runner_test/skill_writer.rs diff --git a/tests/automation_runner_test/skill_writer_consolidation.rs b/crates/tracedecay/tests/automation_runner_test/skill_writer_consolidation.rs similarity index 100% rename from tests/automation_runner_test/skill_writer_consolidation.rs rename to crates/tracedecay/tests/automation_runner_test/skill_writer_consolidation.rs diff --git a/tests/automation_runner_test/support.rs b/crates/tracedecay/tests/automation_runner_test/support.rs similarity index 100% rename from tests/automation_runner_test/support.rs rename to crates/tracedecay/tests/automation_runner_test/support.rs diff --git a/tests/automation_runner_test/support/fixtures.rs b/crates/tracedecay/tests/automation_runner_test/support/fixtures.rs similarity index 100% rename from tests/automation_runner_test/support/fixtures.rs rename to crates/tracedecay/tests/automation_runner_test/support/fixtures.rs diff --git a/tests/catalog_composition_contract.rs b/crates/tracedecay/tests/catalog_composition_contract.rs similarity index 100% rename from tests/catalog_composition_contract.rs rename to crates/tracedecay/tests/catalog_composition_contract.rs diff --git a/tests/common/fixture.rs b/crates/tracedecay/tests/common/fixture.rs similarity index 100% rename from tests/common/fixture.rs rename to crates/tracedecay/tests/common/fixture.rs diff --git a/tests/common/mod.rs b/crates/tracedecay/tests/common/mod.rs similarity index 99% rename from tests/common/mod.rs rename to crates/tracedecay/tests/common/mod.rs index 3997e1424f..418f27b137 100644 --- a/tests/common/mod.rs +++ b/crates/tracedecay/tests/common/mod.rs @@ -1,6 +1,7 @@ #![allow(dead_code)] pub mod fixture; +pub mod repository_layout; use std::ffi::{OsStr, OsString}; use std::fs::{self, File}; @@ -31,16 +32,25 @@ use tracedecay::types::{Node, NodeKind, Visibility}; use tracedecay_sessions::runtime::{SessionMessageRecord, SessionRecord}; use tracedecay_usecases::host_admission::{HostAdmissionOutcome, HostAdmissionScope}; +pub fn repository_root() -> &'static Path { + repository_layout::repository_root() +} + +pub fn repository_path(relative: impl AsRef) -> PathBuf { + repository_layout::repository_path(relative) +} + /// Host-installer source and template assets that live in /// `crates/tracedecay-agent-hosts`. Tests assert over the *source* of the /// generated guidance, so every suite must read the same authority; keeping the /// `include_str!` sites here means one edit repoints them all after a move. pub mod host_sources { pub const HERMES_PLUGIN_INIT_PY: &str = include_str!( - "../../crates/tracedecay-agent-hosts/src/agents/hermes/templates/plugin_init.py" + "../../../../crates/tracedecay-agent-hosts/src/agents/hermes/templates/plugin_init.py" + ); + pub const HERMES_SKILL_MD: &str = include_str!( + "../../../../crates/tracedecay-agent-hosts/src/agents/hermes/templates/skill.md" ); - pub const HERMES_SKILL_MD: &str = - include_str!("../../crates/tracedecay-agent-hosts/src/agents/hermes/templates/skill.md"); } static EMPTY_LCM_DB_TEMPLATE: OnceCell> = OnceCell::const_new(); diff --git a/crates/tracedecay/tests/common/repository_layout.rs b/crates/tracedecay/tests/common/repository_layout.rs new file mode 100644 index 0000000000..8bd6760e9b --- /dev/null +++ b/crates/tracedecay/tests/common/repository_layout.rs @@ -0,0 +1,37 @@ +use std::path::{Path, PathBuf}; +use std::sync::OnceLock; + +static REPOSITORY_ROOT: OnceLock = OnceLock::new(); + +/// Returns the checked-out TraceDecay repository root for integration assets. +/// +/// The `tracedecay` package lives below `crates/`, while fixtures, plugin +/// sources, and the dashboard remain repository-owned. Resolve that boundary +/// once and validate stable sentinels before any test consumes a checkout-only +/// path. +pub fn repository_root() -> &'static Path { + REPOSITORY_ROOT + .get_or_init(|| { + let root = Path::new(env!("CARGO_MANIFEST_DIR")).join("../.."); + assert!( + root.join("Cargo.toml").is_file(), + "missing workspace manifest" + ); + assert!(root.join("dashboard").is_dir(), "missing dashboard source"); + assert!(root.join("plugin").is_dir(), "missing plugin source"); + root + }) + .as_path() +} + +pub fn repository_path(relative: impl AsRef) -> PathBuf { + repository_root().join(relative) +} + +#[test] +fn repository_root_resolves_workspace_asset_sentinels() { + let root = repository_root(); + assert!(root.join("Cargo.toml").is_file()); + assert!(root.join("dashboard").is_dir()); + assert!(root.join("plugin").is_dir()); +} diff --git a/tests/cross_host_handoff_test.rs b/crates/tracedecay/tests/cross_host_handoff_test.rs similarity index 100% rename from tests/cross_host_handoff_test.rs rename to crates/tracedecay/tests/cross_host_handoff_test.rs diff --git a/tests/daemon_fault_harness_test.rs b/crates/tracedecay/tests/daemon_fault_harness_test.rs similarity index 100% rename from tests/daemon_fault_harness_test.rs rename to crates/tracedecay/tests/daemon_fault_harness_test.rs diff --git a/tests/daemon_runtime_acceptance.rs b/crates/tracedecay/tests/daemon_runtime_acceptance.rs similarity index 99% rename from tests/daemon_runtime_acceptance.rs rename to crates/tracedecay/tests/daemon_runtime_acceptance.rs index 915f111555..840e478c36 100644 --- a/tests/daemon_runtime_acceptance.rs +++ b/crates/tracedecay/tests/daemon_runtime_acceptance.rs @@ -132,7 +132,7 @@ async fn authentic_callback_to_all_delivery_surfaces() { .expect("production project-open startup"); let callback = include_bytes!( - "../crates/tracedecay-hooks/fixtures/host_events/claude/post_tool_use_write.json" + "../../../crates/tracedecay-hooks/fixtures/host_events/claude/post_tool_use_write.json" ); let decoded = decode_native_hook_event(HookHostV1::ClaudeCode, callback).expect("authentic callback"); diff --git a/tests/daemon_suite/advanced_workflow_journey/daemon_fixture.rs b/crates/tracedecay/tests/daemon_suite/advanced_workflow_journey/daemon_fixture.rs similarity index 100% rename from tests/daemon_suite/advanced_workflow_journey/daemon_fixture.rs rename to crates/tracedecay/tests/daemon_suite/advanced_workflow_journey/daemon_fixture.rs diff --git a/tests/daemon_suite/advanced_workflow_journey/task_session.rs b/crates/tracedecay/tests/daemon_suite/advanced_workflow_journey/task_session.rs similarity index 100% rename from tests/daemon_suite/advanced_workflow_journey/task_session.rs rename to crates/tracedecay/tests/daemon_suite/advanced_workflow_journey/task_session.rs index f1cf7964b8..c034aa4dde 100644 --- a/tests/daemon_suite/advanced_workflow_journey/task_session.rs +++ b/crates/tracedecay/tests/daemon_suite/advanced_workflow_journey/task_session.rs @@ -500,6 +500,67 @@ fn set_semantic_runtime_configuration( .unwrap_or_else(|error| panic!("{operation}: {error}")); } +/// Proves the evaluated profile is both selected through the public configuration +/// authority and ready through the mounted runtime authority before TaskSession +/// selection. TaskSession anchors deliberately retain only TaskSession provenance. +pub(super) fn wait_for_evaluated_semantic_profile_current( + home: &Path, + project: &Path, + client: &Client, +) { + let configured = client + .execute::( + &tracedecay_application::configuration::ConfigurationGetRequestV1 { + key: SettingKey::new(SEMANTIC_RUNTIME_SETTING_KEY) + .expect("semantic runtime setting key"), + }, + ) + .expect("read activated semantic runtime configuration through typed SDK") + .result; + let ConfigurationValueV1::Text(value) = &configured.effective_value else { + panic!( + "activated semantic runtime must retain its typed configuration text: {configured:?}" + ); + }; + let semantic_config: SemanticConfig = serde_json::from_str(value) + .unwrap_or_else(|error| panic!("decode activated semantic runtime configuration: {error}")); + let active_profile = semantic_config + .active_profile + .as_ref() + .expect("evaluated semantic profile must remain active through the typed SDK"); + assert_eq!( + active_profile.profile_id, EVALUATED_PROFILE_ID, + "the evaluated semantic profile selected through the typed SDK must remain active" + ); + + let deadline = Instant::now() + Duration::from_secs(120); + loop { + let status = semantic_runtime_status(home, project) + .unwrap_or_else(|| panic!("runtime returned an invalid semantic status")); + if let SemanticRuntimeStateV1::Current { receipt } = &status.state { + let runtime_configuration = status + .configuration + .as_ref() + .expect("ready semantic runtime must report its activation configuration"); + assert_eq!( + runtime_configuration.effective_behavior_digest, + configured.effective_behavior_digest, + "the runtime readiness receipt must authorize the exact evaluated configuration selected through the SDK" + ); + assert_eq!( + receipt.configuration, *runtime_configuration, + "the ready semantic receipt must retain the runtime's exact activation configuration" + ); + return; + } + assert!( + Instant::now() < deadline, + "timed out waiting for activated semantic runtime: {status:?}" + ); + std::thread::sleep(Duration::from_millis(250)); + } +} + fn wait_for_semantic_generation( home: &Path, project: &Path, @@ -582,67 +643,6 @@ fn read_active_code_generation( .ok() } -/// Proves the evaluated profile is both selected through the public configuration -/// authority and ready through the mounted runtime authority before TaskSession -/// selection. TaskSession anchors deliberately retain only TaskSession provenance. -pub(super) fn wait_for_evaluated_semantic_profile_current( - home: &Path, - project: &Path, - client: &Client, -) { - let configured = client - .execute::( - &tracedecay_application::configuration::ConfigurationGetRequestV1 { - key: SettingKey::new(SEMANTIC_RUNTIME_SETTING_KEY) - .expect("semantic runtime setting key"), - }, - ) - .expect("read activated semantic runtime configuration through typed SDK") - .result; - let ConfigurationValueV1::Text(value) = &configured.effective_value else { - panic!( - "activated semantic runtime must retain its typed configuration text: {configured:?}" - ); - }; - let semantic_config: SemanticConfig = serde_json::from_str(value) - .unwrap_or_else(|error| panic!("decode activated semantic runtime configuration: {error}")); - let active_profile = semantic_config - .active_profile - .as_ref() - .expect("evaluated semantic profile must remain active through the typed SDK"); - assert_eq!( - active_profile.profile_id, EVALUATED_PROFILE_ID, - "the evaluated semantic profile selected through the typed SDK must remain active" - ); - - let deadline = Instant::now() + Duration::from_secs(120); - loop { - let status = semantic_runtime_status(home, project) - .unwrap_or_else(|| panic!("runtime returned an invalid semantic status")); - if let SemanticRuntimeStateV1::Current { receipt } = &status.state { - let runtime_configuration = status - .configuration - .as_ref() - .expect("ready semantic runtime must report its activation configuration"); - assert_eq!( - runtime_configuration.effective_behavior_digest, - configured.effective_behavior_digest, - "the runtime readiness receipt must authorize the exact evaluated configuration selected through the SDK" - ); - assert_eq!( - receipt.configuration, *runtime_configuration, - "the ready semantic receipt must retain the runtime's exact activation configuration" - ); - return; - } - assert!( - Instant::now() < deadline, - "timed out waiting for activated semantic runtime: {status:?}" - ); - std::thread::sleep(Duration::from_millis(250)); - } -} - fn semantic_runtime_status(home: &Path, project: &Path) -> Option { let value = serve_tool_call( home, diff --git a/tests/daemon_suite/advanced_workflow_journey_test.rs b/crates/tracedecay/tests/daemon_suite/advanced_workflow_journey_test.rs similarity index 100% rename from tests/daemon_suite/advanced_workflow_journey_test.rs rename to crates/tracedecay/tests/daemon_suite/advanced_workflow_journey_test.rs diff --git a/tests/daemon_suite/fixture_authority_test.rs b/crates/tracedecay/tests/daemon_suite/fixture_authority_test.rs similarity index 100% rename from tests/daemon_suite/fixture_authority_test.rs rename to crates/tracedecay/tests/daemon_suite/fixture_authority_test.rs diff --git a/tests/daemon_suite/git_watch_test.rs b/crates/tracedecay/tests/daemon_suite/git_watch_test.rs similarity index 100% rename from tests/daemon_suite/git_watch_test.rs rename to crates/tracedecay/tests/daemon_suite/git_watch_test.rs diff --git a/tests/daemon_suite/indexing_lifecycle_test.rs b/crates/tracedecay/tests/daemon_suite/indexing_lifecycle_test.rs similarity index 99% rename from tests/daemon_suite/indexing_lifecycle_test.rs rename to crates/tracedecay/tests/daemon_suite/indexing_lifecycle_test.rs index 20f81bd898..b9f169bbb3 100644 --- a/tests/daemon_suite/indexing_lifecycle_test.rs +++ b/crates/tracedecay/tests/daemon_suite/indexing_lifecycle_test.rs @@ -203,7 +203,7 @@ fn exact_identity(project: &Path, project_id: String) -> ExactIndexIdentity { } fn tool_payload(result: Value, operation: &str) -> Value { - let text = result["content"] + result["content"] .as_array() .and_then(|content| { content.iter().find_map(|item| { @@ -212,8 +212,7 @@ fn tool_payload(result: Value, operation: &str) -> Value { .and_then(|text| serde_json::from_str(text).ok()) }) }) - .unwrap_or_else(|| panic!("{operation} did not return JSON content: {result}")); - text + .unwrap_or_else(|| panic!("{operation} did not return JSON content: {result}")) } async fn tool(socket: &Path, handshake: &DaemonHandshake, name: &str, arguments: Value) -> Value { diff --git a/tests/daemon_suite/main.rs b/crates/tracedecay/tests/daemon_suite/main.rs similarity index 100% rename from tests/daemon_suite/main.rs rename to crates/tracedecay/tests/daemon_suite/main.rs diff --git a/tests/daemon_suite/pr_autotrack_test.rs b/crates/tracedecay/tests/daemon_suite/pr_autotrack_test.rs similarity index 100% rename from tests/daemon_suite/pr_autotrack_test.rs rename to crates/tracedecay/tests/daemon_suite/pr_autotrack_test.rs diff --git a/tests/daemon_suite/workflow_handoff_test.rs b/crates/tracedecay/tests/daemon_suite/workflow_handoff_test.rs similarity index 100% rename from tests/daemon_suite/workflow_handoff_test.rs rename to crates/tracedecay/tests/daemon_suite/workflow_handoff_test.rs diff --git a/tests/dashboard_api_test/analytics.rs b/crates/tracedecay/tests/dashboard_api_test/analytics.rs similarity index 100% rename from tests/dashboard_api_test/analytics.rs rename to crates/tracedecay/tests/dashboard_api_test/analytics.rs diff --git a/tests/dashboard_api_test/api.rs b/crates/tracedecay/tests/dashboard_api_test/api.rs similarity index 100% rename from tests/dashboard_api_test/api.rs rename to crates/tracedecay/tests/dashboard_api_test/api.rs diff --git a/tests/dashboard_api_test/assets.rs b/crates/tracedecay/tests/dashboard_api_test/assets.rs similarity index 100% rename from tests/dashboard_api_test/assets.rs rename to crates/tracedecay/tests/dashboard_api_test/assets.rs diff --git a/tests/dashboard_api_test/automation.rs b/crates/tracedecay/tests/dashboard_api_test/automation.rs similarity index 99% rename from tests/dashboard_api_test/automation.rs rename to crates/tracedecay/tests/dashboard_api_test/automation.rs index 382620ed0f..b214ca6065 100644 --- a/tests/dashboard_api_test/automation.rs +++ b/crates/tracedecay/tests/dashboard_api_test/automation.rs @@ -40,7 +40,7 @@ fn fact_store_curate_is_the_only_public_manual_automation_launcher() { tracedecay_application::APPLICATION_REQUEST_ID_HEADER, "request.dashboard.fact-store-curate-single-launcher", ) - .send_json(&serde_json::json!({ + .send_json(serde_json::json!({ "fact_review_limit": 24, "min_confidence_millionths": 720_000 })) @@ -72,7 +72,7 @@ fn fact_store_curate_is_the_only_public_manual_automation_launcher() { tracedecay_application::APPLICATION_REQUEST_ID_HEADER, "request.dashboard.fact-store-curate-reject-operations", ) - .send_json(&serde_json::json!({ + .send_json(serde_json::json!({ "fact_review_limit": 24, "operations": [] })) @@ -87,7 +87,7 @@ fn fact_store_curate_is_the_only_public_manual_automation_launcher() { crate::common::http_call_with_retry(&format!("POST {retired_curator_url}"), || { agent .post(&retired_curator_url) - .send_json(&serde_json::json!({})) + .send_json(serde_json::json!({})) }); let status = response.status().as_u16(); assert_eq!( @@ -101,7 +101,7 @@ fn fact_store_curate_is_the_only_public_manual_automation_launcher() { format!("{base_url}/api/projects/{project_id}/automation/run/{route}"), ] { let response = crate::common::http_call_with_retry(&format!("POST {url}"), || { - agent.post(&url).send_json(&serde_json::json!({})) + agent.post(&url).send_json(serde_json::json!({})) }); assert_eq!(response.status().as_u16(), 404, "retired launcher: {url}"); } diff --git a/tests/dashboard_api_test/automation_config.rs b/crates/tracedecay/tests/dashboard_api_test/automation_config.rs similarity index 100% rename from tests/dashboard_api_test/automation_config.rs rename to crates/tracedecay/tests/dashboard_api_test/automation_config.rs diff --git a/tests/dashboard_api_test/automation_jobs.rs b/crates/tracedecay/tests/dashboard_api_test/automation_jobs.rs similarity index 99% rename from tests/dashboard_api_test/automation_jobs.rs rename to crates/tracedecay/tests/dashboard_api_test/automation_jobs.rs index 6389bd17e3..afabd4f846 100644 --- a/tests/dashboard_api_test/automation_jobs.rs +++ b/crates/tracedecay/tests/dashboard_api_test/automation_jobs.rs @@ -21,7 +21,7 @@ fn dashboard_three_request_chain_cannot_enable_and_run_a_shell_command() { let missing_codex_bin = tmp_root.join("missing-codex"); let _codex_bin_guard = EnvVarGuard::set("TRACEDECAY_CODEX_BIN", &missing_codex_bin); - let mut global_config = tracedecay::user_config::UserConfig::default(); + let mut global_config = tracedecay_usecases::user_config::UserConfig::default(); global_config.automation.enabled = true; global_config.automation.backend = tracedecay_agent_hosts::automation::config::AutomationBackend::CodexAppServer; diff --git a/tests/dashboard_api_test/automation_skills.rs b/crates/tracedecay/tests/dashboard_api_test/automation_skills.rs similarity index 100% rename from tests/dashboard_api_test/automation_skills.rs rename to crates/tracedecay/tests/dashboard_api_test/automation_skills.rs diff --git a/tests/dashboard_api_test/code_diagnostics.rs b/crates/tracedecay/tests/dashboard_api_test/code_diagnostics.rs similarity index 100% rename from tests/dashboard_api_test/code_diagnostics.rs rename to crates/tracedecay/tests/dashboard_api_test/code_diagnostics.rs diff --git a/tests/dashboard_api_test/dashboard_api_support.rs b/crates/tracedecay/tests/dashboard_api_test/dashboard_api_support.rs similarity index 97% rename from tests/dashboard_api_test/dashboard_api_support.rs rename to crates/tracedecay/tests/dashboard_api_test/dashboard_api_support.rs index 7623be8ddd..8a3b0017c1 100644 --- a/tests/dashboard_api_test/dashboard_api_support.rs +++ b/crates/tracedecay/tests/dashboard_api_test/dashboard_api_support.rs @@ -77,7 +77,6 @@ pub(crate) struct DashboardFixture { pub(crate) _data_dir_guard: EnvVarGuard, pub(crate) _home_guard: EnvVarGuard, pub(crate) _userprofile_guard: EnvVarGuard, - pub(crate) home: std::path::PathBuf, pub(crate) global_db_path: std::path::PathBuf, pub(crate) base_url: String, pub(crate) project_root: std::path::PathBuf, @@ -900,7 +899,6 @@ async fn start_dashboard_fixture_with_options( _data_dir_guard: data_dir_guard, _home_guard: home_guard, _userprofile_guard: userprofile_guard, - home, global_db_path, base_url, project_root, @@ -959,21 +957,3 @@ pub(crate) fn commit_all(project: &Path, message: &str) { ], ); } - -/// Opens the resolved registered project session authority. -pub(crate) async fn open_project_session_store(project_root: &Path) -> Arc { - let project_id = tracedecay::storage::read_repository_identity_marker(project_root) - .unwrap_or_else(|error| panic!("read dashboard project identity: {error}")) - .and_then(|marker| ProjectId::new(marker.project_id).ok()) - .unwrap_or_else(|| panic!("dashboard fixture requires an authoritative project identity")); - Arc::new( - DashboardTestRuntimeV1::project( - tracedecay::storage::default_profile_root() - .unwrap_or_else(|error| panic!("resolve dashboard test profile root: {error}")), - project_root, - project_id, - ) - .await - .unwrap_or_else(|error| panic!("open dashboard project session authority: {error}")), - ) -} diff --git a/tests/dashboard_api_test/delivery.rs b/crates/tracedecay/tests/dashboard_api_test/delivery.rs similarity index 100% rename from tests/dashboard_api_test/delivery.rs rename to crates/tracedecay/tests/dashboard_api_test/delivery.rs diff --git a/tests/dashboard_api_test/doctor.rs b/crates/tracedecay/tests/dashboard_api_test/doctor.rs similarity index 100% rename from tests/dashboard_api_test/doctor.rs rename to crates/tracedecay/tests/dashboard_api_test/doctor.rs diff --git a/tests/dashboard_api_test/explorer.rs b/crates/tracedecay/tests/dashboard_api_test/explorer.rs similarity index 100% rename from tests/dashboard_api_test/explorer.rs rename to crates/tracedecay/tests/dashboard_api_test/explorer.rs diff --git a/tests/dashboard_api_test/graph.rs b/crates/tracedecay/tests/dashboard_api_test/graph.rs similarity index 100% rename from tests/dashboard_api_test/graph.rs rename to crates/tracedecay/tests/dashboard_api_test/graph.rs diff --git a/tests/dashboard_api_test/loom.rs b/crates/tracedecay/tests/dashboard_api_test/loom.rs similarity index 100% rename from tests/dashboard_api_test/loom.rs rename to crates/tracedecay/tests/dashboard_api_test/loom.rs diff --git a/tests/dashboard_api_test/main.rs b/crates/tracedecay/tests/dashboard_api_test/main.rs similarity index 100% rename from tests/dashboard_api_test/main.rs rename to crates/tracedecay/tests/dashboard_api_test/main.rs diff --git a/tests/dashboard_api_test/memory_curation.rs b/crates/tracedecay/tests/dashboard_api_test/memory_curation.rs similarity index 100% rename from tests/dashboard_api_test/memory_curation.rs rename to crates/tracedecay/tests/dashboard_api_test/memory_curation.rs diff --git a/tests/dashboard_api_test/projects.rs b/crates/tracedecay/tests/dashboard_api_test/projects.rs similarity index 100% rename from tests/dashboard_api_test/projects.rs rename to crates/tracedecay/tests/dashboard_api_test/projects.rs diff --git a/tests/dashboard_api_test/runtime.rs b/crates/tracedecay/tests/dashboard_api_test/runtime.rs similarity index 100% rename from tests/dashboard_api_test/runtime.rs rename to crates/tracedecay/tests/dashboard_api_test/runtime.rs diff --git a/tests/dashboard_api_test/savings.rs b/crates/tracedecay/tests/dashboard_api_test/savings.rs similarity index 100% rename from tests/dashboard_api_test/savings.rs rename to crates/tracedecay/tests/dashboard_api_test/savings.rs diff --git a/tests/dashboard_api_test/settings.rs b/crates/tracedecay/tests/dashboard_api_test/settings.rs similarity index 100% rename from tests/dashboard_api_test/settings.rs rename to crates/tracedecay/tests/dashboard_api_test/settings.rs diff --git a/tests/dashboard_api_test/storage.rs b/crates/tracedecay/tests/dashboard_api_test/storage.rs similarity index 100% rename from tests/dashboard_api_test/storage.rs rename to crates/tracedecay/tests/dashboard_api_test/storage.rs diff --git a/tests/dashboard_build_manifest.rs b/crates/tracedecay/tests/dashboard_build_manifest.rs similarity index 100% rename from tests/dashboard_build_manifest.rs rename to crates/tracedecay/tests/dashboard_build_manifest.rs diff --git a/tests/git_index_snapshot_root_canonicalization.rs b/crates/tracedecay/tests/git_index_snapshot_root_canonicalization.rs similarity index 100% rename from tests/git_index_snapshot_root_canonicalization.rs rename to crates/tracedecay/tests/git_index_snapshot_root_canonicalization.rs diff --git a/tests/git_intelligence_regression.rs b/crates/tracedecay/tests/git_intelligence_regression.rs similarity index 99% rename from tests/git_intelligence_regression.rs rename to crates/tracedecay/tests/git_intelligence_regression.rs index 7a91d4ec0b..471e7e64de 100644 --- a/tests/git_intelligence_regression.rs +++ b/crates/tracedecay/tests/git_intelligence_regression.rs @@ -19,9 +19,6 @@ use std::path::Path; use std::process::{Command, Output}; use tempfile::TempDir; -use tracedecay::git_intelligence::{ - GitBlameRequest, GitHistoryRequest, GitIntelligenceError, NativeGitIntelligence, -}; use tracedecay::git_query::{ GenerationBoundGitQueryV1, GenerationStalenessV1, GitQueryBounds, GitQueryEngine, GitQueryError, }; @@ -31,6 +28,9 @@ use tracedecay_domain::git::{ HunkDirectionV1, }; use tracedecay_domain::research::{ManifestDigest, RepositoryId, WorktreeId}; +use tracedecay_usecases::git_intelligence::{ + GitBlameRequest, GitHistoryRequest, GitIntelligenceError, NativeGitIntelligence, +}; /// An isolated repository fixture driven by the real `git` executable. struct Fixture { diff --git a/tests/grafeo_restart_acceptance.rs b/crates/tracedecay/tests/grafeo_restart_acceptance.rs similarity index 99% rename from tests/grafeo_restart_acceptance.rs rename to crates/tracedecay/tests/grafeo_restart_acceptance.rs index 61f64bbe01..fa96435a8b 100644 --- a/tests/grafeo_restart_acceptance.rs +++ b/crates/tracedecay/tests/grafeo_restart_acceptance.rs @@ -15,11 +15,11 @@ use tracedecay_usecases::primitives::{PrimitiveRequest, StorageStatusPrimitiveRe fn initialize_project(home: &Path, project: &Path) { copy_dir( - &Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/context_eval_project"), + &common::repository_path("tests/fixtures/context_eval_project"), project, ); copy_dir( - &Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/managed_run_overlay"), + &common::repository_path("tests/fixtures/managed_run_overlay"), project, ); // Context fail-closes without a verified generation. Sibling graph diff --git a/tests/graph_rebuild_status_test.rs b/crates/tracedecay/tests/graph_rebuild_status_test.rs similarity index 98% rename from tests/graph_rebuild_status_test.rs rename to crates/tracedecay/tests/graph_rebuild_status_test.rs index 6f73d9f71a..0f1c4bf86c 100644 --- a/tests/graph_rebuild_status_test.rs +++ b/crates/tracedecay/tests/graph_rebuild_status_test.rs @@ -150,17 +150,17 @@ async fn wait_for_current_generation( && worktree["staleness_state"] == "fresh" && worktree["source_reference"] == "refs/heads/main" && worktree["source_revision"] == expected_revision - && generation.is_some() + && let Some(current_generation) = generation { last_search = search(harness, project, query).await; - if last_search["code_generation"].as_str() == generation.as_deref() + if last_search["code_generation"].as_str() == Some(current_generation.as_str()) && !result_paths(&last_search).is_empty() { assert!( last_status.get("code_index_freshness_warning").is_none(), "a current generation must not carry a warming warning: {last_status}" ); - return generation.expect("current generation"); + return current_generation; } } tokio::task::yield_now().await; diff --git a/tests/graph_suite/annotation_helpers_test.rs b/crates/tracedecay/tests/graph_suite/annotation_helpers_test.rs similarity index 100% rename from tests/graph_suite/annotation_helpers_test.rs rename to crates/tracedecay/tests/graph_suite/annotation_helpers_test.rs diff --git a/tests/graph_suite/bench_test.rs b/crates/tracedecay/tests/graph_suite/bench_test.rs similarity index 100% rename from tests/graph_suite/bench_test.rs rename to crates/tracedecay/tests/graph_suite/bench_test.rs diff --git a/tests/graph_suite/complexity_test.rs b/crates/tracedecay/tests/graph_suite/complexity_test.rs similarity index 100% rename from tests/graph_suite/complexity_test.rs rename to crates/tracedecay/tests/graph_suite/complexity_test.rs diff --git a/tests/graph_suite/graph_test.rs b/crates/tracedecay/tests/graph_suite/graph_test.rs similarity index 100% rename from tests/graph_suite/graph_test.rs rename to crates/tracedecay/tests/graph_suite/graph_test.rs diff --git a/tests/graph_suite/main.rs b/crates/tracedecay/tests/graph_suite/main.rs similarity index 100% rename from tests/graph_suite/main.rs rename to crates/tracedecay/tests/graph_suite/main.rs diff --git a/tests/graph_suite/types_test.rs b/crates/tracedecay/tests/graph_suite/types_test.rs similarity index 100% rename from tests/graph_suite/types_test.rs rename to crates/tracedecay/tests/graph_suite/types_test.rs diff --git a/tests/hermes_suite/lcm_bridge.rs b/crates/tracedecay/tests/hermes_suite/lcm_bridge.rs similarity index 99% rename from tests/hermes_suite/lcm_bridge.rs rename to crates/tracedecay/tests/hermes_suite/lcm_bridge.rs index 4ad73f7583..d50719b455 100644 --- a/tests/hermes_suite/lcm_bridge.rs +++ b/crates/tracedecay/tests/hermes_suite/lcm_bridge.rs @@ -2012,7 +2012,7 @@ fn generated_skill_mirrors_session_context_retrieval_contract() { for (label, skill) in [ ( "repository managing-session-context skill", - include_str!("../../plugin/skills/managing-session-context/SKILL.md"), + include_str!("../../../../plugin/skills/managing-session-context/SKILL.md"), ), ("Hermes template", template), ("installed Hermes skill snapshot", installed.as_str()), diff --git a/tests/hermes_suite/main.rs b/crates/tracedecay/tests/hermes_suite/main.rs similarity index 100% rename from tests/hermes_suite/main.rs rename to crates/tracedecay/tests/hermes_suite/main.rs diff --git a/tests/hooks_lsp_suite/hook_branch_routing_test.rs b/crates/tracedecay/tests/hooks_lsp_suite/hook_branch_routing_test.rs similarity index 100% rename from tests/hooks_lsp_suite/hook_branch_routing_test.rs rename to crates/tracedecay/tests/hooks_lsp_suite/hook_branch_routing_test.rs diff --git a/tests/hooks_lsp_suite/hook_lifecycle_lease_test.rs b/crates/tracedecay/tests/hooks_lsp_suite/hook_lifecycle_lease_test.rs similarity index 93% rename from tests/hooks_lsp_suite/hook_lifecycle_lease_test.rs rename to crates/tracedecay/tests/hooks_lsp_suite/hook_lifecycle_lease_test.rs index dab8b3237b..007b9ca0dc 100644 --- a/tests/hooks_lsp_suite/hook_lifecycle_lease_test.rs +++ b/crates/tracedecay/tests/hooks_lsp_suite/hook_lifecycle_lease_test.rs @@ -9,21 +9,21 @@ use super::common::{ fn native_hook_commands() -> Vec<(&'static str, Vec)> { let claude_stop = - include_bytes!("../../crates/tracedecay-hooks/fixtures/host_events/claude/stop.json") + include_bytes!("../../../../crates/tracedecay-hooks/fixtures/host_events/claude/stop.json") .to_vec(); let cursor_edit = include_bytes!( - "../../crates/tracedecay-hooks/fixtures/host_events/cursor/after-file-edit.json" + "../../../../crates/tracedecay-hooks/fixtures/host_events/cursor/after-file-edit.json" ) .to_vec(); let codex_stop = - include_bytes!("../../crates/tracedecay-hooks/fixtures/host_events/codex/stop.json") + include_bytes!("../../../../crates/tracedecay-hooks/fixtures/host_events/codex/stop.json") .to_vec(); let hermes_receipt = include_bytes!( - "../../crates/tracedecay-hooks/fixtures/host_events/hermes/terminal-receipt.json" + "../../../../crates/tracedecay-hooks/fixtures/host_events/hermes/terminal-receipt.json" ) .to_vec(); let kimi_edit = include_bytes!( - "../../crates/tracedecay-hooks/fixtures/host_events/kimi/post-tool-use-edit.json" + "../../../../crates/tracedecay-hooks/fixtures/host_events/kimi/post-tool-use-edit.json" ) .to_vec(); let kiro_prompt = br#"{ @@ -33,8 +33,9 @@ fn native_hook_commands() -> Vec<(&'static str, Vec)> { "prompt": "" }"# .to_vec(); - let opencode = - include_str!("../../crates/tracedecay-hooks/fixtures/host_events/opencode/baseline.json"); + let opencode = include_str!( + "../../../../crates/tracedecay-hooks/fixtures/host_events/opencode/baseline.json" + ); let opencode_stop = fixture_request(opencode, "stop"); let opencode_tool_after = fixture_request(opencode, "post_tool_use"); @@ -318,15 +319,16 @@ fn native_hook_captures_only_bound_transport_spool_records() { }; let temp = tempfile::tempdir().unwrap(); - let opencode = - include_str!("../../crates/tracedecay-hooks/fixtures/host_events/opencode/baseline.json"); + let opencode = include_str!( + "../../../../crates/tracedecay-hooks/fixtures/host_events/opencode/baseline.json" + ); let cases = [ ( "hook-claude-post-tool-use", HookHostV1::ClaudeCode, HookEventFamily::ToolLifecycle, include_bytes!( - "../../crates/tracedecay-hooks/fixtures/host_events/claude/post_tool_use_write.json" + "../../../../crates/tracedecay-hooks/fixtures/host_events/claude/post_tool_use_write.json" ) .to_vec(), ), @@ -334,14 +336,14 @@ fn native_hook_captures_only_bound_transport_spool_records() { "hook-stop", HookHostV1::ClaudeCode, HookEventFamily::SessionBoundary, - include_bytes!("../../crates/tracedecay-hooks/fixtures/host_events/claude/stop.json") + include_bytes!("../../../../crates/tracedecay-hooks/fixtures/host_events/claude/stop.json") .to_vec(), ), ( "hook-codex-stop", HookHostV1::Codex, HookEventFamily::SessionBoundary, - include_bytes!("../../crates/tracedecay-hooks/fixtures/host_events/codex/stop.json") + include_bytes!("../../../../crates/tracedecay-hooks/fixtures/host_events/codex/stop.json") .to_vec(), ), ( @@ -349,7 +351,7 @@ fn native_hook_captures_only_bound_transport_spool_records() { HookHostV1::CursorDesktop, HookEventFamily::SavedEdit, include_bytes!( - "../../crates/tracedecay-hooks/fixtures/host_events/cursor/after-file-edit.json" + "../../../../crates/tracedecay-hooks/fixtures/host_events/cursor/after-file-edit.json" ) .to_vec(), ), @@ -358,7 +360,7 @@ fn native_hook_captures_only_bound_transport_spool_records() { HookHostV1::Hermes, HookEventFamily::ToolLifecycle, include_bytes!( - "../../crates/tracedecay-hooks/fixtures/host_events/hermes/terminal-receipt.json" + "../../../../crates/tracedecay-hooks/fixtures/host_events/hermes/terminal-receipt.json" ) .to_vec(), ), @@ -367,7 +369,7 @@ fn native_hook_captures_only_bound_transport_spool_records() { HookHostV1::KimiCode, HookEventFamily::SavedEdit, include_bytes!( - "../../crates/tracedecay-hooks/fixtures/host_events/kimi/post-tool-use-edit.json" + "../../../../crates/tracedecay-hooks/fixtures/host_events/kimi/post-tool-use-edit.json" ) .to_vec(), ), diff --git a/tests/hooks_lsp_suite/hook_replay_test.rs b/crates/tracedecay/tests/hooks_lsp_suite/hook_replay_test.rs similarity index 100% rename from tests/hooks_lsp_suite/hook_replay_test.rs rename to crates/tracedecay/tests/hooks_lsp_suite/hook_replay_test.rs diff --git a/tests/hooks_lsp_suite/hooks_test.rs b/crates/tracedecay/tests/hooks_lsp_suite/hooks_test.rs similarity index 100% rename from tests/hooks_lsp_suite/hooks_test.rs rename to crates/tracedecay/tests/hooks_lsp_suite/hooks_test.rs diff --git a/tests/hooks_lsp_suite/lsp_gateway_protocol_test.rs b/crates/tracedecay/tests/hooks_lsp_suite/lsp_gateway_protocol_test.rs similarity index 100% rename from tests/hooks_lsp_suite/lsp_gateway_protocol_test.rs rename to crates/tracedecay/tests/hooks_lsp_suite/lsp_gateway_protocol_test.rs diff --git a/tests/hooks_lsp_suite/main.rs b/crates/tracedecay/tests/hooks_lsp_suite/main.rs similarity index 100% rename from tests/hooks_lsp_suite/main.rs rename to crates/tracedecay/tests/hooks_lsp_suite/main.rs diff --git a/tests/host_bundle_acceptance.rs b/crates/tracedecay/tests/host_bundle_acceptance.rs similarity index 97% rename from tests/host_bundle_acceptance.rs rename to crates/tracedecay/tests/host_bundle_acceptance.rs index 130d77fd49..6bdbd8fc4a 100644 --- a/tests/host_bundle_acceptance.rs +++ b/crates/tracedecay/tests/host_bundle_acceptance.rs @@ -776,7 +776,7 @@ fn unreadable_host_registration_refuses_instead_of_reporting_no_conflict() { #[test] fn cline_family_routes_come_only_from_the_checked_in_evidence_packet() { let packet: Value = serde_json::from_str(include_str!( - "../crates/tracedecay-hooks/fixtures/host_events/cline-family.json" + "../../../crates/tracedecay-hooks/fixtures/host_events/cline-family.json" )) .expect("the checked-in Cline evidence packet parses"); @@ -1257,40 +1257,42 @@ fn authentic_host_fixtures_use_production_typed_decoders() { ( HookHostV1::ClaudeCode, include_str!( - "../crates/tracedecay-hooks/fixtures/host_events/claude/post_tool_use_write.json" + "../../../crates/tracedecay-hooks/fixtures/host_events/claude/post_tool_use_write.json" ), ), ( HookHostV1::ClaudeCode, - include_str!("../crates/tracedecay-hooks/fixtures/host_events/claude/stop.json"), + include_str!("../../../crates/tracedecay-hooks/fixtures/host_events/claude/stop.json"), ), ( HookHostV1::Codex, - include_str!("../crates/tracedecay-hooks/fixtures/host_events/codex/stop.json"), + include_str!("../../../crates/tracedecay-hooks/fixtures/host_events/codex/stop.json"), ), ( HookHostV1::CursorDesktop, include_str!( - "../crates/tracedecay-hooks/fixtures/host_events/cursor/after-file-edit.json" + "../../../crates/tracedecay-hooks/fixtures/host_events/cursor/after-file-edit.json" ), ), ( HookHostV1::Hermes, - include_str!("../crates/tracedecay-hooks/fixtures/host_events/hermes/saved-edit.json"), + include_str!( + "../../../crates/tracedecay-hooks/fixtures/host_events/hermes/saved-edit.json" + ), ), ( HookHostV1::Hermes, - include_str!("../crates/tracedecay-hooks/fixtures/host_events/hermes/stop.json"), + include_str!("../../../crates/tracedecay-hooks/fixtures/host_events/hermes/stop.json"), ), ( HookHostV1::KimiCode, include_str!( - "../crates/tracedecay-hooks/fixtures/host_events/kimi/post-tool-use-edit.json" + "../../../crates/tracedecay-hooks/fixtures/host_events/kimi/post-tool-use-edit.json" ), ), ( HookHostV1::KimiCode, - include_str!("../crates/tracedecay-hooks/fixtures/host_events/kimi/stop.json"), + include_str!("../../../crates/tracedecay-hooks/fixtures/host_events/kimi/stop.json"), ), ]; for (host, fixture) in fixtures { @@ -1299,7 +1301,7 @@ fn authentic_host_fixtures_use_production_typed_decoders() { } let opencode = parse_fixture(include_str!( - "../crates/tracedecay-hooks/fixtures/host_events/opencode/baseline.json" + "../../../crates/tracedecay-hooks/fixtures/host_events/opencode/baseline.json" )); let events = opencode["events"].as_array().expect("OpenCode events"); for identity in ["saved_edit", "stop"] { @@ -1339,7 +1341,7 @@ fn authentic_host_fixtures_use_production_typed_decoders() { #[test] fn corrupted_host_identity_fails_typed_decoder() { let mut fixture = parse_fixture(include_str!( - "../crates/tracedecay-hooks/fixtures/host_events/claude/stop.json" + "../../../crates/tracedecay-hooks/fixtures/host_events/claude/stop.json" )); fixture["hook_event_name"] = json!("NotARealEvent"); assert!( diff --git a/tests/host_event_fixture_test.rs b/crates/tracedecay/tests/host_event_fixture_test.rs similarity index 97% rename from tests/host_event_fixture_test.rs rename to crates/tracedecay/tests/host_event_fixture_test.rs index e9d7d33f5b..4c702bb661 100644 --- a/tests/host_event_fixture_test.rs +++ b/crates/tracedecay/tests/host_event_fixture_test.rs @@ -39,23 +39,23 @@ use common::{ const FIXTURES: [(&str, &str); 5] = [ ( "codex", - include_str!("fixtures/host_events/codex/baseline.json"), + include_str!("../../../tests/fixtures/host_events/codex/baseline.json"), ), ( "claude", - include_str!("fixtures/host_events/claude/baseline.json"), + include_str!("../../../tests/fixtures/host_events/claude/baseline.json"), ), ( "cursor", - include_str!("fixtures/host_events/cursor/baseline.json"), + include_str!("../../../tests/fixtures/host_events/cursor/baseline.json"), ), ( "hermes", - include_str!("fixtures/host_events/hermes/baseline.json"), + include_str!("../../../tests/fixtures/host_events/hermes/baseline.json"), ), ( "kiro", - include_str!("fixtures/host_events/kiro/baseline.json"), + include_str!("../../../tests/fixtures/host_events/kiro/baseline.json"), ), ]; @@ -380,7 +380,7 @@ fn initialize_boundary_project(home: &Path) -> std::path::PathBuf { fn write_claude_boundary_transcript(home: &Path, project: &Path) -> std::path::PathBuf { let path = home.join("claude-boundary.jsonl"); let mut record: Value = serde_json::from_str(include_str!( - "fixtures/provider_normalization/claude/assistant_tool_use.input.json" + "../../../tests/fixtures/provider_normalization/claude/assistant_tool_use.input.json" )) .unwrap(); record["cwd"] = project.to_string_lossy().into_owned().into(); @@ -590,12 +590,13 @@ async fn execute_native_provider_path(provider: &str, home: &Path) -> HostAdmiss "codex" => { let transcript = tmp.path().join("codex-golden-session.jsonl"); let mut meta: Value = serde_json::from_str(include_str!( - "fixtures/provider_normalization/codex/session_meta.input.json" + "../../../tests/fixtures/provider_normalization/codex/session_meta.input.json" )) .unwrap(); meta["payload"]["cwd"] = project.to_string_lossy().into_owned().into(); - let message = - include_str!("fixtures/provider_normalization/codex/agent_message.input.json"); + let message = include_str!( + "../../../tests/fixtures/provider_normalization/codex/agent_message.input.json" + ); let usage = json!({ "type": "event_msg", "timestamp": "2026-08-06T00:00:00Z", @@ -629,7 +630,7 @@ async fn execute_native_provider_path(provider: &str, home: &Path) -> HostAdmiss let transcript_dir = home.join(".claude/projects/host-event-fixture"); std::fs::create_dir_all(&transcript_dir).unwrap(); let mut record: Value = serde_json::from_str(include_str!( - "fixtures/provider_normalization/claude/assistant_tool_use.input.json" + "../../../tests/fixtures/provider_normalization/claude/assistant_tool_use.input.json" )) .unwrap(); record["cwd"] = tmp.path().to_string_lossy().into_owned().into(); @@ -653,7 +654,7 @@ async fn execute_native_provider_path(provider: &str, home: &Path) -> HostAdmiss "cursor" => { let transcript = tmp.path().join("cursor-golden-session.jsonl"); let record: Value = serde_json::from_str(include_str!( - "fixtures/provider_normalization/cursor/tool_use.input.json" + "../../../tests/fixtures/provider_normalization/cursor/tool_use.input.json" )) .unwrap(); std::fs::write(&transcript, format!("{record}\n")).unwrap(); @@ -823,7 +824,9 @@ fn write_kiro_native_fixture(home: &Path, project: &Path) { std::fs::create_dir_all(&directory).unwrap(); std::fs::write( directory.join("sess-golden.json"), - include_str!("fixtures/provider_normalization/kiro/workspace_session.input.json"), + include_str!( + "../../../tests/fixtures/provider_normalization/kiro/workspace_session.input.json" + ), ) .unwrap(); } @@ -857,7 +860,7 @@ async fn write_hermes_native_fixture(home: &Path, project: &Path) { ) .unwrap(); let fixture: Value = serde_json::from_str(include_str!( - "fixtures/provider_normalization/hermes/assistant_tool_call.input.json" + "../../../tests/fixtures/provider_normalization/hermes/assistant_tool_call.input.json" )) .unwrap(); let session_id = fixture["session_id"].as_str().unwrap(); diff --git a/tests/lifecycle_production_authority_test.rs b/crates/tracedecay/tests/lifecycle_production_authority_test.rs similarity index 100% rename from tests/lifecycle_production_authority_test.rs rename to crates/tracedecay/tests/lifecycle_production_authority_test.rs diff --git a/tests/mcp_suite/analytics_test.rs b/crates/tracedecay/tests/mcp_suite/analytics_test.rs similarity index 100% rename from tests/mcp_suite/analytics_test.rs rename to crates/tracedecay/tests/mcp_suite/analytics_test.rs diff --git a/tests/mcp_suite/context_relevance_eval_test.rs b/crates/tracedecay/tests/mcp_suite/context_relevance_eval_test.rs similarity index 96% rename from tests/mcp_suite/context_relevance_eval_test.rs rename to crates/tracedecay/tests/mcp_suite/context_relevance_eval_test.rs index 1e79ab3696..c889334012 100644 --- a/tests/mcp_suite/context_relevance_eval_test.rs +++ b/crates/tracedecay/tests/mcp_suite/context_relevance_eval_test.rs @@ -47,9 +47,10 @@ async fn context_eval_fixture_scores_real_queries() { .expect("production project server"); warm_code_index_search(&server, "authenticate").await; - let fixture: Value = - serde_json::from_str(include_str!("../fixtures/context_eval_labeled.json")) - .expect("valid context eval fixture"); + let fixture: Value = serde_json::from_str(include_str!( + "../../../../tests/fixtures/context_eval_labeled.json" + )) + .expect("valid context eval fixture"); let cases = fixture["cases"].as_array().expect("cases"); assert!(!cases.is_empty(), "fixture must define at least one case"); @@ -170,8 +171,7 @@ fn round2(value: f64) -> f64 { } fn copy_fixture_project(dest: &Path) { - let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR")); - let src = manifest_dir.join("tests/fixtures/context_eval_project"); + let src = crate::common::repository_path("tests/fixtures/context_eval_project"); copy_dir_all(&src, dest); } diff --git a/tests/mcp_suite/fixture.rs b/crates/tracedecay/tests/mcp_suite/fixture.rs similarity index 100% rename from tests/mcp_suite/fixture.rs rename to crates/tracedecay/tests/mcp_suite/fixture.rs diff --git a/tests/mcp_suite/git_correlation_test.rs b/crates/tracedecay/tests/mcp_suite/git_correlation_test.rs similarity index 100% rename from tests/mcp_suite/git_correlation_test.rs rename to crates/tracedecay/tests/mcp_suite/git_correlation_test.rs diff --git a/tests/mcp_suite/main.rs b/crates/tracedecay/tests/mcp_suite/main.rs similarity index 100% rename from tests/mcp_suite/main.rs rename to crates/tracedecay/tests/mcp_suite/main.rs diff --git a/tests/mcp_suite/mcp_cli_parity_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_cli_parity_test.rs similarity index 100% rename from tests/mcp_suite/mcp_cli_parity_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_cli_parity_test.rs diff --git a/tests/mcp_suite/mcp_cli_serve_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_cli_serve_test.rs similarity index 100% rename from tests/mcp_suite/mcp_cli_serve_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_cli_serve_test.rs diff --git a/tests/mcp_suite/mcp_dashboard_tool_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_dashboard_tool_test.rs similarity index 99% rename from tests/mcp_suite/mcp_dashboard_tool_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_dashboard_tool_test.rs index 6abf3b29cd..f3d6c5f143 100644 --- a/tests/mcp_suite/mcp_dashboard_tool_test.rs +++ b/crates/tracedecay/tests/mcp_suite/mcp_dashboard_tool_test.rs @@ -173,7 +173,7 @@ async fn tracedecay_dashboard_tool_is_idempotent_and_supports_stop() { let res1 = handle_real_server_tool_call(&server, "tracedecay_dashboard", json!({"port": 0})).await; let text1 = extract_text(&res1); - let url1 = extract_url(&text1); + let url1 = extract_url(text1); // second start returns same (already) let res2 = @@ -184,7 +184,7 @@ async fn tracedecay_dashboard_tool_is_idempotent_and_supports_stop() { "second should be already: {}", text2 ); - let url2 = extract_url(&text2); + let url2 = extract_url(text2); assert_eq!(url1, url2, "idempotent url"); // stop diff --git a/tests/mcp_suite/mcp_handler_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test.rs diff --git a/tests/mcp_suite/mcp_handler_test/admin_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/admin_test.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test/admin_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test/admin_test.rs diff --git a/tests/mcp_suite/mcp_handler_test/automation_runs_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/automation_runs_test.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test/automation_runs_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test/automation_runs_test.rs diff --git a/tests/mcp_suite/mcp_handler_test/bounded_analysis_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/bounded_analysis_test.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test/bounded_analysis_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test/bounded_analysis_test.rs diff --git a/tests/mcp_suite/mcp_handler_test/context_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/context_test.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test/context_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test/context_test.rs diff --git a/tests/mcp_suite/mcp_handler_test/dependency_hint_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/dependency_hint_test.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test/dependency_hint_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test/dependency_hint_test.rs diff --git a/tests/mcp_suite/mcp_handler_test/dependency_hint_test/lazy_cutover.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/dependency_hint_test/lazy_cutover.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test/dependency_hint_test/lazy_cutover.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test/dependency_hint_test/lazy_cutover.rs diff --git a/tests/mcp_suite/mcp_handler_test/edit_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/edit_test.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test/edit_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test/edit_test.rs diff --git a/tests/mcp_suite/mcp_handler_test/graph_analysis_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/graph_analysis_test.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test/graph_analysis_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test/graph_analysis_test.rs diff --git a/tests/mcp_suite/mcp_handler_test/graph_analysis_test/graph_readiness.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/graph_analysis_test/graph_readiness.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test/graph_analysis_test/graph_readiness.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test/graph_analysis_test/graph_readiness.rs diff --git a/tests/mcp_suite/mcp_handler_test/graph_query_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/graph_query_test.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test/graph_query_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test/graph_query_test.rs diff --git a/tests/mcp_suite/mcp_handler_test/lcm_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/lcm_test.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test/lcm_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test/lcm_test.rs diff --git a/tests/mcp_suite/mcp_handler_test/memory_contradiction_contract_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/memory_contradiction_contract_test.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test/memory_contradiction_contract_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test/memory_contradiction_contract_test.rs diff --git a/tests/mcp_suite/mcp_handler_test/memory_fact_assertions.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/memory_fact_assertions.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test/memory_fact_assertions.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test/memory_fact_assertions.rs diff --git a/tests/mcp_suite/mcp_handler_test/memory_facts_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/memory_facts_test.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test/memory_facts_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test/memory_facts_test.rs diff --git a/tests/mcp_suite/mcp_handler_test/memory_feedback_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/memory_feedback_test.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test/memory_feedback_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test/memory_feedback_test.rs diff --git a/tests/mcp_suite/mcp_handler_test/move_symbol_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/move_symbol_test.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test/move_symbol_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test/move_symbol_test.rs diff --git a/tests/mcp_suite/mcp_handler_test/rename_symbol_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/rename_symbol_test.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test/rename_symbol_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test/rename_symbol_test.rs diff --git a/tests/mcp_suite/mcp_handler_test/retrieve_truncation_support.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/retrieve_truncation_support.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test/retrieve_truncation_support.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test/retrieve_truncation_support.rs diff --git a/tests/mcp_suite/mcp_handler_test/retrieve_truncation_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/retrieve_truncation_test.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test/retrieve_truncation_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test/retrieve_truncation_test.rs diff --git a/tests/mcp_suite/mcp_handler_test/schema_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/schema_test.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test/schema_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test/schema_test.rs diff --git a/tests/mcp_suite/mcp_handler_test/session_search_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/session_search_test.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test/session_search_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test/session_search_test.rs diff --git a/tests/mcp_suite/mcp_handler_test/skills_automation_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/skills_automation_test.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test/skills_automation_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test/skills_automation_test.rs diff --git a/tests/mcp_suite/mcp_handler_test/status_runtime_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_handler_test/status_runtime_test.rs similarity index 100% rename from tests/mcp_suite/mcp_handler_test/status_runtime_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_handler_test/status_runtime_test.rs diff --git a/tests/mcp_suite/mcp_rendering_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_rendering_test.rs similarity index 100% rename from tests/mcp_suite/mcp_rendering_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_rendering_test.rs diff --git a/tests/mcp_suite/mcp_server_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_server_test.rs similarity index 100% rename from tests/mcp_suite/mcp_server_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_server_test.rs diff --git a/tests/mcp_suite/mcp_server_test/analytics_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_server_test/analytics_test.rs similarity index 100% rename from tests/mcp_suite/mcp_server_test/analytics_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_server_test/analytics_test.rs diff --git a/tests/mcp_suite/mcp_server_test/hooks_branch_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_server_test/hooks_branch_test.rs similarity index 100% rename from tests/mcp_suite/mcp_server_test/hooks_branch_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_server_test/hooks_branch_test.rs diff --git a/tests/mcp_suite/mcp_server_test/protocol_test.rs b/crates/tracedecay/tests/mcp_suite/mcp_server_test/protocol_test.rs similarity index 100% rename from tests/mcp_suite/mcp_server_test/protocol_test.rs rename to crates/tracedecay/tests/mcp_suite/mcp_server_test/protocol_test.rs diff --git a/tests/mcp_suite/mcp_server_test/protocol_test/initialize_routing.rs b/crates/tracedecay/tests/mcp_suite/mcp_server_test/protocol_test/initialize_routing.rs similarity index 100% rename from tests/mcp_suite/mcp_server_test/protocol_test/initialize_routing.rs rename to crates/tracedecay/tests/mcp_suite/mcp_server_test/protocol_test/initialize_routing.rs diff --git a/tests/mcp_suite/mcp_server_test/support.rs b/crates/tracedecay/tests/mcp_suite/mcp_server_test/support.rs similarity index 100% rename from tests/mcp_suite/mcp_server_test/support.rs rename to crates/tracedecay/tests/mcp_suite/mcp_server_test/support.rs diff --git a/tests/mcp_suite/multi_mcp_coordination_test.rs b/crates/tracedecay/tests/mcp_suite/multi_mcp_coordination_test.rs similarity index 100% rename from tests/mcp_suite/multi_mcp_coordination_test.rs rename to crates/tracedecay/tests/mcp_suite/multi_mcp_coordination_test.rs diff --git a/tests/mcp_suite/serve_harness.rs b/crates/tracedecay/tests/mcp_suite/serve_harness.rs similarity index 100% rename from tests/mcp_suite/serve_harness.rs rename to crates/tracedecay/tests/mcp_suite/serve_harness.rs diff --git a/tests/mcp_suite/serve_template_path_test.rs b/crates/tracedecay/tests/mcp_suite/serve_template_path_test.rs similarity index 100% rename from tests/mcp_suite/serve_template_path_test.rs rename to crates/tracedecay/tests/mcp_suite/serve_template_path_test.rs diff --git a/tests/mcp_suite/support.rs b/crates/tracedecay/tests/mcp_suite/support.rs similarity index 100% rename from tests/mcp_suite/support.rs rename to crates/tracedecay/tests/mcp_suite/support.rs diff --git a/tests/mcp_suite/workflow_query_test.rs b/crates/tracedecay/tests/mcp_suite/workflow_query_test.rs similarity index 100% rename from tests/mcp_suite/workflow_query_test.rs rename to crates/tracedecay/tests/mcp_suite/workflow_query_test.rs diff --git a/tests/memory_suite/main.rs b/crates/tracedecay/tests/memory_suite/main.rs similarity index 100% rename from tests/memory_suite/main.rs rename to crates/tracedecay/tests/memory_suite/main.rs diff --git a/tests/memory_suite/memory_eval/assertions.rs b/crates/tracedecay/tests/memory_suite/memory_eval/assertions.rs similarity index 100% rename from tests/memory_suite/memory_eval/assertions.rs rename to crates/tracedecay/tests/memory_suite/memory_eval/assertions.rs diff --git a/tests/memory_suite/memory_eval_test.rs b/crates/tracedecay/tests/memory_suite/memory_eval_test.rs similarity index 99% rename from tests/memory_suite/memory_eval_test.rs rename to crates/tracedecay/tests/memory_suite/memory_eval_test.rs index e97c5619a4..dbe96ed6b3 100644 --- a/tests/memory_suite/memory_eval_test.rs +++ b/crates/tracedecay/tests/memory_suite/memory_eval_test.rs @@ -129,9 +129,7 @@ impl Fixture { } fn scenario_path(id: &str) -> PathBuf { - Path::new(env!("CARGO_MANIFEST_DIR")) - .join("evals/memory/scenarios") - .join(format!("{id}.json")) + crate::common::repository_path("evals/memory/scenarios").join(format!("{id}.json")) } fn load_scenario(id: &str) -> Scenario { @@ -866,7 +864,7 @@ fn every_scenario_file_is_wired() { ] .into_iter() .collect(); - let directory = Path::new(env!("CARGO_MANIFEST_DIR")).join("evals/memory/scenarios"); + let directory = crate::common::repository_path("evals/memory/scenarios"); let found = std::fs::read_dir(&directory) .expect("read evals/memory/scenarios") .map(|entry| entry.expect("scenario entry").path()) diff --git a/tests/native_integration_surface_mount.rs b/crates/tracedecay/tests/native_integration_surface_mount.rs similarity index 100% rename from tests/native_integration_surface_mount.rs rename to crates/tracedecay/tests/native_integration_surface_mount.rs diff --git a/tests/packaged_semantic_evaluator.rs b/crates/tracedecay/tests/packaged_semantic_evaluator.rs similarity index 100% rename from tests/packaged_semantic_evaluator.rs rename to crates/tracedecay/tests/packaged_semantic_evaluator.rs diff --git a/tests/private_route_restart_acceptance.rs b/crates/tracedecay/tests/private_route_restart_acceptance.rs similarity index 100% rename from tests/private_route_restart_acceptance.rs rename to crates/tracedecay/tests/private_route_restart_acceptance.rs diff --git a/tests/profile_backup_rehearsal_test.rs b/crates/tracedecay/tests/profile_backup_rehearsal_test.rs similarity index 100% rename from tests/profile_backup_rehearsal_test.rs rename to crates/tracedecay/tests/profile_backup_rehearsal_test.rs diff --git a/tests/runtime_surface_acceptance.rs b/crates/tracedecay/tests/runtime_surface_acceptance.rs similarity index 99% rename from tests/runtime_surface_acceptance.rs rename to crates/tracedecay/tests/runtime_surface_acceptance.rs index 9375b46582..1f05517eea 100644 --- a/tests/runtime_surface_acceptance.rs +++ b/crates/tracedecay/tests/runtime_surface_acceptance.rs @@ -110,11 +110,11 @@ async fn lsp_runtime_fixture() -> RuntimeFixture { .or_else(|| option_env!("RUSTUP_TOOLCHAIN").map(OsString::from)); let (environment, project) = common::IsolatedEnv::acquire().await; copy_dir( - &Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/context_eval_project"), + &common::repository_path("tests/fixtures/context_eval_project"), &project, ); copy_dir( - &Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/managed_run_overlay"), + &common::repository_path("tests/fixtures/managed_run_overlay"), &project, ); git(&project, &["init", "--quiet"]); @@ -161,7 +161,7 @@ async fn lsp_runtime_fixture() -> RuntimeFixture { async fn git_runtime_fixture() -> RuntimeFixture { let (environment, project) = common::IsolatedEnv::acquire().await; copy_dir( - &Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/context_eval_project"), + &common::repository_path("tests/fixtures/context_eval_project"), &project, ); git(&project, &["init", "--quiet"]); @@ -394,11 +394,11 @@ async fn poll_lsp_context( fn initialize_project(home: &Path, project: &Path) { copy_dir( - &Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/context_eval_project"), + &common::repository_path("tests/fixtures/context_eval_project"), project, ); copy_dir( - &Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/managed_run_overlay"), + &common::repository_path("tests/fixtures/managed_run_overlay"), project, ); common::initialize_tracedecay_cli_project(home, project); diff --git a/tests/search_eval_cli_test.rs b/crates/tracedecay/tests/search_eval_cli_test.rs similarity index 97% rename from tests/search_eval_cli_test.rs rename to crates/tracedecay/tests/search_eval_cli_test.rs index 93ecaa5ed3..e560505cff 100644 --- a/tests/search_eval_cli_test.rs +++ b/crates/tracedecay/tests/search_eval_cli_test.rs @@ -1,5 +1,7 @@ #![allow(clippy::option_env_unwrap)] +mod common; + use std::process::{Command, Output}; use serde_json::Value; @@ -11,7 +13,7 @@ fn evaluator_bin() -> &'static str { fn run(args: &[&str]) -> Output { Command::new(evaluator_bin()) - .current_dir(env!("CARGO_MANIFEST_DIR")) + .current_dir(common::repository_root()) .args(args) .output() .unwrap() diff --git a/tests/search_quality_suite/main.rs b/crates/tracedecay/tests/search_quality_suite/main.rs similarity index 90% rename from tests/search_quality_suite/main.rs rename to crates/tracedecay/tests/search_quality_suite/main.rs index 02710e97ec..78da82b007 100644 --- a/tests/search_quality_suite/main.rs +++ b/crates/tracedecay/tests/search_quality_suite/main.rs @@ -6,4 +6,7 @@ //! workload/fixture contract that is bound to the root-owned `search_eval` //! module and the root-checked-in fixture corpus. +#[path = "../common/mod.rs"] +mod common; + mod workload_fixture; diff --git a/tests/search_quality_suite/workload_fixture.rs b/crates/tracedecay/tests/search_quality_suite/workload_fixture.rs similarity index 94% rename from tests/search_quality_suite/workload_fixture.rs rename to crates/tracedecay/tests/search_quality_suite/workload_fixture.rs index 90fc6788c7..1b70d0fe23 100644 --- a/tests/search_quality_suite/workload_fixture.rs +++ b/crates/tracedecay/tests/search_quality_suite/workload_fixture.rs @@ -6,7 +6,6 @@ //! `crates/tracedecay-query/tests/search_quality_suite`. use std::fs; -use std::path::Path; use sha2::{Digest, Sha256}; use tracedecay::search_eval::{ @@ -15,7 +14,7 @@ use tracedecay::search_eval::{ #[test] fn semantic_workload_and_incremental_fixture_are_byte_exact() { - let repo_root = Path::new(env!("CARGO_MANIFEST_DIR")); + let repo_root = crate::common::repository_root(); let workload_path = repo_root.join("tests/fixtures/search_quality/query-semantic-candidate-workload-v1.json"); let workload = load_candidate_workload(&workload_path).expect("checked-in workload parses"); diff --git a/tests/semantic_vector_generation_prep_test.rs b/crates/tracedecay/tests/semantic_vector_generation_prep_test.rs similarity index 100% rename from tests/semantic_vector_generation_prep_test.rs rename to crates/tracedecay/tests/semantic_vector_generation_prep_test.rs diff --git a/tests/serve_proxy_lifecycle_test.rs b/crates/tracedecay/tests/serve_proxy_lifecycle_test.rs similarity index 100% rename from tests/serve_proxy_lifecycle_test.rs rename to crates/tracedecay/tests/serve_proxy_lifecycle_test.rs diff --git a/tests/session_suite/anchor_resolution.rs b/crates/tracedecay/tests/session_suite/anchor_resolution.rs similarity index 100% rename from tests/session_suite/anchor_resolution.rs rename to crates/tracedecay/tests/session_suite/anchor_resolution.rs diff --git a/tests/session_suite/anchor_tombstone_expiry.rs b/crates/tracedecay/tests/session_suite/anchor_tombstone_expiry.rs similarity index 100% rename from tests/session_suite/anchor_tombstone_expiry.rs rename to crates/tracedecay/tests/session_suite/anchor_tombstone_expiry.rs diff --git a/tests/session_suite/fact_anchor_authority.rs b/crates/tracedecay/tests/session_suite/fact_anchor_authority.rs similarity index 100% rename from tests/session_suite/fact_anchor_authority.rs rename to crates/tracedecay/tests/session_suite/fact_anchor_authority.rs diff --git a/tests/session_suite/git_backfill.rs b/crates/tracedecay/tests/session_suite/git_backfill.rs similarity index 100% rename from tests/session_suite/git_backfill.rs rename to crates/tracedecay/tests/session_suite/git_backfill.rs diff --git a/tests/session_suite/global_db.rs b/crates/tracedecay/tests/session_suite/global_db.rs similarity index 100% rename from tests/session_suite/global_db.rs rename to crates/tracedecay/tests/session_suite/global_db.rs diff --git a/tests/session_suite/lcm_compression/boundary.rs b/crates/tracedecay/tests/session_suite/lcm_compression/boundary.rs similarity index 100% rename from tests/session_suite/lcm_compression/boundary.rs rename to crates/tracedecay/tests/session_suite/lcm_compression/boundary.rs diff --git a/tests/session_suite/lcm_compression/compaction.rs b/crates/tracedecay/tests/session_suite/lcm_compression/compaction.rs similarity index 100% rename from tests/session_suite/lcm_compression/compaction.rs rename to crates/tracedecay/tests/session_suite/lcm_compression/compaction.rs diff --git a/tests/session_suite/lcm_compression/condensation.rs b/crates/tracedecay/tests/session_suite/lcm_compression/condensation.rs similarity index 100% rename from tests/session_suite/lcm_compression/condensation.rs rename to crates/tracedecay/tests/session_suite/lcm_compression/condensation.rs diff --git a/tests/session_suite/lcm_compression/decision_baseline.rs b/crates/tracedecay/tests/session_suite/lcm_compression/decision_baseline.rs similarity index 100% rename from tests/session_suite/lcm_compression/decision_baseline.rs rename to crates/tracedecay/tests/session_suite/lcm_compression/decision_baseline.rs diff --git a/tests/session_suite/lcm_compression/frontier.rs b/crates/tracedecay/tests/session_suite/lcm_compression/frontier.rs similarity index 100% rename from tests/session_suite/lcm_compression/frontier.rs rename to crates/tracedecay/tests/session_suite/lcm_compression/frontier.rs diff --git a/tests/session_suite/lcm_compression/mod.rs b/crates/tracedecay/tests/session_suite/lcm_compression/mod.rs similarity index 100% rename from tests/session_suite/lcm_compression/mod.rs rename to crates/tracedecay/tests/session_suite/lcm_compression/mod.rs diff --git a/tests/session_suite/lcm_compression/overflow.rs b/crates/tracedecay/tests/session_suite/lcm_compression/overflow.rs similarity index 100% rename from tests/session_suite/lcm_compression/overflow.rs rename to crates/tracedecay/tests/session_suite/lcm_compression/overflow.rs diff --git a/tests/session_suite/lcm_compression/patterns.rs b/crates/tracedecay/tests/session_suite/lcm_compression/patterns.rs similarity index 100% rename from tests/session_suite/lcm_compression/patterns.rs rename to crates/tracedecay/tests/session_suite/lcm_compression/patterns.rs diff --git a/tests/session_suite/lcm_compression/preflight.rs b/crates/tracedecay/tests/session_suite/lcm_compression/preflight.rs similarity index 100% rename from tests/session_suite/lcm_compression/preflight.rs rename to crates/tracedecay/tests/session_suite/lcm_compression/preflight.rs diff --git a/tests/session_suite/lcm_compression/replay.rs b/crates/tracedecay/tests/session_suite/lcm_compression/replay.rs similarity index 100% rename from tests/session_suite/lcm_compression/replay.rs rename to crates/tracedecay/tests/session_suite/lcm_compression/replay.rs diff --git a/tests/session_suite/lcm_compression/summarizer_modes.rs b/crates/tracedecay/tests/session_suite/lcm_compression/summarizer_modes.rs similarity index 100% rename from tests/session_suite/lcm_compression/summarizer_modes.rs rename to crates/tracedecay/tests/session_suite/lcm_compression/summarizer_modes.rs diff --git a/tests/session_suite/lcm_compression/tool_transactions.rs b/crates/tracedecay/tests/session_suite/lcm_compression/tool_transactions.rs similarity index 100% rename from tests/session_suite/lcm_compression/tool_transactions.rs rename to crates/tracedecay/tests/session_suite/lcm_compression/tool_transactions.rs diff --git a/tests/session_suite/lcm_dag.rs b/crates/tracedecay/tests/session_suite/lcm_dag.rs similarity index 100% rename from tests/session_suite/lcm_dag.rs rename to crates/tracedecay/tests/session_suite/lcm_dag.rs diff --git a/tests/session_suite/lcm_payload.rs b/crates/tracedecay/tests/session_suite/lcm_payload.rs similarity index 100% rename from tests/session_suite/lcm_payload.rs rename to crates/tracedecay/tests/session_suite/lcm_payload.rs diff --git a/tests/session_suite/lcm_query/describe.rs b/crates/tracedecay/tests/session_suite/lcm_query/describe.rs similarity index 100% rename from tests/session_suite/lcm_query/describe.rs rename to crates/tracedecay/tests/session_suite/lcm_query/describe.rs diff --git a/tests/session_suite/lcm_query/expand.rs b/crates/tracedecay/tests/session_suite/lcm_query/expand.rs similarity index 100% rename from tests/session_suite/lcm_query/expand.rs rename to crates/tracedecay/tests/session_suite/lcm_query/expand.rs diff --git a/tests/session_suite/lcm_query/expand_query.rs b/crates/tracedecay/tests/session_suite/lcm_query/expand_query.rs similarity index 100% rename from tests/session_suite/lcm_query/expand_query.rs rename to crates/tracedecay/tests/session_suite/lcm_query/expand_query.rs diff --git a/tests/session_suite/lcm_query/grep.rs b/crates/tracedecay/tests/session_suite/lcm_query/grep.rs similarity index 100% rename from tests/session_suite/lcm_query/grep.rs rename to crates/tracedecay/tests/session_suite/lcm_query/grep.rs diff --git a/tests/session_suite/lcm_query/grep_ranking.rs b/crates/tracedecay/tests/session_suite/lcm_query/grep_ranking.rs similarity index 100% rename from tests/session_suite/lcm_query/grep_ranking.rs rename to crates/tracedecay/tests/session_suite/lcm_query/grep_ranking.rs diff --git a/tests/session_suite/lcm_query/load_session.rs b/crates/tracedecay/tests/session_suite/lcm_query/load_session.rs similarity index 100% rename from tests/session_suite/lcm_query/load_session.rs rename to crates/tracedecay/tests/session_suite/lcm_query/load_session.rs diff --git a/tests/session_suite/lcm_query/mod.rs b/crates/tracedecay/tests/session_suite/lcm_query/mod.rs similarity index 100% rename from tests/session_suite/lcm_query/mod.rs rename to crates/tracedecay/tests/session_suite/lcm_query/mod.rs diff --git a/tests/session_suite/lcm_query/sessions.rs b/crates/tracedecay/tests/session_suite/lcm_query/sessions.rs similarity index 100% rename from tests/session_suite/lcm_query/sessions.rs rename to crates/tracedecay/tests/session_suite/lcm_query/sessions.rs diff --git a/tests/session_suite/lcm_query/status.rs b/crates/tracedecay/tests/session_suite/lcm_query/status.rs similarity index 100% rename from tests/session_suite/lcm_query/status.rs rename to crates/tracedecay/tests/session_suite/lcm_query/status.rs diff --git a/tests/session_suite/lcm_raw.rs b/crates/tracedecay/tests/session_suite/lcm_raw.rs similarity index 100% rename from tests/session_suite/lcm_raw.rs rename to crates/tracedecay/tests/session_suite/lcm_raw.rs diff --git a/tests/session_suite/lcm_summary_lineage_review.rs b/crates/tracedecay/tests/session_suite/lcm_summary_lineage_review.rs similarity index 100% rename from tests/session_suite/lcm_summary_lineage_review.rs rename to crates/tracedecay/tests/session_suite/lcm_summary_lineage_review.rs diff --git a/tests/session_suite/main.rs b/crates/tracedecay/tests/session_suite/main.rs similarity index 100% rename from tests/session_suite/main.rs rename to crates/tracedecay/tests/session_suite/main.rs diff --git a/tests/session_suite/message_search_eval_test.rs b/crates/tracedecay/tests/session_suite/message_search_eval_test.rs similarity index 98% rename from tests/session_suite/message_search_eval_test.rs rename to crates/tracedecay/tests/session_suite/message_search_eval_test.rs index aeffce9d5a..5cb7f727bc 100644 --- a/tests/session_suite/message_search_eval_test.rs +++ b/crates/tracedecay/tests/session_suite/message_search_eval_test.rs @@ -41,8 +41,10 @@ async fn open_isolated_db(tmp: &TempDir) -> HostAdmissionTestRuntimeV1 { } fn fixture() -> Value { - serde_json::from_str(include_str!("../fixtures/message_search_eval_labeled.json")) - .expect("valid message-search eval fixture") + serde_json::from_str(include_str!( + "../../../../tests/fixtures/message_search_eval_labeled.json" + )) + .expect("valid message-search eval fixture") } /// Seed every corpus session and message into the store, routing through the diff --git a/tests/session_suite/observation_application.rs b/crates/tracedecay/tests/session_suite/observation_application.rs similarity index 100% rename from tests/session_suite/observation_application.rs rename to crates/tracedecay/tests/session_suite/observation_application.rs diff --git a/tests/session_suite/observation_projection/adoption.rs b/crates/tracedecay/tests/session_suite/observation_projection/adoption.rs similarity index 100% rename from tests/session_suite/observation_projection/adoption.rs rename to crates/tracedecay/tests/session_suite/observation_projection/adoption.rs diff --git a/tests/session_suite/observation_projection/failure_audit.rs b/crates/tracedecay/tests/session_suite/observation_projection/failure_audit.rs similarity index 100% rename from tests/session_suite/observation_projection/failure_audit.rs rename to crates/tracedecay/tests/session_suite/observation_projection/failure_audit.rs diff --git a/tests/session_suite/observation_projection/message_ids.rs b/crates/tracedecay/tests/session_suite/observation_projection/message_ids.rs similarity index 100% rename from tests/session_suite/observation_projection/message_ids.rs rename to crates/tracedecay/tests/session_suite/observation_projection/message_ids.rs diff --git a/tests/session_suite/observation_projection/mod.rs b/crates/tracedecay/tests/session_suite/observation_projection/mod.rs similarity index 100% rename from tests/session_suite/observation_projection/mod.rs rename to crates/tracedecay/tests/session_suite/observation_projection/mod.rs diff --git a/tests/session_suite/observation_projection/queue.rs b/crates/tracedecay/tests/session_suite/observation_projection/queue.rs similarity index 100% rename from tests/session_suite/observation_projection/queue.rs rename to crates/tracedecay/tests/session_suite/observation_projection/queue.rs diff --git a/tests/session_suite/observation_projection/rebuild.rs b/crates/tracedecay/tests/session_suite/observation_projection/rebuild.rs similarity index 100% rename from tests/session_suite/observation_projection/rebuild.rs rename to crates/tracedecay/tests/session_suite/observation_projection/rebuild.rs diff --git a/tests/session_suite/observation_store/mod.rs b/crates/tracedecay/tests/session_suite/observation_store/mod.rs similarity index 100% rename from tests/session_suite/observation_store/mod.rs rename to crates/tracedecay/tests/session_suite/observation_store/mod.rs diff --git a/tests/session_suite/observation_store/retrieval_anchors.rs b/crates/tracedecay/tests/session_suite/observation_store/retrieval_anchors.rs similarity index 100% rename from tests/session_suite/observation_store/retrieval_anchors.rs rename to crates/tracedecay/tests/session_suite/observation_store/retrieval_anchors.rs diff --git a/tests/session_suite/observation_workflow_projection.rs b/crates/tracedecay/tests/session_suite/observation_workflow_projection.rs similarity index 100% rename from tests/session_suite/observation_workflow_projection.rs rename to crates/tracedecay/tests/session_suite/observation_workflow_projection.rs diff --git a/tests/session_suite/temporal_application.rs b/crates/tracedecay/tests/session_suite/temporal_application.rs similarity index 100% rename from tests/session_suite/temporal_application.rs rename to crates/tracedecay/tests/session_suite/temporal_application.rs diff --git a/tests/session_suite/temporal_benchmark.rs b/crates/tracedecay/tests/session_suite/temporal_benchmark.rs similarity index 100% rename from tests/session_suite/temporal_benchmark.rs rename to crates/tracedecay/tests/session_suite/temporal_benchmark.rs diff --git a/tests/session_suite/temporal_benchmark_runner.rs b/crates/tracedecay/tests/session_suite/temporal_benchmark_runner.rs similarity index 98% rename from tests/session_suite/temporal_benchmark_runner.rs rename to crates/tracedecay/tests/session_suite/temporal_benchmark_runner.rs index 904146d6f4..620eee4268 100644 --- a/tests/session_suite/temporal_benchmark_runner.rs +++ b/crates/tracedecay/tests/session_suite/temporal_benchmark_runner.rs @@ -78,7 +78,7 @@ fn invoke_runner(uname: &str, mode: &str) -> RunnerInvocation { } fn repository_root() -> PathBuf { - PathBuf::from(env!("CARGO_MANIFEST_DIR")) + crate::common::repository_root().to_path_buf() } #[test] diff --git a/tests/session_suite/temporal_derived_evidence.rs b/crates/tracedecay/tests/session_suite/temporal_derived_evidence.rs similarity index 100% rename from tests/session_suite/temporal_derived_evidence.rs rename to crates/tracedecay/tests/session_suite/temporal_derived_evidence.rs diff --git a/tests/session_suite/temporal_projection/activation.rs b/crates/tracedecay/tests/session_suite/temporal_projection/activation.rs similarity index 100% rename from tests/session_suite/temporal_projection/activation.rs rename to crates/tracedecay/tests/session_suite/temporal_projection/activation.rs diff --git a/tests/session_suite/temporal_projection/batch_commit.rs b/crates/tracedecay/tests/session_suite/temporal_projection/batch_commit.rs similarity index 100% rename from tests/session_suite/temporal_projection/batch_commit.rs rename to crates/tracedecay/tests/session_suite/temporal_projection/batch_commit.rs diff --git a/tests/session_suite/temporal_projection/lineage.rs b/crates/tracedecay/tests/session_suite/temporal_projection/lineage.rs similarity index 100% rename from tests/session_suite/temporal_projection/lineage.rs rename to crates/tracedecay/tests/session_suite/temporal_projection/lineage.rs diff --git a/tests/session_suite/temporal_projection/mod.rs b/crates/tracedecay/tests/session_suite/temporal_projection/mod.rs similarity index 100% rename from tests/session_suite/temporal_projection/mod.rs rename to crates/tracedecay/tests/session_suite/temporal_projection/mod.rs diff --git a/tests/session_suite/temporal_projection/rebuild_lifecycle.rs b/crates/tracedecay/tests/session_suite/temporal_projection/rebuild_lifecycle.rs similarity index 100% rename from tests/session_suite/temporal_projection/rebuild_lifecycle.rs rename to crates/tracedecay/tests/session_suite/temporal_projection/rebuild_lifecycle.rs diff --git a/tests/session_suite/temporal_refresh.rs b/crates/tracedecay/tests/session_suite/temporal_refresh.rs similarity index 100% rename from tests/session_suite/temporal_refresh.rs rename to crates/tracedecay/tests/session_suite/temporal_refresh.rs diff --git a/tests/session_suite/temporal_refresh_application.rs b/crates/tracedecay/tests/session_suite/temporal_refresh_application.rs similarity index 100% rename from tests/session_suite/temporal_refresh_application.rs rename to crates/tracedecay/tests/session_suite/temporal_refresh_application.rs diff --git a/tests/session_suite/transcript_store.rs b/crates/tracedecay/tests/session_suite/transcript_store.rs similarity index 100% rename from tests/session_suite/transcript_store.rs rename to crates/tracedecay/tests/session_suite/transcript_store.rs diff --git a/tests/storage_suite/fact_merge_hydration_test.rs b/crates/tracedecay/tests/storage_suite/fact_merge_hydration_test.rs similarity index 100% rename from tests/storage_suite/fact_merge_hydration_test.rs rename to crates/tracedecay/tests/storage_suite/fact_merge_hydration_test.rs diff --git a/tests/storage_suite/global_registry_test.rs b/crates/tracedecay/tests/storage_suite/global_registry_test.rs similarity index 100% rename from tests/storage_suite/global_registry_test.rs rename to crates/tracedecay/tests/storage_suite/global_registry_test.rs diff --git a/tests/storage_suite/home_env_lock.rs b/crates/tracedecay/tests/storage_suite/home_env_lock.rs similarity index 100% rename from tests/storage_suite/home_env_lock.rs rename to crates/tracedecay/tests/storage_suite/home_env_lock.rs diff --git a/tests/storage_suite/main.rs b/crates/tracedecay/tests/storage_suite/main.rs similarity index 100% rename from tests/storage_suite/main.rs rename to crates/tracedecay/tests/storage_suite/main.rs diff --git a/tests/storage_suite/multi_connection_test.rs b/crates/tracedecay/tests/storage_suite/multi_connection_test.rs similarity index 100% rename from tests/storage_suite/multi_connection_test.rs rename to crates/tracedecay/tests/storage_suite/multi_connection_test.rs diff --git a/tests/storage_suite/multi_connection_test/fail_closed.rs b/crates/tracedecay/tests/storage_suite/multi_connection_test/fail_closed.rs similarity index 100% rename from tests/storage_suite/multi_connection_test/fail_closed.rs rename to crates/tracedecay/tests/storage_suite/multi_connection_test/fail_closed.rs diff --git a/tests/storage_suite/multi_connection_test/harness.rs b/crates/tracedecay/tests/storage_suite/multi_connection_test/harness.rs similarity index 100% rename from tests/storage_suite/multi_connection_test/harness.rs rename to crates/tracedecay/tests/storage_suite/multi_connection_test/harness.rs diff --git a/tests/storage_suite/multi_connection_test/ownership.rs b/crates/tracedecay/tests/storage_suite/multi_connection_test/ownership.rs similarity index 100% rename from tests/storage_suite/multi_connection_test/ownership.rs rename to crates/tracedecay/tests/storage_suite/multi_connection_test/ownership.rs diff --git a/tests/storage_suite/native_project_alias_test.rs b/crates/tracedecay/tests/storage_suite/native_project_alias_test.rs similarity index 100% rename from tests/storage_suite/native_project_alias_test.rs rename to crates/tracedecay/tests/storage_suite/native_project_alias_test.rs diff --git a/tests/storage_suite/profile_storage_reset_test.rs b/crates/tracedecay/tests/storage_suite/profile_storage_reset_test.rs similarity index 100% rename from tests/storage_suite/profile_storage_reset_test.rs rename to crates/tracedecay/tests/storage_suite/profile_storage_reset_test.rs diff --git a/tests/storage_suite/project_identity_collapse_test.rs b/crates/tracedecay/tests/storage_suite/project_identity_collapse_test.rs similarity index 100% rename from tests/storage_suite/project_identity_collapse_test.rs rename to crates/tracedecay/tests/storage_suite/project_identity_collapse_test.rs diff --git a/tests/storage_suite/storage_resolver_test.rs b/crates/tracedecay/tests/storage_suite/storage_resolver_test.rs similarity index 100% rename from tests/storage_suite/storage_resolver_test.rs rename to crates/tracedecay/tests/storage_suite/storage_resolver_test.rs diff --git a/tests/storage_suite/storage_resolver_test/artifact_routing.rs b/crates/tracedecay/tests/storage_suite/storage_resolver_test/artifact_routing.rs similarity index 100% rename from tests/storage_suite/storage_resolver_test/artifact_routing.rs rename to crates/tracedecay/tests/storage_suite/storage_resolver_test/artifact_routing.rs diff --git a/tests/storage_suite/storage_resolver_test/identity_resolution.rs b/crates/tracedecay/tests/storage_suite/storage_resolver_test/identity_resolution.rs similarity index 100% rename from tests/storage_suite/storage_resolver_test/identity_resolution.rs rename to crates/tracedecay/tests/storage_suite/storage_resolver_test/identity_resolution.rs diff --git a/tests/storage_suite/storage_resolver_test/init_and_open.rs b/crates/tracedecay/tests/storage_suite/storage_resolver_test/init_and_open.rs similarity index 100% rename from tests/storage_suite/storage_resolver_test/init_and_open.rs rename to crates/tracedecay/tests/storage_suite/storage_resolver_test/init_and_open.rs diff --git a/tests/storage_suite/storage_resolver_test/layout_and_paths.rs b/crates/tracedecay/tests/storage_suite/storage_resolver_test/layout_and_paths.rs similarity index 100% rename from tests/storage_suite/storage_resolver_test/layout_and_paths.rs rename to crates/tracedecay/tests/storage_suite/storage_resolver_test/layout_and_paths.rs diff --git a/tests/storage_suite/storage_resolver_test/manifest.rs b/crates/tracedecay/tests/storage_suite/storage_resolver_test/manifest.rs similarity index 100% rename from tests/storage_suite/storage_resolver_test/manifest.rs rename to crates/tracedecay/tests/storage_suite/storage_resolver_test/manifest.rs diff --git a/tests/storage_suite/storage_resolver_test/marker_relocation.rs b/crates/tracedecay/tests/storage_suite/storage_resolver_test/marker_relocation.rs similarity index 100% rename from tests/storage_suite/storage_resolver_test/marker_relocation.rs rename to crates/tracedecay/tests/storage_suite/storage_resolver_test/marker_relocation.rs diff --git a/tests/storage_suite/storage_resolver_test/markers.rs b/crates/tracedecay/tests/storage_suite/storage_resolver_test/markers.rs similarity index 100% rename from tests/storage_suite/storage_resolver_test/markers.rs rename to crates/tracedecay/tests/storage_suite/storage_resolver_test/markers.rs diff --git a/tests/storage_suite/storage_resolver_test/working_tree_guard.rs b/crates/tracedecay/tests/storage_suite/storage_resolver_test/working_tree_guard.rs similarity index 100% rename from tests/storage_suite/storage_resolver_test/working_tree_guard.rs rename to crates/tracedecay/tests/storage_suite/storage_resolver_test/working_tree_guard.rs diff --git a/tests/storage_suite/storage_resolver_test/worktrees_clones.rs b/crates/tracedecay/tests/storage_suite/storage_resolver_test/worktrees_clones.rs similarity index 100% rename from tests/storage_suite/storage_resolver_test/worktrees_clones.rs rename to crates/tracedecay/tests/storage_suite/storage_resolver_test/worktrees_clones.rs diff --git a/tests/storage_suite/support.rs b/crates/tracedecay/tests/storage_suite/support.rs similarity index 95% rename from tests/storage_suite/support.rs rename to crates/tracedecay/tests/storage_suite/support.rs index dcaa0a68c6..f0a68eca7f 100644 --- a/tests/storage_suite/support.rs +++ b/crates/tracedecay/tests/storage_suite/support.rs @@ -19,13 +19,13 @@ use fs2::FileExt; /// fixture SQL defined in a test file). fn template_hash(name: &str, builder_fingerprint: &[u8]) -> u64 { let mut hash = 0xcbf29ce484222325_u64; - for byte in include_bytes!("../../crates/tracedecay-runtime-core/src/db/migrations.rs") + for byte in include_bytes!("../../../../crates/tracedecay-runtime-core/src/db/migrations.rs") .iter() .chain(include_bytes!( - "../../crates/tracedecay-runtime-core/src/db/connection.rs" + "../../../../crates/tracedecay-runtime-core/src/db/connection.rs" )) .chain(include_bytes!( - "../../crates/tracedecay-runtime-core/src/db/engine/test_support.rs" + "../../../../crates/tracedecay-runtime-core/src/db/engine/test_support.rs" )) .chain(include_bytes!("../common/mod.rs")) .chain(name.as_bytes()) diff --git a/tests/storage_suite/worktree_canonical_root_guard_test.rs b/crates/tracedecay/tests/storage_suite/worktree_canonical_root_guard_test.rs similarity index 100% rename from tests/storage_suite/worktree_canonical_root_guard_test.rs rename to crates/tracedecay/tests/storage_suite/worktree_canonical_root_guard_test.rs diff --git a/tests/tool_client_transport.rs b/crates/tracedecay/tests/tool_client_transport.rs similarity index 100% rename from tests/tool_client_transport.rs rename to crates/tracedecay/tests/tool_client_transport.rs diff --git a/tests/transcript_ingest_suite/claude.rs b/crates/tracedecay/tests/transcript_ingest_suite/claude.rs similarity index 100% rename from tests/transcript_ingest_suite/claude.rs rename to crates/tracedecay/tests/transcript_ingest_suite/claude.rs diff --git a/tests/transcript_ingest_suite/cline_like.rs b/crates/tracedecay/tests/transcript_ingest_suite/cline_like.rs similarity index 98% rename from tests/transcript_ingest_suite/cline_like.rs rename to crates/tracedecay/tests/transcript_ingest_suite/cline_like.rs index f0721ff204..d3336750f7 100644 --- a/tests/transcript_ingest_suite/cline_like.rs +++ b/crates/tracedecay/tests/transcript_ingest_suite/cline_like.rs @@ -92,7 +92,7 @@ pub(super) fn write_task_with_api_filename( let dir = root.join(task_id); std::fs::create_dir_all(&dir).unwrap(); let mut metadata: serde_json::Value = serde_json::from_str(include_str!( - "../fixtures/transcript_golden/cline_like/input/task_metadata.json" + "../../../../tests/fixtures/transcript_golden/cline_like/input/task_metadata.json" )) .unwrap(); metadata["workspacePath"] = serde_json::Value::String(project.to_string_lossy().into_owned()); @@ -107,15 +107,16 @@ pub(super) fn write_task_with_api_filename( _ => "api_conversation_history.json", }; let history = std::fs::read_to_string( - std::path::Path::new(env!("CARGO_MANIFEST_DIR")) - .join("tests/fixtures/transcript_golden/cline_like/input") + crate::common::repository_path("tests/fixtures/transcript_golden/cline_like/input") .join(fixture_name), ) .unwrap(); std::fs::write(&api, history).unwrap(); std::fs::write( dir.join("ui_messages.json"), - include_str!("../fixtures/transcript_golden/cline_like/input/ui_messages.json"), + include_str!( + "../../../../tests/fixtures/transcript_golden/cline_like/input/ui_messages.json" + ), ) .unwrap(); api @@ -1017,7 +1018,7 @@ async fn golden_fixture_ingests_through_each_provider_discriminator() { .lock() .unwrap_or_else(|poisoned| poisoned.into_inner()); let manifest: serde_json::Value = serde_json::from_str(include_str!( - "../fixtures/transcript_golden/cline_like/manifest.json" + "../../../../tests/fixtures/transcript_golden/cline_like/manifest.json" )) .expect("cline_like golden manifest"); assert_eq!(manifest["family"], "cline_like"); diff --git a/tests/transcript_ingest_suite/codex.rs b/crates/tracedecay/tests/transcript_ingest_suite/codex.rs similarity index 100% rename from tests/transcript_ingest_suite/codex.rs rename to crates/tracedecay/tests/transcript_ingest_suite/codex.rs diff --git a/tests/transcript_ingest_suite/codex_compaction.rs b/crates/tracedecay/tests/transcript_ingest_suite/codex_compaction.rs similarity index 100% rename from tests/transcript_ingest_suite/codex_compaction.rs rename to crates/tracedecay/tests/transcript_ingest_suite/codex_compaction.rs diff --git a/tests/transcript_ingest_suite/codex_goals.rs b/crates/tracedecay/tests/transcript_ingest_suite/codex_goals.rs similarity index 99% rename from tests/transcript_ingest_suite/codex_goals.rs rename to crates/tracedecay/tests/transcript_ingest_suite/codex_goals.rs index f6161a4b23..0b1c0b3b1c 100644 --- a/tests/transcript_ingest_suite/codex_goals.rs +++ b/crates/tracedecay/tests/transcript_ingest_suite/codex_goals.rs @@ -30,7 +30,7 @@ fn write_codex_rollout_with_goal_events( std::fs::create_dir_all(&dir).unwrap(); let path = dir.join(format!("rollout-2026-01-02T00-00-00-{session}.jsonl")); let mut goal_events: Vec = serde_json::from_str(include_str!( - "../fixtures/provider_normalization/codex/thread_goal_updates.input.json" + "../../../../tests/fixtures/provider_normalization/codex/thread_goal_updates.input.json" )) .expect("checked-in Codex goal update sequence"); for event in &mut goal_events { diff --git a/tests/transcript_ingest_suite/codex_ingest.rs b/crates/tracedecay/tests/transcript_ingest_suite/codex_ingest.rs similarity index 100% rename from tests/transcript_ingest_suite/codex_ingest.rs rename to crates/tracedecay/tests/transcript_ingest_suite/codex_ingest.rs diff --git a/tests/transcript_ingest_suite/codex_response_items.rs b/crates/tracedecay/tests/transcript_ingest_suite/codex_response_items.rs similarity index 100% rename from tests/transcript_ingest_suite/codex_response_items.rs rename to crates/tracedecay/tests/transcript_ingest_suite/codex_response_items.rs diff --git a/tests/transcript_ingest_suite/codex_usage.rs b/crates/tracedecay/tests/transcript_ingest_suite/codex_usage.rs similarity index 100% rename from tests/transcript_ingest_suite/codex_usage.rs rename to crates/tracedecay/tests/transcript_ingest_suite/codex_usage.rs diff --git a/tests/transcript_ingest_suite/cursor.rs b/crates/tracedecay/tests/transcript_ingest_suite/cursor.rs similarity index 100% rename from tests/transcript_ingest_suite/cursor.rs rename to crates/tracedecay/tests/transcript_ingest_suite/cursor.rs diff --git a/tests/transcript_ingest_suite/cursor_composer.rs b/crates/tracedecay/tests/transcript_ingest_suite/cursor_composer.rs similarity index 99% rename from tests/transcript_ingest_suite/cursor_composer.rs rename to crates/tracedecay/tests/transcript_ingest_suite/cursor_composer.rs index 625c93f927..21dfc05283 100644 --- a/tests/transcript_ingest_suite/cursor_composer.rs +++ b/crates/tracedecay/tests/transcript_ingest_suite/cursor_composer.rs @@ -1017,7 +1017,7 @@ async fn composer_envelope_todos_admit_workflow_lifecycle_facts() { mark_test_project(&project); let fixture: serde_json::Value = serde_json::from_str(include_str!( - "../fixtures/provider_normalization/cursor_composer/envelope_todos.input.json" + "../../../../tests/fixtures/provider_normalization/cursor_composer/envelope_todos.input.json" )) .expect("checked-in composer envelope todos fixture"); let mut env = envelope("comp-1", &project, &["b-user"]); @@ -1097,7 +1097,7 @@ async fn composer_envelope_todos_exact_duplicate_is_idempotent() { mark_test_project(&project); let fixture: serde_json::Value = serde_json::from_str(include_str!( - "../fixtures/provider_normalization/cursor_composer/envelope_todos.input.json" + "../../../../tests/fixtures/provider_normalization/cursor_composer/envelope_todos.input.json" )) .unwrap(); let mut env = envelope("comp-1", &project, &["b-user"]); @@ -1179,7 +1179,7 @@ async fn composer_envelope_todos_conflict_does_not_overwrite() { mark_test_project(&project); let fixture: serde_json::Value = serde_json::from_str(include_str!( - "../fixtures/provider_normalization/cursor_composer/envelope_todos.input.json" + "../../../../tests/fixtures/provider_normalization/cursor_composer/envelope_todos.input.json" )) .unwrap(); let mut env = envelope("comp-1", &project, &["b-user"]); @@ -1250,7 +1250,7 @@ async fn composer_envelope_todo_status_update_after_restart_admits_new_checkpoin mark_test_project(&project); let fixture: serde_json::Value = serde_json::from_str(include_str!( - "../fixtures/provider_normalization/cursor_composer/envelope_todos.input.json" + "../../../../tests/fixtures/provider_normalization/cursor_composer/envelope_todos.input.json" )) .unwrap(); assert!(fixture.get("lastUpdatedAt").is_some_and(|v| v.is_null())); diff --git a/tests/transcript_ingest_suite/hermes.rs b/crates/tracedecay/tests/transcript_ingest_suite/hermes.rs similarity index 99% rename from tests/transcript_ingest_suite/hermes.rs rename to crates/tracedecay/tests/transcript_ingest_suite/hermes.rs index dd4a1b1520..ef19b6203d 100644 --- a/tests/transcript_ingest_suite/hermes.rs +++ b/crates/tracedecay/tests/transcript_ingest_suite/hermes.rs @@ -229,7 +229,7 @@ async fn write_hermes_profile( // a user prompt, an assistant tool-call turn with empty content, a tool // result keyed by tool_name, and a final assistant reply. let tool_fixture: serde_json::Value = serde_json::from_str(include_str!( - "../fixtures/provider_normalization/hermes/assistant_tool_call.input.json" + "../../../../tests/fixtures/provider_normalization/hermes/assistant_tool_call.input.json" )) .expect("checked-in Hermes tool-call row"); let tool_calls = tool_fixture["tool_calls"].to_string(); @@ -911,7 +911,7 @@ async fn sweep_skips_rewound_rows_and_surfaces_reasoning_only_turns() { let conn = open_state_db(&state_db); let reasoning_fixture: serde_json::Value = serde_json::from_str(include_str!( - "../fixtures/provider_normalization/hermes/assistant_reasoning.input.json" + "../../../../tests/fixtures/provider_normalization/hermes/assistant_reasoning.input.json" )) .expect("checked-in Hermes reasoning-only row"); // A rewound (soft-deleted) turn and a reasoning-only assistant turn. diff --git a/tests/transcript_ingest_suite/kiro.rs b/crates/tracedecay/tests/transcript_ingest_suite/kiro.rs similarity index 100% rename from tests/transcript_ingest_suite/kiro.rs rename to crates/tracedecay/tests/transcript_ingest_suite/kiro.rs diff --git a/tests/transcript_ingest_suite/main.rs b/crates/tracedecay/tests/transcript_ingest_suite/main.rs similarity index 100% rename from tests/transcript_ingest_suite/main.rs rename to crates/tracedecay/tests/transcript_ingest_suite/main.rs diff --git a/tests/transcript_ingest_suite/provider_contract.rs b/crates/tracedecay/tests/transcript_ingest_suite/provider_contract.rs similarity index 100% rename from tests/transcript_ingest_suite/provider_contract.rs rename to crates/tracedecay/tests/transcript_ingest_suite/provider_contract.rs diff --git a/tests/transcript_ingest_suite/restart_atomicity.rs b/crates/tracedecay/tests/transcript_ingest_suite/restart_atomicity.rs similarity index 100% rename from tests/transcript_ingest_suite/restart_atomicity.rs rename to crates/tracedecay/tests/transcript_ingest_suite/restart_atomicity.rs diff --git a/tests/transcript_ingest_suite/support.rs b/crates/tracedecay/tests/transcript_ingest_suite/support.rs similarity index 100% rename from tests/transcript_ingest_suite/support.rs rename to crates/tracedecay/tests/transcript_ingest_suite/support.rs diff --git a/tests/transcript_ingest_suite/vibe.rs b/crates/tracedecay/tests/transcript_ingest_suite/vibe.rs similarity index 100% rename from tests/transcript_ingest_suite/vibe.rs rename to crates/tracedecay/tests/transcript_ingest_suite/vibe.rs diff --git a/tests/typed_terminal_restart_acceptance.rs b/crates/tracedecay/tests/typed_terminal_restart_acceptance.rs similarity index 99% rename from tests/typed_terminal_restart_acceptance.rs rename to crates/tracedecay/tests/typed_terminal_restart_acceptance.rs index f3e36c9b51..b4d7423c7e 100644 --- a/tests/typed_terminal_restart_acceptance.rs +++ b/crates/tracedecay/tests/typed_terminal_restart_acceptance.rs @@ -45,7 +45,7 @@ mod common; #[path = "typed_terminal_restart_acceptance/transport_boundaries.rs"] mod transport_boundaries; -use std::path::{Path, PathBuf}; +use std::path::Path; use std::process::Stdio; use std::time::{Duration, Instant}; @@ -290,8 +290,8 @@ fn assert_reset_required(payload: &Value, context: &str) { ); } -fn spawn_daemon_with_commit_barrier(home: &Path, barrier_dir: &PathBuf) -> common::DaemonProcess { - let barrier_dir = barrier_dir.clone(); +fn spawn_daemon_with_commit_barrier(home: &Path, barrier_dir: &Path) -> common::DaemonProcess { + let barrier_dir = barrier_dir.to_path_buf(); spawn_tracedecay_daemon_with(home, move |command| { command.env(FACT_COMMIT_BARRIER_DIR_ENV, &barrier_dir); }) diff --git a/tests/typed_terminal_restart_acceptance/transport_boundaries.rs b/crates/tracedecay/tests/typed_terminal_restart_acceptance/transport_boundaries.rs similarity index 99% rename from tests/typed_terminal_restart_acceptance/transport_boundaries.rs rename to crates/tracedecay/tests/typed_terminal_restart_acceptance/transport_boundaries.rs index f78214d0c6..7e13fc00df 100644 --- a/tests/typed_terminal_restart_acceptance/transport_boundaries.rs +++ b/crates/tracedecay/tests/typed_terminal_restart_acceptance/transport_boundaries.rs @@ -275,7 +275,7 @@ fn mcp_tool_call( .wait_with_output(SERVE_TIMEOUT) .expect("the MCP stdio host exits after stdin closes"); let stdout = String::from_utf8_lossy(&output.stdout).into_owned(); - let response = stdout + stdout .lines() .filter_map(|line| serde_json::from_str::(line).ok()) .find(|message| message.get("id") == Some(&json!(2))) @@ -284,8 +284,7 @@ fn mcp_tool_call( "the MCP host returned no response for '{tool}'\nstdout:\n{stdout}\nstderr:\n{}", String::from_utf8_lossy(&output.stderr) ) - }); - response + }) } /// The typed application payload an MCP tool result carries. @@ -629,8 +628,7 @@ fn reset_required_survives_http_mcp_and_rust_sdk_across_restart() { serde_json::from_value(storage_status_body.clone()).expect("canonical storage status"); let sdk_error = client .execute::(&request) - .err() - .expect("a refused store must not read as a healthy status"); + .expect_err("a refused store must not read as a healthy status"); let (sdk_kind, sdk_envelope) = sdk_problem(sdk_error, "Rust SDK reset required"); assert_eq!( sdk_kind, "reset_required", @@ -683,8 +681,7 @@ fn reset_required_survives_http_mcp_and_rust_sdk_across_restart() { let client = sdk_client(&mount, &identity); let sdk_error_after = client .execute::(&request) - .err() - .expect("a refused store must not read as a healthy status after a restart"); + .expect_err("a refused store must not read as a healthy status after a restart"); let (sdk_kind_after, sdk_envelope_after) = sdk_problem(sdk_error_after, "Rust SDK reset required after restart"); assert_eq!( diff --git a/tests/v2_surface_mount_conformance.rs b/crates/tracedecay/tests/v2_surface_mount_conformance.rs similarity index 99% rename from tests/v2_surface_mount_conformance.rs rename to crates/tracedecay/tests/v2_surface_mount_conformance.rs index 55235af48a..86ec953555 100644 --- a/tests/v2_surface_mount_conformance.rs +++ b/crates/tracedecay/tests/v2_surface_mount_conformance.rs @@ -451,7 +451,7 @@ fn mcp_tool_listing(fixture: &MountFixture) -> BTreeSet { let listing = stdout .lines() .filter_map(|line| serde_json::from_str::(line).ok()) - .find(|message| message["id"] == Value::from(2)) + .find(|message| message["id"] == 2) .unwrap_or_else(|| { panic!("the MCP server never answered tools/list\nstdout:\n{stdout}\nstderr:\n{stderr}") }); diff --git a/tests/verified_profile_backup.rs b/crates/tracedecay/tests/verified_profile_backup.rs similarity index 100% rename from tests/verified_profile_backup.rs rename to crates/tracedecay/tests/verified_profile_backup.rs diff --git a/tests/windows_durable_behavior.rs b/crates/tracedecay/tests/windows_durable_behavior.rs similarity index 98% rename from tests/windows_durable_behavior.rs rename to crates/tracedecay/tests/windows_durable_behavior.rs index 264b7264af..12541da02c 100644 --- a/tests/windows_durable_behavior.rs +++ b/crates/tracedecay/tests/windows_durable_behavior.rs @@ -4,7 +4,6 @@ //! helpers as the ordinary suites. CI selects this binary as a whole instead //! of maintaining module-prefix filters or expected test counts. -#[path = "common/mod.rs"] mod common; #[path = "storage_suite/support.rs"] mod support; @@ -17,7 +16,7 @@ mod temporal_projection; #[path = "storage_suite/fact_merge_hydration_test.rs"] mod fact_merge_hydration; -#[path = "../crates/tracedecay-domain/tests/session_contract.rs"] +#[path = "../../../crates/tracedecay-domain/tests/session_contract.rs"] mod domain_session_contract; #[tokio::test] diff --git a/tests/work_views_route.rs b/crates/tracedecay/tests/work_views_route.rs similarity index 100% rename from tests/work_views_route.rs rename to crates/tracedecay/tests/work_views_route.rs diff --git a/docs/superpowers/plans/2026-08-25-root-package-relocation.md b/docs/superpowers/plans/2026-08-25-root-package-relocation.md new file mode 100644 index 0000000000..9661378e48 --- /dev/null +++ b/docs/superpowers/plans/2026-08-25-root-package-relocation.md @@ -0,0 +1,234 @@ +# TraceDecay Root Package Relocation Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Turn the repository root into a virtual Cargo workspace and relocate the existing `tracedecay` daemon/MCP composition library to `crates/tracedecay` without changing product behavior. + +**Architecture:** Preserve package/API identity while changing filesystem and manifest ownership. Establish workspace product-version authority first, move the package atomically, then migrate tests, release staging, test helpers, and compatibility shims in separately reviewable commits. + +**Tech Stack:** Rust 2024, Cargo resolver 3, Bash/Python distribution checks, Rsbuild/TypeScript, GitHub Actions and release-please. + +**Spec:** `docs/superpowers/specs/2026-08-25-root-package-relocation-design.md` + +## Global Constraints + +- The library remains package `tracedecay`; the executable remains `tracedecay` in package `tracedecay-cli`. +- Persisted and wire contracts do not change. +- `[workspace.package].version` is the only literal product version. +- No checked-in duplicate dashboard, plugin, benchmark, fixture, or vendor assets are added. +- Existing parallel JSON-RPC edits are adopted only after their producer finishes and verification is green. +- Every commit is coherent and stages only task-owned files. + +--- + +### Task 1: Workspace Product-Version Authority + +**Files:** +- Modify: `Cargo.toml` +- Modify: `crates/tracedecay-cli/Cargo.toml` +- Modify: `crates/tracedecay-agent-hosts/src/product_version/root_manifest.rs` +- Modify: `crates/tracedecay-agent-hosts/src/product_version.rs` +- Modify: `crates/tracedecay-agent-hosts/build.rs` +- Modify: `release-please-config.json` + +**Interfaces:** +- Produces: `root_manifest::resolve(&Path) -> Option` reading `[workspace.package].version`. + +- [ ] Add this RED test in `root_manifest.rs`: + +```rust +#[test] +fn a_virtual_workspace_product_version_round_trips_through_a_file() { + let directory = tempfile::tempdir().expect("temporary directory"); + std::fs::write( + directory.path().join(ROOT_MANIFEST_FILE), + "[workspace]\nresolver = \"3\"\n\n[workspace.package]\nversion = \"0.1.0-beta.38\"\n", + ) + .expect("write manifest"); + assert_eq!(resolve(directory.path()).as_deref(), Some("0.1.0-beta.38")); +} +``` + +- [ ] Run the exact test and confirm one failure because the parser still requires a root `[package]`: + +```bash +scripts/require-exact-test.sh cargo test -p tracedecay-agent-hosts --lib --locked \ + product_version::root_manifest::tests::a_virtual_workspace_product_version_round_trips_through_a_file -- --exact +``` + +- [ ] Parse only the literal workspace package version; preserve fail-closed behavior for missing, inherited, malformed, or ambiguous values. +- [ ] Add the current literal version to `[workspace.package]`; make the root package and CLI inherit it; update release-please to update the workspace field once. +- [ ] Run: + +```bash +cargo test -p tracedecay-agent-hosts --lib --locked product_version:: +python3 scripts/test-check-distribution-feature-wiring.py +cargo metadata --no-deps --format-version 1 +git diff --check +``` + +- [ ] Commit: + +```bash +git commit -m "refactor(version): move product version to workspace" +``` + +### Task 2: Relocate the Composition Library + +**Files:** +- Create: `crates/tracedecay/Cargo.toml` +- Move: `src/**` to `crates/tracedecay/src/**` +- Move: `build.rs` and `build-support/dashboard_manifest.rs` under `crates/tracedecay/` +- Modify: `Cargo.toml` +- Modify: `crates/tracedecay-cli/Cargo.toml` +- Modify: `crates/tracedecay-agent-hosts/build.rs` + +**Interfaces:** +- Produces: package `tracedecay` at `crates/tracedecay` with unchanged library, features, dependencies, and public symbols. + +- [ ] Capture untracked pre-move metadata at `/tmp/tracedecay-root-package-before.json`; record package targets, feature keys, and dependency package names. +- [ ] Move root package sections into `crates/tracedecay/Cargo.toml`, translate dependency paths, add the member, and leave workspace policy at root. +- [ ] Use `git mv` for source/build ownership. Resolve the canonical dashboard from the workspace root without embedding an absolute path. +- [ ] Change the CLI path dependency from `../..` to `../tracedecay`; update agent-hosts build paths for `build_identity.rs`. +- [ ] Verify: + +```bash +cargo metadata --no-deps --format-version 1 > /tmp/tracedecay-root-package-after.json +cargo check -p tracedecay --lib --no-default-features --locked +cargo check -p tracedecay-cli --bin tracedecay --locked +``` + +Expected: virtual root; one library package `tracedecay` under `crates/`; one binary `tracedecay` owned by the CLI; pre/post feature and dependency names match. + +- [ ] Commit: + +```bash +git commit -m "refactor(workspace): relocate composition library" +``` + +### Task 3: Relocate Package Tests and Benches + +**Files:** +- Move: package-owned Rust `tests/**` to `crates/tracedecay/tests/**` +- Move: `benches/**` to `crates/tracedecay/benches/**` +- Create: `crates/tracedecay/tests/common/repository_layout.rs` +- Modify: relocated fixture and benchmark path callers +- Modify: `crates/tracedecay/Cargo.toml` + +**Interfaces:** +- Produces: one `repository_root() -> &'static Path` test/bench authority validating `Cargo.toml`, `dashboard/`, and `plugin/` sentinels. + +- [ ] Inventory all 29 top-level Rust tests, 14 suite `main.rs` targets, four benches, and explicit target declarations. Keep non-Rust scripts/shared fixtures at root. +- [ ] Write a RED test requiring `repository_root()` to find the three sentinels. +- [ ] Move Rust targets and replace direct root assumptions based on `CARGO_MANIFEST_DIR` with the one helper. +- [ ] Compare Cargo target inventory to the pre-move metadata and run non-vacuously: + +```bash +cargo test -p tracedecay --lib --locked +cargo test -p tracedecay --test runtime_surface_acceptance --locked +cargo test -p tracedecay --test mcp_suite --locked +cargo test -p tracedecay --test session_suite --locked +cargo bench -p tracedecay --bench queries --no-run --locked +``` + +- [ ] Commit: + +```bash +git commit -m "refactor(test): move composition package targets" +``` + +### Task 4: Distribution and Dashboard Packaging + +**Files:** +- Modify: `scripts/check-distribution-acceptance.sh` +- Modify: `scripts/check-production-feature-profile.py` +- Modify: `scripts/check-distribution-feature-wiring.py` +- Modify: `scripts/test-check-distribution-feature-wiring.py` +- Modify: `crates/tracedecay/build.rs` +- Modify: affected `.github/workflows/*.yml` + +**Interfaces:** +- Produces: isolated package staging from `crates/tracedecay` plus the existing exact root asset whitelist. + +- [ ] Change distribution fixture expectations first and confirm they fail because scripts still select the virtual root manifest as the product package. +- [ ] Stage exact dashboard/plugin/benchmark/fixture/vendor assets into a temporary package tree; reject missing assets and compare source/manifest digests before `cargo package`. +- [ ] Update only workflow paths that mean the package manifest; workspace commands remain rooted at `Cargo.toml`. +- [ ] Verify: + +```bash +python3 scripts/test-check-distribution-feature-wiring.py +scripts/check-distribution-acceptance.sh +cd dashboard && npm run contracts:check && npm run typecheck && npm test && npm run build +cargo build -p tracedecay-cli --bin tracedecay --locked +target/debug/tracedecay --version +``` + +- [ ] Commit: + +```bash +git commit -m "build(distribution): stage relocated product package" +``` + +### Task 5: Gate Host-Admission Test Support + +**Files:** +- Modify: `crates/tracedecay/Cargo.toml` +- Modify: `crates/tracedecay/src/host_admission.rs` +- Modify: consuming targets under `crates/tracedecay/tests/**` + +**Interfaces:** +- Produces: feature `test-helpers`; `test-transport` includes it; fixtures compile only under `cfg(any(test, feature = "test-helpers"))`. + +- [ ] Add an external compile probe showing `HostAdmissionTestRuntimeV1` currently resolves without a test feature. +- [ ] Gate support modules/reexports and explicitly feature-gate every integration consumer. +- [ ] Confirm the production probe no longer resolves the helper, while representative session, MCP, storage, and CLI journeys pass with the declared test feature. +- [ ] Commit: + +```bash +git commit -m "test(host-admission): gate integration fixture surface" +``` + +### Task 6: Adopt JSON-RPC Work and Remove Proven Shims + +**Files:** +- Adopt after producer completion: six daemon JSON-RPC files currently modified in this worktree +- Modify/delete: compatibility modules only after complete caller migration + +**Interfaces:** +- Consumes: canonical `tracedecay-jsonrpc` and `tracedecay-usecases` APIs. +- Produces: no duplicate root authority for migrated types. + +- [ ] Do not edit producer-owned files while its Cargo process is active. Inspect its final diff and result; adopt only behavior-preserving canonical imports. +- [ ] Run focused daemon/projectless/bootstrap checks and commit the six files independently: + +```bash +git commit -m "refactor(jsonrpc): use canonical daemon wire types" +``` + +- [ ] For each thin usecase shim, resolve Rust, CLI, integration, macro, schema, and string-keyed consumers; migrate callers and delete only when no supported consumer remains. +- [ ] Run mapped tests after each cohesive owner group and commit each group separately, e.g.: + +```bash +git commit -m "refactor(usecases): remove root diagnostic shims" +``` + +### Task 7: Final Integration + +**Files:** +- Modify only paths required by integration diagnostics. +- Update: draft PR verification and summary. + +- [ ] Merge the latest explicit clean `codex/code-index-catchup-pipeline` floor and regenerate canonical outputs after conflict resolution. +- [ ] Run: + +```bash +cargo fmt --all -- --check +cargo check -p tracedecay --lib --all-features --locked +cargo check -p tracedecay-cli --bin tracedecay --all-features --locked +cargo clippy -p tracedecay -p tracedecay-cli --all-targets --all-features --locked -- -D warnings +git diff --check +``` + +- [ ] Run workspace-appropriate tests, dashboard gates, distribution acceptance, SDK drift checks, and production CLI/daemon smoke. Record exact non-vacuous results. +- [ ] Review for absolute build paths, duplicated assets, default test helpers, stale root-manifest assumptions, lost tests, and compatibility aliases. +- [ ] Push coherent commits, update PR evidence, and mark ready only after required checks and independent review are clear. diff --git a/docs/superpowers/specs/2026-08-25-root-package-relocation-design.md b/docs/superpowers/specs/2026-08-25-root-package-relocation-design.md new file mode 100644 index 0000000000..fecc27e8f1 --- /dev/null +++ b/docs/superpowers/specs/2026-08-25-root-package-relocation-design.md @@ -0,0 +1,266 @@ +# TraceDecay Root Package Relocation Design + +## Status + +Proposed for the draft pull request. This design relocates the existing +`tracedecay` library package without changing product behavior or using the +move as evidence that additional runtime code is dead. + +## Goal + +Make the repository root a virtual Cargo workspace. The workspace package +layout becomes explicit: + +- `crates/tracedecay-cli` owns the `tracedecay` executable and command-line + parsing. +- `crates/tracedecay` owns the daemon, MCP server, dashboard embedding, runtime + composition, and the public `tracedecay` Rust library. +- The existing domain, application, use-case, storage, query, and runtime + crates remain the canonical owners of their current capabilities. + +The package move must preserve the package name, binary name, product version, +feature behavior, release artifacts, persisted formats, and public runtime +behavior. + +## Why This Is Architectural + +The current repository is a valid Cargo layout: a manifest may be both a +workspace root and a package. The root package is not an obsolete binary. It is +a 400,000-line library whose largest owned areas are daemon composition and MCP +serving, and `tracedecay-cli` depends on it. + +Relocation is nevertheless useful if it establishes one durable rule: every +Rust package lives under `crates/`, while the repository root owns only +workspace-wide configuration and product assets. A path-only move that leaves +version, packaging, fixtures, and test ownership ambiguous would not meet this +goal. + +## Current State + +- The workspace-root `Cargo.toml` contains both `[workspace]` and `[package]`. +- The root package is named `tracedecay` and exposes only a library target. +- `crates/tracedecay-cli` owns the sole binary named `tracedecay` and is the + only workspace package with a normal dependency on the root library. +- The root package owns `src/`, its build script, Rust integration tests, + benches, and an explicit package-asset whitelist. +- The root manifest's literal package version is the product-version authority + consumed by release automation and `tracedecay-agent-hosts`. +- Root build and test code currently resolves repository assets through + `CARGO_MANIFEST_DIR`. +- Several tiny root modules are compatibility re-exports of canonical + `tracedecay-usecases` implementations. Separately, host-admission integration + fixtures are compiled into the library so external integration tests can + reach them. + +## Considered Approaches + +### 1. Keep the mixed workspace/package root + +This is the lowest-risk and entirely normal Cargo layout. It avoids path churn, +but it does not satisfy the requested uniform `crates/` package layout and +continues to make repository assets and package-owned sources look like the +same architectural unit. + +### 2. Relocate the package intact under `crates/tracedecay` (selected) + +Move the package as one semantic unit, then separately remove proven +compatibility and test-support leakage. This preserves the existing +composition boundary while making the repository root virtual. It is noisy but +mechanical, and its invariants can be tested without redesigning runtime +behavior. + +### 3. Split daemon, MCP, and dashboard composition into new packages + +This could reduce rebuild scope and public surface further, but it changes +dependency direction and runtime interfaces. Combining it with relocation +would make regressions impossible to attribute. It is explicitly deferred +until dependency and build-time evidence justifies each extraction. + +## Target Layout + +```text +Cargo.toml # virtual workspace and shared policy +crates/ + tracedecay/ + Cargo.toml # package tracedecay, library target + build.rs # product library build authority + build-support/ + src/ + tests/ + benches/ + tracedecay-cli/ + Cargo.toml # package tracedecay-cli + src/main.rs # binary tracedecay +dashboard/ # canonical frontend source remains shared +plugin/ # canonical host bundle source remains shared +benchmark_data/ # canonical benchmark fixtures remain shared +vendor/ # canonical vendored parsers remain shared +``` + +No second copy of dashboard, plugin, benchmark, fixture, or vendor data may be +checked in beneath `crates/tracedecay`. + +## Package and Dependency Contracts + +The relocated package remains named `tracedecay`; this is not a rename. Its +features and dependency graph remain byte-for-byte equivalent unless a path +must change for relocation. + +`crates/tracedecay-cli` changes its dependency path from `../..` to +`../tracedecay`. No other package should gain a direct dependency on +`tracedecay` as part of the move. + +The root manifest gains `crates/tracedecay` as an explicit workspace member and +loses `[package]`, `[lib]`, package features, package dependencies, dev +dependencies, tests, and benches. Workspace dependencies, profiles, patches, +and lint policy remain at the root. + +## Product Version Authority + +The repository must retain one literal product version that release tooling +can update and host bundles can bake without building the CLI. + +The selected authority is `[workspace.package].version` in the virtual root +manifest. `crates/tracedecay` and `crates/tracedecay-cli` inherit it with +`version.workspace = true`. Existing product-version parsing, release-please +configuration, release integrity checks, and build-script rerun edges are +migrated to this field in the same commit. Other workspace crates keep their +existing package-version policy unless they are already intended to track the +product version. + +No fallback to a crate-local version, Git tag, or fabricated default is +allowed. + +## Repository Asset Resolution + +Relocation changes `CARGO_MANIFEST_DIR`, so repository assets need an explicit +authority. Code must not scatter `../..` joins throughout production modules. + +The relocated package build script computes the repository root from its +manifest location, verifies expected sentinels (`Cargo.toml`, `dashboard/`, and +`plugin/`), and exports a compile-time repository-root-relative layout for +build-time inclusion. Test and benchmark helpers use one crate-owned +`repository_layout` helper to resolve checked-out fixtures. + +Installed production behavior may not depend on the source checkout. Assets +needed at runtime remain embedded or copied into the distribution artifact. +Tests and developer benchmarks may use checkout-only fixture paths. + +## Dashboard and Package Archive + +The dashboard source remains at `dashboard/`. The relocated build script still +builds that source and embeds the canonical `dashboard/app-dist` manifest. + +Cargo packages cannot safely claim arbitrary parent-directory files as package +contents. Therefore distribution assembly becomes explicit: + +1. Build the canonical dashboard. +2. Stage the exact package asset whitelist in an isolated distribution tree. +3. Place the relocated `tracedecay` manifest and sources at that tree's package + root alongside the selected dashboard, plugin, benchmark, fixture, and + vendor assets. +4. Run `cargo package` and all existing extracted-package consumers against the + staged tree. + +The distribution acceptance script remains the authority for proving archive +contents, feature wiring, build identity, host bundles, and the executable. It +must compare the staged manifest to `crates/tracedecay/Cargo.toml` rather than +the virtual workspace manifest. + +## Tests and Benches + +Package-owned Rust integration tests and benches move with the package. Shared +fixture directories remain at the repository root and are resolved through the +single repository-layout helper. + +The move must preserve target names, `required-features`, ignored-test policy, +and anti-vacuity behavior. It may not silently drop auto-discovered tests. +Before removing root `tests/` or `benches/`, an inventory must map every current +Rust target to its relocated target. Non-Rust shell/Python acceptance tests and +shared fixtures stay at the repository root. + +## Compatibility Shims + +Relocation alone does not prove a public item is unused. After the mechanical +move is green, the small root compatibility modules that merely glob-re-export +canonical `tracedecay-usecases` modules are handled in a separate commit: + +1. Migrate internal callers to the canonical crate. +2. Check CLI, integration-test, schema, macro, and string-keyed consumers. +3. Delete only shims with no required external contract. + +The root package is unpublished, so an unshipped compatibility path does not +justify permanent duplication. Persisted and wire contracts remain unchanged. + +## Test-Support Boundary + +Host-admission integration support is a distinct concern from dead production +surface. External integration tests currently require those helpers from a +non-`cfg(test)` library build. + +The relocated package introduces an explicit `test-helpers` feature. Test-only +modules and public fixture types compile only under +`cfg(any(test, feature = "test-helpers"))`. Integration targets that consume +them declare the feature explicitly; production and `production`-feature +builds must not contain them. `test-transport` may depend on `test-helpers`, but +the two meanings remain distinct. + +No test-support crate or public trait facade is added merely to avoid declaring +the feature. + +## Migration Sequence + +1. Establish workspace product-version authority and update its consumers. +2. Add the relocated package manifest and move build/source ownership in one + compile-preserving commit. +3. Move package-owned Rust tests and benches, introduce repository-layout + resolution, and prove the exact target inventory. +4. Update distribution staging, dashboard embedding, release automation, + documentation, and source-package checks. +5. Gate host-admission fixtures behind `test-helpers` and update consumers. +6. Migrate and remove compatibility shims whose callers are fully known. +7. Run focused, workspace, dashboard, distribution, and production binary + journeys before requesting final review. + +Each step is committed independently. The branch may temporarily contain +mechanical moves, but every pushed commit must leave Cargo metadata coherent; +behavioral changes never share a commit with bulk path relocation. + +## Verification + +At minimum, the completed branch must prove: + +- `cargo metadata --no-deps --format-version 1` reports a virtual root, + `crates/tracedecay` as package `tracedecay`, and exactly one binary named + `tracedecay` owned by `tracedecay-cli`. +- `cargo check -p tracedecay --lib --no-default-features --locked` passes. +- `cargo check -p tracedecay-cli --bin tracedecay --locked` passes. +- The production and all-feature package graphs retain the intended feature + sets, including feature-off Hotpath behavior. +- Relocated unit and integration targets execute non-vacuously. +- Dashboard contract generation/check, typecheck, focused UI tests, and build + pass. +- Distribution acceptance builds the staged source archive and its external + consumer probes. +- Release-version and host-bundle drift checks read the workspace product + version exactly. +- Default production compilation contains no host-admission test-support + surface. +- `git diff --check`, formatting, and relevant clippy gates pass. + +## Rollback + +Before merge, rollback is a normal branch revert. No persisted data or runtime +configuration changes are involved. The mechanical relocation commit is kept +separate so it can be reverted without retaining half-moved package paths. + +## Non-Goals + +- Renaming the `tracedecay` library or executable. +- Splitting daemon, MCP, dashboard, or runtime composition into additional + packages in this pull request. +- Changing serialized, database, JSON-RPC, MCP, LSP, hook, or dashboard wire + contracts. +- Treating raw dead-code counts as proof that a crate or public API can be + deleted. +- Adding compatibility aliases solely for branch-local paths. diff --git a/release-please-config.json b/release-please-config.json index e0b4f2ce55..5dcc4d14a8 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -12,12 +12,7 @@ { "type": "toml", "path": "Cargo.toml", - "jsonpath": "$.package.version" - }, - { - "type": "toml", - "path": "crates/tracedecay-cli/Cargo.toml", - "jsonpath": "$.package.version" + "jsonpath": "$.workspace.package.version" }, { "type": "json", diff --git a/scripts/check-distribution-acceptance.sh b/scripts/check-distribution-acceptance.sh index e54a02f344..d0230359ed 100755 --- a/scripts/check-distribution-acceptance.sh +++ b/scripts/check-distribution-acceptance.sh @@ -338,6 +338,109 @@ cargo build \ --lib \ --bins +echo "distribution acceptance: staging the product package tree" +# `tracedecay` is `crates/tracedecay`, but the assets it ships — the dashboard +# bundle, host plugins, vendored payloads, benchmark corpora, and the packaged +# fixtures — are repository-root directories shared with the whole workspace. +# Cargo packs only what lives inside the package directory, so packaging the +# checkout as-is yields a `tracedecay` archive with none of them, and the +# `include` whitelist in `crates/tracedecay/Cargo.toml` silently matches +# nothing. Stage a copy of the workspace, place exactly those root assets +# beside the product manifest, and pack from the staged tree. `build.rs` +# already recognises this shape: a manifest directory with `dashboard` and +# `plugin` beside it *is* the repository root, and it embeds the prebuilt +# app-dist rather than rebuilding the frontend. +staged="$work/staged" +mkdir -p -- "$staged" +tar -C "$repo" \ + --exclude=./target \ + --exclude=./.git \ + --exclude=./.codex-worktrees \ + --exclude=./.claude-worktrees \ + --exclude='./dashboard/node_modules' \ + --exclude='./node_modules' \ + -cf - . | tar -xf - -C "$staged" + +staged_product="$staged/crates/tracedecay" +[[ -f "$staged_product/Cargo.toml" ]] || + die "staged workspace is missing the product manifest at crates/tracedecay" + +# Exactly the root entries the product `include` whitelist names. Keep this in +# sync with `include` in crates/tracedecay/Cargo.toml: a missing asset is a +# packaging defect, never something to skip past. +declare -a staged_root_assets=( + "CHANGELOG.md" + "LICENSE" + "README.md" + "rust-toolchain.toml" + ".cargo/config.toml" + "plugin" + "vendor" + "benchmark_data" + "dashboard/app-dist" + "dashboard/hermes-wrapper" + "tests/fixtures" + "scripts/run-session-temporal-benchmark.sh" +) +for asset in "${staged_root_assets[@]}"; do + [[ -e "$repo/$asset" ]] || + die "product package asset is missing from the source tree: $asset" + mkdir -p -- "$staged_product/$(dirname -- "$asset")" + cp -a -- "$repo/$asset" "$staged_product/$(dirname -- "$asset")/" +done + +# The manifest reads its readme from the workspace root, which is outside the +# package. The staged tree carries its own copy, so point at that one; nothing +# else about the staged manifest may differ, and the feature-wiring comparison +# below is run against the source manifest to prove it. +python3 - "$staged_product/Cargo.toml" <<'PY' +import pathlib +import sys + +path = pathlib.Path(sys.argv[1]) +text = path.read_text(encoding="utf-8") +old = 'readme = "../../README.md"' +new = 'readme = "README.md"' +if text.count(old) != 1: + raise SystemExit( + "distribution acceptance: staged product manifest does not declare the " + f"expected workspace-root readme ({old})" + ) +path.write_text(text.replace(old, new), encoding="utf-8") +PY + +# Prove the staged assets are byte-identical to the source tree, so the archive +# below ships what the repository actually holds. +python3 - "$repo" "$staged_product" "${staged_root_assets[@]}" <<'PY' +import hashlib +import pathlib +import sys + +repo = pathlib.Path(sys.argv[1]) +staged = pathlib.Path(sys.argv[2]) + + +def digest(root: pathlib.Path) -> str: + if root.is_file(): + return hashlib.sha256(root.read_bytes()).hexdigest() + accumulator = hashlib.sha256() + for path in sorted(p for p in root.rglob("*") if p.is_file()): + accumulator.update(str(path.relative_to(root)).encode("utf-8")) + accumulator.update(path.read_bytes()) + return accumulator.hexdigest() + + +for asset in sys.argv[3:]: + source, copied = repo / asset, staged / asset + if not copied.exists(): + raise SystemExit(f"distribution acceptance: staged asset is missing: {asset}") + if digest(source) != digest(copied): + raise SystemExit( + f"distribution acceptance: staged asset differs from its source: {asset}" + ) +print(f"distribution acceptance: staged {len(sys.argv) - 3} product asset entries") +PY + echo "distribution acceptance: packaging every workspace crate" # Every workspace member is publish = false: releases ship GitHub-release # artifacts, never crates.io uploads. Packaging is used here only to produce @@ -347,7 +450,7 @@ echo "distribution acceptance: packaging every workspace crate" # embedded lock — every extracted tree resolves through the [patch.crates-io] # path overlay below, and the install step builds from a path, not an archive. cargo package \ - --manifest-path "$repo/Cargo.toml" \ + --manifest-path "$staged/Cargo.toml" \ --workspace \ --allow-dirty \ --no-verify \ @@ -355,7 +458,7 @@ cargo package \ metadata="$work/metadata.json" cargo metadata \ - --manifest-path "$repo/Cargo.toml" \ + --manifest-path "$staged/Cargo.toml" \ --format-version 1 \ --no-deps >"$metadata" @@ -393,6 +496,14 @@ while IFS=$'\t' read -r name version; do [[ -f "$directory/Cargo.toml" ]] || die "package archive did not contain $name-$version/Cargo.toml" package_dirs["$name"]=$directory + # Extracted archives are named `-`, but in the workspace every + # crate sits at `crates/`. Build scripts that reach a sibling crate by + # relative path — `tracedecay-agent-hosts/build.rs` shares + # `tracedecay/src/version/build_identity.rs` through `#[path]` — resolve + # against that unversioned shape. `cargo package` cannot carry a file from + # outside the package, so give the battery the same sibling layout the + # workspace has rather than a copy that could drift from it. + ln -sfn -- "$name-$version" "$packages/$name" done <"$package_table" for required_package in \ @@ -440,7 +551,7 @@ for package in sorted(metadata["packages"], key=lambda value: value["name"]): PY verify_feature_wiring \ - "$repo/Cargo.toml" \ + "$repo/crates/tracedecay/Cargo.toml" \ "$root_package/Cargo.toml" \ "$repo/crates/tracedecay-code-index/Cargo.toml" \ "$code_index_package/Cargo.toml" \ diff --git a/scripts/check-production-feature-profile.py b/scripts/check-production-feature-profile.py index 29a42edf56..a6ad113a7f 100755 --- a/scripts/check-production-feature-profile.py +++ b/scripts/check-production-feature-profile.py @@ -51,7 +51,12 @@ def main() -> int: arguments = parser.parse_args() repo = arguments.repo.resolve() - with repo.joinpath("Cargo.toml").open("rb") as handle: + # The product package moved to `crates/tracedecay`; the repository root is + # now a virtual workspace manifest that declares no features at all. + package_manifest = repo.joinpath("crates", "tracedecay", "Cargo.toml") + if not package_manifest.is_file(): + raise SystemExit(f"missing product package manifest at {package_manifest}") + with package_manifest.open("rb") as handle: manifest = tomllib.load(handle) features = manifest.get("features", {}) if features.get("default") != ["production"]: diff --git a/scripts/check-release-drift.sh b/scripts/check-release-drift.sh index 8e1b2fe1b0..a3afbcba5d 100755 --- a/scripts/check-release-drift.sh +++ b/scripts/check-release-drift.sh @@ -43,7 +43,10 @@ import tomllib with open(sys.argv[1], "rb") as handle: manifest = tomllib.load(handle) -print(manifest["package"]["version"]) +# The repository root is a virtual workspace manifest with no `[package]`. +# Every member inherits `version.workspace = true`, so the released version is +# the workspace one. +print(manifest["workspace"]["package"]["version"]) PY )" diff --git a/scripts/resolve-release-source-profile.py b/scripts/resolve-release-source-profile.py index a12bd53116..78c0428ec0 100755 --- a/scripts/resolve-release-source-profile.py +++ b/scripts/resolve-release-source-profile.py @@ -54,7 +54,15 @@ def main() -> int: arguments = parser.parse_args() source = arguments.source.resolve() - with source.joinpath("Cargo.toml").open("rb") as handle: + # The product package moved to `crates/tracedecay`; the repository root is + # now a virtual workspace manifest that declares no features at all. + # Reading the root here resolved every relocated tree to `legacy-default`, + # which silently drops `production` from the release feature set and skips + # the production feature-profile check below. + package_manifest = source.joinpath("crates", "tracedecay", "Cargo.toml") + if not package_manifest.is_file(): + raise SystemExit(f"missing product package manifest at {package_manifest}") + with package_manifest.open("rb") as handle: manifest = tomllib.load(handle) features = manifest.get("features", {}) if not isinstance(features, dict): diff --git a/scripts/test-build-mcpb.py b/scripts/test-build-mcpb.py index 4b5fe523f2..651e89f4c6 100644 --- a/scripts/test-build-mcpb.py +++ b/scripts/test-build-mcpb.py @@ -17,9 +17,12 @@ def main() -> None: repository = SCRIPT.parent.parent + # The repository root is a virtual workspace manifest with no `[package]`. + # Every member inherits `version.workspace = true`, so the shipped version + # is the workspace one. package_version = tomllib.loads( (repository / "Cargo.toml").read_text(encoding="utf-8") - )["package"]["version"] + )["workspace"]["package"]["version"] registry = json.loads((repository / "server.json").read_text(encoding="utf-8")) assert registry["version"] == package_version expected_description = ( diff --git a/scripts/test-resolve-release-source-profile.py b/scripts/test-resolve-release-source-profile.py index a7c667ed37..707ff6030f 100755 --- a/scripts/test-resolve-release-source-profile.py +++ b/scripts/test-resolve-release-source-profile.py @@ -34,7 +34,11 @@ class FixtureResult: def run_fixture(manifest: str) -> FixtureResult: with tempfile.TemporaryDirectory() as temporary_directory: source = Path(temporary_directory) - source.joinpath("Cargo.toml").write_text(manifest, encoding="utf-8") + # The resolver reads the product package manifest, not the workspace + # root: `crates/tracedecay/Cargo.toml` is where the feature table lives. + product = source.joinpath("crates", "tracedecay") + product.mkdir(parents=True) + product.joinpath("Cargo.toml").write_text(manifest, encoding="utf-8") output = source / "github-output.txt" completed = subprocess.run( [ diff --git a/src/config/scope_control.rs b/src/config/scope_control.rs deleted file mode 100644 index 4de1d135d3..0000000000 --- a/src/config/scope_control.rs +++ /dev/null @@ -1,6 +0,0 @@ -//! Protected-change planning types — moved to `tracedecay-usecases::config::scope_control`. -//! -//! Thin shim so every `crate::config/scope_control::…` path in the root crate keeps -//! resolving after the crate split. See the canonical module for rationale. - -pub use tracedecay_usecases::config::scope_control::*; diff --git a/src/context/read_cache.rs b/src/context/read_cache.rs deleted file mode 100644 index f2729f8f12..0000000000 --- a/src/context/read_cache.rs +++ /dev/null @@ -1,7 +0,0 @@ -//! Root shim for the cross-session read cache. -//! -//! The implementation lives in `tracedecay_usecases::context::read_cache` -//! (canonical copy; see SEAMS.md). This module keeps every historical -//! `crate::context::read_cache::…` path resolving from the root crate. - -pub use tracedecay_usecases::context::read_cache::*; diff --git a/src/context/read_modes.rs b/src/context/read_modes.rs deleted file mode 100644 index 7e76c9dcd7..0000000000 --- a/src/context/read_modes.rs +++ /dev/null @@ -1,6 +0,0 @@ -//! Source read-mode + line-range types — moved to `tracedecay-usecases::context::read_modes`. -//! -//! Thin shim so every `crate::context/read_modes::…` path in the root crate keeps -//! resolving after the crate split. See the canonical module for rationale. - -pub use tracedecay_usecases::context::read_modes::*; diff --git a/src/context/source_read.rs b/src/context/source_read.rs deleted file mode 100644 index fc182393f1..0000000000 --- a/src/context/source_read.rs +++ /dev/null @@ -1,9 +0,0 @@ -//! Mode-aware source read + indexed path resolution — moved to -//! `tracedecay-usecases::context::source_read`. -//! -//! Thin shim so every `crate::context::source_read::…` path in the root crate -//! keeps resolving after the crate split. See the canonical module for -//! rationale. The canonical `SourceReadOutput` carries the `mode` field the -//! root `tracedecay_read` handler echoes back to callers. - -pub use tracedecay_usecases::context::source_read::*; diff --git a/src/diagnose.rs b/src/diagnose.rs deleted file mode 100644 index c9e875d2a3..0000000000 --- a/src/diagnose.rs +++ /dev/null @@ -1,6 +0,0 @@ -//! Diagnostic severity + record types — moved to `tracedecay-usecases::diagnose`. -//! -//! Thin shim so every `crate::diagnose::…` path in the root crate keeps -//! resolving after the crate split. See the canonical module for rationale. - -pub use tracedecay_usecases::diagnose::*; diff --git a/src/diagnostics_publication.rs b/src/diagnostics_publication.rs deleted file mode 100644 index 8c6df3455c..0000000000 --- a/src/diagnostics_publication.rs +++ /dev/null @@ -1,10 +0,0 @@ -//! Production write side for generation-bound diagnostics (Plan 35, -//! "Universal managed diagnostics"). -//! -//! The canonical implementation now lives in -//! [`tracedecay_usecases::diagnostics_publication`]; this module is a thin -//! re-export shim so existing `crate::diagnostics_publication::…` paths keep -//! resolving during the crate split. See the canonical module for the full -//! contract documentation. - -pub use tracedecay_usecases::diagnostics_publication::*; diff --git a/src/diagnostics_query.rs b/src/diagnostics_query.rs deleted file mode 100644 index 23804a0149..0000000000 --- a/src/diagnostics_query.rs +++ /dev/null @@ -1,6 +0,0 @@ -//! Diagnostics query types — moved to `tracedecay-usecases::diagnostics_query`. -//! -//! Thin shim so every `crate::diagnostics_query::…` path in the root crate keeps -//! resolving after the crate split. See the canonical module for rationale. - -pub use tracedecay_usecases::diagnostics_query::*; diff --git a/src/diagnostics_store.rs b/src/diagnostics_store.rs deleted file mode 100644 index 6bf3f844b1..0000000000 --- a/src/diagnostics_store.rs +++ /dev/null @@ -1,6 +0,0 @@ -//! Diagnostics store — moved to `tracedecay-usecases::diagnostics_store`. -//! -//! Thin shim so every `crate::diagnostics_store::…` path in the root crate keeps -//! resolving after the crate split. See the canonical module for rationale. - -pub use tracedecay_usecases::diagnostics_store::*; diff --git a/src/git_intelligence.rs b/src/git_intelligence.rs deleted file mode 100644 index 425dc44440..0000000000 --- a/src/git_intelligence.rs +++ /dev/null @@ -1,7 +0,0 @@ -//! Root shim for the native Git intelligence adapter. -//! -//! The implementation lives in `tracedecay_usecases::git_intelligence` -//! (canonical copy; see SEAMS.md). This module keeps every historical -//! `crate::git_intelligence::…` path resolving from the root crate. - -pub use tracedecay_usecases::git_intelligence::*; diff --git a/src/graph/queries.rs b/src/graph/queries.rs deleted file mode 100644 index fb7ce195f5..0000000000 --- a/src/graph/queries.rs +++ /dev/null @@ -1,6 +0,0 @@ -//! Graph query manager + node metrics — moved to `tracedecay-usecases::graph::queries`. -//! -//! Thin shim so every `crate::graph/queries::…` path in the root crate keeps -//! resolving after the crate split. See the canonical module for rationale. - -pub use tracedecay_usecases::graph::queries::*; diff --git a/src/graph/scc.rs b/src/graph/scc.rs deleted file mode 100644 index 511c7d82d3..0000000000 --- a/src/graph/scc.rs +++ /dev/null @@ -1,7 +0,0 @@ -//! Root shim for Tarjan's strongly-connected-components algorithm. -//! -//! The implementation lives in `tracedecay_usecases::graph::scc` -//! (canonical copy; see SEAMS.md). This module keeps every historical -//! `crate::graph::scc::…` path resolving from the root crate. - -pub use tracedecay_usecases::graph::scc::*; diff --git a/src/request_identity.rs b/src/request_identity.rs deleted file mode 100644 index 2f2933d61d..0000000000 --- a/src/request_identity.rs +++ /dev/null @@ -1,7 +0,0 @@ -//! Root shim for request-identity primitives. -//! -//! The implementation lives in `tracedecay_usecases::request_identity` -//! (canonical copy; see SEAMS.md). This module keeps every historical -//! `crate::request_identity::…` path resolving from the root crate. - -pub use tracedecay_usecases::request_identity::*; diff --git a/src/retention/code_index_generations.rs b/src/retention/code_index_generations.rs deleted file mode 100644 index 6d48835d19..0000000000 --- a/src/retention/code_index_generations.rs +++ /dev/null @@ -1,7 +0,0 @@ -//! Liveness-based retention for immutable code-index generations. -//! -//! Moved to `tracedecay-usecases::retention::code_index_generations`. This is a -//! thin shim so every `crate::retention::code_index_generations::…` path in the -//! root crate keeps resolving after the crate split. - -pub use tracedecay_usecases::retention::code_index_generations::*; diff --git a/src/store/vector_generations.rs b/src/store/vector_generations.rs deleted file mode 100644 index 56dad17cda..0000000000 --- a/src/store/vector_generations.rs +++ /dev/null @@ -1,9 +0,0 @@ -//! Immutable semantic vector-generation storage. -//! -//! The canonical definitions now live in -//! `tracedecay_usecases::store::vector_generations`. This module re-exports -//! them so existing `crate::store::vector_generations::…` paths keep working -//! without duplicating the state machine, the database-backed store, or the -//! legacy-migration adapters. - -pub use tracedecay_usecases::store::vector_generations::*; diff --git a/src/user_config.rs b/src/user_config.rs deleted file mode 100644 index 491df3ead9..0000000000 --- a/src/user_config.rs +++ /dev/null @@ -1,7 +0,0 @@ -//! Root shim for user-level `TraceDecay` configuration. -//! -//! The implementation lives in `tracedecay_usecases::user_config` (canonical -//! copy; see SEAMS.md). This module keeps every historical -//! `crate::user_config::…` path resolving from the root crate. - -pub use tracedecay_usecases::user_config::*; diff --git a/tests/release_drift_check_test.sh b/tests/release_drift_check_test.sh index aca92d60dd..4100a17437 100755 --- a/tests/release_drift_check_test.sh +++ b/tests/release_drift_check_test.sh @@ -11,9 +11,13 @@ write_repo() { local path="$GATE_SCRATCH/repo" rm -rf "$path" mkdir -p "$path" + # Mirror the real repository: a virtual workspace manifest that carries the + # released version, with no package of its own. cat >"$path/Cargo.toml" <