Skip to content

feat(hotpath): fill agent-hosts hook dispatch/store gaps - #777

Merged
ScriptedAlchemy merged 4 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/hp-hosts-dispatch-store-gaps-b158
Sep 3, 2026
Merged

feat(hotpath): fill agent-hosts hook dispatch/store gaps#777
ScriptedAlchemy merged 4 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
cursor/hp-hosts-dispatch-store-gaps-b158

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Summary

Fills the remaining #[hotpath::measure] coverage gaps in crates/tracedecay-agent-hosts only (HP-hosts). Attribute-only change: 38 added lines, zero behavior changes, no Cargo.toml edits, no hotpath/tokio, hotpath stays off in default/production builds (macros expand to no-ops without the opt-in hotpath feature).

New labels follow the crate's established agent_hosts.<area>.<verb> convention (as in agents/mod.rs). No existing #[hotpath::measure] was restamped; tracedecay-hooks and tracedecay-host-integration are untouched.

Instrumented call sites

  • ports/hook_runtime.rs (was no-hp): daemon_tool_json, resolve_project_root_with_identity, resolve_hook_scope, notify_hook_event, is_project_initialized (fs-backed fallback), resolve_store_layoutagent_hosts.hook_runtime.*. Register setters and pure gate getters skipped.
  • hooks/daemon_ports.rs (was no-hp): daemon_admission_response decode, timed_daemon_hook_action, DaemonDeliveryReceiptPort::post_receipt, DaemonOpenCodeLspUpdatePort::submit_updated_eventagent_hosts.hook_ports.*. Boxed-future trait methods (try_admit_async, deliver_hook_v2) are not fn-level measurable without measuring only future construction; their inner daemon round trip is already covered by hosts.hooks.daemon_action plus the helpers above.
  • hooks/kiro.rs (was no-hp): hook_kiro_pre_tool_use, hook_kiro_prompt_submit, hook_kiro_post_tool_useagent_hosts.hooks.kiro.*.
  • hooks/cursor_compact.rs (was no-hp): cursor_pre_compact_via_daemon_with_telemetryagent_hosts.hooks.cursor.compact_via_daemon (the thin pub wrapper is skipped to avoid double counting).
  • agents/context_scout_model.rs (was no-hp): context_scout_model_assistant_from_automation_config (includes the backend availability probe), backend_request, response_to_proposalagent_hosts.context_scout.*. Trivial mappers/schema/cost helpers skipped; propose returns a boxed future whose blocking backend work runs in spawn_blocking.
  • hooks/mod.rs (add-missing only): dispatch_kimi_event, dispatch_opencode_event, dispatch_opencode_tool_afteragent_hosts.hooks.dispatch_*.
  • native_integration/store.rs (add-missing only): all 18 actor round-trip operations on DaemonNativeIntegrationStore (save_approval/read_approval plus the full NativeIntegrationStore trait impl) — agent_hosts.native_store.*. submit/await_reply internals, shutdown, the long-lived run_store_actor loop, and the pure-delegation SharedDaemonNativeIntegrationStore wrappers are skipped.

agents/host_bundle_v2.rs trivia intentionally skipped per plan/evidence.

Verification

Do not merge #707 as part of this PR; this targets it as base only.

Open in Web Open in Cursor 

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: df47aea

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

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Performance Comparison codex/tracedecay-total-redesign-plan-reopenedcursor/hp-hosts-dispatch-store-gaps-b158

Total Elapsed Time: 5.79s → 5.16s (-10.9%)
CPU Baseline: 80.98µs → 84.88µs (+4.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.79s → 5.16s (-10.9%)          | 5.80s → 5.16s (-11.0%)           | 5.79s → 5.16s (-10.9%)           | 100.00% → 100.00% (+0.0%)    |
+--------------------------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| query.artifact.append_pages                                  | 13 → 13 (+0.0%)            | 199.91ms → 182.28ms (-8.8%)     | 275.51ms → 246.81ms (-10.4%)     | 2.60s → 2.37s (-8.8%)            | 44.86% → 45.93% (+2.4%)      |
+--------------------------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| query.artifact.batch.sqlite                                  | 13 → 13 (+0.0%)            | 127.87ms → 125.82ms (-1.6%)     | 178.52ms → 170.39ms (-4.6%)      | 1.66s → 1.64s (-1.2%)            | 28.70% → 31.70% (+10.5%)     |
+--------------------------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| query.artifact.batch.postings                                | 13 → 13 (+0.0%)            | 110.55ms → 108.48ms (-1.9%)     | 156.11ms → 149.42ms (-4.3%)      | 1.44s → 1.41s (-2.1%)            | 24.81% → 27.33% (+10.2%)     |
+--------------------------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| CodeIndexProductionOwnerV1::extract_file                     | 276 → 276 (+0.0%)          | 5.36ms → 4.85ms (-9.5%)         | 10.15ms → 7.52ms (-25.9%) 🚀     | 1.48s → 1.34s (-9.5%)            | 25.55% → 25.92% (+1.4%)      |
+--------------------------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| code_index.workers.install                                   | 83 → 83 (+0.0%)            | 19.18ms → 15.71ms (-18.1%)      | 71.37ms → 53.48ms (-25.1%) 🚀    | 1.59s → 1.30s (-18.2%)           | 27.48% → 25.28% (-8.0%)      |
+--------------------------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| code_index.build.and_publish                                 | 2 → 2 (+0.0%)              | 540.09ms → 522.99ms (-3.2%)     | 569.38ms → 535.30ms (-6.0%)      | 1.08s → 1.05s (-2.8%)            | 18.65% → 20.27% (+8.7%)      |
+--------------------------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| domain.canonical.sha256                                      | 114526 → 114526 (+0.0%)    | 9.44µs → 9.01µs (-4.6%)         | 15.13µs → 15.08µs (-0.3%)        | 1.08s → 1.03s (-4.6%)            | 18.67% → 20.01% (+7.2%)      |
+--------------------------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| query.artifact.finalization.advance_wake                     | 14 → 14 (+0.0%)            | 76.18ms → 56.76ms (-25.5%) 🚀   | 482.08ms → 275.25ms (-42.9%) 🚀  | 1.07s → 794.70ms (-25.7%) 🚀     | 18.41% → 15.40% (-16.3%)     |
+--------------------------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| code_index.chunk.index_file                                  | 276 → 276 (+0.0%)          | 2.47ms → 2.25ms (-8.9%)         | 5.38ms → 3.35ms (-37.7%) 🚀      | 682.13ms → 620.15ms (-9.1%)      | 11.78% → 12.02% (+2.0%)      |
+--------------------------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| query.artifact.prepare_pages                                 | 13 → 13 (+0.0%)            | 61.30ms → 47.15ms (-23.1%) 🚀   | 88.41ms → 68.35ms (-22.7%) 🚀    | 796.93ms → 612.99ms (-23.1%) 🚀  | 13.76% → 11.88% (-13.7%)     |
+--------------------------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| code_index.extract.parser_artifact                           | 276 → 276 (+0.0%)          | 2.28ms → 2.07ms (-9.2%)         | 5.03ms → 3.09ms (-38.6%) 🚀      | 629.39ms → 571.46ms (-9.2%)      | 10.87% → 11.08% (+1.9%)      |
+--------------------------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| query.artifact.batch.parallel_prepare                        | 13 → 13 (+0.0%)            | 49.98ms → 36.94ms (-26.1%) 🚀   | 73.53ms → 53.48ms (-27.3%) 🚀    | 649.75ms → 480.25ms (-26.1%) 🚀  | 11.22% → 9.31% (-17.0%)      |
+--------------------------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| code_index.chunk.build                                       | 276 → 276 (+0.0%)          | 1.50ms → 1.38ms (-8.0%)         | 2.56ms → 1.98ms (-22.7%) 🚀      | 414.88ms → 380.05ms (-8.4%)      | 7.16% → 7.37% (+2.9%)        |
+--------------------------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| 🆕 code_index.build.assemble                                 | 0 → 2 (+100.0%) ⚠️         | 0.00ns → 188.28ms (+100.0%) ⚠️  | 0.00ns → 197.00ms (+100.0%) ⚠️   | 0.00ns → 376.57ms (+100.0%) ⚠️   | 0.00% → 7.30% (+100.0%) ⚠️   |
+--------------------------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+
| 🗑️ query.artifact.finalization.index.ngram_postings_by_ngram | 1 → 0 (-100.0%) 🚀         | 469.86ms → 0.00ns (-100.0%) 🚀  | 470.02ms → 0.00ns (-100.0%) 🚀   | 469.86ms → 0.00ns (-100.0%) 🚀   | 8.11% → 0.00% (-100.0%) 🚀   |
+--------------------------------------------------------------+----------------------------+---------------------------------+----------------------------------+----------------------------------+------------------------------+

Generated with hotpath-rs

@ScriptedAlchemy
ScriptedAlchemy merged commit 74ac47a into codex/tracedecay-total-redesign-plan-reopened Sep 3, 2026
10 of 18 checks passed
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Integrated into codex/tracedecay-total-redesign-plan-reopened.

Review evidence:

  • Original commit b10f8e5eec96877427ddd73392f8d58b44b3061a changes only tracedecay-agent-hosts: 38 #[hotpath::measure(...)] annotations across 7 files, with no semantic behavior changes.
  • Unresolved review threads: none.
  • cargo test -p tracedecay-agent-hosts --locked -- --test-threads=1 — passed (cargo-hauler ticket cc-1904).
  • cargo check -p tracedecay-agent-hosts --features hotpath --locked — passed (ticket cc-1903).
  • cargo check -p tracedecay --no-default-features --locked — passed (ticket cc-1905; pre-existing warnings only).
  • git diff --check — passed.

PR merge commit: 74ac47a008ec33d276d54d9b01e5aa96513ca66b
Published integration tip after merging the latest target: c7a9758841080463fbac657a3e8e0a5f661e197a.

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