Skip to content

feat(hotpath): fill daemon mcp/host-admission/io gaps - #789

Draft
ScriptedAlchemy wants to merge 2 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/hotpath-gap-fill-leftovers-04d2
Draft

feat(hotpath): fill daemon mcp/host-admission/io gaps#789
ScriptedAlchemy wants to merge 2 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/hotpath-gap-fill-leftovers-04d2

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Aug 31, 2026

Copy link
Copy Markdown
Owner

feat(hotpath): fill daemon mcp/host-admission/io gaps

Gap-fill hotpath coverage PR for the root daemon crate (crates/tracedecay), branched from codex/tracedecay-total-redesign-plan-reopened (PR #707 base; #707 is NOT merged by this PR).

Rebase note: the base later extracted src/daemon/store_runtime/session_registry.rs into the new tracedecay-store-runtime crate. The 12 session-registry sites in this PR followed that file move, so the diff now touches crates/tracedecay-store-runtime/src/session_registry.rs (same functions, same labels — no new scope). All other files remain in crates/tracedecay.

Scope guarantees:

  • Only the 12 originally targeted files touched (11 in crates/tracedecay, plus the rename-followed session_registry.rs above) — no Cargo.toml changes, no hooks/host-integration files, no *_benchmark.rs / *_tests.rs.
  • No existing #[hotpath::measure] site was modified, relabeled, or removed.
  • hotpath/hotpath-alloc/hotpath-cpu/hotpath-mcp remain out of default and production; macros no-op without --features hotpath. No metrics server, no output-format changes — the MCP hook-protocol stdout guard is untouched.
  • All new labels follow 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 hotpath is currently blocked by a pre-existing base break unrelated to this PR: tracedecay-session-runtime fails with queries overflow the depth limit! at session_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):

File New sites New labels
crates/tracedecay/src/host_admission.rs 14 daemon.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.rs 8 mcp.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.rs 9 mcp.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.rs 7 mcp.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.rs 7 daemon.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.rs 7 daemon.profile_registry.{open_existing, open, list_projects, classify_storage, retire_paths, apply_orphan_relink, gc}
crates/tracedecay-store-runtime/src/session_registry.rs (moved from crates/tracedecay/src/daemon/store_runtime/ by base refactor) 12 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.rs 8 daemon.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.rs 4 daemon.engine.{git_watcher_health, log_version_skew, claim_catalog_refresh, cached_open_failure}
crates/tracedecay/src/daemon/scheduler.rs 9 daemon.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.rs 7 daemon.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.rs 10 daemon.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 inside McpServer::new_with_context and the two Box::pin(async move { ... }) boxed-future bodies in daemon/maintenance.rs (same pattern already used in daemon/engine.rs). The larger diff stat in maintenance.rs is indentation-only from those two wraps.

Open in Web Open in Cursor 

@changeset-bot

changeset-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c36a294

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cursor
cursor Bot force-pushed the cursor/hotpath-gap-fill-leftovers-04d2 branch from d2e3546 to cf6f5ee Compare August 31, 2026 19:24
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/hotpath-gap-fill-leftovers-04d2 branch from 69f3531 to e9efb28 Compare August 31, 2026 22:05
@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Performance Comparison codex/tracedecay-total-redesign-plan-reopenedcursor/hotpath-gap-fill-leftovers-04d2

Total Elapsed Time: 5.32s → 5.14s (-3.4%)
CPU Baseline: 80.70µs → 80.08µs (-0.8%)
Benchmark ID: index-bench-timing

timing - Execution duration of functions.

+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| Function                                 | Calls                      | Avg                             | P95                             | Total                            | % Total                      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| tracedecay-index-bench                   | 1 → 1 (+0.0%)              | 5.32s → 5.14s (-3.4%)           | 5.32s → 5.14s (-3.4%)           | 5.32s → 5.14s (-3.4%)            | 100.00% → 100.00% (+0.0%)    |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| query.artifact.append_pages              | 13 → 13 (+0.0%)            | 174.11ms → 184.48ms (+6.0%)     | 237.24ms → 256.90ms (+8.3%)     | 2.26s → 2.40s (+6.2%)            | 42.57% → 46.69% (+9.7%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| query.artifact.batch.sqlite              | 13 → 13 (+0.0%)            | 118.99ms → 122.62ms (+3.1%)     | 163.05ms → 168.43ms (+3.3%)     | 1.55s → 1.59s (+2.6%)            | 29.10% → 31.03% (+6.6%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| query.artifact.batch.postings            | 13 → 13 (+0.0%)            | 104.30ms → 107.47ms (+3.0%)     | 143.79ms → 149.95ms (+4.3%)     | 1.36s → 1.40s (+2.9%)            | 25.51% → 27.20% (+6.6%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| code_index.workers.install               | 83 → 83 (+0.0%)            | 19.37ms → 16.77ms (-13.4%)      | 56.59ms → 61.34ms (+8.4%)       | 1.61s → 1.39s (-13.7%)           | 30.23% → 27.10% (-10.4%)     |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| CodeIndexProductionOwnerV1::extract_file | 276 → 276 (+0.0%)          | 6.36ms → 4.81ms (-24.4%) 🚀     | 12.59ms → 7.42ms (-41.1%) 🚀    | 1.75s → 1.33s (-24.0%) 🚀        | 33.00% → 25.83% (-21.7%) 🚀  |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| code_index.build.and_publish             | 2 → 2 (+0.0%)              | 634.37ms → 520.08ms (-18.0%)    | 652.21ms → 522.98ms (-19.8%)    | 1.27s → 1.04s (-18.1%)           | 23.86% → 20.25% (-15.1%)     |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| domain.canonical.sha256                  | 114526 → 114526 (+0.0%)    | 10.89µs → 9.04µs (-17.0%)       | 14.92µs → 14.95µs (+0.2%)       | 1.25s → 1.03s (-17.6%)           | 23.47% → 20.15% (-14.1%)     |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| query.artifact.finalization.advance_wake | 14 → 14 (+0.0%)            | 53.15ms → 54.89ms (+3.3%)       | 260.83ms → 275.25ms (+5.5%)     | 744.05ms → 768.47ms (+3.3%)      | 14.00% → 14.96% (+6.9%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| query.artifact.prepare_pages             | 13 → 13 (+0.0%)            | 47.52ms → 53.80ms (+13.2%)      | 67.01ms → 81.72ms (+22.0%) ⚠️   | 617.72ms → 699.44ms (+13.2%)     | 11.62% → 13.62% (+17.2%)     |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| code_index.chunk.index_file              | 276 → 276 (+0.0%)          | 2.96ms → 2.22ms (-25.0%) 🚀     | 6.02ms → 3.20ms (-46.8%) 🚀     | 818.29ms → 612.79ms (-25.1%) 🚀  | 15.39% → 11.93% (-22.5%) 🚀  |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| code_index.extract.parser_artifact       | 276 → 276 (+0.0%)          | 2.69ms → 2.05ms (-23.8%) 🚀     | 5.79ms → 3.13ms (-45.9%) 🚀     | 742.35ms → 566.08ms (-23.7%) 🚀  | 13.96% → 11.02% (-21.1%) 🚀  |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| query.artifact.batch.parallel_prepare    | 13 → 13 (+0.0%)            | 37.35ms → 43.34ms (+16.0%)      | 52.49ms → 68.55ms (+30.6%) ⚠️   | 485.61ms → 563.42ms (+16.0%)     | 9.13% → 10.97% (+20.2%) ⚠️   |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| 🆕 code_index.build.assemble             | 0 → 2 (+100.0%) ⚠️         | 0.00ns → 188.97ms (+100.0%) ⚠️  | 0.00ns → 203.55ms (+100.0%) ⚠️  | 0.00ns → 377.94ms (+100.0%) ⚠️   | 0.00% → 7.36% (+100.0%) ⚠️   |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| code_index.chunk.build                   | 276 → 276 (+0.0%)          | 1.92ms → 1.35ms (-29.7%) 🚀     | 4.72ms → 1.95ms (-58.7%) 🚀     | 530.02ms → 373.01ms (-29.6%) 🚀  | 9.97% → 7.26% (-27.2%) 🚀    |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| 🗑️ code_index.chunk.identify             | 276 → 0 (-100.0%) 🚀       | 1.89ms → 0.00ns (-100.0%) 🚀    | 4.71ms → 0.00ns (-100.0%) 🚀    | 521.63ms → 0.00ns (-100.0%) 🚀   | 9.81% → 0.00% (-100.0%) 🚀   |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+

Generated with hotpath-rs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants