feat(hotpath): fill daemon mcp/host-admission/io gaps - #789
Conversation
|
d2e3546 to
cf6f5ee
Compare
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
69f3531 to
e9efb28
Compare
…sor/hotpath-gap-fill-leftovers-04d2
Performance Comparison
|
89e9e77
into
codex/tracedecay-total-redesign-plan-reopened
|
Review of record (integration lane, base The base moved under this PR: Two hunks are rejected and will be reverted in a follow-up commit on the merged head:
Everything else (session_registry, engine, http_application, maintenance, pr_autotrack, scheduler, project_route, remaining server/ledger, profile_registry, store_meta) is accepted. The 9 red checks here are from a merge commit against a base that is ≥2 days stale (Format/Clippy/Test lanes fail on the base of that era); they will be re-judged on the merged |
|
Integrated as merge commit Evidence:
The Hotpath future wrappers only wrap polling; newer target bodies, typed outcomes, lock scopes, cancellation paths, and daemon/MCP lifecycle ownership were retained. |
host_admission.rs instruments HostAdmissionTestRuntimeV1, a doc(hidden) test fixture runtime, and the process background-CPU test fallback; those are not production hot paths. mcp.server.read_tokens_baseline wrapped an await that daemon.store_meta.read_tokens_saved already measures, doubling the same span. Refs #789
|
Follow-up on the review above, now landed on
Gates on the integrated head: |
host_admission.rs instruments HostAdmissionTestRuntimeV1, a doc(hidden) test fixture runtime, and the process background-CPU test fallback; those are not production hot paths. mcp.server.read_tokens_baseline wrapped an await that daemon.store_meta.read_tokens_saved already measures, doubling the same span.
feat(hotpath): fill daemon mcp/host-admission/io gaps
Gap-fill hotpath coverage PR for the root daemon crate (
crates/tracedecay), branched fromcodex/tracedecay-total-redesign-plan-reopened(PR #707 base; #707 is NOT merged by this PR).Scope guarantees:
crates/tracedecay, plus the rename-followedsession_registry.rsabove) — noCargo.tomlchanges, no hooks/host-integration files, no*_benchmark.rs/*_tests.rs.#[hotpath::measure]site was modified, relabeled, or removed.hotpath/hotpath-alloc/hotpath-cpu/hotpath-mcpremain out ofdefaultandproduction; macros no-op without--features hotpath. No metrics server, no output-format changes — the MCP hook-protocol stdout guard is untouched.daemon.<area>.<verb>/mcp.<area>.<verb>and are unique repo-wide (re-verified after each rebase).Verification:
cargo check -p tracedecay(default features) passes on the rebased branch.cargo check -p tracedecay --features hotpathis currently blocked by a pre-existing base break unrelated to this PR:tracedecay-session-runtimefails withqueries overflow the depth limit!atsession_sync.rs:431(base-side instrumentation; needs#![recursion_limit = "256"]or restructuring on the base). This PR's hotpath-featured build passed before that break landed.Coverage table
102 new measure sites across 12 files (previously zero-coverage files first, then add-missing-only files):
crates/tracedecay/src/host_admission.rsdaemon.host_admission.{install_background_cpu, mount_sibling_project, open_runtime, scan_storage_bytes, digest_session_domain, replay_observations, count_temporal_rows, upsert_transcript_batch, count_transcript_rows, init_project_graph, open_project_graph, open_project_branch, open_graph_read_only, validate_authorities}crates/tracedecay/src/mcp/server.rsmcp.server.{construct, read_tokens_baseline, detect_worktree_mismatch, reconcile_automation, retrieval_scope_check, mount_work_evidence, mount_retained_surfaces, stats_snapshot}crates/tracedecay/src/mcp/project_route.rsmcp.project_route.{resolve_registered, forget_project, observe_route, select_route, snapshot_cache, store_cache, refresh_cache, forget_project_shared, protect_structural_ids}crates/tracedecay/src/mcp/server/ledger.rsmcp.ledger.{read_upload_policy, estimate_raw_tokens, persist_token_accounting, flush_worldwide, record_error_analytics, record_route_analytics, record_span_observation}crates/tracedecay/src/tracedecay/queries/meta.rsdaemon.store_meta.{read_tokens_saved, write_tokens_saved, read_local_counter, reset_local_counter, add_local_counter, checkpoint, quick_check}crates/tracedecay/src/profile_registry_maintenance.rsdaemon.profile_registry.{open_existing, open, list_projects, classify_storage, retire_paths, apply_orphan_relink, gc}crates/tracedecay-store-runtime/src/session_registry.rs(moved fromcrates/tracedecay/src/daemon/store_runtime/by base refactor)daemon.session_registry.{list_ready_sessions, reserve_session_replacement, reserve_session_recovery, reconstruct_terminal_recovery, bind_memory_graph, admit_remote_node, admit_project_runtime, extend_project_runtime, reserve_runtime_retirement, retire_session_sync, rebind_session_sync, runtime_incarnation}crates/tracedecay/src/daemon/http_application.rsdaemon.http.application.{build_registry_router, remote_status_read, local_admission, tls_bind, tls_accept, tls_validate_identity, observe_http_request, parse_body_length}crates/tracedecay/src/daemon/engine.rsdaemon.engine.{git_watcher_health, log_version_skew, claim_catalog_refresh, cached_open_failure}crates/tracedecay/src/daemon/scheduler.rsdaemon.scheduler.{settle_retained_automation, commit_exit, retire_scheduler, retained_project_graph, global_retention, read_automation_config, probe_scheduler_work, user_jobs_pass, mint_user_job_run_id}crates/tracedecay/src/daemon/maintenance.rsdaemon.maintenance.{read_table_growth, read_store_size, compare_table_growth, sample_store_telemetry, mint_telemetry_context, load_cursor, persist_cursor}crates/tracedecay/src/daemon/pr_autotrack.rsdaemon.pr_autotrack.{run_git, discover_gh, discover_ls_remote, activate_manual_branch, cleanup_manual_activation, cleanup_manual_retirement, activate_worktree, remove_store, prepare_worktree, cleanup_worktree}Macro forms used:
#[hotpath::measure(label = ...)](sync fns),#[hotpath::measure(label = ..., future = true)](async fns),hotpath::future!for two awaited startup stages insideMcpServer::new_with_contextand the twoBox::pin(async move { ... })boxed-future bodies indaemon/maintenance.rs(same pattern already used indaemon/engine.rs). The larger diff stat inmaintenance.rsis indentation-only from those two wraps.