feat(hotpath): fill usecases stream/emit/semantic-config gaps - #785
Conversation
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
|
…sor/hotpath-gap-fill-2db4
…sor/hotpath-gap-fill-2db4
…sor/hotpath-gap-fill-2db4
Performance Comparison
|
9acc64b
into
codex/tracedecay-total-redesign-plan-reopened
|
Integrated into the #707 target via merge commit Evidence:
Reviewed changes are instrumentation-only annotations/future wrappers and preserve the original usecase control flow and return semantics. |
Summary
crates/tracedecay-usecasesonly (HP-usecases). Adds 111 new measure sites (102#[hotpath::measure]attributes, 9hotpath::future!wraps of boxed port futures) across 14 files.operation_stream.rs, observability emit/producer lanes, semantic config store/operation, diagnostics publication, vector generation store, advisory GitHub/CI stores) plus add-missing-only sites insemantic_runtime/production.rs,diagnostics_store.rs, andfeedback/concrete.rs.--features hotpath; the feature stays out ofdefault/production. The hook-protocol metrics-server guard is untouched. Does not merge feat: TraceDecay V2 delivery (PR8–PR13) + daemon performance, memory, and reliability overhaul #707.Motivation
Coverage inventory showed 68/340 async fns measured and ~84 files with no hotpath sites in
tracedecay-usecases. This fills the highest-value gaps (usecase entrypoints, durable store read/write paths, emit lanes) so opt-in profiling sees the full request path.Changes
src/operation_stream.rsusecases.operation.{begin, begin_test_run, cancel, cancel_test_run, subscribe, expire_all, resolve_context, read_test_run, page_test_run, emit_progress, emit_test_result, emit_terminal}src/observability/retrieval_emit.rsusecases.observability.{emit_pipeline, observe_ablation, record_planner, record_retriever, record_synthesis, record_source, record_context_outcome, record_ablation, record_consent}src/observability/emit.rsusecases.observability.{record_query, record_adoption_eligibility, record_adoption_outcome, record_latency, record_operation_resource, record_storage, record_index, emit_index}src/observability/producer.rsusecases.observability.{try_emit, producer_stop, persist_queued, persist_envelope}src/semantic_runtime/config_store.rsusecases.semantic_config.{install_initial, read_committed, read_present, read_profile, read_committed_profile, preview_mutation, stage_activation, stage_rollback, persist_pending}src/semantic_runtime/configuration_operation.rsusecases.semantic_config.{commit_publication, qualify_profile, evaluate_publish, activate, rollback, prepare_activation, validate_snapshot, read_state}src/diagnostics_publication.rsusecases.diagnostics.{contribute, publish_snapshot, resolve_compiler, load_project_file, publish_compiler, publish_compiler_indexed}src/store/vector_generations.rsusecases.vector.{begin_generation, rebuild_generation, commit_batch, validate_batch, apply_batch, publish_generation, persist_sealed, reopen_sealed, intern_vectors, hydrate_values, sweep_retired}src/advisory/github_runtime/store.rsusecases.advisory.github.{load_manifest, load_inventory, load_entry, load_state, record_refresh}src/advisory/github_runtime/anchors.rsusecases.advisory.github.{resolve_seeds, resolve_stored_seed, resolve_new_seed, remap_original, remap_seed, load_anchor, persist_anchor, persist_body, read_body}src/advisory/ci_runtime/stores.rsusecases.advisory.ci.{load_inventory, load_entry, load_manifest, load_record, retain_observation, resolve_code_anchor}src/semantic_runtime/production.rsusecases.semantic.{restore_current, prepare_restore, revalidate_target, active_generation, execute_search, inspect_eval_snapshot}src/diagnostics_store.rsusecases.diagnostics_store.{immediate_tx, insert_record, publication_state, query_generation, find_successor, collect_rows}src/feedback/concrete.rsusecases.feedback.{read_diagnostics, read_get, read_expand, read_list, close_drain, load_publications, doctor_latest, record_publication, observation_read_model, persist_observation, persist_boot, load_ledger}Non-obvious bits:
FeedbackPortFuture<'a, _>(boxed futures) cannot take the attribute macro, so they are wrapped asBox::pin(hotpath::future!(async move { ... }, label = "...")), the same pattern already used infeedback/cycle_production.rsandfeedback/cycle_runtime.rs.commit_batchis measured oncommit_batch_ref(the shared implementation) so the public wrapper and the persistent adapter path are both covered by one span without double counting.Displayimpls, serde/DTO glue, test modules, and long-lived worker loops (run_worker/settle_worker— per-iteration persistence is measured instead).hotpath::future!is used without anyhotpath/tokiopassthrough, matching existing usage in this crate; notokio_runtime!was introduced.Test plan
cargo check -p tracedecay-usecases(default features) passescargo check -p tracedecay-usecases --features tracedecay-usecases/hotpathpassescargo clippy -p tracedecay-usecases --all-targets --features tracedecay-usecases/hotpathexits 0 (single pre-existingmanual_ok_errwarning inbenches/semantic_vector_commit_scale.rs, untouched by this PR)cargo nextest run --workspace --no-fail-fast(not run here; instrumentation is behavior-neutral without the feature)Checklist
.envfiles includedCHANGELOG.mdupdated (not updated: instrumentation-only change with no user-facing behavior; can add on request)